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
ImageEngine/gaffer/python/GafferTest/SignalsTest.py
[ { "content": "##########################################################################\n#\n# Copyright (c) 2011-2013, John Haddon. All rights reserved.\n# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n# * Redistributions of source code must retain the above\n# copyright notice, this list of conditions and the following\n# disclaimer.\n#\n# * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following\n# disclaimer in the documentation and/or other materials provided with\n# the distribution.\n#\n# * Neither the name of John Haddon nor the names of\n# any other contributors to this software may be used to endorse or\n# promote products derived from this software without specific prior\n# written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n# IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n##########################################################################\n\nimport StringIO\nimport unittest\nimport weakref\nimport sys\nimport gc\n\nimport IECore\n\nimport Gaffer\nimport GafferTest\n\n\nif __name__ == \"__main__\":\n\tunittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SignalsTest( GafferTest.TestCase ) :\n\n\n\n\n\n\n\n\t## Check that Exceptions being thrown in callbacks don't cause additional references\n\t# to be created which would stop or delay collection. This tests a bug whereby the use\n\t# of PyErr_Print caused tracebacks to be stored in sys.last_traceback, which meant that\n\t# references to the T instance below were kept until another exception was thrown.\n\n\n\n\n\n\n", "metadata": "root.SignalsTest", "header": "['module', '___EOS___']", "index": 48 }, { "content": "\tdef test( self ) :\n\n\t\tdef f( a ) :\n\n\t\t\treturn int( a )\n\n\t\ts = Gaffer.Signal1()\n\t\tc = s.connect( f )\n\t\tself.assertEqual( c.connected(), True )\n\t\tself.assertEqual( c.blocked(), False )\n\n\t\tself.assertEqual( s( 5.5 ), 5 )\n\n\t\tc.block()\n\t\tself.assertEqual( c.blocked(), True )\n\t\tc.unblock()\n\t\tself.assertEqual( c.blocked(), False )\n\t\tc.disconnect()\n\t\tself.assertEqual( c.connected(), False )", "metadata": "root.SignalsTest.test", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": "\tdef testDisconnectWhenSignalDies( self ) :\n\n\t\tdef f( a ) :\n\n\t\t\treturn int( a )\n\n\t\ts = Gaffer.Signal1()\n\t\tc = s.connect( f )\n\t\tself.assert_( c.connected() )\n\t\tdel s\n\t\tself.assert_( not c.connected() )", "metadata": "root.SignalsTest.testDisconnectWhenSignalDies", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 70 }, { "content": "\tdef test2( self ) :\n\n\t\tdef f( a, b ) :\n\n\t\t\treturn a * b\n\n\t\ts = Gaffer.Signal2()\n\t\tc = s.connect( f )\n\t\tself.assertEqual( s( 2.0, 4.0 ), 8.0 )", "metadata": "root.SignalsTest.test2", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 82 }, { "content": "\tdef testCircularRef( self ) :\n\n\t\tdef default( a ) :\n\n\t\t\treturn -1\n\n\t\tclass A( IECore.V3f ) :\n\n\t\t\tdef __init__( self ) :\n\n\t\t\t\tIECore.V3f.__init__( self )\n\t\t\t\tself.signal = Gaffer.Signal1()\n\n\t\t\tdef f( self, n ) :\n\n\t\t\t\treturn int( n * 2 )\n\n\t\ta1 = A()\n\t\ta2 = A()\n\n\t\t# connect a signal to always return a value of -1\n\t\tdefaultConnection = a2.signal.connect( default )\n\t\tself.assertEqual( a2.signal( 2 ), -1 )\n\n\t\t# connect a method in\n\t\ta1.c = a2.signal.connect( Gaffer.WeakMethod( a1.f ) )\n\t\tself.assertEqual( a2.signal( 2 ), 4 )\n\n\t\t# connect a method of a2 to the signal on a1\n\t\ta2.c = a1.signal.connect( Gaffer.WeakMethod( a2.f ) )\n\t\tself.assert_( a2.c.connected() )\n\n\t\tself.assertEqual( a1.signal( 2 ), 4 )\n\n\t\t# we should be able to delete a1 and have it die\n\t\t# straight away, because the use of WeakMethods in\n\t\t# the connections should prevent any circular references.\n\t\tdel a1\n\t\tself.assertEqual( a2.signal( 2 ), -1 )\n\n\t\t# as a1 is now dead, a2's connection to a1.signal\n\t\t# should have died.\n\t\tself.assert_( not a2.c.connected() )", "metadata": "root.SignalsTest.testCircularRef", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 92 }, { "content": "\tdef testDeletionOfConnectionDisconnects( self ) :\n\n\t\tdef default( a ) :\n\n\t\t\treturn -1\n\n\t\tdef f( a ) :\n\n\t\t\treturn int( a * 10 )\n\n\t\ts = Gaffer.Signal1()\n\t\tdc = s.connect( default )\n\t\tself.assertEqual( s( 1 ), -1 )\n\n\t\tc = s.connect( f )\n\t\tself.assertEqual( s( 1 ), 10 )\n\n\t\tdel c\n\t\tself.assertEqual( s( 1 ), -1 )", "metadata": "root.SignalsTest.testDeletionOfConnectionDisconnects", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 136 }, { "content": "\tdef testMany( self ) :\n\n\t\tclass S( IECore.V3f ) :\n\n\t\t\tinstances = 0\n\n\t\t\tdef __init__( self, parent ) :\n\n\t\t\t\tIECore.V3f.__init__( self )\n\n\t\t\t\tS.instances += 1\n\n\t\t\t\tself.children = []\n\t\t\t\tself.numConnections = 0\n\t\t\t\tself.signal = Gaffer.Signal1()\n\t\t\t\tif parent :\n\t\t\t\t\tself.c = parent.signal.connect( self.f )\n\t\t\t\t\tparent.numConnections += 1\n\t\t\t\t\tparent.children.append( self )\n\n\t\t\tdef f( self, a ) :\n\n\t\t\t\tr = 1\n\t\t\t\tif self.numConnections!=0 :\n\t\t\t\t\tr += self.signal( a )\n\n\t\t\t\treturn r\n\n\t\tdef build( parent, depth=0 ) :\n\n\t\t\tif( depth > 15 ) :\n\t\t\t\treturn\n\t\t\telse :\n\t\t\t\ts1 = S( parent )\n\t\t\t\ts2 = S( parent )\n\t\t\t\tbuild( s1, depth + 1 )\n\t\t\t\tbuild( s2, depth + 1 )\n\n\t\ts = S( None )\n\t\tbuild( s )\n\n\t\ts.signal( 1 )", "metadata": "root.SignalsTest.testMany", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 156 }, { "content": "\tdef testExceptionRefCounting( self ) :\n\n\t\tclass T( object ) :\n\n\t\t\tdef __init__( self, s ) :\n\n\t\t\t\t# note the use of Gaffer.WeakMethod to avoid creating a circular reference\n\t\t\t\t# from self -> self.connection -> self.callback -> self. this is critical\n\t\t\t\t# when connecting methods of class to a signal.\n\t\t\t\tself.connection = s.memberAddedSignal().connect( Gaffer.WeakMethod( self.callback ) )\n\n\t\t\tdef callback( self, s, n ) :\n\n\t\t\t\traise Exception\n\n\t\ts = Gaffer.StandardSet()\n\t\tt = T( s )\n\t\tw = weakref.ref( t )\n\n\t\trealStdErr = sys.stderr\n\t\tsio = StringIO.StringIO()\n\t\ttry :\n\t\t\tsys.stderr = sio\n\t\t\ts.add( Gaffer.Node() )\n\t\tfinally :\n\t\t\tsys.stderr = realStdErr\n\n\t\tdel t\n\n\t\tself.assert_( w() is None )\n\t\tself.assert_( \"Exception\" in sio.getvalue() )", "metadata": "root.SignalsTest.testExceptionRefCounting", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 203 }, { "content": "\tdef test0Arity( self ) :\n\n\t\tdef one() :\n\n\t\t\treturn 1\n\n\t\ts = Gaffer.Signal0()\n\n\t\tc = s.connect( one )\n\n\t\tself.assertEqual( s(), 1 )", "metadata": "root.SignalsTest.test0Arity", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 235 }, { "content": "\tdef testGenericPythonSignals( self ) :\n\n\t\tdef one() :\n\t\t\treturn \"one\"\n\n\t\tdef two() :\n\t\t\treturn \"two\"\n\n\t\ts = Gaffer.Signal0()\n\t\tc1 = s.connect( one )\n\t\tc2 = s.connect( two )\n\n\t\tself.assertEqual( s(), \"two\" )", "metadata": "root.SignalsTest.testGenericPythonSignals", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 247 }, { "content": "\tdef testGenericPythonSignalsWithCombiner( self ) :\n\n\t\tdef myCombiner( slotResults ) :\n\n\t\t\tl = []\n\t\t\tfor r in slotResults :\n\t\t\t\tl.append( r )\n\n\t\t\treturn l\n\n\t\tdef add( a, b ) :\n\n\t\t\treturn a + b\n\n\t\tdef mult( a, b ) :\n\n\t\t\treturn a * b\n\n\t\ts = Gaffer.Signal2( myCombiner )\n\t\taddConnection = s.connect( add )\n\t\tmultConnection = s.connect( mult )\n\n\t\tself.assertEqual( s( 2, 4 ), [ 6, 8 ] )", "metadata": "root.SignalsTest.testGenericPythonSignalsWithCombiner", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 261 }, { "content": "\tdef testPythonResultCombinersCanSkipSlots( self ) :\n\n\t\tdef myCombiner( slotResults ) :\n\n\t\t\tfor r in slotResults :\n\t\t\t\tif r :\n\t\t\t\t\treturn r\n\n\t\t\treturn False\n\n\t\tdef slot1() :\n\n\t\t\tself.numCalls += 1\n\t\t\treturn True\n\n\t\tdef slot2() :\n\n\t\t\tself.numCalls += 1\n\t\t\treturn False\n\n\t\ts = Gaffer.Signal0( myCombiner )\n\t\tc1 = s.connect( slot1 )\n\t\tc2 = s.connect( slot2 )\n\n\t\tself.numCalls = 0\n\t\tself.assertEqual( s(), True )\n\t\tself.assertEqual( self.numCalls, 1 )", "metadata": "root.SignalsTest.testPythonResultCombinersCanSkipSlots", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 285 }, { "content": "\tdef testGroupingAndOrdering( self ) :\n\n\t\tvalues = []\n\t\tdef f( value ) :\n\n\t\t\tvalues.append( value )\n\n\t\ts = Gaffer.Signal0()\n\t\tc1 = s.connect( IECore.curry( f, \"one\" ) )\n\t\tc2 = s.connect( IECore.curry( f, \"two\" ) )\n\t\ts()\n\n\t\tself.assertEqual( values, [ \"one\", \"two\" ] )\n\n\t\tdel values[:]\n\n\t\tc1 = s.connect( 1, IECore.curry( f, \"one\" ) )\n\t\tc2 = s.connect( 0, IECore.curry( f, \"two\" ) )\n\t\ts()\n\n\t\tself.assertEqual( values, [ \"two\", \"one\" ] )\n\n\t\tdel values[:]\n\n\t\tc1 = s.connect( IECore.curry( f, \"one\" ) )\n\t\tc2 = s.connect( 0, IECore.curry( f, \"two\" ) )\n\t\ts()\n\n\t\tself.assertEqual( values, [ \"two\", \"one\" ] )", "metadata": "root.SignalsTest.testGroupingAndOrdering", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 313 }, { "content": "\tdef testSlotQueries( self ) :\n\n\t\tdef f() :\n\t\t\tpass\n\n\t\ts = Gaffer.Signal0()\n\t\tself.assertTrue( s.empty() )\n\t\tself.assertEqual( s.num_slots(), 0 )\n\n\t\tc = s.connect( f )\n\t\tself.assertFalse( s.empty() )\n\t\tself.assertEqual( s.num_slots(), 1 )\n\n\t\tdel c\n\t\tself.assertTrue( s.empty() )\n\t\tself.assertEqual( s.num_slots(), 0 )", "metadata": "root.SignalsTest.testSlotQueries", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 343 }, { "content": "\tdef testNonScopedConnection( self ) :\n\n\t\tself.numCalls = 0\n\t\tdef f() :\n\t\t\tself.numCalls += 1\n\n\t\ts = Gaffer.Signal0()\n\t\tc = s.connect( f, scoped = False )\n\n\t\tself.assertEqual( self.numCalls, 0 )\n\t\ts()\n\t\tself.assertEqual( self.numCalls, 1 )\n\n\t\tc.block( True )\n\t\ts()\n\t\tself.assertEqual( self.numCalls, 1 )\n\t\tc.block( False )\n\t\ts()\n\t\tself.assertEqual( self.numCalls, 2 )\n\n\t\t# If we drop our reference to the slot,\n\t\t# it should still be alive because the\n\t\t# signal is referencing it (because it\n\t\t# is connected).\n\t\tw = weakref.ref( f )\n\t\tdel f\n\t\tself.assertTrue( w() is not None )\n\n\t\t# And it should still be triggered when\n\t\t# we call the signal.\n\t\ts()\n\t\tself.assertEqual( self.numCalls, 3 )\n\n\t\t# And it should finally die when the\n\t\t# signal dies.\n\t\tdel s\n\t\tself.assertTrue( w() is None )", "metadata": "root.SignalsTest.testNonScopedConnection", "header": "['class', 'SignalsTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 360 } ]
[ { "span": "import gc", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2011", "-", "2013", ",", " ", "Joh", "n", " ", "Had", "don", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2011", "-", "2012", ",", " ", "Image", " ", "Engine", " ", "Desig", "n", " ", "Inc", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", " ", "in", " ", "the", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "Joh", "n", " ", "Had", "don", " ", "nor", " ", "the", " ", "names", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "any", " ", "other", " ", "contributor", "s", " ", "to", " ", "this", " ", "software", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "promote", " ", "products", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "writt", "en", " ", "permissi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "IS", "\"", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "THE", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PUR", "POS", "E", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "OWNER", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "weakref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "IE", "Core_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "Ga", "ffer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Ga", "ffer", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\t", "_", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Check", " ", "tha", "t", " ", "Except", "ion", "s", " ", "bei", "ng", " ", "throw", "n", " ", "in", " ", "callback", "s", " ", "don", "'", "t", " ", "caus", "e", " ", "addition", "al", " ", "references_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "be", " ", "created", " ", "whi", "ch", " ", "wou", "ld", " ", "stop", " ", "or", " ", "dela", "y", " ", "collection", ".", " ", "Thi", "s", " ", "tests", " ", "a", " ", "bug", " ", "where", "by", " ", "the", " ", "use_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "Py", "Err", "\\u", "Print", " ", "caus", "ed", " ", "traceback", "s", " ", "to", " ", "be", " ", "store", "d", " ", "in", " ", "sys", ".", "last", "\\u", "traceback", ",", " ", "whi", "ch", " ", "mean", "t", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reference", "s", " ", "to", " ", "the", " ", "T", " ", "instance", " ", "belo", "w", " ", "wer", "e", " ", "kep", "t", " ", "unti", "l", " ", "anot", "her", " ", "exception", " ", "was", " ", "throw", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "f_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "int_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "s_", "._", "connect_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "c_", "._", "connected_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "c_", "._", "blocked_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", "5.5_", ")_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "block_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "c_", "._", "blocked_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "unbl", "ock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "c_", "._", "blocked_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "disconnect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "c_", "._", "connected_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Disconnect", "Whe", "n", "Signal", "Die", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "f_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "int_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "s_", "._", "connect_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "c_", "._", "connected_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "not_", "c_", "._", "connected_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "f_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "a_", "*_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "2_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "s_", "._", "connect_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", "2.0_", ",_", "4.0_", ")_", ",_", "8.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Circular", "Ref_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "default_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "A_", "(_", "IE", "Core_", "._", "V3", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "IE", "Core_", "._", "V3", "f_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "signal_", "=_", "Ga", "ffer", "_", "._", "Signal", "1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "f_", "(_", "self_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "return_", "int_", "(_", "n_", "*_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "a1_", "=_", "A_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "A_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connect", " ", "a", " ", "signal", " ", "to", " ", "alw", "ay", "s", " ", "return", " ", "a", " ", "value", " ", "of", " ", "-1", "_", "\\u\\u\\uNL\\u\\u\\u_", "default", "Connection_", "=_", "a2_", "._", "signal_", "._", "connect_", "(_", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a2_", "._", "signal_", "(_", "2_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connect", " ", "a", " ", "method", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "a1_", "._", "c_", "=_", "a2_", "._", "signal_", "._", "connect_", "(_", "Ga", "ffer", "_", "._", "Wea", "k", "Method_", "(_", "a1_", "._", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a2_", "._", "signal_", "(_", "2_", ")_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connect", " ", "a", " ", "method", " ", "of", " ", "a2", " ", "to", " ", "the", " ", "signal", " ", "on", " ", "a1_", "\\u\\u\\uNL\\u\\u\\u_", "a2_", "._", "c_", "=_", "a1_", "._", "signal_", "._", "connect_", "(_", "Ga", "ffer", "_", "._", "Wea", "k", "Method_", "(_", "a2_", "._", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "a2_", "._", "c_", "._", "connected_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a1_", "._", "signal_", "(_", "2_", ")_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "shou", "ld", " ", "be", " ", "able", " ", "to", " ", "delete", " ", "a1", " ", "and", " ", "have", " ", "it", " ", "die_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "straight", " ", "awa", "y", ",", " ", "bec", "aus", "e", " ", "the", " ", "use", " ", "of", " ", "Wea", "k", "Meth", "ods", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "connections", " ", "shou", "ld", " ", "prevent", " ", "any", " ", "circular", " ", "reference", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "del_", "a1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a2_", "._", "signal_", "(_", "2_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "a1", " ", "is", " ", "now", " ", "dead", ",", " ", "a2", "'", "s", " ", "connecti", "on", " ", "to", " ", "a1", ".", "signal_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "have", " ", "die", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "not_", "a2_", "._", "c_", "._", "connected_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Deletion", "Of", "Connect", "ion", "Disconnect", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "default_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "f_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "int_", "(_", "a_", "*_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dc_", "=_", "s_", "._", "connect_", "(_", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", "1_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "s_", "._", "connect_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", "1_", ")_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", "1_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Many", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "class_", "S_", "(_", "IE", "Core_", "._", "V3", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "instances_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "IE", "Core_", "._", "V3", "f_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "S_", "._", "instances_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "children_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "num", "Connections_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "signal_", "=_", "Ga", "ffer", "_", "._", "Signal", "1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "c_", "=_", "parent_", "._", "signal_", "._", "connect_", "(_", "self_", "._", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "._", "num", "Connections_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "._", "children_", "._", "append_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "f_", "(_", "self_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "r_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "num", "Connections_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "r_", "+=_", "self_", "._", "signal_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build_", "(_", "parent_", ",_", "depth_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "(_", "depth_", ">_", "15_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "s1_", "=_", "S_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "=_", "S_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build_", "(_", "s1_", ",_", "depth_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build_", "(_", "s2_", ",_", "depth_", "+_", "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_", "s_", "=_", "S_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "signal_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Except", "ion", "Ref", "Count", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "class_", "T_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "note", " ", "the", " ", "use", " ", "of", " ", "Ga", "ffer", ".", "Wea", "k", "Meth", "od", " ", "to", " ", "avoid", " ", "creati", "ng", " ", "a", " ", "circular", " ", "reference_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "self", " ", "->", " ", "self", ".", "connecti", "on", " ", "->", " ", "self", ".", "callback", " ", "->", " ", "self", ".", " ", "this", " ", "is", " ", "critical_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "n", " ", "connecti", "ng", " ", "method", "s", " ", "of", " ", "class", " ", "to", " ", "a", " ", "signal", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "connection_", "=_", "s_", "._", "member", "Added", "Signal_", "(_", ")_", "._", "connect_", "(_", "Ga", "ffer", "_", "._", "Wea", "k", "Method_", "(_", "self_", "._", "callback_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "callback_", "(_", "self_", ",_", "s_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Standard", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "T_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w_", "=_", "weakref_", "._", "ref_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "real", "Std", "Err_", "=_", "sys_", "._", "stderr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sio_", "=_", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stderr_", "=_", "sio_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add_", "(_", "Ga", "ffer", "_", "._", "Node_", "(_", ")_", ")_", "\\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\t", "\t\t_", "sys_", "._", "stderr_", "=_", "real", "Std", "Err_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "w_", "(_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "\"", "Except", "ion", "\"_", "in_", "sio_", "._", "getvalue_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "Ari", "ty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "one_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "0_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "s_", "._", "connect_", "(_", "one_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Gene", "ric", "Pyth", "on", "Signals_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "one_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "\"", "one", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "two_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "\"", "two", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "0_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "s_", "._", "connect_", "(_", "one_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "s_", "._", "connect_", "(_", "two_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", ")_", ",_", "\"", "two", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Gene", "ric", "Pyth", "on", "Signal", "s", "With", "Combine", "r_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "my", "Combine", "r_", "(_", "slot", "Results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "slot", "Results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "l_", "._", "append_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "a_", "+_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mult_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "a_", "*_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "2_", "(_", "my", "Combine", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "Connection_", "=_", "s_", "._", "connect_", "(_", "add_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mult", "Connection_", "=_", "s_", "._", "connect_", "(_", "mult_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", "2_", ",_", "4_", ")_", ",_", "[_", "6_", ",_", "8_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Pyth", "on", "Result", "Combine", "rs", "Can", "Ski", "p", "Slot", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "my", "Combine", "r_", "(_", "slot", "Results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "r_", "in_", "slot", "Results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "return_", "r_", "\\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_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "slot", "1_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "num", "Calls", "_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "slot", "2_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "num", "Calls", "_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "0_", "(_", "my", "Combine", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "s_", "._", "connect_", "(_", "slot", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "s_", "._", "connect_", "(_", "slot", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "num", "Calls", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "num", "Calls", "_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Group", "ing", "And", "Order", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "f_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "values_", "._", "append_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "0_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "s_", "._", "connect_", "(_", "IE", "Core_", "._", "curr", "y_", "(_", "f_", ",_", "\"", "one", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "s_", "._", "connect_", "(_", "IE", "Core_", "._", "curr", "y_", "(_", "f_", ",_", "\"", "two", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", ",_", "[_", "\"", "one", "\"_", ",_", "\"", "two", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "values_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "s_", "._", "connect_", "(_", "1_", ",_", "IE", "Core_", "._", "curr", "y_", "(_", "f_", ",_", "\"", "one", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "s_", "._", "connect_", "(_", "0_", ",_", "IE", "Core_", "._", "curr", "y_", "(_", "f_", ",_", "\"", "two", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", ",_", "[_", "\"", "two", "\"_", ",_", "\"", "one", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "values_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "s_", "._", "connect_", "(_", "IE", "Core_", "._", "curr", "y_", "(_", "f_", ",_", "\"", "one", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "s_", "._", "connect_", "(_", "0_", ",_", "IE", "Core_", "._", "curr", "y_", "(_", "f_", ",_", "\"", "two", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", ",_", "[_", "\"", "two", "\"_", ",_", "\"", "one", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Slot", "Querie", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "f_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "0_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "s_", "._", "empty_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "num", "\\u", "slots_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "s_", "._", "connect_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "s_", "._", "empty_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "num", "\\u", "slots_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "s_", "._", "empty_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "num", "\\u", "slots_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Signal", "s", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "Sco", "ped", "Connection_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "num", "Calls", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "f_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "num", "Calls", "_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Signal", "0_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "s_", "._", "connect_", "(_", "f_", ",_", "scoped", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "num", "Calls", "_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "num", "Calls", "_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "block_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "num", "Calls", "_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "block_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "num", "Calls", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "drop", " ", "our", " ", "reference", " ", "to", " ", "the", " ", "slot", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "shou", "ld", " ", "still", " ", "be", " ", "alive", " ", "bec", "aus", "e", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "signal", " ", "is", " ", "referenci", "ng", " ", "it", " ", "(", "bec", "aus", "e", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "connect", "ed", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "w_", "=_", "weakref_", "._", "ref_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "w_", "(_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "it", " ", "shou", "ld", " ", "still", " ", "be", " ", "trigger", "ed", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "call", " ", "the", " ", "signal", "._", "\\u\\u\\uNL\\u\\u\\u_", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "num", "Calls", "_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "it", " ", "shou", "ld", " ", "final", "ly", " ", "die", " ", "whe", "n", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "signal", " ", "die", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "del_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "w_", "(_", ")_", "is_", "None_", ")_", "\\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,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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 ]
Unused local variable
boakley/robotframework-workbench/rwb/widgets/dte.py
[ { "content": " def __init__(self, *args, **kwargs):\n tk.Text.__init__(self, *args, **kwargs)\n font = self.cget(\"font\")\n self.log = logging.getLogger(\"dte\")\n\n self.tmpvar = QuietIntVar(master=self, name=\"::__countx__\")\n# self.tmpvar = tk.IntVar(master=self, name=\"::__countx__\")\n\n # add a special bind tag before the class binding so we can\n # preempt the default bindings when the completion window is\n # visible (eg: up and down arrows will affect the selection in\n # the dropdown list rather than the cursor position)\n bindtags = self.bindtags()\n new_bindtags = tuple([bindtags[0], \"Completion\"] + list(bindtags[1:]))\n self.bindtags(new_bindtags)\n self.bind_class(\"Completion\",\"<Control-space>\", self._on_autocomplete)\n self.bind_class(\"Completion\",\"<Escape>\", self._on_escape)\n self.bind_class(\"Completion\",\"<Key-Down>\", self._on_down)\n self.bind_class(\"Completion\",\"<Key-Up>\", self._on_up)\n self.bind_class(\"Completion\",\"<Any-Key-Return>\", self._on_return)\n self.bind_class(\"Completion\",\"<Tab>\", self._on_tab)\n self.bind_class(\"Completion\",\"<1>\", self._on_click)\n self.bind(\"<Control-w>\", self._on_select_block)\n\n # should these be in the caller? They are robot-specific\n # but my long term goal is for this widget to be somewhat\n # generic\n self.bind(\"<{>\", self._on_brace_open)\n self.bind(\"<|>\", self._on_pipe)\n self.bind(\"<Tab>\", self.on_tab)\n self.bind(\"<Triple-1>\", self._on_triple_click) \n self.bind(\"<Control-Return>\", self._on_control_enter)\n self.bind(\"<Control-\\\\>\", self._on_expand)\n self.bind(\"<<Paste>>\", self._on_paste)\n \n # other ideas:\n # double-1: if inside a variable, select only the word not the\n # whole cell\n # return or tab: if in table name (ie, inbetween *** and ***), move\n # to the next line\n\n self.tag_configure(\"current_line\", background=\"#f2f2f2\")\n self.tag_raise(\"sel\", \"current_line\")\n\n # since we automatically add a space after an inserted pipe,\n # we want to ignore a space that immediately follows since\n # it's easy to think \"I need a pipe and a space\". Without this\n # you would end up with two spaces, negating any gain from\n # automatically adding one\n self.bind(\"<|><space>\", lambda event: \"break\")\n\n # this stuff is related to auto-complete\n self.complete_frame = ttk.Frame(self)\n self.list = tk.Listbox(self.complete_frame, width=30, height=8, \n borderwidth=1, relief=\"solid\", exportselection=False)\n self.list.pack(side=\"top\", fill=\"both\", expand=True)\n self.hooks = []\n\n post_change_hook = self.register(self._post_change_hook)\n widget = str(self)\n self.tk.eval(tcl.CREATE_WIDGET_PROXY)\n self.tk.eval('''\n rename {widget} _{widget}\n interp alias {{}} ::{widget} {{}} widget_proxy _{widget} {post_change_hook}\n '''.format(widget=widget, post_change_hook=post_change_hook))\n self._last_current_cell_start = \"\"", "metadata": "root.DynamicTableEditor.__init__", "header": "['class', 'DynamicTableEditor', '(', 'tk', '.', 'Text', ',', 'HighlightMixin', ')', ':', '___EOS___']", "index": 42 }, { "content": " def compress_columns(self, anchor=\"insert\"):\n '''Remove leading and trailing whitespace from each column in the selected range\n\n This operates on whole rows, even if only a partial row is selected.\n '''\n linenumber = self.index(anchor).split(\".\")[0]\n rows = self.get_selected_rows()\n result = []\n for row in rows:\n row = [cell.strip() for cell in row]\n result.append(row)\n self.replace_selected_rows(result)", "metadata": "root.DynamicTableEditor.compress_columns", "header": "['class', 'DynamicTableEditor', '(', 'tk', '.', 'Text', ',', 'HighlightMixin', ')', ':', '___EOS___']", "index": 163 }, { "content": " def align_columns(self, anchor=\"insert\"):\n '''Give each column in the selected range the same width'''\n\n rows = self.get_selected_rows()\n col_size = {}\n for row in rows:\n for i, col in enumerate(row):\n col_size[i] = max(col_size.get(i, 0), len(col))\n ncols = len(col_size)\n result = []\n for row in rows:\n for i, col in enumerate(row):\n row[i] = col.ljust(col_size[i])\n result.append(row)\n self.replace_selected_rows(result)", "metadata": "root.DynamicTableEditor.align_columns", "header": "['class', 'DynamicTableEditor', '(', 'tk', '.', 'Text', ',', 'HighlightMixin', ')', ':', '___EOS___']", "index": 176 }, { "content": " def replace_selected_rows(self, rows):\n '''Replace the selected rows with the given data'''\n string = self.convert_to_string(rows)\n self.mark_set(\"sel_start\", \"sel.first linestart\")\n self.mark_set(\"sel_end\", \"sel.last lineend\")\n self.mark_gravity(\"sel_start\", \"left\")\n self.mark_gravity(\"sel_end\", \"right\")\n sel = (self.index(\"sel.first linestart\"), \n self.index(\"sel.last lineend\"))\n self.replace(\"sel.first linestart\", \"sel.last lineend\", string)\n self.tag_add(\"sel\", \"sel_start\", \"sel_end\")\n self.mark_unset(\"sel_start\")", "metadata": "root.DynamicTableEditor.replace_selected_rows", "header": "['class', 'DynamicTableEditor', '(', 'tk', '.', 'Text', ',', 'HighlightMixin', ')', ':', '___EOS___']", "index": 204 }, { "content": " def _post_change_hook(self, result, command, *args):\n self._tag_current_cell()\n self.tag_remove(\"current_line\", 1.0, \"end\")\n self.tag_add(\"current_line\", \"insert linestart\", \"insert lineend +1c\")\n self._reposition_choices()\n for func in self.hooks:\n try:\n func(result, command, *args)\n except Exception, e:\n print \"warning: exception in post_change_hook:\", e\n\n if (command in (\"insert\",\"delete\") and self.complete_frame.winfo_viewable()):\n self.event_generate(\"<<AutoComplete>>\")\n \n line = self.index(\"insert\").split(\".\")[0]", "metadata": "root.DynamicTableEditor._post_change_hook", "header": "['class', 'DynamicTableEditor', '(', 'tk', '.', 'Text', ',', 'HighlightMixin', ')', ':', '___EOS___']", "index": 496 } ]
[ { "span": "font ", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 12 }, { "span": "linenumber ", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 18 }, { "span": "ncols ", "start_line": 184, "start_column": 8, "end_line": 184, "end_column": 13 }, { "span": "sel ", "start_line": 211, "start_column": 8, "end_line": 211, "end_column": 11 }, { "span": "line ", "start_line": 510, "start_column": 8, "end_line": 510, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Dynamic", "Table", "Editor_", "(_", "tk_", "._", "Text_", ",_", "Highlight", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk_", "._", "Text_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "font_", "=_", "self_", "._", "cg", "et_", "(_", "\"", "font", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "\"", "dte", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "tmp", "var_", "=_", "Qui", "et", "Int", "Var_", "(_", "master_", "=_", "self_", ",_", "name_", "=_", "\":", ":\\u", "\\u", "count", "x", "\\u\\u\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "tmp", "var", " ", "=", " ", "tk", ".", "Int", "Var", "(", "master", "=", "self", ",", " ", "name", "=\"", "::", "\\u\\u", "count", "x", "\\u\\u\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "special", " ", "bind", " ", "tag", " ", "bef", "ore", " ", "the", " ", "class", " ", "bindi", "ng", " ", "so", " ", "we", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pree", "mpt", " ", "the", " ", "default", " ", "bindi", "ngs", " ", "whe", "n", " ", "the", " ", "completion", " ", "window", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "visi", "ble", " ", "(", "eg", ":", " ", "up", " ", "and", " ", "down", " ", "arrows", " ", "will", " ", "affect", " ", "the", " ", "selection", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "dropdown", " ", "list", " ", "rat", "her", " ", "than", " ", "the", " ", "cursor", " ", "position", ")_", "\\u\\u\\uNL\\u\\u\\u_", "bind", "tags_", "=_", "self_", "._", "bind", "tags_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "bind", "tags_", "=_", "tuple_", "(_", "[_", "bind", "tags_", "[_", "0_", "]_", ",_", "\"", "Completi", "on", "\"_", "]_", "+_", "list_", "(_", "bind", "tags_", "[_", "1_", ":_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind", "tags_", "(_", "new", "\\u", "bind", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind", "\\u", "class_", "(_", "\"", "Completi", "on", "\"_", ",_", "\"<", "Control", "-", "space", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "autocomplete", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind", "\\u", "class_", "(_", "\"", "Completi", "on", "\"_", ",_", "\"<", "Esc", "ape", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "escape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind", "\\u", "class_", "(_", "\"", "Completi", "on", "\"_", ",_", "\"<", "Key", "-", "Down", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "down_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind", "\\u", "class_", "(_", "\"", "Completi", "on", "\"_", ",_", "\"<", "Key", "-", "Up", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "up_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind", "\\u", "class_", "(_", "\"", "Completi", "on", "\"_", ",_", "\"<", "Any", "-", "Key", "-", "Return", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "return_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind", "\\u", "class_", "(_", "\"", "Completi", "on", "\"_", ",_", "\"<", "Tab", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "tab_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind", "\\u", "class_", "(_", "\"", "Completi", "on", "\"_", ",_", "\"<", "1", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "click_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<", "Control", "-", "w", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "select", "\\u", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "these", " ", "be", " ", "in", " ", "the", " ", "caller", "?", " ", "The", "y", " ", "are", " ", "robot", "-", "specific_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "my", " ", "long", " ", "term", " ", "goal", " ", "is", " ", "for", " ", "this", " ", "widget", " ", "to", " ", "be", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generic_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<", "{", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "brace", "\\u", "open_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<", "|", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "pipe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<", "Tab", ">\"_", ",_", "self_", "._", "on", "\\u", "tab_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<", "Triple", "-1", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "triple", "\\u", "click_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<", "Control", "-", "Return", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "control", "\\u", "enter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<", "Control", "-\\\\\\\\", ">\"_", ",_", "self_", "._", "\\u", "on", "\\u", "expand_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<<", "Past", "e", ">>", "\"_", ",_", "self_", "._", "\\u", "on", "\\u", "paste_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "idea", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "double", "-1", ":", " ", "if", " ", "insi", "de", " ", "a", " ", "variab", "le", ",", " ", "select", " ", "only", " ", "the", " ", "word", " ", "not", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whole", " ", "cell_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "or", " ", "tab", ":", " ", "if", " ", "in", " ", "table", " ", "name", " ", "(", "ie", ",", " ", "inb", "et", "ween", " ", "***", " ", "and", " ", "***", "),", " ", "move_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "next", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "tag", "\\u", "configure_", "(_", "\"", "current", "\\u", "line", "\"_", ",_", "background_", "=_", "\"#", "f2", "f2", "f2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u", "raise_", "(_", "\"", "sel", "\"_", ",_", "\"", "current", "\\u", "line", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sinc", "e", " ", "we", " ", "automati", "call", "y", " ", "add", " ", "a", " ", "space", " ", "after", " ", "an", " ", "inserted", " ", "pipe", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "want", " ", "to", " ", "ignore", " ", "a", " ", "space", " ", "tha", "t", " ", "immediate", "ly", " ", "follow", "s", " ", "since_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", "'", "s", " ", "easy", " ", "to", " ", "think", " ", "\"", "I", " ", "need", " ", "a", " ", "pipe", " ", "and", " ", "a", " ", "space", "\".", " ", "With", "out", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "wou", "ld", " ", "end", " ", "up", " ", "with", " ", "two", " ", "space", "s", ",", " ", "negati", "ng", " ", "any", " ", "gain", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "automati", "call", "y", " ", "addin", "g", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "bind_", "(_", "\"<", "|", "><", "space", ">\"_", ",_", "lambda_", "event_", ":_", "\"", "break", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "stu", "ff", " ", "is", " ", "relate", "d", " ", "to", " ", "auto", "-", "complete_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "complete", "\\u", "frame_", "=_", "ttk_", "._", "Frame_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list_", "=_", "tk_", "._", "Listbox", "_", "(_", "self_", "._", "complete", "\\u", "frame_", ",_", "width_", "=_", "30_", ",_", "height_", "=_", "8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "border", "width_", "=_", "1_", ",_", "relief_", "=_", "\"", "solid", "\"_", ",_", "export", "selection_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list_", "._", "pack_", "(_", "side_", "=_", "\"", "top", "\"_", ",_", "fill_", "=_", "\"", "bot", "h", "\"_", ",_", "expand_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hooks_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post", "\\u", "change", "\\u", "hook_", "=_", "self_", "._", "register_", "(_", "self_", "._", "\\u", "post", "\\u", "change", "\\u", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widget_", "=_", "str_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tk_", "._", "eval_", "(_", "tcl", "_", "._", "CREATE", "\\u", "WID", "GET", "\\u", "PROX", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tk_", "._", "eval_", "(_", "'''", "\\", "10", ";", " ", " ", " ", " ", "rename", " ", "{", "widget", "}", " ", "\\u{", "widget", "}", "\\", "10", ";", " ", " ", " ", " ", "interp", " ", "alias", " ", "{{", "}}", " ", "::", "{", "widget", "}", " ", "{{", "}}", " ", "widget", "\\u", "proxy", " ", "\\u{", "widget", "}", " ", "{", "post", "\\u", "change", "\\u", "hook", "}", "\\", "10", ";", " ", " ", " ", " ", "'''_", "._", "format_", "(_", "widget_", "=_", "widget_", ",_", "post", "\\u", "change", "\\u", "hook_", "=_", "post", "\\u", "change", "\\u", "hook_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "last", "\\u", "current", "\\u", "cell", "\\u", "start_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dynamic", "Table", "Editor_", "(_", "tk_", "._", "Text_", ",_", "Highlight", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "compress", "\\u", "columns_", "(_", "self_", ",_", "anchor_", "=_", "\"", "insert", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Remove", " ", "lead", "ing", " ", "and", " ", "trail", "ing", " ", "whitespace", " ", "from", " ", "each", " ", "column", " ", "in", " ", "the", " ", "selecte", "d", " ", "range", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "operate", "s", " ", "on", " ", "whole", " ", "rows", ",", " ", "even", " ", "if", " ", "only", " ", "a", " ", "partial", " ", "row", " ", "is", " ", "selecte", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linenum", "ber_", "=_", "self_", "._", "index_", "(_", "anchor_", ")_", "._", "split_", "(_", "\".\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "self_", "._", "get", "\\u", "selecte", "d\\u", "rows_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "[_", "cell_", "._", "strip_", "(_", ")_", "for_", "cell_", "in_", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "append_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "replace", "\\u", "selecte", "d\\u", "rows_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dynamic", "Table", "Editor_", "(_", "tk_", "._", "Text_", ",_", "Highlight", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "align", "\\u", "columns_", "(_", "self_", ",_", "anchor_", "=_", "\"", "insert", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Give", " ", "each", " ", "column", " ", "in", " ", "the", " ", "selecte", "d", " ", "range", " ", "the", " ", "same", " ", "widt", "h", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rows_", "=_", "self_", "._", "get", "\\u", "selecte", "d\\u", "rows_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "\\u", "size_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", ",_", "col_", "in_", "enumerate_", "(_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "\\u", "size_", "[_", "i_", "]_", "=_", "max_", "(_", "col", "\\u", "size_", "._", "get_", "(_", "i_", ",_", "0_", ")_", ",_", "len_", "(_", "col_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ncols_", "=_", "len_", "(_", "col", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", ",_", "col_", "in_", "enumerate_", "(_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "[_", "i_", "]_", "=_", "col_", "._", "ljust_", "(_", "col", "\\u", "size_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "._", "append_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "replace", "\\u", "selecte", "d\\u", "rows_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dynamic", "Table", "Editor_", "(_", "tk_", "._", "Text_", ",_", "Highlight", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "replace", "\\u", "selecte", "d\\u", "rows_", "(_", "self_", ",_", "rows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Replace", " ", "the", " ", "selecte", "d", " ", "rows", " ", "with", " ", "the", " ", "give", "n", " ", "data", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "=_", "self_", "._", "convert", "\\u", "to", "\\u", "string_", "(_", "rows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mark", "\\u", "set_", "(_", "\"", "sel", "\\u", "start", "\"_", ",_", "\"", "sel", ".", "first", " ", "linest", "art", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mark", "\\u", "set_", "(_", "\"", "sel", "\\u", "end", "\"_", ",_", "\"", "sel", ".", "last", " ", "line", "end", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mark", "\\u", "gravity", "_", "(_", "\"", "sel", "\\u", "start", "\"_", ",_", "\"", "left", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mark", "\\u", "gravity", "_", "(_", "\"", "sel", "\\u", "end", "\"_", ",_", "\"", "right", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "=_", "(_", "self_", "._", "index_", "(_", "\"", "sel", ".", "first", " ", "linest", "art", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "index_", "(_", "\"", "sel", ".", "last", " ", "line", "end", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "replace_", "(_", "\"", "sel", ".", "first", " ", "linest", "art", "\"_", ",_", "\"", "sel", ".", "last", " ", "line", "end", "\"_", ",_", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u", "add_", "(_", "\"", "sel", "\"_", ",_", "\"", "sel", "\\u", "start", "\"_", ",_", "\"", "sel", "\\u", "end", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mark", "\\u", "unset_", "(_", "\"", "sel", "\\u", "start", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dynamic", "Table", "Editor_", "(_", "tk_", "._", "Text_", ",_", "Highlight", "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_", "\\u", "post", "\\u", "change", "\\u", "hook_", "(_", "self_", ",_", "result_", ",_", "command_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "tag", "\\u", "current", "\\u", "cell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u", "remove_", "(_", "\"", "current", "\\u", "line", "\"_", ",_", "1.0_", ",_", "\"", "end", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tag", "\\u", "add_", "(_", "\"", "current", "\\u", "line", "\"_", ",_", "\"", "insert", " ", "linest", "art", "\"_", ",_", "\"", "insert", " ", "line", "end", " ", "+", "1c", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "repos", "ition", "\\u", "choices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "func_", "in_", "self_", "._", "hooks_", ":_", "\\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 ", " _", "func_", "(_", "result_", ",_", "command_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "warn", "ing", ":", " ", "exception", " ", "in", " ", "post", "\\u", "change", "\\u", "hook", ":\"_", ",_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "command_", "in_", "(_", "\"", "insert", "\"_", ",_", "\"", "delete", "\"_", ")_", "and_", "self_", "._", "complete", "\\u", "frame_", "._", "win", "fo", "\\u", "view", "able_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "event", "\\u", "generate_", "(_", "\"<<", "Auto", "Complete", ">>", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "line_", "=_", "self_", "._", "index_", "(_", "\"", "insert", "\"_", ")_", "._", "split_", "(_", "\".\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
jimmycallin/pydsm/pydsm/similarity.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom pydsm.indexmatrix import IndexMatrix\nimport pydsm.model\n\n\n\n\n\n\n\n\n\n\n__dsm__ = ['nearest_neighbors']\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _assure_consistency(matrix, vector):\n return vector.synchronize_word_order(matrix, axis=1)", "metadata": "root._assure_consistency", "header": "['module', '___EOS___']", "index": 5 }, { "content": "def dot(matrix, vector, assure_consistency=False):\n \"\"\"\n Calculate dot product distance for all words in matrix against vector.\n \"\"\"\n if assure_consistency:\n vector = _assure_consistency(matrix, vector)\n return matrix.dot(vector.transpose())", "metadata": "root.dot", "header": "['module', '___EOS___']", "index": 8 }, { "content": "def euclidean(matrix, vector, assure_consistency=False):\n \"\"\"\n Calculate inversed euclidean distance for all words in matrix against vector.\n \"\"\"\n if assure_consistency:\n vector = _assure_consistency(matrix, vector)\n inv_euc= 1/(1+matrix.subtract(vector).norm(axis=1))\n return inv_euc.sort(ascending=False)", "metadata": "root.euclidean", "header": "['module', '___EOS___']", "index": 17 }, { "content": "def cos(mat1, mat2, assure_consistency=False):\n \"\"\"\n Calculate cosine distance for all words in matrix against all words in second matrix.\n Params:\n mat1: A matrix to check all values against\n mat2: Another matrix.\n assure_consistency: If set, it makes sure the matrix and vector share the same column indices. \n This makes it more secure, but a bit slower.\n \"\"\"\n\n if assure_consistency:\n mat2 = _assure_consistency(mat1, mat2)\n\n if mat1.is_vector() and mat2.is_vector():\n return _vector_vector_cos(mat1, mat2)\n \n\n mat1 = mat1 / mat1.norm(axis=1)\n mat2 = mat2 / mat2.norm(axis=1)\n dotted = mat1.dot(mat2.transpose())\n return dotted", "metadata": "root.cos", "header": "['module', '___EOS___']", "index": 27 }, { "content": "def _vector_vector_cos(v1, v2, assure_consistency=False):\n \"\"\"\n Faster calculation for vector pair cosine similarity.\n \"\"\"\n return v1.dot(v2.transpose()) / (v1.norm() * v2.norm())", "metadata": "root._vector_vector_cos", "header": "['module', '___EOS___']", "index": 49 } ]
[ { "span": "from pydsm.indexmatrix import IndexMatrix", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 41 }, { "span": "import pydsm.model", "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_", "from_", "pyd", "sm_", "._", "index", "matrix_", "import_", "Index", "Matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyd", "sm_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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", "ds", "m", "\\u\\u_", "=_", "[_", "'", "near", "est", "\\u", "neighbor", "s", "'_", "]_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "ass", "ure", "\\u", "consiste", "ncy_", "(_", "matrix_", ",_", "vector_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "vector_", "._", "synchronize", "\\u", "word", "\\u", "order_", "(_", "matrix_", ",_", "axis_", "=_", "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_", "dot_", "(_", "matrix_", ",_", "vector_", ",_", "ass", "ure", "\\u", "consiste", "ncy_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "e", " ", "dot", " ", "product", " ", "distance", " ", "for", " ", "all", " ", "words", " ", "in", " ", "matrix", " ", "against", " ", "vector", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ass", "ure", "\\u", "consiste", "ncy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vector_", "=_", "\\u", "ass", "ure", "\\u", "consiste", "ncy_", "(_", "matrix_", ",_", "vector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "matrix_", "._", "dot_", "(_", "vector_", "._", "transpose_", "(_", ")_", ")_", "\\u\\u\\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_", "euclidean", "_", "(_", "matrix_", ",_", "vector_", ",_", "ass", "ure", "\\u", "consiste", "ncy_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "e", " ", "inv", "erse", "d", " ", "euclidean", " ", "distance", " ", "for", " ", "all", " ", "words", " ", "in", " ", "matrix", " ", "against", " ", "vector", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ass", "ure", "\\u", "consiste", "ncy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vector_", "=_", "\\u", "ass", "ure", "\\u", "consiste", "ncy_", "(_", "matrix_", ",_", "vector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "inv", "\\u", "euc", "_", "=_", "1_", "/_", "(_", "1_", "+_", "matrix_", "._", "subtract_", "(_", "vector_", ")_", "._", "norm_", "(_", "axis_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "inv", "\\u", "euc", "_", "._", "sort_", "(_", "ascending_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cos_", "(_", "mat", "1_", ",_", "mat", "2_", ",_", "ass", "ure", "\\u", "consiste", "ncy_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "e", " ", "cosine", " ", "distance", " ", "for", " ", "all", " ", "words", " ", "in", " ", "matrix", " ", "against", " ", "all", " ", "words", " ", "in", " ", "second", " ", "matrix", ".", "\\", "10", ";", " ", " ", " ", " ", "Param", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "mat", "1", ":", " ", "A", " ", "matrix", " ", "to", " ", "check", " ", "all", " ", "values", " ", "against", "\\", "10", ";", " ", " ", " ", " ", "mat", "2", ":", " ", "Ano", "ther", " ", "matrix", ".", "\\", "10", ";", " ", " ", " ", " ", "ass", "ure", "\\u", "consiste", "nc", "y", ":", " ", "If", " ", "set", ",", " ", "it", " ", "make", "s", " ", "sure", " ", "the", " ", "matrix", " ", "and", " ", "vector", " ", "share", " ", " ", "the", " ", "same", " ", "column", " ", "indice", "s", ".", " ", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "Thi", "s", " ", "make", "s", " ", "it", " ", "more", " ", "secure", ",", " ", "but", " ", "a", " ", "bit", " ", "slowe", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ass", "ure", "\\u", "consiste", "ncy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mat", "2_", "=_", "\\u", "ass", "ure", "\\u", "consiste", "ncy_", "(_", "mat", "1_", ",_", "mat", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mat", "1_", "._", "is", "\\u", "vector_", "(_", ")_", "and_", "mat", "2_", "._", "is", "\\u", "vector_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "vector", "\\u", "vector", "\\u", "cos_", "(_", "mat", "1_", ",_", "mat", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mat", "1_", "=_", "mat", "1_", "/_", "mat", "1_", "._", "norm_", "(_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mat", "2_", "=_", "mat", "2_", "/_", "mat", "2_", "._", "norm_", "(_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dot", "ted_", "=_", "mat", "1_", "._", "dot_", "(_", "mat", "2_", "._", "transpose_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dot", "ted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "vector", "\\u", "vector", "\\u", "cos_", "(_", "v1_", ",_", "v2_", ",_", "ass", "ure", "\\u", "consiste", "ncy_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fast", "er", " ", "calculati", "on", " ", "for", " ", "vector", " ", "pair", " ", "cosine", " ", "similar", "it", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "v1_", "._", "dot_", "(_", "v2_", "._", "transpose_", "(_", ")_", ")_", "/_", "(_", "v1_", "._", "norm_", "(_", ")_", "*_", "v2_", "._", "norm_", "(_", ")_", ")_", "\\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, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
OpenMDAO/OpenMDAO/openmdao/core/parallel_fd_group.py
[ { "content": " def _setup_communicators(self, comm, parent_dir):\n \"\"\"\n Assign communicator to this `Group` and all of its subsystems.\n\n Args\n ----\n comm : an MPI communicator (real or fake)\n The communicator being offered by the parent system.\n\n parent_dir : str\n Absolute dir of parent `System`.\n \"\"\"\n if self._num_par_fds < 1:\n raise ValueError(\"'%s': num_par_fds must be >= 1 but value is %s.\" %\n (self.pathname, self._num_par_fds))\n if not MPI:\n self._num_par_fds = 1\n\n self._full_comm = comm\n\n # figure out which parallel FD we are associated with\n if self._num_par_fds > 1:\n minprocs, maxprocs = super(ParallelFDGroup, self).get_req_procs()\n sizes, offsets = evenly_distrib_idxs(self._num_par_fds, comm.size)\n\n # a 'color' is assigned to each subsystem, with\n # an entry for each processor it will be given\n # e.g. [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]\n color = []\n for i in range(self._num_par_fds):\n color.extend([i]*sizes[i])\n\n self._par_fd_id = color[comm.rank]\n\n # create a sub-communicator for each color and\n # get the one assigned to our color/process\n if trace:\n debug('%s: splitting comm, fd_id=%s' % (self.pathname,\n self._par_fd_id))\n comm = comm.Split(self._par_fd_id)\n\n self._local_subsystems = []\n\n self.comm = comm\n\n self._setup_dir(parent_dir)\n\n for sub in itervalues(self._subsystems):\n sub._setup_communicators(comm, self._sysdata.absdir)\n if self.is_active() and sub.is_active():\n self._local_subsystems.append(sub)", "metadata": "root.ParallelFDGroup._setup_communicators", "header": "['class', 'ParallelFDGroup', '(', 'Group', ')', ':', '___EOS___']", "index": 52 } ]
[ { "span": "minprocs,", "start_line": 74, "start_column": 12, "end_line": 74, "end_column": 20 }, { "span": "maxprocs ", "start_line": 74, "start_column": 22, "end_line": 74, "end_column": 30 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Parallel", "FD", "Group_", "(_", "Group_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "communicator", "s_", "(_", "self_", ",_", "comm_", ",_", "parent", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Assign", " ", "communicator", " ", "to", " ", "this", " ", "`", "Group", "`", " ", "and", " ", "all", " ", "of", " ", "its", " ", "subsystem", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", "\\", "10", ";", " ", " ", " ", " ", "----", "\\", "10", ";", " ", " ", " ", " ", "comm", " ", ":", " ", "an", " ", "MPI", " ", "communicator", " ", "(", "real", " ", "or", " ", "fake", ")", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "communicator", " ", "bei", "ng", " ", "offered", " ", "by", " ", "the", " ", "parent", " ", "system", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "parent", "\\u", "dir", " ", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "Abs", "olute", " ", "dir", " ", "of", " ", "parent", " ", "`", "System", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "num", "\\u", "par", "\\u", "fds_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"'", "%", "s", "':", " ", "num", "\\u", "par", "\\u", "fds", " ", "must", " ", "be", " ", ">=", " ", "1", " ", "but", " ", "value", " ", "is", " ", "%", "s", ".\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "pathname_", ",_", "self_", "._", "\\u", "num", "\\u", "par", "\\u", "fds_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "MPI_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "num", "\\u", "par", "\\u", "fds_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "full", "\\u", "comm_", "=_", "comm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "figure", " ", "out", " ", "whi", "ch", " ", "parall", "el", " ", "FD", " ", "we", " ", "are", " ", "associate", "d", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "num", "\\u", "par", "\\u", "fds_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "minp", "roc", "s_", ",_", "maxp", "roc", "s_", "=_", "super_", "(_", "Parallel", "FD", "Group_", ",_", "self_", ")_", "._", "get", "\\u", "req", "\\u", "procs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizes_", ",_", "offsets_", "=_", "even", "ly", "\\u", "distri", "b", "\\u", "idxs_", "(_", "self_", "._", "\\u", "num", "\\u", "par", "\\u", "fds_", ",_", "comm_", "._", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "'", "color", "'", " ", "is", " ", "assign", "ed", " ", "to", " ", "each", " ", "subsystem", ",", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "entry", " ", "for", " ", "each", " ", "process", "or", " ", "it", " ", "will", " ", "be", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "e", ".", "g", ".", " ", "[", "0", ",", " ", "0", ",", " ", "0", ",", " ", "1", ",", " ", "1", ",", " ", "1", ",", " ", "2", ",", " ", "2", ",", " ", "2", ",", " ", "3", ",", " ", "3", ",", " ", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "\\u", "num", "\\u", "par", "\\u", "fds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "color_", "._", "extend_", "(_", "[_", "i_", "]_", "*_", "sizes_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "par", "\\u", "fd", "\\u", "id_", "=_", "color_", "[_", "comm_", "._", "rank_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "sub", "-", "communicator", " ", "for", " ", "each", " ", "color", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "one", " ", "assign", "ed", " ", "to", " ", "our", " ", "color", "/", "process_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "trace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "(_", "'%", "s", ":", " ", "splitting", " ", "comm", ",", " ", "fd", "\\u", "id", "=", "%", "s", "'_", "%_", "(_", "self_", "._", "pathname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "par", "\\u", "fd", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "comm_", "=_", "comm_", "._", "Split_", "(_", "self_", "._", "\\u", "par", "\\u", "fd", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "local", "\\u", "subsystem", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "comm_", "=_", "comm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "setup", "\\u", "dir_", "(_", "parent", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "sub_", "in_", "itervalues_", "(_", "self_", "._", "\\u", "subsystem", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub_", "._", "\\u", "setup", "\\u", "communicator", "s_", "(_", "comm_", ",_", "self_", "._", "\\u", "sys", "data_", "._", "abs", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "active_", "(_", ")_", "and_", "sub_", "._", "is", "\\u", "active_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "local", "\\u", "subsystem", "s_", "._", "append_", "(_", "sub_", ")_", "\\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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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 ]
Except block handles 'BaseException'
uranusjr/django-gunicorn/djgunicorn/logging.py
[ { "content": " def access(self, resp, req, environ, request_time):\n \"\"\"Override to apply styling on access logs.\n\n This duplicates a large portion of `gunicorn.glogging.Logger.access`,\n only adding\n \"\"\"\n if not (self.cfg.accesslog or self.cfg.logconfig or self.cfg.syslog):\n return\n\n msg = self.make_access_message(resp, req, environ, request_time)\n try:\n self.access_log.info(msg)\n except:\n self.error(traceback.format_exc())", "metadata": "root.GunicornLogger.access", "header": "['class', 'GunicornLogger', '(', 'gunicorn', '.', 'glogging', '.', 'Logger', ')', ':', '___EOS___']", "index": 59 } ]
[ { "span": "except:", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Gun", "icor", "n", "Logger_", "(_", "gun", "icor", "n_", "._", "glo", "ggi", "ng_", "._", "Logger_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "access_", "(_", "self_", ",_", "resp_", ",_", "req_", ",_", "environ_", ",_", "request", "\\u", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Override", " ", "to", " ", "appl", "y", " ", "sty", "ling", " ", "on", " ", "access", " ", "logs", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "duplicat", "es", " ", "a", " ", "large", " ", "porti", "on", " ", "of", " ", "`", "gun", "icor", "n", ".", "glo", "ggi", "ng", ".", "Log", "ger", ".", "access", "`", ",", "\\", "10", ";", " ", " ", " ", " ", "only", " ", "addin", "g", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "self_", "._", "cfg_", "._", "access", "log_", "or_", "self_", "._", "cfg_", "._", "logc", "onfig_", "or_", "self_", "._", "cfg_", "._", "syslog_", ")_", ":_", "\\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_", "msg_", "=_", "self_", "._", "make", "\\u", "access", "\\u", "message_", "(_", "resp_", ",_", "req_", ",_", "environ_", ",_", "request", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "access", "\\u", "log_", "._", "info_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_" ]
[ 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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/query_hdf5.py
[ { "content": " def _fetch(self, query):\n \"\"\" Return data based on `query`. \"\"\"\n self._setup(query)\n\n\n if query.vnames:\n tmp = []\n for name in self.metadata_names:\n if name in query.vnames:\n tmp.append(name)\n self.metadata_names = tmp\n names = query.vnames\n else:\n if query.driver_name:\n #driver_info = self._drivers[self._driver_id]\n driver_info = self._drivers[self._driver_name]\n prefix = driver_info['prefix']\n all_names = [prefix+name\n for name in driver_info['recording']]\n else:\n all_names = []\n for driver_info in self._drivers.values():\n prefix = driver_info['prefix']\n all_names.extend([prefix+name\n for name in driver_info['recording']])\n names = sorted(all_names+self.metadata_names)\n\n if query.names:\n # Returning single row, not list of rows.\n return names\n\n nan = float('NaN')\n rows = ListResult()\n state = {} # Retains last seen values.\n for case_data in self._reader.cases():\n data = case_data['data']\n metadata = case_data['metadata']\n case_id = metadata['_id']\n case_driver_id = metadata['_driver_id']\n case_driver_name = metadata['_driver_name']\n case_itername = metadata['_itername']\n\n prefix = self._drivers[case_driver_name]['prefix']\n #prefix = self._drivers[case_driver_id]['prefix']\n if prefix:\n # Make names absolute.\n pass\n #data = dict([(prefix+name, value)\n # for name, value in data.items()])\n else:\n data = data.copy() # Don't modify reader version.\n\n state.update(data)\n\n # Filter on driver.\n if self._driver_name is not None and \\\n case_driver_name != self._driver_name:\n continue\n #if self._driver_id is not None and \\\n #case_driver_id != self._driver_id:\n #continue\n\n ## Filter on case.\n #if self._case_ids is None or case_id in self._case_ids:\n if self._case_iternames is None or case_itername in self._case_iternames:\n for name in self.metadata_names:\n data[name] = case_data['metadata'][name]\n\n row = DictList(names)\n for name in names:\n if query.local_only:\n if name in self.metadata_names:\n row.append(data[name])\n else:\n driver = self._drivers[case_driver_name]\n # driver = self._drivers[case_driver_id]\n lnames = [prefix+rec for rec in driver['recording']]\n if name in lnames:\n row.append(data[name])\n else:\n row.append(nan)\n elif name in state:\n row.append(state[name])\n elif name in data:\n row.append(data[name])\n else:\n row.append(nan)\n rows.append(row)\n\n #if case_id == self._query_id or case_id == self._parent_id:\n #break # Parent is last case recorded.\n if case_itername == self._query_itername or case_itername == self._parent_itername:\n break # Parent is last case recorded.\n\n if self._query_id and not rows:\n raise ValueError('No case with _id %s' % self._query_id)\n\n if query.transpose:\n tmp = DictList(names)\n for i in range(len(rows[0])):\n tmp.append([row[i] for row in rows])\n # Keep CDS as attribute for post-processing\n tmp.cds = self\n return tmp\n\n # Keep CDS as attribute for post-processing\n rows.cds = self\n return rows", "metadata": "root.CaseDatasetHDF5._fetch", "header": "['class', 'CaseDatasetHDF5', '(', 'object', ')', ':', '___EOS___']", "index": 71 }, { "content": " def _setup(self, query):\n \"\"\" Setup for processing `query`. \"\"\"\n if query.vnames is not None:\n bad = []\n metadata = self.simulation_info['variable_metadata']\n expressions = self.simulation_info['expressions']\n for name in query.vnames:\n if name not in metadata and name not in [ e['pcomp_name'] for e in expressions.values()] and name not in self.metadata_names:\n bad.append(name)\n if bad:\n raise RuntimeError('Names not found in the dataset: %s' % bad)\n\n self._drivers = {}\n self._driver_id = None\n self._driver_name = None\n for driver_info in self._reader.drivers():\n _id = driver_info['_id']\n name = driver_info['name']\n prefix, _, name = name.rpartition('.')\n if prefix:\n prefix += '.'\n driver_info['prefix'] = prefix\n self._drivers[driver_info['name'] ] = driver_info\n if ( driver_info['name'] ) == query.driver_name:\n self._driver_name = query.driver_name\n #self._driver_id = _id\n\n # self._drivers = {}\n # self._driver_id = None\n # for driver_info in self._reader.drivers():\n # _id = driver_info['_id']\n # name = driver_info['name']\n # prefix, _, name = name.rpartition('.')\n # if prefix:\n # prefix += '.'\n # driver_info['prefix'] = prefix\n # self._drivers[_id] = driver_info\n # if driver_info['name'] == query.driver_name:\n # self._driver_id = _id\n\n if query.driver_name:\n #if self._driver_id is None:\n if self._driver_name is None:\n raise ValueError('No driver named %r' % query.driver_name)\n\n self._case_ids = None\n self._query_id = None\n self._parent_id = None\n #if query.case_id is not None:\n #self._query_id = query.case_id\n #self._case_ids = set((self._query_id,))\n ##self._driver_id = None # Case specified, ignore driver.\n #self._driver_name = None # Case specified, ignore driver.\n if query.case_itername is not None:\n self._query_itername = query.case_itername\n self._case_iternames = set((self._query_itername,))\n #self._driver_id = None # Case specified, ignore driver.\n self._driver_name = None # Case specified, ignore driver.\n\n\n #elif query.parent_id is not None: # TODO - fix this\n elif query.parent_itername is not None: # TODO - fix this\n self._parent_itername = query.parent_itername\n self._case_iternames = set((self._parent_itername,))\n parent_itername_parts = self._parent_itername.split('-')\n for case_data in self._reader.cases():\n itername = case_data['metadata']['_itername']\n itername_parts = itername.split('-')\n if len(parent_itername_parts) + 1 == len(itername_parts) and itername_parts[:-1] == parent_itername_parts:\n self._case_iternames.add(itername)", "metadata": "root.CaseDatasetHDF5._setup", "header": "['class', 'CaseDatasetHDF5', '(', 'object', ')', ':', '___EOS___']", "index": 183 } ]
[ { "span": "case_id ", "start_line": 108, "start_column": 12, "end_line": 108, "end_column": 19 }, { "span": "case_driver_id ", "start_line": 109, "start_column": 12, "end_line": 109, "end_column": 26 }, { "span": "_id ", "start_line": 199, "start_column": 12, "end_line": 199, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Case", "Datas", "et", "HDF", "5_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "fetch_", "(_", "self_", ",_", "query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Return", " ", "data", " ", "based", " ", "on", " ", "`", "query", "`.", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "setup_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "query_", "._", "vn", "ames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "self_", "._", "metadata", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "in_", "query_", "._", "vn", "ames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp_", "._", "append_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "metadata", "\\u", "names_", "=_", "tmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "query_", "._", "vn", "ames_", "\\u\\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_", "query_", "._", "driver", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "driver", "\\u", "info", " ", "=", " ", "self", ".\\u", "driver", "s", "[", "self", ".\\u", "driver", "\\u", "id", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver", "\\u", "info_", "=_", "self_", "._", "\\u", "drivers_", "[_", "self_", "._", "\\u", "driver", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "driver", "\\u", "info_", "[_", "'", "prefix", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "names_", "=_", "[_", "prefix_", "+_", "name_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", "in_", "driver", "\\u", "info_", "[_", "'", "record", "ing", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "driver", "\\u", "info_", "in_", "self_", "._", "\\u", "drivers_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "prefix_", "=_", "driver", "\\u", "info_", "[_", "'", "prefix", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "names_", "._", "extend_", "(_", "[_", "prefix_", "+_", "name_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", "in_", "driver", "\\u", "info_", "[_", "'", "record", "ing", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "names_", "=_", "sorted_", "(_", "all", "\\u", "names_", "+_", "self_", "._", "metadata", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "query_", "._", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Return", "ing", " ", "single", " ", "row", ",", " ", "not", " ", "list", " ", "of", " ", "rows", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nan_", "=_", "float_", "(_", "'", "Na", "N", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "List", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "{_", "}_", "#", " ", "Ret", "ain", "s", " ", "last", " ", "see", "n", " ", "values", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "case", "\\u", "data_", "in_", "self_", "._", "\\u", "reader_", "._", "cases_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "case", "\\u", "data_", "[_", "'", "data", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "case", "\\u", "data_", "[_", "'", "metadata", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "id_", "=_", "metadata_", "[_", "'\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "driver", "\\u", "id_", "=_", "metadata_", "[_", "'\\u", "driver", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "driver", "\\u", "name_", "=_", "metadata_", "[_", "'\\u", "driver", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "iter", "name_", "=_", "metadata_", "[_", "'\\u", "iter", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "self_", "._", "\\u", "drivers_", "[_", "case", "\\u", "driver", "\\u", "name_", "]_", "[_", "'", "prefix", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "prefix", " ", "=", " ", "self", ".\\u", "driver", "s", "[", "case", "\\u", "driver", "\\u", "id", "]['", "prefix", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "names", " ", "abs", "olute", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "data", " ", "=", " ", "dict", "([(", "prefix", "+", "name", ",", " ", "value", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "name", ",", " ", "value", " ", "in", " ", "data", ".", "items", "()]", ")_", "\\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 ", " _", "data_", "=_", "data_", "._", "copy_", "(_", ")_", "#", " ", "Don", "'", "t", " ", "modif", "y", " ", "reader", " ", "version", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "state_", "._", "update_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Filter", " ", "on", " ", "driver", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "driver", "\\u", "name_", "is_", "not_", "None_", "and_", "case", "\\u", "driver", "\\u", "name_", "!=_", "self_", "._", "\\u", "driver", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "self", ".\\u", "driver", "\\u", "id", " ", "is", " ", "not", " ", "Non", "e", " ", "and", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", "case", "\\u", "driver", "\\u", "id", " ", "!=", " ", "self", ".\\u", "driver", "\\u", "id", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Filter", " ", "on", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "self", ".\\u", "case", "\\u", "ids", " ", "is", " ", "Non", "e", " ", "or", " ", "case", "\\u", "id", " ", "in", " ", "self", ".\\u", "case", "\\u", "ids", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "case", "\\u", "iter", "names_", "is_", "None_", "or_", "case", "\\u", "iter", "name_", "in_", "self_", "._", "\\u", "case", "\\u", "iter", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", "in_", "self_", "._", "metadata", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "data_", "[_", "name_", "]_", "=_", "case", "\\u", "data_", "[_", "'", "metadata", "'_", "]_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "row_", "=_", "Dict", "List_", "(_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "query_", "._", "local", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "name_", "in_", "self_", "._", "metadata", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "row_", "._", "append_", "(_", "data_", "[_", "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 ", " ", " _", "driver_", "=_", "self_", "._", "\\u", "drivers_", "[_", "case", "\\u", "driver", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "driver", " ", "=", " ", "self", ".\\u", "driver", "s", "[", "case", "\\u", "driver", "\\u", "id", "]_", "\\u\\u\\uNL\\u\\u\\u_", "lname", "s_", "=_", "[_", "prefix_", "+_", "rec_", "for_", "rec_", "in_", "driver_", "[_", "'", "record", "ing", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "in_", "lname", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "row_", "._", "append_", "(_", "data_", "[_", "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 ", " ", " _", "row_", "._", "append_", "(_", "nan_", ")_", "\\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_", "name_", "in_", "state_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "row_", "._", "append_", "(_", "state_", "[_", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "row_", "._", "append_", "(_", "data_", "[_", "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 ", " ", " _", "row_", "._", "append_", "(_", "nan_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rows_", "._", "append_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "case", "\\u", "id", " ", "==", " ", "self", ".\\u", "query", "\\u", "id", " ", "or", " ", "case", "\\u", "id", " ", "==", " ", "self", ".\\u", "parent", "\\u", "id", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "break", " ", " ", "#", " ", "Parent", " ", "is", " ", "last", " ", "case", " ", "recorde", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "case", "\\u", "iter", "name_", "==_", "self_", "._", "\\u", "query", "\\u", "iter", "name_", "or_", "case", "\\u", "iter", "name_", "==_", "self_", "._", "\\u", "parent", "\\u", "iter", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "#", " ", "Parent", " ", "is", " ", "last", " ", "case", " ", "recorde", "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_", "if_", "self_", "._", "\\u", "query", "\\u", "id_", "and_", "not_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "No", " ", "case", " ", "with", " ", "\\u", "id", " ", "%", "s", "'_", "%_", "self_", "._", "\\u", "query", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "query_", "._", "transpose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "Dict", "List_", "(_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "rows_", "[_", "0_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "._", "append_", "(_", "[_", "row_", "[_", "i_", "]_", "for_", "row_", "in_", "rows_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Keep", " ", "CD", "S", " ", "as", " ", "attribute", " ", "for", " ", "post", "-", "processing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp_", "._", "cds", "_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Keep", " ", "CD", "S", " ", "as", " ", "attribute", " ", "for", " ", "post", "-", "processing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rows_", "._", "cds", "_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Datas", "et", "HDF", "5_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup_", "(_", "self_", ",_", "query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Set", "up", " ", "for", " ", "process", "ing", " ", "`", "query", "`.", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "query_", "._", "vn", "ames_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bad_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "self_", "._", "simulati", "on", "\\u", "info_", "[_", "'", "variab", "le", "\\u", "metadata", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expressions_", "=_", "self_", "._", "simulati", "on", "\\u", "info_", "[_", "'", "express", "ion", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "query_", "._", "vn", "ames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "not_", "in_", "metadata_", "and_", "name_", "not_", "in_", "[_", "e_", "[_", "'", "pco", "mp", "\\u", "name", "'_", "]_", "for_", "e_", "in_", "expressions_", "._", "values_", "(_", ")_", "]_", "and_", "name_", "not_", "in_", "self_", "._", "metadata", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bad_", "._", "append_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "bad_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'", "Names", " ", "not", " ", "found", " ", "in", " ", "the", " ", "dataset", ":", " ", "%", "s", "'_", "%_", "bad_", ")_", "\\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_", "._", "\\u", "drivers_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "driver", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "driver", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "driver", "\\u", "info_", "in_", "self_", "._", "\\u", "reader_", "._", "drivers_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "id_", "=_", "driver", "\\u", "info_", "[_", "'\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "driver", "\\u", "info_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", ",_", "\\u_", ",_", "name_", "=_", "name_", "._", "rpartition_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "+=_", "'.'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "driver", "\\u", "info_", "[_", "'", "prefix", "'_", "]_", "=_", "prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "drivers_", "[_", "driver", "\\u", "info_", "[_", "'", "name", "'_", "]_", "]_", "=_", "driver", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "driver", "\\u", "info_", "[_", "'", "name", "'_", "]_", ")_", "==_", "query_", "._", "driver", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "driver", "\\u", "name_", "=_", "query_", "._", "driver", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".\\u", "driver", "\\u", "id", " ", "=", " ", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".\\u", "driver", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".\\u", "driver", "\\u", "id", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "driver", "\\u", "info", " ", "in", " ", "self", ".\\u", "reader", ".", "driver", "s", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\\u", "id", " ", "=", " ", "driver", "\\u", "info", "['", "\\u", "id", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "name", " ", "=", " ", "driver", "\\u", "info", "['", "name", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prefix", ",", " ", "\\u", ",", " ", "name", " ", "=", " ", "name", ".", "rpa", "rti", "tion", "('.", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "prefix", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "prefix", " ", "+=", " ", "'.'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "driver", "\\u", "info", "['", "prefix", "']", " ", "=", " ", "prefix_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".\\u", "driver", "s", "[\\u", "id", "]", " ", "=", " ", "driver", "\\u", "info_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "driver", "\\u", "info", "['", "name", "']", " ", "==", " ", "query", ".", "driver", "\\u", "name", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "self", ".\\u", "driver", "\\u", "id", " ", "=", " ", "\\u", "id_", "\\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_", "query_", "._", "driver", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "self", ".\\u", "driver", "\\u", "id", " ", "is", " ", "Non", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "driver", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "No", " ", "driver", " ", "named", " ", "%", "r", "'_", "%_", "query_", "._", "driver", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "case", "\\u", "ids_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "query", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "parent", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "query", ".", "case", "\\u", "id", " ", "is", " ", "not", " ", "Non", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".\\u", "query", "\\u", "id", " ", "=", " ", "query", ".", "case", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".\\u", "case", "\\u", "ids", " ", "=", " ", "set", "((", "self", ".\\u", "query", "\\u", "id", ",)", ")_", "\\u\\u\\uNL\\u\\u\\u_", "##", "self", ".\\u", "driver", "\\u", "id", " ", "=", " ", "Non", "e", " ", " ", "#", " ", "Case", " ", "specified", ",", " ", "ignore", " ", "driver", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".\\u", "driver", "\\u", "name", " ", "=", " ", "Non", "e", " ", " ", "#", " ", "Case", " ", "specified", ",", " ", "ignore", " ", "driver", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "query_", "._", "case", "\\u", "iter", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "query", "\\u", "iter", "name_", "=_", "query_", "._", "case", "\\u", "iter", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "case", "\\u", "iter", "names_", "=_", "set_", "(_", "(_", "self_", "._", "\\u", "query", "\\u", "iter", "name_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".\\u", "driver", "\\u", "id", " ", "=", " ", "Non", "e", " ", " ", "#", " ", "Case", " ", "specified", ",", " ", "ignore", " ", "driver", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "driver", "\\u", "name_", "=_", "None_", "#", " ", "Case", " ", "specified", ",", " ", "ignore", " ", "driver", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "eli", "f", " ", "query", ".", "parent", "\\u", "id", " ", "is", " ", "not", " ", "Non", "e", ":", " ", "#", " ", "TOD", "O", " ", "-", " ", "fix", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "query_", "._", "parent", "\\u", "iter", "name_", "is_", "not_", "None_", ":_", "#", " ", "TOD", "O", " ", "-", " ", "fix", " ", "this_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "parent", "\\u", "iter", "name_", "=_", "query_", "._", "parent", "\\u", "iter", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "case", "\\u", "iter", "names_", "=_", "set_", "(_", "(_", "self_", "._", "\\u", "parent", "\\u", "iter", "name_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent", "\\u", "iter", "name", "\\u", "parts_", "=_", "self_", "._", "\\u", "parent", "\\u", "iter", "name_", "._", "split_", "(_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "case", "\\u", "data_", "in_", "self_", "._", "\\u", "reader_", "._", "cases_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "name_", "=_", "case", "\\u", "data_", "[_", "'", "metadata", "'_", "]_", "[_", "'\\u", "iter", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iter", "name", "\\u", "parts_", "=_", "iter", "name_", "._", "split_", "(_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "parent", "\\u", "iter", "name", "\\u", "parts_", ")_", "+_", "1_", "==_", "len_", "(_", "iter", "name", "\\u", "parts_", ")_", "and_", "iter", "name", "\\u", "parts_", "[_", ":_", "-_", "1_", "]_", "==_", "parent", "\\u", "iter", "name", "\\u", "parts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "case", "\\u", "iter", "names_", "._", "add_", "(_", "iter", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
anhstudios/swganh/data/scripts/radials/blue_frog.py
[ { "content": "import swgpy\nfrom swgpy.object import *\nfrom swgpy.sui import *\nfrom swgpy.utility import vector3, quat\nfrom swgpy.combat import *\nfrom swgpy.gamesystems import *\nfrom swgpy import ACTION\n\n\nimport random\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PyRadialMenu(RadialMenu):\n\t\n\t\n\tlevels = ('None', 'Light', 'Medium', 'Heavy')\n\t\n\tdamage_types = ('Energy', 'Kinetic', 'Acid', 'Cold', 'Electricity', 'Heat')\n\t\n\t\n\t\n\t\n\t\n\t\n\t\t\t\n\n\n\n\t\n\t\n\t\n\t\t\n\n\n\n\n\t\t\n\n\t\t\t\t\n\tvehicleDeeds = ('object/tangible/deed/vehicle_deed/shared_jetpack_deed.iff',\n\t\t\t\t\t'object/tangible/deed/vehicle_deed/shared_landspeeder_av21_deed.iff',\n\t\t\t\t\t'object/tangible/deed/vehicle_deed/shared_landspeeder_x31_deed.iff',\n\t\t\t\t\t'object/tangible/deed/vehicle_deed/shared_landspeeder_x34_deed.iff',\n\t\t\t\t\t'object/tangible/deed/vehicle_deed/shared_speederbike_flash_deed.iff',\n\t\t\t\t\t'object/tangible/deed/vehicle_deed/shared_speederbike_swoop_deed.iff')\n\n\tweapons = [('object/weapon/melee/2h_sword/shared_2h_sword_battleaxe.iff',\n\t\t\t\t\t'object/weapon/melee/2h_sword/shared_2h_sword_blacksun_hack.iff',\n\t\t\t\t\t'object/weapon/melee/2h_sword/shared_2h_sword_cleaver.iff',\n\t\t\t\t\t'object/weapon/melee/2h_sword/shared_2h_sword_katana.iff',\n\t\t\t\t\t'object/weapon/melee/2h_sword/shared_2h_sword_maul.iff',\n\t\t\t\t\t'object/weapon/melee/2h_sword/shared_2h_sword_scythe.iff',\n\t\t\t\t\t'object/weapon/melee/axe/shared_axe_heavy_duty.iff',\n\t\t\t\t\t'object/weapon/melee/axe/shared_axe_vibroaxe.iff',\n\t\t\t\t\t'object/weapon/melee/baton/shared_baton_gaderiffi.iff',\n\t\t\t\t\t'object/weapon/melee/baton/shared_baton_stun.iff',\n\t\t\t\t\t'object/weapon/melee/baton/shared_victor_baton_gaderiffi.iff',\n\t\t\t\t\t'object/weapon/melee/knife/shared_knife_dagger.iff',\n\t\t\t\t\t'object/weapon/melee/knife/shared_knife_donkuwah.iff',\n\t\t\t\t\t'object/weapon/melee/knife/shared_knife_janta.iff',\n\t\t\t\t\t'object/weapon/melee/knife/shared_knife_stone.iff',\n\t\t\t\t\t'object/weapon/melee/knife/shared_knife_stone_noob.iff',\n\t\t\t\t\t'object/weapon/melee/knife/shared_knife_survival.iff',\n\t\t\t\t\t'object/weapon/melee/knife/shared_knife_vibroblade.iff',\n\t\t\t\t\t'object/weapon/melee/polearm/shared_lance_nightsister.iff',\n\t\t\t\t\t'object/weapon/melee/polearm/shared_lance_staff_janta.iff',\n\t\t\t\t\t'object/weapon/melee/polearm/shared_lance_staff_metal.iff',\n\t\t\t\t\t'object/weapon/melee/polearm/shared_lance_staff_wood_s1.iff',\n\t\t\t\t\t'object/weapon/melee/polearm/shared_lance_staff_wood_s2.iff',\n\t\t\t\t\t'object/weapon/melee/polearm/shared_lance_vibrolance.iff',\n\t\t\t\t\t'object/weapon/melee/polearm/shared_polearm_vibro_axe.iff',\n\t\t\t\t\t'object/weapon/melee/special/shared_blacksun_razor.iff',\n\t\t\t\t\t'object/weapon/melee/special/shared_vibroknucler.iff'),\n\t\t\t\t\t\n\t\t\t\t\t('object/weapon/ranged/carbine/shared_carbine_cdef.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_cdef_corsec.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_dh17.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_dh17_black.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_dh17_snubnose.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_dxr6.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_e11.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_ee3.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_elite.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_laser.iff',\n\t\t\t\t\t'object/weapon/ranged/carbine/shared_carbine_nym_slugthrower.iff',\n\t\t\t\t\t'object/weapon/ranged/heavy/shared_heavy_acid_beam.iff',\n\t\t\t\t\t'object/weapon/ranged/heavy/shared_heavy_lightning_beam.iff',\n\t\t\t\t\t'object/weapon/ranged/heavy/shared_heavy_particle_beam.iff',\n\t\t\t\t\t'object/weapon/ranged/heavy/shared_heavy_rocket_launcher.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_cdef.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_cdef_corsec.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_cdef_noob.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_d18.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_de_10.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_dh17.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_dl44.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_dl44_metal.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_dx2.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_fwg5.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_geonosian_sonic_blaster_loot.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_launcher.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_power5.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_republic_blaster.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_scatter.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_scout_blaster.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_scout_blaster_corsec.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_srcombat.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_striker.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_striker_noob.iff',\n\t\t\t\t\t'object/weapon/ranged/pistol/shared_pistol_tangle.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_acid_beam.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_beam.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_berserker.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_bowcaster.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_cdef.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_dlt20.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_dlt20a.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_e11.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_ewok_crossbow.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_flame_thrower.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_jawa_ion.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_laser.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_laser_noob.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_lightning.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_sg82.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_spraystick.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_t21.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_tenloss_dxr6_disruptor_loot.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_tusken.iff',\n\t\t\t\t\t'object/weapon/ranged/rifle/shared_rifle_victor_tusken.iff'), \n\t\t\t\t\t\n\t\t\t\t\t()]\n\n\tarmor = [\t('object/tangible/wearables/armor/bone/shared_armor_bone_s01_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bone/shared_armor_bone_s01_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bone/shared_armor_bone_s01_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bone/shared_armor_bone_s01_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bone/shared_armor_bone_s01_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bone/shared_armor_bone_s01_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bone/shared_armor_bone_s01_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bone/shared_armor_bone_s01_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bone/shared_armor_bone_s01_leggings.iff',),\n\t\t\t\t\n\t\t\t\t('object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_belt.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/bounty_hunter/shared_armor_bounty_hunter_leggings.iff'),\n\t\t\t\t\n\t\t\t\t('object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/chitin/shared_armor_chitin_s01_leggings.iff'),\n\t\t\t\t \n\t\t\t\t('object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff'),\n\t\t\t\t\n\t\t\t\t('object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_leggings.iff'),\n\t\t\t\t\n\t\t\t\t('object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_leggings.iff'),\n\t\t\t\t\n\t\t\t\t('object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_leggings.iff'),\n\t\t\t\t \n\t\t\t\t('object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_belt.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_leggings.iff',\n\t\t\t\t 'object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_shoes.iff'),\n\t\t\t\t \n\t\t\t\t('object/tangible/wearables/armor/marine/shared_armor_marine_backpack.iff',\n\t\t\t\t 'object/tangible/wearables/armor/marine/shared_armor_marine_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/marine/shared_armor_marine_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/marine/shared_armor_marine_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/marine/shared_armor_marine_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/marine/shared_armor_marine_chest_plate_rebel.iff',\n\t\t\t\t 'object/tangible/wearables/armor/marine/shared_armor_marine_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/marine/shared_armor_marine_leggings.iff'),\n\t\t\t\t\n\t\t\t\t('object/tangible/wearables/armor/padded/shared_armor_padded_s01_belt.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/padded/shared_armor_padded_s01_leggings.iff'),\n\t\t\t\t \n\t\t\t\t('object/tangible/wearables/armor/ris/shared_armor_ris_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ris/shared_armor_ris_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ris/shared_armor_ris_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ris/shared_armor_ris_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ris/shared_armor_ris_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ris/shared_armor_ris_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ris/shared_armor_ris_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ris/shared_armor_ris_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ris/shared_armor_ris_leggings.iff'),\n\t\t\t\t \n\t\t\t\t('object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_bicep_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_bicep_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_leggings.iff',\n\t\t\t\t 'object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_utility_belt.iff'),\n\t\t\t\t \n\t\t\t\t('object/tangible/wearables/armor/tantel/shared_armor_tantel_skreej_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/tantel/shared_armor_tantel_skreej_chest_plate.iff',\n\t\t\t\t 'object/tangible/wearables/armor/tantel/shared_armor_tantel_skreej_helmet.iff'),\n\t\t\t\t\n\t\t\t\t('object/tangible/wearables/armor/ubese/shared_armor_ubese_bandolier.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ubese/shared_armor_ubese_boots.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ubese/shared_armor_ubese_bracer_l.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ubese/shared_armor_ubese_bracer_r.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ubese/shared_armor_ubese_gloves.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ubese/shared_armor_ubese_helmet.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ubese/shared_armor_ubese_jacket.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ubese/shared_armor_ubese_pants.iff',\n\t\t\t\t 'object/tangible/wearables/armor/ubese/shared_armor_ubese_shirt.iff')]\n\t\t\t\t\t\n\tstructureDeeds = [('object/tangible/deed/factory_deed/shared_factory_clothing_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/factory_deed/shared_factory_food_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/factory_deed/shared_factory_item_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/factory_deed/shared_factory_structure_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/generator_deed/shared_generator_fusion_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/generator_deed/shared_generator_photo_bio_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/generator_deed/shared_generator_solar_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/generator_deed/shared_generator_wind_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_creature_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_flora_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_flora_deed_heavy.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_flora_deed_medium.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_gas_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_gas_deed_heavy.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_gas_deed_medium.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_liquid_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_liquid_deed_heavy.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_liquid_deed_medium.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_moisture_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_moisture_deed_heavy.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_moisture_deed_medium.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_ore_heavy_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_ore_s1_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/harvester_deed/shared_harvester_ore_s2_deed.iff'),\n\t\t\t\t\t\t\n\t\t\t\t\t\t('object/tangible/deed/player_house_deed/shared_corellia_house_large_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_corellia_house_large_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_corellia_house_medium_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_corellia_house_medium_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_corellia_house_small_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_corellia_house_small_floor_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_corellia_house_small_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_corellia_house_small_style_02_floor_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_generic_house_large_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_generic_house_large_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_generic_house_medium_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_generic_house_medium_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_generic_house_small_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_generic_house_small_floor_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_generic_house_small_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_generic_house_small_style_02_floor_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_merchent_tent_style_01_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_merchent_tent_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_merchent_tent_style_03_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_naboo_house_large_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_naboo_house_medium_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_naboo_house_medium_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_naboo_house_small_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_naboo_house_small_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_tatooine_house_large_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_tatooine_house_medium_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_tatooine_house_medium_style_02_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_tatooine_house_small_deed.iff',\n\t\t\t\t\t\t'object/tangible/deed/player_house_deed/shared_tatooine_house_small_style_02_deed.iff'),\n\t\t\t\t\t\t\n\t\t\t\t\t\t('object/tangibe/deed/city_deed/shared_bank_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cityhall_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cloning_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garage_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_lrg_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_lrg_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_lrg_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_lrg_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_lrg_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_med_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_med_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_med_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_med_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_med_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_sml_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_sml_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_sml_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_sml_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_corellia_sml_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_hospital_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_shuttleport_corellia_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_theater_corellia_deed.iff'),\n\t\t\t\t\t\t \n\t\t\t\t\t\t('object/tangibe/deed/city_deed/shared_bank_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cityhall_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cloning_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garage_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_lrg_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_lrg_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_lrg_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_lrg_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_lrg_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_med_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_med_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_med_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_med_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_med_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_sml_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_sml_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_sml_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_sml_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_naboo_sml_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_hospital_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_shuttleport_naboo_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_theater_naboo_deed.iff'),\n\t\t\t\t\t\t \n\t\t\t\t\t\t('object/tangibe/deed/city_deed/shared_bank_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cityhall_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cloning_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garage_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_cantina_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_lrg_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_lrg_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_lrg_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_lrg_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_lrg_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_med_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_med_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_med_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_med_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_med_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_sml_01_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_sml_02_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_sml_03_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_sml_04_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_garden_tatooine_sml_05_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_hospital_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_shuttleport_tatooine_deed.iff',\n\t\t\t\t\t\t 'object/tangibe/deed/city_deed/shared_theater_tatooine_deed.iff'),\n\t\t\t\t\t\t \n\t\t\t\t\t\t('object/tangible/deed/guild_deed/shared_corellia_guild_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/guild_deed/shared_generic_guild_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/guild_deed/shared_naboo_guild_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/guild_deed/shared_tatooine_guild_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/guild_deed/shared_tatooine_guild_style_02_deed.iff'),\n\t\t\t\t\t\t \n\t\t\t\t\t\t('object/tangible/deed/faction_perk/covert_detector/shared_detector_32m_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s01.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s01_pvp.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s02.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s02_pvp.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s03.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s03_pvp.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s04.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s04_pvp.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s05.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/hq/shared_hq_s05_pvp.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/minefield/shared_field_1x1_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/turret/shared_block_lg_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/turret/shared_block_med_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/turret/shared_block_sm_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/turret/shared_dish_lg_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/turret/shared_dish_sm_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/turret/shared_tower_lg_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/turret/shared_tower_med_deed.iff',\n\t\t\t\t\t\t 'object/tangible/deed/faction_perk/turret/shared_tower_sm_deed.iff')]\n\t\t\t\t\t\n\tpetDeeds = ('object/tangible/deed/pet_deed/shared_angler_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_bageraset_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_bantha_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_bearded_jax_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_blurrg_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_boar_wolf_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_bocatt_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_bol_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_bolle_bol_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_bolma_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_bordok_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_brackaset_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_carrion_spat_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_choku_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_cu_pa_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_dalyrake_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_dewback_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_dune_lizard_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_durni_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_eopie_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_falumpaset_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_fambaa_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_gnort_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_graul_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_gronda_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_gualama_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_guf_drolg_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_gurnaset_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_gurrcat_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_gurreck_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_hermit_spider_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_huf_dun_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_huurton_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_ikopi_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_kaadu_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_kahmurra_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_kima_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_kimogila_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_kliknik_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_krahbu_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_kusak_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_kwi_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_langlatch_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_malkloc_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_mawgax_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_marek_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_mott_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_narglatch_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_piket_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_pugoriss_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_rancor_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_roba_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_ronto_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_sand_panther_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_sharnaff_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_shear_mite_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_slice_hound_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_snorbal_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_squall_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_swirl_prong_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_thune_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_torton_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_tybis_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_veermok_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_verne_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_vesp_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_vir_vur_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_woolamander_deed.iff',\n\t\t\t\t'object/tangible/deed/pet_deed/shared_zucca_boar_deed.iff')\n\t\n\tdroidDeeds = (\t'object/tangible/deed/pet_deed/shared_deed_3p0_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_3p0_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_binary_load_lifter_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_binary_load_lifter_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_dz70_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_dz70_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_le_repair_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_le_repair_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_mse_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_mse_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_power_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_power_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_probot_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_probot_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_r2_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_r2_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_r3_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_r3_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_r4_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_r4_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_r5_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_r5_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_surgical_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_surgical_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_treadwell_advanced_basic.iff',\n\t\t\t\t\t'object/tangible/deed/pet_deed/shared_deed_treadwell_basic.iff',\n\t\t\t\t\t)\n\t\t\t\t\t\n\tinstruments = ( 'object/tangible/instrument/shared_bandfill.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_fanfar.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_fizz.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_flute_droopy.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_instrument_kloo_horn.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_mandoviol.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_nalargon.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_ommni_box.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_slitherhorn.iff',\n\t\t\t\t\t'object/tangible/instrument/shared_traz.iff')", "metadata": "root.PyRadialMenu", "header": "['module', '___EOS___']", "index": 11 }, { "content": "\tdef buildRadial(self, owner, target, radials):\n\t\tradial_list = RadialOptionsList()\n\t\tradial_list.append(RadialOptions(0, RadialIdentifier.itemUse, 1, 'Hack Universe'))\n\t\tradial_list.append(RadialOptions(0, RadialIdentifier.examine, 1, ''))\n\t\tradial_list.append(RadialOptions(1, RadialIdentifier.serverMenu1, 3, 'items'))\n\t\tradial_list.append(RadialOptions(1, RadialIdentifier.serverMenu2, 3, 'Weapon Pack'))\n\t\tradial_list.append(RadialOptions(1, RadialIdentifier.serverMenu3, 3, 'Armor Pack'))\n\t\tradial_list.append(RadialOptions(1, RadialIdentifier.serverMenu4, 3, 'Structures Pack'))\n\t\tradial_list.append(RadialOptions(1, RadialIdentifier.serverMenu5, 3, 'Pets Pack'))\n\t\tradial_list.append(RadialOptions(1, RadialIdentifier.serverMenu6, 3, 'Instrument Pack'))\n\t\tradial_list.append(RadialOptions(1, RadialIdentifier.serverMenu7, 3, 'Ham Options'))\n\t\tradial_list.append(RadialOptions(1, RadialIdentifier.serverMenu8, 3, 'Professions'))\n\t\treturn radial_list", "metadata": "root.PyRadialMenu.buildRadial", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 13 }, { "content": "\tdef defaultPostProcess(self, item):\n\t\tpass", "metadata": "root.PyRadialMenu.defaultPostProcess", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 31 }, { "content": "\tdef weaponPostProcess(self, item):\n\t\t\n\t\titem.max_condition = random.randint(100, 10000)\n\t\titem.setStringAttribute('wpn_armor_pierce_rating', random.choice(self.levels))\n\t\titem.setFloatAttribute('wpn_attack_speed', random.uniform(0.1, 5))\n\t\titem.setStringAttribute('cat_wpn_damage.wpn_damage_type', random.choice(self.damage_types))\n\t\tmin_damage = random.randint(1, 1000)\n\t\tmax_damage = random.randint(min_damage, 1000)\n\t\titem.setIntAttribute('cat_wpn_damage.wpn_damage_min', min_damage)\n\t\titem.setIntAttribute('cat_wpn_damage.wpn_damage_max', max_damage)\n\t\titem.setFloatAttribute('cat_wpn_damage.wpn_wound_chance', random.uniform(0, 100))\n\t\titem.setIntAttribute('cat_wpn_rangemods.wpn_range_zero', 0)\n\t\titem.setIntAttribute('cat_wpn_rangemods.wpn_range_mid', 40)\n\t\titem.setIntAttribute('cat_wpn_rangemods.wpn_range_max', -80)\n\t\titem.setIntAttribute('cat_wpn_attack_cost.wpn_attack_cost_health', random.randint(1, 200))\n\t\titem.setIntAttribute('cat_wpn_attack_cost.wpn_attack_cost_action', random.randint(1, 200))\n\t\titem.setIntAttribute('cat_wpn_attack_cost.wpn_attack_cost_mind', random.randint(1, 200))", "metadata": "root.PyRadialMenu.weaponPostProcess", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 34 }, { "content": "\tdef armorPostProcess(self, item):\n\t\titem.max_condition = random.randint(100, 10000)\n\t\titem.setStringAttribute('armor_rating', random.choice(self.levels))\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_kinetic', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_energy', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_blast', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_stun', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_elemental_heat', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_elemental_cold', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_elemental_acid', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_elemental_electrical', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_special_protection.armor_eff_restraint', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_restraint', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_energy', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_blast', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_stun', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_elemental_heat', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_elemental_cold', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_elemental_acid', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_elemental_electrical', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_effectiveness.armor_eff_restraint', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_kinetic', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_energy', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_blast', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_stun', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_elemental_heat', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_elemental_cold', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_elemental_acid', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_elemental_electrical', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setFloatAttribute('cat_armor_vulnerability.armor_eff_restraint', random.uniform(0, 100) if random.random()>0.7 else 0)\n\t\titem.setIntAttribute('cat_armor_encumbrance.armor_health_encumbrance', random.randint(20, 300))\n\t\titem.setIntAttribute('cat_armor_encumbrance.armor_action_encumbrance', random.randint(20, 300))\n\t\titem.setIntAttribute('cat_armor_encumbrance.armor_mind_encumbrance', random.randint(20, 300))\n\t\titem.setStringAttribute('crafter', 'Blue Frog, Inc.')", "metadata": "root.PyRadialMenu.armorPostProcess", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 52 }, { "content": "\tdef giveItems(self, owner, list, postProcess):\n\t\tsim = self.getKernel().serviceManager().simulationService()\n\t\tinv = self.getKernel().serviceManager().equipmentService().getEquippedObject(owner, \"inventory\")\n\t\tfor name in list:\n\t\t\titem = sim.createObject(name, swgpy.ContainerPermission.DEFAULT)\n\t\t\tif item is not None:\n\t\t\t\tpostProcess(item)\n\t\t\t\tinv.add(owner, item)", "metadata": "root.PyRadialMenu.giveItems", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 87 }, { "content": "\tdef displaySUIList(self, owner, list, callbackName):\n\t\tsui = self.getKernel().serviceManager().suiService()\n\t\t\n\t\t#if sui.getSUIWindowByScriptName(owner, 'Script.listBox') != None:\n\t\t\t#return\n\n\t\toptions = EventResultList()\n\t\tfor option in list:\n\t\t\toptions.append(option)\n\t\t\n\t\twindow = sui.createListBox(ListBoxType.OK_CANCEL, '0xDEADBEEF', '...00010011010001...\\n\\n...[OVERRIDE]...\\n\\nWELCOME, JOHN SMEDLEY', options, owner)\n\t\t\t\n\t\tresults = ResultList()\n\t\tresults.append('List.lstList:SelectedRow')\n\t\tcallback = PythonCallback(self, callbackName)\n\t\t\n\t\twindow.subscribeToEventCallback(0, '', InputTrigger.OK, results, callback)\n\t\twindow.subscribeToEventCallback(1, '', InputTrigger.CANCEL, results, callback)\n\t\tsui.openSUIWindow(window)", "metadata": "root.PyRadialMenu.displaySUIList", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 96 }, { "content": "\tdef professionCallback(self, owner, event_id, results):\n\t\tif event_id == 0:\n\t\t\tif int(results[0]) == 0:\n\t\t\t\tself.displaySUIList(owner, ['grant entertainer_novice'], 'entertainerCallback')\n\t\treturn True", "metadata": "root.PyRadialMenu.professionCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 117 }, { "content": "\tdef entertainerCallback(self, owner, event_id, results):\n\t\tif event_id == 0:\n\t\t\tif int(results[0]) == 0:\n\t\t\t\tcreature = owner.toCreature()\n\t\t\t\tGameSytems = self.getKernel().serviceManager().gamesystemsService()\n\t\t\t\tGameSytems.grantSkill(creature, \"social_entertainer_novice\")\n\n\n\t\t\t\t\n\t\treturn True", "metadata": "root.PyRadialMenu.entertainerCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 123 }, { "content": "\tdef itemCallback(self, owner, event_id, results):\n\t\tif event_id == 0:\n\t\t\tif int(results[0]) == 0:\n\t\t\t\tself.giveItems(owner, self.vehicleDeeds, self.defaultPostProcess)\n\t\t\tif int(results[0]) == 1:\n\t\t\t\tself.giveItems(owner, self.droidDeeds, self.defaultPostProcess)\n\t\treturn True", "metadata": "root.PyRadialMenu.itemCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 134 }, { "content": "\tdef weaponCallback(self, owner, event_id, results):\n\t\tif event_id == 0:\n\t\t\tself.giveItems(owner, self.weapons[int(results[0])], self.weaponPostProcess)\n\t\treturn True", "metadata": "root.PyRadialMenu.weaponCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 142 }, { "content": "\tdef armorCallback(self, owner, event_id, results):\n\t\tif event_id == 0:\n\t\t\tself.giveItems(owner, self.armor[int(results[0])], self.armorPostProcess)\n\t\treturn True", "metadata": "root.PyRadialMenu.armorCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 149 }, { "content": "\tdef structureCallback(self, owner, event_id, results):\n\t\tif event_id == 0:\n\t\t\tself.giveItems(owner, self.structureDeeds[int(results[0])], self.defaultPostProcess)\n\t\treturn True", "metadata": "root.PyRadialMenu.structureCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 154 }, { "content": "\tdef hamCallback(self, owner, event_id, results):\n\t\tprint('result : ' + \"{0} : {1}\".format(event_id, results[0]))\n\t\tif event_id == 0:\n\t\t\tif int(results[0]) == 0:\n\t\t\t\tself.displaySUIList(owner, ['Health Wounds', 'heal Health Wounds','Action Wounds', 'heal Action Wounds', 'Mind Wounds', 'heal Mind Wounds'], 'woundCallback')\n\t\t\tif int(results[0]) == 1:\n\t\t\t\tself.displaySUIList(owner, ['Health Damage', 'heal Health Damage', 'Action Damage', 'Mind Damage'], 'damageCallback')\n\t\treturn True", "metadata": "root.PyRadialMenu.hamCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 159 }, { "content": "\tdef woundCallback(self, owner, event_id, results):\n\t\tif event_id == 0:\n\t\t\tcombat = self.getKernel().serviceManager().combatService()\n\t\t\tham = combat.getHamManager()\n\t\t\tcreature = owner.toCreature()\n\t\t\tif int(results[0]) == 0:\n\t\t\t\ta = ham.applyWound(creature,0,25)\n\t\t\tif int(results[0]) == 1:\n\t\t\t\tham.removeWound(creature,0,25)\n\t\t\tif int(results[0]) == 2:\n\t\t\t\tham.applyWound(creature,3,25)\n\t\t\tif int(results[0]) == 3:\n\t\t\t\tham.removeWound(creature,3,25)\n\t\t\tif int(results[0]) == 4:\n\t\t\t\tham.applyWound(creature,6,25)\n\t\t\tif int(results[0]) == 5:\n\t\t\t\tham.removeWound(creature,6,25)\n\t\treturn True", "metadata": "root.PyRadialMenu.woundCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 168 }, { "content": "\tdef damageCallback(self, owner, event_id, results):\n\t\tcombat = self.getKernel().serviceManager().combatService()\n\t\tham = combat.getHamManager()\n\t\tcreature = owner.toCreature()\n\t\tif event_id == 0:\n\t\t\tif int(results[0]) == 0:\n\t\t\t\tham.updateCurrentHitpoints(creature, 0, -75)\n\t\t\tif int(results[0]) == 1:\n\t\t\t\tham.updateCurrentHitpoints(creature, 0, 75)\t\t\t\n\t\t\tif int(results[0]) == 2:\n\t\t\t\tham.updateCurrentHitpoints(creature, 3, -75)\n\t\t\tif int(results[0]) == 3:\n\t\t\t\tham.updateCurrentHitpoints(creature, 3, 75)\n\t\t\tif int(results[0]) == 4:\n\t\t\t\tham.updateCurrentHitpoints(creature, 6, -75)\n\t\t\tif int(results[0]) == 5:\n\t\t\t\tham.updateCurrentHitpoints(creature, 6, 75)\n\t\treturn True", "metadata": "root.PyRadialMenu.damageCallback", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 187 }, { "content": "\tdef handleRadial(self, owner, target, action):\n\t\tif action == RadialIdentifier.serverMenu1:\n\t\t\tself.displaySUIList(owner, ['vehicles', 'droids'], 'itemCallback')\n\t\telif action == RadialIdentifier.serverMenu2:\n\t\t\tself.displaySUIList(owner, ['Melee Weapons', 'Ranged Weapons', 'Misc Weapons'], 'weaponCallback')\n\t\telif action == RadialIdentifier.serverMenu3:\n\t\t\tself.displaySUIList(owner, ['Bone', 'Bounty Hunter', 'Chitin', 'Composite', \n\t\t\t'Ithorian Defender', 'Ithorian Guardian', 'Ithorian Sentinel', 'Mandalorian', \n\t\t\t'Marine', 'Padded', 'Ris', 'Stormtrooper', 'Tantel', 'Ubese'], 'armorCallback')\n\t\telif action == RadialIdentifier.serverMenu4:\n\t\t\tself.displaySUIList(owner, ['Crafting Structures', 'Housing Structures', 'Corellia Civic Structures', \n\t\t\t'Naboo Civic Structures', 'Tatooine Civic Structures', 'Guild Structures', 'Faction Structures'], 'structureCallback')\n\t\telif action == RadialIdentifier.serverMenu5:\n\t\t\tself.giveItems(owner, self.petDeeds, self.defaultPostProcess)\n\t\telif action == RadialIdentifier.serverMenu6:\n\t\t\tself.giveItems(owner, self.instruments, self.defaultPostProcess)\n\t\telif action == RadialIdentifier.serverMenu7:\n\t\t\tself.displaySUIList(owner, ['Wounds', 'Damage'], 'hamCallback')\n\t\telif action == RadialIdentifier.serverMenu8:\n\t\t\tself.displaySUIList(owner, ['entertainer'], 'professionCallback')", "metadata": "root.PyRadialMenu.handleRadial", "header": "['class', 'PyRadialMenu', '(', 'RadialMenu', ')', ':', '___EOS___']", "index": 207 } ]
[ { "span": "from swgpy.utility import vector3, quat", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 39 }, { "span": "from swgpy import ACTION", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 24 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "swgpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "swgpy_", "._", "object_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "swgpy_", "._", "sui", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "swgpy_", "._", "utility_", "import_", "vector", "3_", ",_", "quat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "swgpy_", "._", "combat", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "swgpy_", "._", "games", "yste", "ms_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "swgpy_", "import_", "ACTION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "random_", "\\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_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\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_", "levels_", "=_", "(_", "'", "Non", "e", "'_", ",_", "'", "Light", "'_", ",_", "'", "Medi", "um", "'_", ",_", "'", "Heav", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "damage", "\\u", "types_", "=_", "(_", "'", "Energ", "y", "'_", ",_", "'", "Kine", "tic", "'_", ",_", "'", "Aci", "d", "'_", ",_", "'", "Col", "d", "'_", ",_", "'", "Electric", "it", "y", "'_", ",_", "'", "Heat", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\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\\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_", "vehic", "le", "De", "eds", "_", "=_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "vehic", "le", "\\u", "dee", "d", "/", "shared", "\\u", "jet", "pack", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "vehic", "le", "\\u", "dee", "d", "/", "shared", "\\u", "lands", "peed", "er", "\\u", "av", "21", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "vehic", "le", "\\u", "dee", "d", "/", "shared", "\\u", "lands", "peed", "er", "\\u", "x3", "1", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "vehic", "le", "\\u", "dee", "d", "/", "shared", "\\u", "lands", "peed", "er", "\\u", "x3", "4", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "vehic", "le", "\\u", "dee", "d", "/", "shared", "\\u", "speed", "erb", "ike", "\\u", "flash", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "vehic", "le", "\\u", "dee", "d", "/", "shared", "\\u", "speed", "erb", "ike", "\\u", "sw", "oop", "\\u", "dee", "d", ".", "iff", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "weapon", "s_", "=_", "[_", "(_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "2h", "\\u", "sword", "/", "shared", "\\u", "2h", "\\u", "sword", "\\u", "battle", "axe", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "2h", "\\u", "sword", "/", "shared", "\\u", "2h", "\\u", "sword", "\\u", "black", "sun", "\\u", "hack", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "2h", "\\u", "sword", "/", "shared", "\\u", "2h", "\\u", "sword", "\\u", "cle", "aver", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "2h", "\\u", "sword", "/", "shared", "\\u", "2h", "\\u", "sword", "\\u", "kata", "na", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "2h", "\\u", "sword", "/", "shared", "\\u", "2h", "\\u", "sword", "\\u", "mau", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "2h", "\\u", "sword", "/", "shared", "\\u", "2h", "\\u", "sword", "\\u", "sc", "yth", "e", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "axe", "/", "shared", "\\u", "axe", "\\u", "heav", "y", "\\u", "duty", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "axe", "/", "shared", "\\u", "axe", "\\u", "vib", "roa", "xe", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "bat", "on", "/", "shared", "\\u", "bat", "on", "\\u", "gad", "eri", "ffi", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "bat", "on", "/", "shared", "\\u", "bat", "on", "\\u", "stu", "n", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "bat", "on", "/", "shared", "\\u", "vict", "or", "\\u", "bat", "on", "\\u", "gad", "eri", "ffi", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "kni", "fe", "/", "shared", "\\u", "kni", "fe", "\\u", "dag", "ger", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "kni", "fe", "/", "shared", "\\u", "kni", "fe", "\\u", "don", "ku", "wa", "h", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "kni", "fe", "/", "shared", "\\u", "kni", "fe", "\\u", "jan", "ta", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "kni", "fe", "/", "shared", "\\u", "kni", "fe", "\\u", "stone", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "kni", "fe", "/", "shared", "\\u", "kni", "fe", "\\u", "stone", "\\u", "noo", "b", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "kni", "fe", "/", "shared", "\\u", "kni", "fe", "\\u", "surviv", "al", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "kni", "fe", "/", "shared", "\\u", "kni", "fe", "\\u", "vib", "rob", "lad", "e", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "pole", "arm", "/", "shared", "\\u", "lanc", "e\\u", "night", "siste", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "pole", "arm", "/", "shared", "\\u", "lanc", "e\\u", "sta", "ff", "\\u", "jan", "ta", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "pole", "arm", "/", "shared", "\\u", "lanc", "e\\u", "sta", "ff", "\\u", "metal", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "pole", "arm", "/", "shared", "\\u", "lanc", "e\\u", "sta", "ff", "\\u", "wood", "\\u", "s1", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "pole", "arm", "/", "shared", "\\u", "lanc", "e\\u", "sta", "ff", "\\u", "wood", "\\u", "s2", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "pole", "arm", "/", "shared", "\\u", "lanc", "e\\u", "vib", "rol", "anc", "e", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "pole", "arm", "/", "shared", "\\u", "pole", "arm", "\\u", "vib", "ro", "\\u", "axe", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "special", "/", "shared", "\\u", "black", "sun", "\\u", "raz", "or", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "mele", "e", "/", "special", "/", "shared", "\\u", "vib", "rok", "nucle", "r", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "cdef", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "cdef", "\\u", "cors", "ec", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "dh", "17.", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "dh", "1", "7", "\\u", "black", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "dh", "1", "7", "\\u", "sn", "ub", "nose", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "dx", "r", "6", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "e1", "1", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "ee", "3", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "elit", "e", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "laser", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "car", "bin", "e", "/", "shared", "\\u", "car", "bin", "e\\u", "nym", "\\u", "slug", "throw", "er", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "heav", "y", "/", "shared", "\\u", "heav", "y", "\\u", "acid", "\\u", "beam", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "heav", "y", "/", "shared", "\\u", "heav", "y", "\\u", "light", "ning", "\\u", "beam", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "heav", "y", "/", "shared", "\\u", "heav", "y", "\\u", "partic", "le", "\\u", "beam", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "heav", "y", "/", "shared", "\\u", "heav", "y", "\\u", "rocket", "\\u", "launcher", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "cdef", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "cdef", "\\u", "cors", "ec", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "cdef", "\\u", "noo", "b", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "d1", "8", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "de", "\\u", "10.", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "dh", "17.", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "dl", "44.", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "dl", "4", "4", "\\u", "metal", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "dx", "2", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "fw", "g", "5", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "geon", "osi", "an", "\\u", "son", "ic", "\\u", "blast", "er", "\\u", "loo", "t", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "launcher", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "power", "5", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "repu", "bli", "c\\u", "blast", "er", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "scatter", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "scou", "t", "\\u", "blast", "er", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "scou", "t", "\\u", "blast", "er", "\\u", "cors", "ec", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "src", "omb", "at", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "strike", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "strike", "r", "\\u", "noo", "b", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "pis", "tol", "/", "shared", "\\u", "pis", "tol", "\\u", "tang", "le", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "acid", "\\u", "beam", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "beam", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "bers", "erk", "er", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "bow", "caster", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "cdef", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "dl", "t2", "0.", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "dl", "t2", "0a", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "e1", "1", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "ew", "ok", "\\u", "cross", "bow", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "flame", "\\u", "throw", "er", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "ja", "wa", "\\u", "ion", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "laser", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "laser", "\\u", "noo", "b", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "light", "ning", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "sg", "82.", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "spr", "ay", "stick", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "t2", "1", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "ten", "loss", "\\u", "dx", "r", "6", "\\u", "dis", "rupt", "or", "\\u", "loo", "t", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "tus", "ken", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "weapon", "/", "range", "d", "/", "rif", "le", "/", "shared", "\\u", "rif", "le", "\\u", "vict", "or", "\\u", "tus", "ken", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "armor_", "=_", "[_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bone", "/", "shared", "\\u", "armo", "r", "\\u", "bone", "\\u", "s0", "1", "\\u", "leg", "ging", "s", ".", "iff", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "bel", "t", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "bou", "nt", "y", "\\u", "hunt", "er", "/", "shared", "\\u", "armo", "r", "\\u", "bou", "nt", "y", "\\u", "hunt", "er", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "chi", "tin", "/", "shared", "\\u", "armo", "r", "\\u", "chi", "tin", "\\u", "s0", "1", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "composi", "te", "/", "shared", "\\u", "armo", "r", "\\u", "composi", "te", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "defend", "er", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "1", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "guard", "ian", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "2", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ith", "oria", "n", "\\u", "sentinel", "/", "shared", "\\u", "ith", "\\u", "armo", "r", "\\u", "s0", "3", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "bel", "t", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "leg", "ging", "s", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mand", "alo", "rian", "/", "shared", "\\u", "armo", "r", "\\u", "mand", "alo", "rian", "\\u", "shoe", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mari", "ne", "/", "shared", "\\u", "armo", "r", "\\u", "mari", "ne", "\\u", "backp", "ack", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mari", "ne", "/", "shared", "\\u", "armo", "r", "\\u", "mari", "ne", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mari", "ne", "/", "shared", "\\u", "armo", "r", "\\u", "mari", "ne", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mari", "ne", "/", "shared", "\\u", "armo", "r", "\\u", "mari", "ne", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mari", "ne", "/", "shared", "\\u", "armo", "r", "\\u", "mari", "ne", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mari", "ne", "/", "shared", "\\u", "armo", "r", "\\u", "mari", "ne", "\\u", "chest", "\\u", "plate", "\\u", "reb", "el", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mari", "ne", "/", "shared", "\\u", "armo", "r", "\\u", "mari", "ne", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "mari", "ne", "/", "shared", "\\u", "armo", "r", "\\u", "mari", "ne", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "bel", "t", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "padde", "d", "/", "shared", "\\u", "armo", "r", "\\u", "padde", "d\\u", "s0", "1", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ris", "/", "shared", "\\u", "armo", "r", "\\u", "ris", "\\u", "leg", "ging", "s", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "bic", "ep", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "bic", "ep", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "leg", "ging", "s", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "storm", "tro", "oper", "/", "shared", "\\u", "armo", "r", "\\u", "storm", "tro", "oper", "\\u", "utility", "\\u", "bel", "t", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "tant", "el", "/", "shared", "\\u", "armo", "r", "\\u", "tant", "el", "\\u", "skr", "ee", "j", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "tant", "el", "/", "shared", "\\u", "armo", "r", "\\u", "tant", "el", "\\u", "skr", "ee", "j", "\\u", "chest", "\\u", "plate", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "tant", "el", "/", "shared", "\\u", "armo", "r", "\\u", "tant", "el", "\\u", "skr", "ee", "j", "\\u", "helm", "et", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "band", "oli", "er", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "boots", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "brace", "r", "\\u", "l", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "brace", "r", "\\u", "r", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "glo", "ves", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "helm", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "jack", "et", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "pant", "s", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "wea", "rab", "les", "/", "armo", "r", "/", "ube", "se", "/", "shared", "\\u", "armo", "r", "\\u", "ube", "se", "\\u", "shir", "t", ".", "iff", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "structure", "De", "eds", "_", "=_", "[_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "factor", "y", "\\u", "dee", "d", "/", "shared", "\\u", "factor", "y", "\\u", "cloth", "ing", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "factor", "y", "\\u", "dee", "d", "/", "shared", "\\u", "factor", "y", "\\u", "food", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "factor", "y", "\\u", "dee", "d", "/", "shared", "\\u", "factor", "y", "\\u", "item", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "factor", "y", "\\u", "dee", "d", "/", "shared", "\\u", "factor", "y", "\\u", "structure", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "generat", "or", "\\u", "dee", "d", "/", "shared", "\\u", "generat", "or", "\\u", "fusion", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "generat", "or", "\\u", "dee", "d", "/", "shared", "\\u", "generat", "or", "\\u", "photo", "\\u", "bio", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "generat", "or", "\\u", "dee", "d", "/", "shared", "\\u", "generat", "or", "\\u", "solar", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "generat", "or", "\\u", "dee", "d", "/", "shared", "\\u", "generat", "or", "\\u", "wind", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "creature", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "flo", "ra", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "flo", "ra", "\\u", "dee", "d\\u", "heav", "y", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "flo", "ra", "\\u", "dee", "d\\u", "medium", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "gas", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "gas", "\\u", "dee", "d\\u", "heav", "y", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "gas", "\\u", "dee", "d\\u", "medium", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "liquid", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "liquid", "\\u", "dee", "d\\u", "heav", "y", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "liquid", "\\u", "dee", "d\\u", "medium", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "mois", "ture", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "mois", "ture", "\\u", "dee", "d\\u", "heav", "y", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "mois", "ture", "\\u", "dee", "d\\u", "medium", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "ore", "\\u", "heav", "y", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "ore", "\\u", "s1", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "harvester", "\\u", "dee", "d", "/", "shared", "\\u", "harvester", "\\u", "ore", "\\u", "s2", "\\u", "dee", "d", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "house", "\\u", "large", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "house", "\\u", "large", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "house", "\\u", "medium", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "house", "\\u", "medium", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "house", "\\u", "small", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "house", "\\u", "small", "\\u", "floor", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "house", "\\u", "small", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "house", "\\u", "small", "\\u", "style", "\\u", "02", "\\u", "floor", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "house", "\\u", "large", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "house", "\\u", "large", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "house", "\\u", "medium", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "house", "\\u", "medium", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "house", "\\u", "small", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "house", "\\u", "small", "\\u", "floor", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "house", "\\u", "small", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "house", "\\u", "small", "\\u", "style", "\\u", "02", "\\u", "floor", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "merc", "hen", "t", "\\u", "tent", "\\u", "style", "\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "merc", "hen", "t", "\\u", "tent", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "merc", "hen", "t", "\\u", "tent", "\\u", "style", "\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "nab", "oo", "\\u", "house", "\\u", "large", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "nab", "oo", "\\u", "house", "\\u", "medium", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "nab", "oo", "\\u", "house", "\\u", "medium", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "nab", "oo", "\\u", "house", "\\u", "small", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "nab", "oo", "\\u", "house", "\\u", "small", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "tat", "oo", "ine", "\\u", "house", "\\u", "large", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "tat", "oo", "ine", "\\u", "house", "\\u", "medium", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "tat", "oo", "ine", "\\u", "house", "\\u", "medium", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "tat", "oo", "ine", "\\u", "house", "\\u", "small", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "player", "\\u", "house", "\\u", "dee", "d", "/", "shared", "\\u", "tat", "oo", "ine", "\\u", "house", "\\u", "small", "\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "bank", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "city", "hall", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "clo", "ning", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gar", "age", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "lr", "g", "\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "lr", "g", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "lr", "g", "\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "lr", "g", "\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "lr", "g", "\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "med", "\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "med", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "med", "\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "med", "\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "med", "\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "sm", "l\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "sm", "l\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "sm", "l\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "sm", "l\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "core", "lli", "a", "\\u", "sm", "l\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "hospital", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "shutt", "lep", "ort", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "thea", "ter", "\\u", "core", "lli", "a", "\\u", "dee", "d", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "bank", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "city", "hall", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "clo", "ning", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gar", "age", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "lr", "g", "\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "lr", "g", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "lr", "g", "\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "lr", "g", "\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "lr", "g", "\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "med", "\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "med", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "med", "\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "med", "\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "med", "\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "sm", "l\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "sm", "l\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "sm", "l\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "sm", "l\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "nab", "oo", "\\u", "sm", "l\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "hospital", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "shutt", "lep", "ort", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "thea", "ter", "\\u", "nab", "oo", "\\u", "dee", "d", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "bank", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "city", "hall", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "clo", "ning", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gar", "age", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "cant", "ina", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "lr", "g", "\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "lr", "g", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "lr", "g", "\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "lr", "g", "\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "lr", "g", "\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "med", "\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "med", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "med", "\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "med", "\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "med", "\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "sm", "l\\u", "01", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "sm", "l\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "sm", "l\\u", "03", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "sm", "l\\u", "04", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "gard", "en", "\\u", "tat", "oo", "ine", "\\u", "sm", "l\\u", "05", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "hospital", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "shutt", "lep", "ort", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibe", "/", "dee", "d", "/", "city", "\\u", "dee", "d", "/", "shared", "\\u", "thea", "ter", "\\u", "tat", "oo", "ine", "\\u", "dee", "d", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "guil", "d\\u", "dee", "d", "/", "shared", "\\u", "core", "lli", "a", "\\u", "guil", "d\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "guil", "d\\u", "dee", "d", "/", "shared", "\\u", "gener", "ic", "\\u", "guil", "d\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "guil", "d\\u", "dee", "d", "/", "shared", "\\u", "nab", "oo", "\\u", "guil", "d\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "guil", "d\\u", "dee", "d", "/", "shared", "\\u", "tat", "oo", "ine", "\\u", "guil", "d\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "guil", "d\\u", "dee", "d", "/", "shared", "\\u", "tat", "oo", "ine", "\\u", "guil", "d\\u", "style", "\\u", "02", "\\u", "dee", "d", ".", "iff", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "cover", "t", "\\u", "detect", "or", "/", "shared", "\\u", "detect", "or", "\\u", "32", "m", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "1", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "1", "\\u", "pv", "p", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "2", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "2", "\\u", "pv", "p", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "3", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "3", "\\u", "pv", "p", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "4", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "4", "\\u", "pv", "p", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "5", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "hq", "/", "shared", "\\u", "hq", "\\u", "s0", "5", "\\u", "pv", "p", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "mine", "field", "/", "shared", "\\u", "field", "\\u", "1x", "1", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "tur", "ret", "/", "shared", "\\u", "block", "\\u", "lg", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "tur", "ret", "/", "shared", "\\u", "block", "\\u", "med", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "tur", "ret", "/", "shared", "\\u", "block", "\\u", "sm", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "tur", "ret", "/", "shared", "\\u", "dis", "h", "\\u", "lg", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "tur", "ret", "/", "shared", "\\u", "dis", "h", "\\u", "sm", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "tur", "ret", "/", "shared", "\\u", "tower", "\\u", "lg", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "tur", "ret", "/", "shared", "\\u", "tower", "\\u", "med", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "faction", "\\u", "per", "k", "/", "tur", "ret", "/", "shared", "\\u", "tower", "\\u", "sm", "\\u", "dee", "d", ".", "iff", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pet", "De", "eds", "_", "=_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "angle", "r", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bage", "ras", "et", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ban", "tha", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bear", "ded", "\\u", "jax", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "blur", "rg", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bo", "ar", "\\u", "wolf", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bo", "catt", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bol", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bol", "le", "\\u", "bol", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bol", "ma", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bor", "dok", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "bra", "ck", "ase", "t", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "carri", "on", "\\u", "spat", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "cho", "ku", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "cu", "\\u", "pa", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dal", "yra", "ke", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dew", "back", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dun", "e\\u", "liza", "rd", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dur", "ni", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "eo", "pie", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "fal", "ump", "ase", "t", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "fam", "baa", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "gnor", "t", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "gra", "ul", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "gro", "nda", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "gua", "lam", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "gu", "f", "\\u", "dro", "lg", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "gur", "nas", "et", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "gur", "rca", "t", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "gur", "rec", "k", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "herm", "it", "\\u", "spider", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "hu", "f", "\\u", "dun", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "hu", "ur", "ton", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "iko", "pi", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ka", "ad", "u\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ka", "hm", "urr", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "kim", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "kim", "ogi", "la", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "kli", "kni", "k", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "kra", "hb", "u\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "kus", "ak", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "kw", "i", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "lang", "lat", "ch", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "mal", "kl", "oc", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ma", "wg", "ax", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "mar", "ek", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "mot", "t", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "narg", "lat", "ch", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "pike", "t", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "pu", "gori", "ss", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ran", "cor", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "rob", "a", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ront", "o", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "sand", "\\u", "pant", "her", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "shar", "na", "ff", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "shear", "\\u", "mite", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "slice", "\\u", "hou", "nd", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "sno", "rba", "l\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "squa", "ll", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "swi", "rl", "\\u", "pron", "g", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "thu", "ne", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "tor", "ton", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ty", "bis", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ve", "erm", "ok", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ver", "ne", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "ves", "p", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "vir", "\\u", "vu", "r", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "woo", "lam", "ander", "\\u", "dee", "d", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "zu", "cca", "\\u", "bo", "ar", "\\u", "dee", "d", ".", "iff", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "droid", "De", "eds", "_", "=_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "3p", "0", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "3p", "0", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "binar", "y", "\\u", "load", "\\u", "lift", "er", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "binar", "y", "\\u", "load", "\\u", "lift", "er", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "dz", "7", "0", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "dz", "7", "0", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "le", "\\u", "repair", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "le", "\\u", "repair", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "mse", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "mse", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "power", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "power", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "prob", "ot", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "prob", "ot", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "r2", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "r2", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "r3", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "r3", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "r4", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "r4", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "r", "5", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "r", "5", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "sur", "gic", "al", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "sur", "gic", "al", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "trea", "dwe", "ll", "\\u", "advanced", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "dee", "d", "/", "pet", "\\u", "dee", "d", "/", "shared", "\\u", "dee", "d\\u", "trea", "dwe", "ll", "\\u", "basic", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "instruments_", "=_", "(_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "band", "fill", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "fan", "far", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "fi", "zz", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "flu", "te", "\\u", "dro", "opy", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "instrument", "\\u", "kl", "oo", "\\u", "horn", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "mand", "ovi", "ol", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "nal", "argo", "n", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "omm", "ni", "\\u", "box", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "slit", "her", "horn", ".", "iff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object", "/", "tang", "ibl", "e", "/", "instrument", "/", "shared", "\\u", "tra", "z", ".", "iff", "'_", ")_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "build", "Radia", "l_", "(_", "self_", ",_", "owner_", ",_", "target_", ",_", "radial", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "radial", "\\u", "list_", "=_", "Radia", "l", "Optio", "ns", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "0_", ",_", "Radia", "l", "Identifier_", "._", "item", "Use_", ",_", "1_", ",_", "'", "Hack", " ", "Univers", "e", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "0_", ",_", "Radia", "l", "Identifier_", "._", "examine", "_", ",_", "1_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "1_", ",_", "Radia", "l", "Identifier_", "._", "server", "Menu", "1_", ",_", "3_", ",_", "'", "items", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "1_", ",_", "Radia", "l", "Identifier_", "._", "server", "Menu", "2_", ",_", "3_", ",_", "'", "Weapon", " ", "Pack", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "1_", ",_", "Radia", "l", "Identifier_", "._", "server", "Menu", "3_", ",_", "3_", ",_", "'", "Armor", " ", "Pack", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "1_", ",_", "Radia", "l", "Identifier_", "._", "server", "Menu", "4_", ",_", "3_", ",_", "'", "Structur", "es", " ", "Pack", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "1_", ",_", "Radia", "l", "Identifier_", "._", "server", "Menu", "5_", ",_", "3_", ",_", "'", "Pet", "s", " ", "Pack", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "1_", ",_", "Radia", "l", "Identifier_", "._", "server", "Menu", "6_", ",_", "3_", ",_", "'", "Instrum", "ent", " ", "Pack", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "1_", ",_", "Radia", "l", "Identifier_", "._", "server", "Menu", "7_", ",_", "3_", ",_", "'", "Ham", " ", "Optio", "ns", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radial", "\\u", "list_", "._", "append_", "(_", "Radia", "l", "Options_", "(_", "1_", ",_", "Radia", "l", "Identifier_", "._", "server", "Menu", "8_", ",_", "3_", ",_", "'", "Profess", "ion", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "radial", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "default", "Post", "Process_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "weapon", "Post", "Process_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "item_", "._", "max", "\\u", "condition_", "=_", "random_", "._", "randint_", "(_", "100_", ",_", "10000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "String", "Attribute_", "(_", "'", "wp", "n", "\\u", "armo", "r", "\\u", "pie", "rce", "\\u", "rati", "ng", "'_", ",_", "random_", "._", "choice_", "(_", "self_", "._", "levels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "wp", "n", "\\u", "attac", "k", "\\u", "speed", "'_", ",_", "random_", "._", "uniform_", "(_", "0.1_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "String", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "damage", ".", "wp", "n", "\\u", "damage", "\\u", "type", "'_", ",_", "random_", "._", "choice_", "(_", "self_", "._", "damage", "\\u", "types_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "\\u", "damage_", "=_", "random_", "._", "randint_", "(_", "1_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "damage_", "=_", "random_", "._", "randint_", "(_", "min", "\\u", "damage_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "damage", ".", "wp", "n", "\\u", "damage", "\\u", "min", "'_", ",_", "min", "\\u", "damage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "damage", ".", "wp", "n", "\\u", "damage", "\\u", "max", "'_", ",_", "max", "\\u", "damage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "damage", ".", "wp", "n", "\\u", "wou", "nd", "\\u", "chan", "ce", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "range", "mod", "s", ".", "wp", "n", "\\u", "range", "\\u", "zero", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "range", "mod", "s", ".", "wp", "n", "\\u", "range", "\\u", "mid", "'_", ",_", "40_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "range", "mod", "s", ".", "wp", "n", "\\u", "range", "\\u", "max", "'_", ",_", "-_", "80_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "attac", "k", "\\u", "cost", ".", "wp", "n", "\\u", "attac", "k", "\\u", "cost", "\\u", "health", "'_", ",_", "random_", "._", "randint_", "(_", "1_", ",_", "200_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "attac", "k", "\\u", "cost", ".", "wp", "n", "\\u", "attac", "k", "\\u", "cost", "\\u", "action", "'_", ",_", "random_", "._", "randint_", "(_", "1_", ",_", "200_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "wp", "n", "\\u", "attac", "k", "\\u", "cost", ".", "wp", "n", "\\u", "attac", "k", "\\u", "cost", "\\u", "mind", "'_", ",_", "random_", "._", "randint_", "(_", "1_", ",_", "200_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "armo", "r", "Post", "Process_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "item_", "._", "max", "\\u", "condition_", "=_", "random_", "._", "randint_", "(_", "100_", ",_", "10000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "String", "Attribute_", "(_", "'", "armo", "r", "\\u", "rati", "ng", "'_", ",_", "random_", "._", "choice_", "(_", "self_", "._", "levels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "kinetic", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "energ", "y", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "blast", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "stu", "n", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "heat", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "cold", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "acid", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "electric", "al", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "special", "\\u", "protection", ".", "armo", "r", "\\u", "eff", "\\u", "restrain", "t", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "restrain", "t", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "energ", "y", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "blast", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "stu", "n", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "heat", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "cold", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "acid", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "electric", "al", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "effective", "ness", ".", "armo", "r", "\\u", "eff", "\\u", "restrain", "t", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "kinetic", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "energ", "y", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "blast", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "stu", "n", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "heat", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "cold", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "acid", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "elementa", "l\\u", "electric", "al", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Float", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "vulnerability", ".", "armo", "r", "\\u", "eff", "\\u", "restrain", "t", "'_", ",_", "random_", "._", "uniform_", "(_", "0_", ",_", "100_", ")_", "if_", "random_", "._", "random_", "(_", ")_", ">_", "0.7_", "else_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "enc", "umb", "rance", ".", "armo", "r", "\\u", "health", "\\u", "enc", "umb", "rance", "'_", ",_", "random_", "._", "randint_", "(_", "20_", ",_", "300_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "enc", "umb", "rance", ".", "armo", "r", "\\u", "action", "\\u", "enc", "umb", "rance", "'_", ",_", "random_", "._", "randint_", "(_", "20_", ",_", "300_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "Int", "Attribute_", "(_", "'", "cat", "\\u", "armo", "r", "\\u", "enc", "umb", "rance", ".", "armo", "r", "\\u", "mind", "\\u", "enc", "umb", "rance", "'_", ",_", "random_", "._", "randint_", "(_", "20_", ",_", "300_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "set", "String", "Attribute_", "(_", "'", "craft", "er", "'_", ",_", "'", "Blue", " ", "Fro", "g", ",", " ", "Inc", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "give", "Items_", "(_", "self_", ",_", "owner_", ",_", "list_", ",_", "post", "Process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sim_", "=_", "self_", "._", "get", "Kernel_", "(_", ")_", "._", "service", "Manager_", "(_", ")_", "._", "simulati", "on", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv_", "=_", "self_", "._", "get", "Kernel_", "(_", ")_", "._", "service", "Manager_", "(_", ")_", "._", "equipment", "Service_", "(_", ")_", "._", "get", "Equip", "ped", "Object_", "(_", "owner_", ",_", "\"", "inventor", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "item_", "=_", "sim_", "._", "create", "Object_", "(_", "name_", ",_", "swgpy_", "._", "Containe", "r", "Permission_", "._", "DEFAULT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "post", "Process_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv_", "._", "add_", "(_", "owner_", ",_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\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_", "display", "SU", "IL", "ist_", "(_", "self_", ",_", "owner_", ",_", "list_", ",_", "callback", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sui", "_", "=_", "self_", "._", "get", "Kernel_", "(_", ")_", "._", "service", "Manager_", "(_", ")_", "._", "sui", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "sui", ".", "get", "SU", "IW", "indo", "w", "By", "Script", "Name", "(", "owner", ",", " ", "'", "Script", ".", "list", "Box", "')", " ", "!=", " ", "Non", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "=_", "Event", "Result", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "options_", "._", "append_", "(_", "option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "window_", "=_", "sui", "_", "._", "create", "List", "Box_", "(_", "List", "Box", "Type_", "._", "OK", "\\u", "CANCEL_", ",_", "'", "0xDE", "AD", "BE", "EF", "'_", ",_", "'...", "000100", "1101", "0001", "...", "\\\\", "n", "\\\\", "n", "...", "[", "OVERRIDE", "].", "..", "\\\\", "n", "\\\\", "n", "WEL", "COM", "E", ",", " ", "JO", "HN", " ", "SM", "ED", "LE", "Y", "'_", ",_", "options_", ",_", "owner_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "Result", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "append_", "(_", "'", "List", ".", "lst", "List", ":", "Select", "ed", "Row", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callback_", "=_", "Pyth", "on", "Callback_", "(_", "self_", ",_", "callback", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "window_", "._", "subscribe", "To", "Event", "Callback_", "(_", "0_", ",_", "''_", ",_", "Inp", "ut", "Trigger_", "._", "OK_", ",_", "results_", ",_", "callback_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "subscribe", "To", "Event", "Callback_", "(_", "1_", ",_", "''_", ",_", "Inp", "ut", "Trigger_", "._", "CANCEL_", ",_", "results_", ",_", "callback_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sui", "_", "._", "open", "SU", "IW", "indo", "w_", "(_", "window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "professio", "n", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "grant", " ", "enter", "tain", "er", "\\u", "nov", "ice", "'_", "]_", ",_", "'", "enter", "tain", "er", "Call", "back", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "enter", "tain", "er", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "creature", "_", "=_", "owner_", "._", "to", "Creat", "ure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Game", "Sy", "tems_", "=_", "self_", "._", "get", "Kernel_", "(_", ")_", "._", "service", "Manager_", "(_", ")_", "._", "games", "yste", "ms", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Game", "Sy", "tems_", "._", "grant", "Ski", "ll_", "(_", "creature", "_", ",_", "\"", "social", "\\u", "enter", "tain", "er", "\\u", "nov", "ice", "\"_", ")_", "\\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_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "item", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "give", "Items_", "(_", "owner_", ",_", "self_", "._", "vehic", "le", "De", "eds", "_", ",_", "self_", "._", "default", "Post", "Process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "give", "Items_", "(_", "owner_", ",_", "self_", "._", "droid", "De", "eds", "_", ",_", "self_", "._", "default", "Post", "Process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "weapon", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "give", "Items_", "(_", "owner_", ",_", "self_", "._", "weapon", "s_", "[_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "]_", ",_", "self_", "._", "weapon", "Post", "Process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "armo", "r", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "give", "Items_", "(_", "owner_", ",_", "self_", "._", "armor_", "[_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "]_", ",_", "self_", "._", "armo", "r", "Post", "Process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "structure", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "give", "Items_", "(_", "owner_", ",_", "self_", "._", "structure", "De", "eds", "_", "[_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "]_", ",_", "self_", "._", "default", "Post", "Process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ham", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "(_", "'", "result", " ", ":", " ", "'_", "+_", "\"{", "0", "}", " ", ":", " ", "{", "1", "}\"_", "._", "format_", "(_", "event", "\\u", "id_", ",_", "results_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "Health", " ", "Wo", "und", "s", "'_", ",_", "'", "heal", " ", "Health", " ", "Wo", "und", "s", "'_", ",_", "'", "Action", " ", "Wo", "und", "s", "'_", ",_", "'", "heal", " ", "Action", " ", "Wo", "und", "s", "'_", ",_", "'", "Min", "d", " ", "Wo", "und", "s", "'_", ",_", "'", "heal", " ", "Min", "d", " ", "Wo", "und", "s", "'_", "]_", ",_", "'", "wou", "nd", "Call", "back", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "Health", " ", "Dam", "age", "'_", ",_", "'", "heal", " ", "Health", " ", "Dam", "age", "'_", ",_", "'", "Action", " ", "Dam", "age", "'_", ",_", "'", "Min", "d", " ", "Dam", "age", "'_", "]_", ",_", "'", "damage", "Call", "back", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wou", "nd", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "combat", "_", "=_", "self_", "._", "get", "Kernel_", "(_", ")_", "._", "service", "Manager_", "(_", ")_", "._", "combat", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ham", "_", "=_", "combat", "_", "._", "get", "Ham", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "creature", "_", "=_", "owner_", "._", "to", "Creat", "ure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "a_", "=_", "ham", "_", "._", "appl", "y", "Wo", "und_", "(_", "creature", "_", ",_", "0_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "remove", "Wo", "und_", "(_", "creature", "_", ",_", "0_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "appl", "y", "Wo", "und_", "(_", "creature", "_", ",_", "3_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "remove", "Wo", "und_", "(_", "creature", "_", ",_", "3_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "appl", "y", "Wo", "und_", "(_", "creature", "_", ",_", "6_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "remove", "Wo", "und_", "(_", "creature", "_", ",_", "6_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "damage", "Callback_", "(_", "self_", ",_", "owner_", ",_", "event", "\\u", "id_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "combat", "_", "=_", "self_", "._", "get", "Kernel_", "(_", ")_", "._", "service", "Manager_", "(_", ")_", "._", "combat", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ham", "_", "=_", "combat", "_", "._", "get", "Ham", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "creature", "_", "=_", "owner_", "._", "to", "Creat", "ure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "event", "\\u", "id_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "update", "Curr", "ent", "Hit", "points_", "(_", "creature", "_", ",_", "0_", ",_", "-_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "update", "Curr", "ent", "Hit", "points_", "(_", "creature", "_", ",_", "0_", ",_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "update", "Curr", "ent", "Hit", "points_", "(_", "creature", "_", ",_", "3_", ",_", "-_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "update", "Curr", "ent", "Hit", "points_", "(_", "creature", "_", ",_", "3_", ",_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "update", "Curr", "ent", "Hit", "points_", "(_", "creature", "_", ",_", "6_", ",_", "-_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "results_", "[_", "0_", "]_", ")_", "==_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ham", "_", "._", "update", "Curr", "ent", "Hit", "points_", "(_", "creature", "_", ",_", "6_", ",_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "Radia", "l", "Menu_", "(_", "Radia", "l", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "Radia", "l_", "(_", "self_", ",_", "owner_", ",_", "target_", ",_", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "action_", "==_", "Radia", "l", "Identifier_", "._", "server", "Menu", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "vehic", "les", "'_", ",_", "'", "droid", "s", "'_", "]_", ",_", "'", "item", "Call", "back", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "Radia", "l", "Identifier_", "._", "server", "Menu", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "Mel", "ee", " ", "Weapon", "s", "'_", ",_", "'", "Range", "d", " ", "Weapon", "s", "'_", ",_", "'", "Mis", "c", " ", "Weapon", "s", "'_", "]_", ",_", "'", "weapon", "Call", "back", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "Radia", "l", "Identifier_", "._", "server", "Menu", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "Bone", "'_", ",_", "'", "Bou", "nt", "y", " ", "Hunt", "er", "'_", ",_", "'", "Chi", "tin", "'_", ",_", "'", "Composit", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "It", "hor", "ian", " ", "Defen", "der", "'_", ",_", "'", "It", "hor", "ian", " ", "Guard", "ian", "'_", ",_", "'", "It", "hor", "ian", " ", "Senti", "nel", "'_", ",_", "'", "Man", "dal", "oria", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mari", "ne", "'_", ",_", "'", "Padd", "ed", "'_", ",_", "'", "Ris", "'_", ",_", "'", "Stor", "mtr", "oop", "er", "'_", ",_", "'", "Tan", "tel", "'_", ",_", "'", "Ub", "ese", "'_", "]_", ",_", "'", "armo", "r", "Call", "back", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "Radia", "l", "Identifier_", "._", "server", "Menu", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "Cra", "fti", "ng", " ", "Structur", "es", "'_", ",_", "'", "Hou", "sing", " ", "Structur", "es", "'_", ",_", "'", "Core", "lli", "a", " ", "Ci", "vic", " ", "Structur", "es", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Na", "boo", " ", "Ci", "vic", " ", "Structur", "es", "'_", ",_", "'", "Ta", "too", "ine", " ", "Ci", "vic", " ", "Structur", "es", "'_", ",_", "'", "Guil", "d", " ", "Structur", "es", "'_", ",_", "'", "Fact", "ion", " ", "Structur", "es", "'_", "]_", ",_", "'", "structure", "Call", "back", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "Radia", "l", "Identifier_", "._", "server", "Menu", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "give", "Items_", "(_", "owner_", ",_", "self_", "._", "pet", "De", "eds", "_", ",_", "self_", "._", "default", "Post", "Process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "Radia", "l", "Identifier_", "._", "server", "Menu", "6_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "give", "Items_", "(_", "owner_", ",_", "self_", "._", "instruments_", ",_", "self_", "._", "default", "Post", "Process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "Radia", "l", "Identifier_", "._", "server", "Menu", "7_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "Wo", "und", "s", "'_", ",_", "'", "Dam", "age", "'_", "]_", ",_", "'", "ham", "Call", "back", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "Radia", "l", "Identifier_", "._", "server", "Menu", "8_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "display", "SU", "IL", "ist_", "(_", "owner_", ",_", "[_", "'", "enter", "tain", "er", "'_", "]_", ",_", "'", "professio", "n", "Call", "back", "'_", ")_", "\\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, 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, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Testing equality to None
sjuxax/raggregate/raggregate/views/user.py
[ { "content": "@view_config(renderer='login.mak', route_name='login')\ndef login(request):\n #@FIXME: this uses a request handling method with success with which I was experimenting\n # it is not used elsewhere and is a pain to read and write\n # success = False causes a page to stop drawing and \"error out\"\n # some error conditions therefore don't set success to false because it's more convenient\n # to draw the rest of the page.\n #\n # someone should adapt this to be less success-centric and read less branchy.\n s = request.session\n\n success = True\n\n # check for facebook login, provided by Facebook's JS SDK\n try:\n fb_cookie = fb.extract_from_cookie(request)\n try:\n u = users.get_user_by_name(fb_cookie['local_username'])\n except sqlalchemy.orm.exc.NoResultFound:\n u = fb.create_local_user(fb_cookie['info'], fb_cookie['local_username'], request = request)\n try:\n users.login_user(request, u, None, bypass_password = True)\n except LoginAdapterExc:\n pass\n except LoginAdapterExc:\n pass\n\n if 'logout' in request.session['safe_params']:\n if 'logged_in' in s:\n del s['logged_in']\n del s['users.id']\n if 'u_fbgraph' in s:\n del s['u_fbgraph']\n del s['u_fbinfo']\n if 'u_twit' in s:\n del s['u_twit']\n s['message'] = \"You have been logged out, thanks.\"\n success = True\n else:\n s['message'] = \"You are not logged in.\"\n success = True\n else:\n logged_in = False\n if 'logged_in' in s:\n s['message'] = \"You are already logged in.\"\n logged_in = True\n else:\n if 'message' not in s:\n if 'last_login_status' in s:\n s['message'] = s['last_login_status']\n del s['last_login_status']\n else:\n s['message'] = \"Please log in.\"\n p = request.session['safe_post']\n prm = request.session['safe_params']\n username = None\n if 'username' in prm:\n username = general.strip_all_html(prm['username'])\n if p:\n dbsession = DBSession()\n if request.session['safe_get']['act'] == 'register':\n if logged_in:\n try:\n u = users.get_user_by_id(s['users.id'])\n if u.temporary:\n users.create_user(temp_to_perm = True, extant_id = s['users.id'], username = username, password = p['password'], email = p['email'], origination = 'site')\n s['message'] = \"Your anonymous profile has been converted, thanks.\"\n else:\n s['message'] = \"You can't register while you're logged in.\"\n except sqlalchemy.exc.IntegrityError:\n s['message'] = \"This username is already registered, sorry.\"\n dbsession.rollback()\n else:\n try:\n users.create_user(username = username, password = p['password'], email = p['email'], origination = 'site')\n s['message'] = \"Successfully registered.\"\n success = True\n except sqlalchemy.exc.IntegrityError:\n s['message'] = \"This username is already registered, sorry.\"\n success = False\n dbsession.rollback()\n elif request.session['safe_get']['act'] == 'update_pw':\n if p['new_password'] != p['new_password_confirm']:\n s['message'] = 'New password doesn\\'t match confirmation, please try again.'\n else:\n u = None\n\n if s['logged_in_admin']:\n if 'user_id' in prm:\n u = users.get_user_by_id(prm['user_id'])\n\n if u == None:\n u = users.get_user_by_id(s['users.id'])\n\n if u.verify_pw(p['old_password']) or s['logged_in_admin']:\n u.password = u.hash_pw(p['new_password'])\n dbsession.add(u)\n s['message'] = 'Password updated.'\n success = True\n else:\n s['message'] = 'Old password invalid.'\n elif request.session['safe_get']['act'] == 'forgot_pass':\n user = users.get_user_by_email(p['email'])\n if not user:\n s['message'] = \"That email isn't registered\"\n else:\n s['message'] = \"Check your mail for a confirmation message.\"\n users.send_lost_password_verify_email(request, user)\n else:\n try:\n u = users.get_user_by_name(username)\n try:\n users.login_user(request, u, p['password'])\n s['message'] = \"Good, logged in\"\n success = True\n return HTTPFound(request.route_url('post'))\n except LoginAdapterExc:\n s['message'] = \"Incorrect password.\"\n success = False\n except sqlalchemy.orm.exc.NoResultFound:\n s['message'] = \"Sorry, I don't know you.\"\n success = False\n\n return {'success': success,}", "metadata": "root.login", "header": "['module', '___EOS___']", "index": 18 } ]
[ { "span": "u == None:", "start_line": 109, "start_column": 23, "end_line": 109, "end_column": 32 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "view", "\\u", "config_", "(_", "renderer_", "=_", "'", "login", ".", "mak", "'_", ",_", "route", "\\u", "name_", "=_", "'", "login", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "login_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#@", "FIX", "ME", ":", " ", "this", " ", "use", "s", " ", "a", " ", "request", " ", "handling", " ", "method", " ", "with", " ", "success", " ", "with", " ", "whi", "ch", " ", "I", " ", "was", " ", "experiment", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "is", " ", "not", " ", "used", " ", "else", "where", " ", "and", " ", "is", " ", "a", " ", "pain", " ", "to", " ", "read", " ", "and", " ", "write_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "success", " ", "=", " ", "Fal", "se", " ", "caus", "es", " ", "a", " ", "page", " ", "to", " ", "stop", " ", "drawing", " ", "and", " ", "\"", "error", " ", "out", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "some", " ", "error", " ", "condition", "s", " ", "there", "fore", " ", "don", "'", "t", " ", "set", " ", "success", " ", "to", " ", "fal", "se", " ", "bec", "aus", "e", " ", "it", "'", "s", " ", "more", " ", "convenien", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "draw", " ", "the", " ", "rest", " ", "of", " ", "the", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "some", "one", " ", "shou", "ld", " ", "adapt", " ", "this", " ", "to", " ", "be", " ", "less", " ", "success", "-", "centr", "ic", " ", "and", " ", "read", " ", "less", " ", "branch", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "request_", "._", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "facebook", " ", "login", ",", " ", "provided", " ", "by", " ", "Face", "book", "'", "s", " ", "JS", " ", "SD", "K_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fb", "\\u", "cookie_", "=_", "fb_", "._", "extract", "\\u", "from", "\\u", "cookie_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "u_", "=_", "users_", "._", "get", "\\u", "user", "\\u", "by", "\\u", "name_", "(_", "fb", "\\u", "cookie_", "[_", "'", "local", "\\u", "user", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sqlalchemy_", "._", "orm_", "._", "exc_", "._", "No", "Result", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "u_", "=_", "fb_", "._", "create", "\\u", "local", "\\u", "user_", "(_", "fb", "\\u", "cookie_", "[_", "'", "info", "'_", "]_", ",_", "fb", "\\u", "cookie_", "[_", "'", "local", "\\u", "user", "name", "'_", "]_", ",_", "request_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "users_", "._", "login", "\\u", "user_", "(_", "request_", ",_", "u_", ",_", "None_", ",_", "bypass", "\\u", "password_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Logi", "n", "Adapt", "er", "Exc", "_", ":_", "\\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_", "except_", "Logi", "n", "Adapt", "er", "Exc", "_", ":_", "\\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_", "if_", "'", "logo", "ut", "'_", "in_", "request_", "._", "session_", "[_", "'", "safe", "\\u", "params", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "logged", "\\u", "in", "'_", "in_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "s_", "[_", "'", "logged", "\\u", "in", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "s_", "[_", "'", "users", ".", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "u\\u", "fb", "graph", "'_", "in_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "s_", "[_", "'", "u\\u", "fb", "graph", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "s_", "[_", "'", "u\\u", "fb", "info", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "u\\u", "twit", "'_", "in_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "s_", "[_", "'", "u\\u", "twit", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "You", " ", "have", " ", "bee", "n", " ", "logged", " ", "out", ",", " ", "thanks", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "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 ", " _", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "You", " ", "are", " ", "not", " ", "logged", " ", "in", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logged", "\\u", "in_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "logged", "\\u", "in", "'_", "in_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "You", " ", "are", " ", "alr", "ead", "y", " ", "logged", " ", "in", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logged", "\\u", "in_", "=_", "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 ", " _", "if_", "'", "message", "'_", "not_", "in_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "last", "\\u", "login", "\\u", "status", "'_", "in_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "[_", "'", "message", "'_", "]_", "=_", "s_", "[_", "'", "last", "\\u", "login", "\\u", "status", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "s_", "[_", "'", "last", "\\u", "login", "\\u", "status", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Ple", "ase", " ", "log", " ", "in", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "=_", "request_", "._", "session_", "[_", "'", "safe", "\\u", "post", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prm_", "=_", "request_", "._", "session_", "[_", "'", "safe", "\\u", "params", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "user", "name", "'_", "in_", "prm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "general_", "._", "strip", "\\u", "all", "\\u", "html_", "(_", "prm_", "[_", "'", "user", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbse", "ssion_", "=_", "DB", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "session_", "[_", "'", "safe", "\\u", "get", "'_", "]_", "[_", "'", "act", "'_", "]_", "==_", "'", "register", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "logged", "\\u", "in_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "u_", "=_", "users_", "._", "get", "\\u", "user", "\\u", "by", "\\u", "id_", "(_", "s_", "[_", "'", "users", ".", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "u_", "._", "temporar", "y_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "users_", "._", "create", "\\u", "user_", "(_", "temp", "\\u", "to", "\\u", "perm_", "=_", "True_", ",_", "ext", "ant", "\\u", "id_", "=_", "s_", "[_", "'", "users", ".", "id", "'_", "]_", ",_", "username_", "=_", "username_", ",_", "password_", "=_", "p_", "[_", "'", "password", "'_", "]_", ",_", "email_", "=_", "p_", "[_", "'", "email", "'_", "]_", ",_", "originat", "ion_", "=_", "'", "site", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "You", "r", " ", "anonym", "ous", " ", "profile", " ", "has", " ", "bee", "n", " ", "convert", "ed", ",", " ", "thanks", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "You", " ", "can", "'", "t", " ", "register", " ", "whi", "le", " ", "you", "'", "re", " ", "logged", " ", "in", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sqlalchemy_", "._", "exc_", "._", "Int", "egr", "it", "y", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Thi", "s", " ", "user", "name", " ", "is", " ", "alr", "ead", "y", " ", "register", "ed", ",", " ", "sorr", "y", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbse", "ssion_", "._", "rollback_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "users_", "._", "create", "\\u", "user_", "(_", "username_", "=_", "username_", ",_", "password_", "=_", "p_", "[_", "'", "password", "'_", "]_", ",_", "email_", "=_", "p_", "[_", "'", "email", "'_", "]_", ",_", "originat", "ion_", "=_", "'", "site", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Success", "full", "y", " ", "register", "ed", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sqlalchemy_", "._", "exc_", "._", "Int", "egr", "it", "y", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Thi", "s", " ", "user", "name", " ", "is", " ", "alr", "ead", "y", " ", "register", "ed", ",", " ", "sorr", "y", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbse", "ssion_", "._", "rollback_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "request_", "._", "session_", "[_", "'", "safe", "\\u", "get", "'_", "]_", "[_", "'", "act", "'_", "]_", "==_", "'", "update", "\\u", "pw", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p_", "[_", "'", "new", "\\u", "password", "'_", "]_", "!=_", "p_", "[_", "'", "new", "\\u", "password", "\\u", "confirm", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "[_", "'", "message", "'_", "]_", "=_", "'", "New", " ", "password", " ", "doe", "sn", "\\\\'", "t", " ", "match", " ", "confirmation", ",", " ", "plea", "se", " ", "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 ", " ", "_", "u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "s_", "[_", "'", "logged", "\\u", "in", "\\u", "admin", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "'", "user", "\\u", "id", "'_", "in_", "prm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "u_", "=_", "users_", "._", "get", "\\u", "user", "\\u", "by", "\\u", "id_", "(_", "prm_", "[_", "'", "user", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "u_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "u_", "=_", "users_", "._", "get", "\\u", "user", "\\u", "by", "\\u", "id_", "(_", "s_", "[_", "'", "users", ".", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "u_", "._", "verify", "\\u", "pw_", "(_", "p_", "[_", "'", "old", "\\u", "password", "'_", "]_", ")_", "or_", "s_", "[_", "'", "logged", "\\u", "in", "\\u", "admin", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "u_", "._", "password_", "=_", "u_", "._", "hash", "\\u", "pw_", "(_", "p_", "[_", "'", "new", "\\u", "password", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbse", "ssion_", "._", "add_", "(_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "'", "message", "'_", "]_", "=_", "'", "Passw", "ord", " ", "update", "d", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "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 ", " ", " _", "s_", "[_", "'", "message", "'_", "]_", "=_", "'", "Old", " ", "password", " ", "invalid", ".'_", "\\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_", "request_", "._", "session_", "[_", "'", "safe", "\\u", "get", "'_", "]_", "[_", "'", "act", "'_", "]_", "==_", "'", "forgo", "t", "\\u", "pass", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "users_", "._", "get", "\\u", "user", "\\u", "by", "\\u", "email_", "(_", "p_", "[_", "'", "email", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Tha", "t", " ", "email", " ", "isn", "'", "t", " ", "register", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Check", " ", "your", " ", "mail", " ", "for", " ", "a", " ", "confirmation", " ", "message", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", "._", "send", "\\u", "lost", "\\u", "password", "\\u", "verify", "\\u", "email_", "(_", "request_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "u_", "=_", "users_", "._", "get", "\\u", "user", "\\u", "by", "\\u", "name_", "(_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "users_", "._", "login", "\\u", "user_", "(_", "request_", ",_", "u_", ",_", "p_", "[_", "'", "password", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Good", ",", " ", "logged", " ", "in", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "HTTP", "Found_", "(_", "request_", "._", "route", "\\u", "url_", "(_", "'", "post", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Logi", "n", "Adapt", "er", "Exc", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Inco", "rrect", " ", "password", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sqlalchemy_", "._", "orm_", "._", "exc_", "._", "No", "Result", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "[_", "'", "message", "'_", "]_", "=_", "\"", "So", "rr", "y", ",", " ", "I", " ", "don", "'", "t", " ", "know", " ", "you", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "{_", "'", "success", "'_", ":_", "success_", ",_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused local variable
XiaoMi/minos/client/deploy_chronos.py
[ { "content": "def generate_configs(args, job_name, host_id, instance_id):\n chronos_cfg_dict = args.chronos_config.configuration.generated_files[\"chronos.cfg\"]\n hosts = args.chronos_config.jobs[job_name].hosts\n chronos_cfg = deploy_utils.generate_properties_file(args, chronos_cfg_dict)\n\n config_files = {\n \"chronos.cfg\": chronos_cfg,\n \"jaas.conf\" : generate_zk_jaas_config(args),\n }\n config_files.update(args.chronos_config.configuration.raw_files) # what's this?\n\n return config_files", "metadata": "root.generate_configs", "header": "['module', '___EOS___']", "index": 33 }, { "content": "def generate_run_scripts_params(args, host, job_name, host_id, instance_id):\n job = args.chronos_config.jobs[job_name]\n\n supervisor_client = deploy_utils.get_supervisor_client(host,\n \"chronos\", args.chronos_config.cluster.name, job_name, instance_id=instance_id)\n\n artifact_and_version = \"chronos-\" + args.chronos_config.cluster.version\n\n jar_dirs = \"$package_dir/lib/*\"\n log_level = deploy_utils.get_service_log_level(args, args.chronos_config)\n\n params = job.get_arguments(args, args.chronos_config.cluster, args.chronos_config.jobs,\n args.chronos_config.arguments_dict, job_name, host_id, instance_id)\n\n script_dict = {\n \"artifact\": artifact_and_version,\n \"job_name\": job_name,\n \"jar_dirs\": jar_dirs,\n \"run_dir\": supervisor_client.get_run_dir(),\n \"params\": params,\n }\n\n return script_dict", "metadata": "root.generate_run_scripts_params", "header": "['module', '___EOS___']", "index": 46 } ]
[ { "span": "hosts ", "start_line": 35, "start_column": 2, "end_line": 35, "end_column": 7 }, { "span": "log_level ", "start_line": 55, "start_column": 2, "end_line": 55, "end_column": 11 } ]
[]
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_", "generat", "e\\u", "configs_", "(_", "args_", ",_", "job", "\\u", "name_", ",_", "host", "\\u", "id_", ",_", "instance", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chrono", "s", "\\u", "cfg", "\\u", "dict_", "=_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "configuration_", "._", "generat", "ed", "\\u", "files_", "[_", "\"", "chrono", "s", ".", "cfg", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "jobs_", "[_", "job", "\\u", "name_", "]_", "._", "hosts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chrono", "s", "\\u", "cfg_", "=_", "deploy", "\\u", "utils_", "._", "generat", "e\\u", "proper", "ties", "\\u", "file_", "(_", "args_", ",_", "chrono", "s", "\\u", "cfg", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config", "\\u", "files_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chrono", "s", ".", "cfg", "\"_", ":_", "chrono", "s", "\\u", "cfg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ja", "as", ".", "conf", "\"_", ":_", "generat", "e\\u", "zk", "\\u", "ja", "as", "\\u", "config_", "(_", "args_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config", "\\u", "files_", "._", "update_", "(_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "configuration_", "._", "raw", "\\u", "files_", ")_", "#", " ", "what", "'", "s", " ", "this", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "config", "\\u", "files_", "\\u\\u\\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_", "generat", "e\\u", "run", "\\u", "scripts", "\\u", "params_", "(_", "args_", ",_", "host_", ",_", "job", "\\u", "name_", ",_", "host", "\\u", "id_", ",_", "instance", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "job_", "=_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "jobs_", "[_", "job", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "supervisor", "\\u", "client_", "=_", "deploy", "\\u", "utils_", "._", "get", "\\u", "supervisor", "\\u", "client_", "(_", "host_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chrono", "s", "\"_", ",_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "cluster_", "._", "name_", ",_", "job", "\\u", "name_", ",_", "instance", "\\u", "id_", "=_", "instance", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "artifact", "\\u", "and", "\\u", "version_", "=_", "\"", "chrono", "s", "-\"_", "+_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "cluster_", "._", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "jar", "\\u", "dirs_", "=_", "\"$", "package", "\\u", "dir", "/", "lib", "/*\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "level_", "=_", "deploy", "\\u", "utils_", "._", "get", "\\u", "service", "\\u", "log", "\\u", "level_", "(_", "args_", ",_", "args_", "._", "chrono", "s", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "job_", "._", "get", "\\u", "arguments_", "(_", "args_", ",_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "cluster_", ",_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "jobs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "._", "chrono", "s", "\\u", "config_", "._", "argu", "ment", "s", "\\u", "dict_", ",_", "job", "\\u", "name_", ",_", "host", "\\u", "id_", ",_", "instance", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "script", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "artifact", "\"_", ":_", "artifact", "\\u", "and", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "job", "\\u", "name", "\"_", ":_", "job", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "jar", "\\u", "dirs", "\"_", ":_", "jar", "\\u", "dirs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "run", "\\u", "dir", "\"_", ":_", "supervisor", "\\u", "client_", "._", "get", "\\u", "run", "\\u", "dir_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "params", "\"_", ":_", "params_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "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, 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 ]
Unused import
sightmachine/SimpleCV/SimpleCV/tests/test_stereovision.py
[ { "content": "# /usr/bin/python\n# To run this test you need python nose tools installed\n# Run test just use:\n# nosetest test_stereovision.py\n#\n\nimport os, sys, pickle\nfrom SimpleCV import *\nfrom nose.tools import with_setup, nottest\n\nVISUAL_TEST = True # if TRUE we save the images - otherwise we DIFF against them - the default is False\nSHOW_WARNING_TESTS = False # show that warnings are working - tests will pass but warnings are generated.\n\n#colors\nblack = Color.BLACK\nwhite = Color.WHITE\nred = Color.RED\ngreen = Color.GREEN\nblue = Color.BLUE\n\n###############\n# TODO -\n# Examples of how to do profiling\n# Examples of how to do a single test -\n# UPDATE THE VISUAL TESTS WITH EXAMPLES.\n# Fix exif data\n# Turn off test warnings using decorators.\n# Write a use the tests doc.\n\n#images\npair1 = (\"../sampleimages/stereo1_left.png\" , \"../sampleimages/stereo1_right.png\")\npair2 = (\"../sampleimages/stereo2_left.png\" , \"../sampleimages/stereo2_right.png\")\npair3 = (\"../sampleimages/stereo1_real_left.png\" , \"../sampleimages/stereo1_real_right.png\")\npair4 = (\"../sampleimages/stereo2_real_left.png\" , \"../sampleimages/stereo2_real_right.png\")\npair5 = (\"../sampleimages/stereo3_real_left.png\" , \"../sampleimages/stereo3_real_right.png\")\n\ncorrect_pairs = [pair1,pair2,pair3,pair4,pair5]\n\n#standards path\nstandard_path = \"./standard/\"\n\n\n#Given a set of images, a path, and a tolerance do the image diff.\n\n#Save a list of images to a standard path.\n\n#perform the actual image save and image diffs.\n\n#These function names are required by nose test, please leave them as is\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def imgDiffs(test_imgs,name_stem,tolerance,path):\n count = len(test_imgs)\n for idx in range(0,count):\n lhs = test_imgs[idx].applyLayers() # this catches drawing methods\n fname = standard_path+name_stem+str(idx)+\".jpg\"\n rhs = Image(fname)\n if( lhs.width == rhs.width and lhs.height == rhs.height ):\n diff = (lhs-rhs)\n val = np.average(diff.getNumpy())\n if( val > tolerance ):\n print val\n return True\n return False", "metadata": "root.imgDiffs", "header": "['module', '___EOS___']", "index": 43 }, { "content": "def imgSaves(test_imgs, name_stem, path=standard_path):\n count = len(test_imgs)\n for idx in range(0,count):\n fname = standard_path+name_stem+str(idx)+\".jpg\"\n test_imgs[idx].save(fname)#,quality=95)", "metadata": "root.imgSaves", "header": "['module', '___EOS___']", "index": 58 }, { "content": "def perform_diff(result,name_stem,tolerance=2.0,path=standard_path):\n if(VISUAL_TEST): # save the correct images for a visual test\n imgSaves(result,name_stem,path)\n else: # otherwise we test our output against the visual test\n if( imgDiffs(result,name_stem,tolerance,path) ):\n assert False\n else:\n pass", "metadata": "root.perform_diff", "header": "['module', '___EOS___']", "index": 65 }, { "content": "def setup_context():\n img = Image(pair1[0])", "metadata": "root.setup_context", "header": "['module', '___EOS___']", "index": 75 }, { "content": "def destroy_context():\n img = \"\"", "metadata": "root.destroy_context", "header": "['module', '___EOS___']", "index": 78 }, { "content": "@with_setup(setup_context, destroy_context)\ndef test_findFundamentalMat():\n for pairs in correct_pairs :\n img1 = Image(pairs[0])\n img2 = Image(pairs[1])\n StereoImg = StereoImage(img1,img2)\n if ( not StereoImg.findFundamentalMat()):\n assert False", "metadata": "root.test_findFundamentalMat", "header": "['module', '___EOS___']", "index": 81 }, { "content": "def test_findHomography():\n for pairs in correct_pairs :\n img1 = Image(pairs[0])\n img2 = Image(pairs[1])\n StereoImg = StereoImage(img1,img2)\n if (not StereoImg.findHomography()):\n assert False", "metadata": "root.test_findHomography", "header": "['module', '___EOS___']", "index": 90 }, { "content": "def test_findDisparityMap():\n dips = []\n for pairs in correct_pairs :\n img1 = Image(pairs[0])\n img2 = Image(pairs[1])\n StereoImg = StereoImage(img1,img2)\n dips.append(StereoImg.findDisparityMap(method=\"BM\"))\n name_stem = \"test_disparitymapBM\"\n perform_diff(dips,name_stem)\n\n dips = []\n for pairs in correct_pairs :\n img1 = Image(pairs[0])\n img2 = Image(pairs[1])\n StereoImg = StereoImage(img1,img2)\n dips.append(StereoImg.findDisparityMap(method=\"SGBM\"))\n name_stem = \"test_disparitymapSGBM\"\n perform_diff(dips,name_stem)", "metadata": "root.test_findDisparityMap", "header": "['module', '___EOS___']", "index": 98 }, { "content": "def test_eline():\n for pairs in correct_pairs :\n img1 = Image(pairs[0])\n img2 = Image(pairs[1])\n StereoImg = StereoImage(img1,img2)\n F,ptsLeft,ptsRight = StereoImg.findFundamentalMat()\n for pts in ptsLeft :\n line = StereoImg.Eline(pts,F,2)\n if (line == None):\n assert False", "metadata": "root.test_eline", "header": "['module', '___EOS___']", "index": 117 }, { "content": "def test_projectPoint():\n for pairs in correct_pairs :\n img1 = Image(pairs[0])\n img2 = Image(pairs[1])\n StereoImg = StereoImage(img1,img2)\n H,ptsLeft,ptsRight = StereoImg.findHomography()\n for pts in ptsLeft :\n line = StereoImg.projectPoint(pts,H,2)\n if (line == None):\n assert False", "metadata": "root.test_projectPoint", "header": "['module', '___EOS___']", "index": 129 }, { "content": "def test_StereoCalibration():\n cam = StereoCamera()\n try :\n cam1 = Camera(0)\n cam2 = Camera(1)\n cam1.getImage()\n cam2.getImage()\n try :\n cam = StereoCamera()\n calib = cam.StereoCalibration(0,1,nboards=1)\n if (calib):\n assert True\n else :\n assert False\n except:\n assert False\n except :\n assert True", "metadata": "root.test_StereoCalibration", "header": "['module', '___EOS___']", "index": 141 }, { "content": "def test_loadCalibration():\n cam = StereoCamera()\n calbib = cam.loadCalibration(\"Stereo\",\"./StereoVision/\")\n if (calbib) :\n assert True\n else :\n assert False", "metadata": "root.test_loadCalibration", "header": "['module', '___EOS___']", "index": 160 }, { "content": "def test_StereoRectify():\n cam = StereoCamera()\n calib = cam.loadCalibration(\"Stereo\",\"./StereoVision/\")\n rectify = cam.stereoRectify(calib)\n if rectify :\n assert True\n else :\n assert False", "metadata": "root.test_StereoRectify", "header": "['module', '___EOS___']", "index": 168 }, { "content": "def test_getImagesUndistort():\n img1 = Image(correct_pairs[0][0]).resize(352,288)\n img2 = Image(correct_pairs[0][1]).resize(352,288)\n cam = StereoCamera()\n calib = cam.loadCalibration(\"Stereo\",\"./StereoVision/\")\n rectify = cam.stereoRectify(calib)\n rectLeft,rectRight = cam.getImagesUndistort(img1,img2,calib,rectify)\n if rectLeft and rectRight :\n assert True\n else :\n assert False", "metadata": "root.test_getImagesUndistort", "header": "['module', '___EOS___']", "index": 177 } ]
[ { "span": "import os, sys, pickle", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 22 }, { "span": "from nose.tools import with_setup, nottest", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 42 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "run", " ", "this", " ", "test", " ", "you", " ", "need", " ", "python", " ", "nose", " ", "tool", "s", " ", "installed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "test", " ", "just", " ", "use", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "nose", "test", " ", "test\\u", "stereo", "vision", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", ",_", "sys_", ",_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Simple", "CV_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "with", "\\u", "setup_", ",_", "not", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "VIS", "UAL", "\\u", "TEST_", "=_", "True_", "#", " ", "if", " ", "TRU", "E", " ", "we", " ", "save", " ", "the", " ", "images", " ", "-", " ", "other", "wis", "e", " ", "we", " ", "DIFF", " ", "against", " ", "them", " ", "-", " ", "the", " ", "default", " ", "is", " ", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHOW", "\\u", "WARN", "ING", "\\u", "TESTS_", "=_", "False_", "#", " ", "show", " ", "tha", "t", " ", "warn", "ings", " ", "are", " ", "working", " ", "-", " ", "tests", " ", "will", " ", "pass", " ", "but", " ", "warn", "ings", " ", "are", " ", "generat", "ed", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "colors_", "\\u\\u\\uNL\\u\\u\\u_", "black_", "=_", "Color_", "._", "BLACK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "white_", "=_", "Color_", "._", "WHITE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "red_", "=_", "Color_", "._", "RED_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "green_", "=_", "Color_", "._", "GREEN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blue_", "=_", "Color_", "._", "BLUE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exam", "ples", " ", "of", " ", "how", " ", "to", " ", "do", " ", "profiling", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exam", "ples", " ", "of", " ", "how", " ", "to", " ", "do", " ", "a", " ", "single", " ", "test", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "UPDATE", " ", "THE", " ", "VIS", "UAL", " ", "TESTS", " ", "WITH", " ", "EXAMPLES", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", " ", "exif", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Turn", " ", "off", " ", "test", " ", "warn", "ings", " ", "usi", "ng", " ", "decorat", "ors", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Write", " ", "a", " ", "use", " ", "the", " ", "tests", " ", "doc", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "images_", "\\u\\u\\uNL\\u\\u\\u_", "pair", "1_", "=_", "(_", "\"..", "/", "sample", "images", "/", "stereo", "1", "\\u", "left", ".", "png", "\"_", ",_", "\"..", "/", "sample", "images", "/", "stereo", "1", "\\u", "right", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pair", "2_", "=_", "(_", "\"..", "/", "sample", "images", "/", "stereo", "2", "\\u", "left", ".", "png", "\"_", ",_", "\"..", "/", "sample", "images", "/", "stereo", "2", "\\u", "right", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pair", "3_", "=_", "(_", "\"..", "/", "sample", "images", "/", "stereo", "1", "\\u", "real", "\\u", "left", ".", "png", "\"_", ",_", "\"..", "/", "sample", "images", "/", "stereo", "1", "\\u", "real", "\\u", "right", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pair", "4_", "=_", "(_", "\"..", "/", "sample", "images", "/", "stereo", "2", "\\u", "real", "\\u", "left", ".", "png", "\"_", ",_", "\"..", "/", "sample", "images", "/", "stereo", "2", "\\u", "real", "\\u", "right", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pair", "5_", "=_", "(_", "\"..", "/", "sample", "images", "/", "stereo", "3", "\\u", "real", "\\u", "left", ".", "png", "\"_", ",_", "\"..", "/", "sample", "images", "/", "stereo", "3", "\\u", "real", "\\u", "right", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "correct", "\\u", "pairs_", "=_", "[_", "pair", "1_", ",_", "pair", "2_", ",_", "pair", "3_", ",_", "pair", "4_", ",_", "pair", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "standard", "s", " ", "path_", "\\u\\u\\uNL\\u\\u\\u_", "standard", "\\u", "path_", "=_", "\"./", "standard", "/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Give", "n", " ", "a", " ", "set", " ", "of", " ", "images", ",", " ", "a", " ", "path", ",", " ", "and", " ", "a", " ", "tolera", "nce", " ", "do", " ", "the", " ", "image", " ", "diff", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Save", " ", "a", " ", "list", " ", "of", " ", "images", " ", "to", " ", "a", " ", "standard", " ", "path", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "perform", " ", "the", " ", "actual", " ", "image", " ", "save", " ", "and", " ", "image", " ", "diffs", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "The", "se", " ", "function", " ", "names", " ", "are", " ", "require", "d", " ", "by", " ", "nose", " ", "test", ",", " ", "plea", "se", " ", "lea", "ve", " ", "them", " ", "as", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\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_", "img", "Diff", "s_", "(_", "test\\u", "imgs_", ",_", "name", "\\u", "stem_", ",_", "tolerance_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "len_", "(_", "test\\u", "imgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "idx_", "in_", "range_", "(_", "0_", ",_", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lhs_", "=_", "test\\u", "imgs_", "[_", "idx_", "]_", "._", "appl", "y", "Layers_", "(_", ")_", "#", " ", "this", " ", "catche", "s", " ", "drawing", " ", "methods_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname_", "=_", "standard", "\\u", "path_", "+_", "name", "\\u", "stem_", "+_", "str_", "(_", "idx_", ")_", "+_", "\".", "jp", "g", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rhs_", "=_", "Image_", "(_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "lhs_", "._", "width_", "==_", "rhs_", "._", "width_", "and_", "lhs_", "._", "height_", "==_", "rhs_", "._", "height_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diff_", "=_", "(_", "lhs_", "-_", "rhs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val_", "=_", "np_", "._", "average_", "(_", "diff_", "._", "get", "Num", "py_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "val_", ">_", "tolerance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "img", "Save", "s_", "(_", "test\\u", "imgs_", ",_", "name", "\\u", "stem_", ",_", "path_", "=_", "standard", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "len_", "(_", "test\\u", "imgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "idx_", "in_", "range_", "(_", "0_", ",_", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fname_", "=_", "standard", "\\u", "path_", "+_", "name", "\\u", "stem_", "+_", "str_", "(_", "idx_", ")_", "+_", "\".", "jp", "g", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "imgs_", "[_", "idx_", "]_", "._", "save_", "(_", "fname_", ")_", "#", ",", "quali", "ty", "=", "9", "5", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "perform", "\\u", "diff_", "(_", "result_", ",_", "name", "\\u", "stem_", ",_", "tolerance_", "=_", "2.0_", ",_", "path_", "=_", "standard", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "VIS", "UAL", "\\u", "TEST_", ")_", ":_", "#", " ", "save", " ", "the", " ", "correct", " ", "images", " ", "for", " ", "a", " ", "visu", "al", " ", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img", "Save", "s_", "(_", "result_", ",_", "name", "\\u", "stem_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "other", "wis", "e", " ", "we", " ", "test", " ", "our", " ", "output", " ", "against", " ", "the", " ", "visu", "al", " ", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "img", "Diff", "s_", "(_", "result_", ",_", "name", "\\u", "stem_", ",_", "tolerance_", ",_", "path_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "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_", "setup", "\\u", "context_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img_", "=_", "Image_", "(_", "pair", "1_", "[_", "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_", "def_", "destroy", "\\u", "context_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "with", "\\u", "setup_", "(_", "setup", "\\u", "context_", ",_", "destroy", "\\u", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "find", "Fund", "amental", "Mat_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "pairs_", "in_", "correct", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img1_", "=_", "Image_", "(_", "pairs_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img2_", "=_", "Image_", "(_", "pairs_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ster", "eo", "Img_", "=_", "Ster", "eo", "Image_", "(_", "img1_", ",_", "img2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "not_", "Ster", "eo", "Img_", "._", "find", "Fund", "amental", "Mat_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "find", "Homo", "graphy_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "pairs_", "in_", "correct", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img1_", "=_", "Image_", "(_", "pairs_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img2_", "=_", "Image_", "(_", "pairs_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ster", "eo", "Img_", "=_", "Ster", "eo", "Image_", "(_", "img1_", ",_", "img2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "not_", "Ster", "eo", "Img_", "._", "find", "Homo", "graphy_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "find", "Dispa", "rity", "Map_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dip", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pairs_", "in_", "correct", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img1_", "=_", "Image_", "(_", "pairs_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img2_", "=_", "Image_", "(_", "pairs_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ster", "eo", "Img_", "=_", "Ster", "eo", "Image_", "(_", "img1_", ",_", "img2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dip", "s_", "._", "append_", "(_", "Ster", "eo", "Img_", "._", "find", "Dispa", "rity", "Map_", "(_", "method_", "=_", "\"", "BM", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name", "\\u", "stem_", "=_", "\"", "test\\u", "disp", "arit", "yma", "p", "BM", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "perform", "\\u", "diff_", "(_", "dip", "s_", ",_", "name", "\\u", "stem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dip", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pairs_", "in_", "correct", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img1_", "=_", "Image_", "(_", "pairs_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img2_", "=_", "Image_", "(_", "pairs_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ster", "eo", "Img_", "=_", "Ster", "eo", "Image_", "(_", "img1_", ",_", "img2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dip", "s_", "._", "append_", "(_", "Ster", "eo", "Img_", "._", "find", "Dispa", "rity", "Map_", "(_", "method_", "=_", "\"", "SG", "BM", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name", "\\u", "stem_", "=_", "\"", "test\\u", "disp", "arit", "yma", "p", "SG", "BM", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "perform", "\\u", "diff_", "(_", "dip", "s_", ",_", "name", "\\u", "stem_", ")_", "\\u\\u\\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", "elin", "e_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "pairs_", "in_", "correct", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img1_", "=_", "Image_", "(_", "pairs_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img2_", "=_", "Image_", "(_", "pairs_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ster", "eo", "Img_", "=_", "Ster", "eo", "Image_", "(_", "img1_", ",_", "img2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "F_", ",_", "pts", "Left_", ",_", "pts", "Right_", "=_", "Ster", "eo", "Img_", "._", "find", "Fund", "amental", "Mat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pts_", "in_", "pts", "Left_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "Ster", "eo", "Img_", "._", "Eli", "ne_", "(_", "pts_", ",_", "F_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "line_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "project", "Point_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "pairs_", "in_", "correct", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img1_", "=_", "Image_", "(_", "pairs_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img2_", "=_", "Image_", "(_", "pairs_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ster", "eo", "Img_", "=_", "Ster", "eo", "Image_", "(_", "img1_", ",_", "img2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "H_", ",_", "pts", "Left_", ",_", "pts", "Right_", "=_", "Ster", "eo", "Img_", "._", "find", "Homo", "graphy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pts_", "in_", "pts", "Left_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "Ster", "eo", "Img_", "._", "project", "Point_", "(_", "pts_", ",_", "H_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "line_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Ster", "eo", "Calibrat", "ion_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cam_", "=_", "Ster", "eo", "Camera_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cam", "1_", "=_", "Camera_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cam", "2_", "=_", "Camera_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cam", "1_", "._", "get", "Image_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cam", "2_", "._", "get", "Image_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cam_", "=_", "Ster", "eo", "Camera_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calib", "_", "=_", "cam_", "._", "Ster", "eo", "Calibrat", "ion_", "(_", "0_", ",_", "1_", ",_", "nbo", "ards", "_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "calib", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "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 ", " _", "assert_", "False_", "\\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 ", " _", "assert_", "False_", "\\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 ", " _", "assert_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Calibrat", "ion_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cam_", "=_", "Ster", "eo", "Camera_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cal", "bib", "_", "=_", "cam_", "._", "load", "Calibrat", "ion_", "(_", "\"", "Ster", "eo", "\"_", ",_", "\"./", "Ster", "eo", "Vis", "ion", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "cal", "bib", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "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 ", " _", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Ster", "eo", "Rect", "ify_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cam_", "=_", "Ster", "eo", "Camera_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calib", "_", "=_", "cam_", "._", "load", "Calibrat", "ion_", "(_", "\"", "Ster", "eo", "\"_", ",_", "\"./", "Ster", "eo", "Vis", "ion", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recti", "fy_", "=_", "cam_", "._", "stereo", "Rect", "ify_", "(_", "calib", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "recti", "fy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "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 ", " _", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "Image", "s", "Und", "isto", "rt_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img1_", "=_", "Image_", "(_", "correct", "\\u", "pairs_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "._", "resize_", "(_", "352", "_", ",_", "288_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img2_", "=_", "Image_", "(_", "correct", "\\u", "pairs_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", "._", "resize_", "(_", "352", "_", ",_", "288_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cam_", "=_", "Ster", "eo", "Camera_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calib", "_", "=_", "cam_", "._", "load", "Calibrat", "ion_", "(_", "\"", "Ster", "eo", "\"_", ",_", "\"./", "Ster", "eo", "Vis", "ion", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recti", "fy_", "=_", "cam_", "._", "stereo", "Rect", "ify_", "(_", "calib", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rect", "Left_", ",_", "rect", "Right_", "=_", "cam_", "._", "get", "Image", "s", "Und", "isto", "rt_", "(_", "img1_", ",_", "img2_", ",_", "calib", "_", ",_", "recti", "fy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rect", "Left_", "and_", "rect", "Right_", ":_", "\\u\\u\\uNEWLINE\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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 assignment
beltashazzer/jmpy/jmpy/plotting/histogram.py
[ { "content": "def histogram(x, data=None, legend=None, figsize=(12, 6),\n xscale='linear', yscale='linear', cmap='default',\n alpha=0.5, cumprob=False, marker='.', bins=25,\n table=True, fig=None, axes=None, cgrid=None, **kwargs):\n \"\"\"\n :param x: str or ndarray\n :param data: is x is a str, this is a pd.Dataframe\n :param legend: str or ndarray,\n :param figsize: default is 9,6; sets the figure size\n :param xscale: default is linear, set the scale type [linear, log, symlog]\n :param yscale: default is linear, set the scale type [linear, log, symlog]\n :param cmap: colormap to use for plotting\n :param alpha: default is 0.5\n :param cumprob: bool, determines if cumprob plot is displayed\n :param marker: set matplotlib marker\n :param bins: # of bins to use\n :param table: bool, default is True, prints the datatable summary to the graph\n :param kwargs: passed to matplotlib hist function\n :param fig: matplotlib figure instance for re-use...\n :return:\n \"\"\"\n\n # if no dataframe is supplied, create one\n if data is None:\n (x, _, _, legend, _, _), data = components.create_df(x, None, legend)\n\n df = data.copy()\n df = df.reset_index()\n df[x] = df[x].astype('float').dropna()\n\n min_, max_ = np.min(df[x]), np.max(df[x])\n\n binlist = np.linspace(min_, max_, bins)\n\n if fig:\n fig = fig\n canvas = mbb.FigureCanvasAgg(fig)\n axm, axc, axl, axt = components.get_axes(fig)\n elif axes:\n axm = axes\n else:\n fig = mpl.figure.Figure(figsize=figsize, tight_layout=True)\n canvas = mbb.FigureCanvasAgg(fig)\n axm, axc, axl, axt = components.create_axes(cumprob, legend, table, fig=fig)\n\n if table and not axes:\n axt = components.datatable(x, data, axt, by=legend)\n\n if legend:\n # colormap is supposed to be the goto function to get all colormaps\n # should return a colorgrid that maps each point to a set of colors\n if cgrid is None:\n cgrid = common.colors.colormap(df[legend], kind='discrete', cmap=cmap)\n\n legend_color = {}\n for i, key in df[legend].iteritems():\n legend_color[key] = cgrid[i]\n\n if not axes:\n axl = components.legend(sorted(list(legend_color.items())), axl)\n axl.set_title(legend, loc='left')\n\n for group in sorted(set(df[legend])):\n axm.hist(np.asarray(df[df[legend] == group][x]),\n alpha=alpha,\n bins=binlist,\n color=legend_color[group],\n label=str(group),\n **kwargs)\n if cumprob and not axes:\n axc = components.cumprob(df[df[legend] == group][x],\n axc,\n color=legend_color[group],\n marker=marker,\n alpha=alpha)\n else:\n axm.hist(np.asarray(df[x]),\n alpha=alpha,\n bins=binlist,\n **kwargs)\n if cumprob:\n axc = components.cumprob(df[x], axc, marker=marker, alpha=alpha)\n\n # various formating\n axm.set_xlim(min_, max_)\n axm.set_xscale(xscale)\n axm.set_yscale(yscale)\n axm.set_xlabel(x)\n\n for label in axm.get_xticklabels():\n label.set_rotation(90)\n\n if cumprob:\n axc.set_xlim(min_, max_)\n axc.set_xscale(xscale)\n axc.set_yticklabels([], visible=False)\n for label in axc.get_xticklabels():\n label.set_rotation(90)\n\n if axes:\n return axm\n\n return canvas.figure", "metadata": "root.histogram", "header": "['module', '___EOS___']", "index": 9 } ]
[ { "span": "fig = fig", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "assignment_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "histogram_", "(_", "x_", ",_", "data_", "=_", "None_", ",_", "legend_", "=_", "None_", ",_", "figsize_", "=_", "(_", "12_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xscale_", "=_", "'", "linear", "'_", ",_", "yscale_", "=_", "'", "linear", "'_", ",_", "cmap_", "=_", "'", "default", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alpha_", "=_", "0.5_", ",_", "cum", "prob_", "=_", "False_", ",_", "marker_", "=_", "'.'_", ",_", "bins_", "=_", "25_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "table_", "=_", "True_", ",_", "fig_", "=_", "None_", ",_", "axes_", "=_", "None_", ",_", "cg", "rid_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "x", ":", " ", " ", "str", " ", "or", " ", "ndar", "ray", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "data", ":", " ", "is", " ", "x", " ", "is", " ", "a", " ", "str", ",", " ", "this", " ", "is", " ", "a", " ", "pd", ".", "Dataf", "rame", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "legend", ":", " ", "str", " ", "or", " ", "ndar", "ray", ",", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "figs", "ize", ":", " ", "default", " ", "is", " ", "9", ",", "6", ";", " ", "sets", " ", "the", " ", "figure", " ", "size", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "xs", "cale", ":", " ", "default", " ", "is", " ", "linear", ",", " ", "set", " ", "the", " ", "scale", " ", "type", " ", "[", "linear", ",", " ", "log", ",", " ", "sym", "log", "]", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "ysc", "ale", ":", " ", "default", " ", "is", " ", "linear", ",", " ", "set", " ", "the", " ", "scale", " ", "type", " ", "[", "linear", ",", " ", "log", ",", " ", "sym", "log", "]", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "cmap", ":", " ", "colormap", " ", "to", " ", "use", " ", "for", " ", "plott", "ing", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "alpha", ":", " ", "default", " ", "is", " ", "0.", "5", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "cum", "prob", ":", " ", "bool", ",", " ", "dete", "rmin", "es", " ", "if", " ", "cum", "prob", " ", "plot", " ", "is", " ", "displaye", "d", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "marker", ":", " ", "set", " ", "mat", "plotlib", " ", "marker", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "bins", ":", " ", "#", " ", "of", " ", "bins", " ", "to", " ", "use", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "table", ":", " ", "bool", ",", " ", "default", " ", "is", " ", "Tru", "e", ",", " ", "print", "s", " ", "the", " ", "datata", "ble", " ", "summar", "y", " ", "to", " ", "the", " ", "graph", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "kwarg", "s", ":", " ", " ", "pass", "ed", " ", "to", " ", "mat", "plotlib", " ", "hist", " ", "function", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "fig", ":", " ", "mat", "plotlib", " ", "figure", " ", "instance", " ", "for", " ", "re", "-", "use", "...", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "no", " ", "dataframe", " ", "is", " ", "supplie", "d", ",", " ", "create", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "data_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "x_", ",_", "\\u_", ",_", "\\u_", ",_", "legend_", ",_", "\\u_", ",_", "\\u_", ")_", ",_", "data_", "=_", "components_", "._", "create", "\\u", "df_", "(_", "x_", ",_", "None_", ",_", "legend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "df_", "=_", "data_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "df_", "._", "reset", "\\u", "index_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "[_", "x_", "]_", "=_", "df_", "[_", "x_", "]_", "._", "astype_", "(_", "'", "float", "'_", ")_", "._", "dropna_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u_", ",_", "max", "\\u_", "=_", "np_", "._", "min_", "(_", "df_", "[_", "x_", "]_", ")_", ",_", "np_", "._", "max_", "(_", "df_", "[_", "x_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bin", "list_", "=_", "np_", "._", "linspace_", "(_", "min", "\\u_", ",_", "max", "\\u_", ",_", "bins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "fig_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fig_", "=_", "fig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "canvas_", "=_", "mb", "b_", "._", "Fig", "ure", "Can", "vas", "Agg", "_", "(_", "fig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax", "m_", ",_", "ax", "c_", ",_", "axl", "_", ",_", "ax", "t_", "=_", "components_", "._", "get", "\\u", "axes_", "(_", "fig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "axes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax", "m_", "=_", "axes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fig_", "=_", "mpl_", "._", "figure_", "._", "Figure_", "(_", "figsize_", "=_", "figsize_", ",_", "tig", "ht", "\\u", "layout_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "canvas_", "=_", "mb", "b_", "._", "Fig", "ure", "Can", "vas", "Agg", "_", "(_", "fig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax", "m_", ",_", "ax", "c_", ",_", "axl", "_", ",_", "ax", "t_", "=_", "components_", "._", "create", "\\u", "axes_", "(_", "cum", "prob_", ",_", "legend_", ",_", "table_", ",_", "fig_", "=_", "fig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "table_", "and_", "not_", "axes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax", "t_", "=_", "components_", "._", "datata", "ble_", "(_", "x_", ",_", "data_", ",_", "ax", "t_", ",_", "by_", "=_", "legend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "legend_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "colormap", " ", "is", " ", "supposed", " ", "to", " ", "be", " ", "the", " ", "got", "o", " ", "function", " ", "to", " ", "get", " ", "all", " ", "colormap", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "return", " ", "a", " ", "color", "grid", " ", "tha", "t", " ", "maps", " ", "each", " ", "point", " ", "to", " ", "a", " ", "set", " ", "of", " ", "colors_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cg", "rid_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cg", "rid_", "=_", "common_", "._", "colors_", "._", "colormap_", "(_", "df_", "[_", "legend_", "]_", ",_", "kind_", "=_", "'", "discrete", "'_", ",_", "cmap_", "=_", "cmap_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "legend", "\\u", "color_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "key_", "in_", "df_", "[_", "legend_", "]_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "legend", "\\u", "color_", "[_", "key_", "]_", "=_", "cg", "rid_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "axes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "axl", "_", "=_", "components_", "._", "legend_", "(_", "sorted_", "(_", "list_", "(_", "legend", "\\u", "color_", "._", "items_", "(_", ")_", ")_", ")_", ",_", "axl", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axl", "_", "._", "set\\u", "title_", "(_", "legend_", ",_", "loc_", "=_", "'", "left", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "group_", "in_", "sorted_", "(_", "set_", "(_", "df_", "[_", "legend_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax", "m_", "._", "hist_", "(_", "np_", "._", "asarray_", "(_", "df_", "[_", "df_", "[_", "legend_", "]_", "==_", "group_", "]_", "[_", "x_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alpha_", "=_", "alpha_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bins_", "=_", "bin", "list_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "legend", "\\u", "color_", "[_", "group_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "str_", "(_", "group_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cum", "prob_", "and_", "not_", "axes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax", "c_", "=_", "components_", "._", "cum", "prob_", "(_", "df_", "[_", "df_", "[_", "legend_", "]_", "==_", "group_", "]_", "[_", "x_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ax", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "legend", "\\u", "color_", "[_", "group_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "marker_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alpha_", "=_", "alpha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax", "m_", "._", "hist_", "(_", "np_", "._", "asarray_", "(_", "df_", "[_", "x_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alpha_", "=_", "alpha_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bins_", "=_", "bin", "list_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cum", "prob_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax", "c_", "=_", "components_", "._", "cum", "prob_", "(_", "df_", "[_", "x_", "]_", ",_", "ax", "c_", ",_", "marker_", "=_", "marker_", ",_", "alpha_", "=_", "alpha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vari", "ous", " ", "format", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ax", "m_", "._", "set\\u", "xlim_", "(_", "min", "\\u_", ",_", "max", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax", "m_", "._", "set\\u", "xscale_", "(_", "xscale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax", "m_", "._", "set\\u", "yscale_", "(_", "yscale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax", "m_", "._", "set\\u", "xlabel_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "label_", "in_", "ax", "m_", "._", "get", "\\u", "xticklabels_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label_", "._", "set\\u", "rotation_", "(_", "90_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cum", "prob_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax", "c_", "._", "set\\u", "xlim_", "(_", "min", "\\u_", ",_", "max", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax", "c_", "._", "set\\u", "xscale_", "(_", "xscale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax", "c_", "._", "set\\u", "yticklabels_", "(_", "[_", "]_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "label_", "in_", "ax", "c_", "._", "get", "\\u", "xticklabels_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label_", "._", "set\\u", "rotation_", "(_", "90_", ")_", "\\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_", "axes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ax", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "canvas_", "._", "figure_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
felinx/d3status/d3status/tasks/status_tasks.py
[ { "content": "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2012 feilong.me. All rights reserved.\n#\n# @author: Felinx Lee <[email protected]>\n# Created on Jul 2, 2012\n#\n\nimport os\nimport tornado.locale\n\nfrom celery.task import task\nfrom tornado.options import options\nfrom d3status.db import load_model\nfrom d3status.tasks import apns_tasks\n\n\n\n\n\n\n\n\n\n\n_i18n_dir = os.path.join(os.path.join(os.path.dirname(__file__), \"..\"), 'i18n')\ntornado.locale.load_translations(_i18n_dir)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@task\ndef status_notification_task(changed_status):\n status_notifciation(changed_status)", "metadata": "root.status_notification_task", "header": "['module', '___EOS___']", "index": 17 }, { "content": "def status_notifciation(changed_status):\n notifications = {}\n for category, services in changed_status.iteritems():\n for name, st in services.iteritems():\n # just push notification about game server now\n if name == \"GameServer\":\n notifications[category] = st\n\n for category, st in notifications.iteritems():\n status = \"Available\" if st else \"Unavailable\"\n\n offset = 0\n limit = 200\n while True:\n subscribers = load_model(\"subscribers\").get_subscribers(limit, offset)\n if not subscribers:\n break\n\n for subscribe in subscribers:\n if category in subscribe.categorys:\n alert = _trans_alert(\"Diablo3 %s server status has changed to %s\",\n category, status, subscribe.locale)\n apns_tasks.apns_push_task.delay(subscribe.token, {},\n alert=alert, badge=1,\n sound=\"default\")\n offset += len(subscribers)", "metadata": "root.status_notifciation", "header": "['module', '___EOS___']", "index": 22 }, { "content": "def _trans(s, locale):\n locale = tornado.locale.get(locale)\n s = locale.translate(s).strip(\"\\\"\")\n\n return s", "metadata": "root._trans", "header": "['module', '___EOS___']", "index": 50 }, { "content": "def _trans_alert(alert, category, status, locale):\n def _(s):\n return _trans(s, locale)\n\n return _(alert) % (_(category), _(status))", "metadata": "root._trans_alert", "header": "['module', '___EOS___']", "index": 57 } ]
[ { "span": "from tornado.options import options", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 35 } ]
[]
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_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2012", " ", "fei", "long", ".", "me", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "author", ":", " ", "Fel", "inx", " ", "Lee", " ", "<", "fel", "inx", ".", "lee", "@", "gma", "il", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "ed", " ", "on", " ", " ", "Ju", "l", " ", "2", ",", " ", "2012_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tornado_", "._", "locale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "celery_", "._", "task_", "import_", "task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "options_", "import_", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "d3", "status_", "._", "db_", "import_", "load", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "d3", "status_", "._", "tasks_", "import_", "apn", "s", "\\u", "tasks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "i18n", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "\"..\"_", ")_", ",_", "'", "i18n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tornado_", "._", "locale_", "._", "load", "\\u", "translations_", "(_", "\\u", "i18n", "\\u", "dir_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "status", "\\u", "notification", "\\u", "task_", "(_", "change", "d\\u", "status_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status", "\\u", "notif", "ciat", "ion_", "(_", "change", "d\\u", "status_", ")_", "\\u\\u\\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_", "status", "\\u", "notif", "ciat", "ion_", "(_", "change", "d\\u", "status_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notifications_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "category_", ",_", "services_", "in_", "change", "d\\u", "status_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", ",_", "st_", "in_", "services_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "just", " ", "push", " ", "notification", " ", "abo", "ut", " ", "game", " ", "server", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "==_", "\"", "Game", "Server", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notifications_", "[_", "category_", "]_", "=_", "st_", "\\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_", "category_", ",_", "st_", "in_", "notifications_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "\"", "Avail", "able", "\"_", "if_", "st_", "else_", "\"", "Una", "vail", "able", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "limit_", "=_", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscribers_", "=_", "load", "\\u", "model_", "(_", "\"", "subscribers", "\"_", ")_", "._", "get", "\\u", "subscribers_", "(_", "limit_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "subscribers_", ":_", "\\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_", "for_", "subscribe_", "in_", "subscribers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "category_", "in_", "subscribe_", "._", "category", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "alert_", "=_", "\\u", "trans", "\\u", "alert_", "(_", "\"", "Dia", "blo", "3", " ", "%", "s", " ", "server", " ", "status", " ", "has", " ", "change", "d", " ", "to", " ", "%", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "category_", ",_", "status_", ",_", "subscribe_", "._", "locale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "apn", "s", "\\u", "tasks_", "._", "apn", "s", "\\u", "push", "\\u", "task_", "._", "delay_", "(_", "subscribe_", "._", "token_", ",_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alert_", "=_", "alert_", ",_", "badge", "_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sound_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "offset_", "+=_", "len_", "(_", "subscribers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "trans_", "(_", "s_", ",_", "locale_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "locale_", "=_", "tornado_", "._", "locale_", "._", "get_", "(_", "locale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "locale_", "._", "translate_", "(_", "s_", ")_", "._", "strip_", "(_", "\"\\\\\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "trans", "\\u", "alert_", "(_", "alert_", ",_", "category_", ",_", "status_", ",_", "locale_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "trans_", "(_", "s_", ",_", "locale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u_", "(_", "alert_", ")_", "%_", "(_", "\\u_", "(_", "category_", ")_", ",_", "\\u_", "(_", "status_", ")_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 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 ]
Unused import
openstack/stacktach/tests/unit/test_stacky_server.py
[ { "content": "# Copyright (c) 2012 - Rackspace Inc.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to\n# deal in the Software without restriction, including without limitation the\n# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n# sell copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n# IN THE SOFTWARE.\nimport ast\n\nimport datetime\nimport decimal\nimport json\nfrom django.core.exceptions import FieldError\n\nimport mox\n\nfrom stacktach import datetime_to_decimal as dt\nfrom stacktach import models\nfrom stacktach import stacky_server\nimport utils\nfrom utils import INSTANCE_ID_1, INSTANCE_TYPE_ID_1\nfrom utils import INSTANCE_FLAVOR_ID_1\nfrom utils import INSTANCE_ID_2\nfrom utils import REQUEST_ID_1\n\nfrom tests.unit import StacktachBaseTestCase\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class StackyServerTestCase(StacktachBaseTestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.StackyServerTestCase", "header": "['module', '___EOS___']", "index": 40 }, { "content": " def setUp(self):\n self.mox = mox.Mox()\n self.mox.StubOutWithMock(models, 'RawData', use_mock_anything=True)\n models.RawData.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'Deployment', use_mock_anything=True)\n self.mox.StubOutWithMock(models, 'GlanceRawData',\n use_mock_anything=True)\n models.GlanceRawData.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'GenericRawData',\n use_mock_anything=True)\n models.GenericRawData.objects = self.mox.CreateMockAnything()\n models.Deployment.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'Lifecycle', use_mock_anything=True)\n models.Lifecycle.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'Timing', use_mock_anything=True)\n models.Timing.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'RequestTracker',\n use_mock_anything=True)\n models.RequestTracker.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'InstanceUsage',\n use_mock_anything=True)\n models.InstanceUsage.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'InstanceDeletes',\n use_mock_anything=True)\n models.InstanceDeletes.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'InstanceExists',\n use_mock_anything=True)\n models.InstanceExists.objects = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(models, 'JsonReport', use_mock_anything=True)\n models.JsonReport.objects = self.mox.CreateMockAnything()", "metadata": "root.StackyServerTestCase.setUp", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 41 }, { "content": " def tearDown(self):\n self.mox.UnsetStubs()", "metadata": "root.StackyServerTestCase.tearDown", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 72 }, { "content": " def _create_raw(self):\n raw = self.mox.CreateMockAnything()\n raw.when = utils.decimal_utc(datetime.datetime(2013, 7, 17, 10, 16,\n 10, 717219))\n raw.instance = INSTANCE_ID_1\n raw.id = 1\n raw.routing_key = 'monitor.info'\n raw.deployment = self.mox.CreateMockAnything()\n raw.deployment.id = 1\n raw.deployment.name = 'deployment'\n raw.event = 'test.start'\n raw.host = 'example.com'\n raw.state = 'active'\n raw.old_state = None\n raw.old_task = None\n raw.publisher = \"api.example.com\"\n raw.service = 'api'\n raw.host = 'example.com'\n raw.status = 'state'\n raw.request_id = REQUEST_ID_1\n raw.json = '{\"key\": \"value\"}'\n raw.uuid = 'uuid'\n raw.tenant = 'tenant'\n return raw", "metadata": "root.StackyServerTestCase._create_raw", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 75 }, { "content": " def test_get_event_names(self):\n model = self.mox.CreateMockAnything()\n result = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(stacky_server, '_model_factory')\n stacky_server._model_factory('nova').AndReturn(model)\n model.values('event').AndReturn(result)\n result.distinct().AndReturn(result)\n self.mox.ReplayAll()\n\n event_names = stacky_server.get_event_names()\n self.assertEqual(event_names, result)\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_get_event_names", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 100 }, { "content": " def test_get_host_names_for_nova(self):\n result = self.mox.CreateMockAnything()\n models.RawData.objects.values('host').AndReturn(result)\n result.distinct().AndReturn(result)\n self.mox.ReplayAll()\n\n event_names = stacky_server.get_host_names('nova')\n self.assertEqual(event_names, result)\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_get_host_names_for_nova", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 114 }, { "content": " def test_get_host_names_for_glance(self):\n result = self.mox.CreateMockAnything()\n models.GlanceRawData.objects.values('host').AndReturn(result)\n result.distinct().AndReturn(result)\n self.mox.ReplayAll()\n\n event_names = stacky_server.get_host_names('glance')\n self.assertEqual(event_names, result)\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_get_host_names_for_glance", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 125 }, { "content": " def test_get_deployments(self):\n result = self.mox.CreateMockAnything()\n models.Deployment.objects.all().AndReturn(result)\n result.order_by('name').AndReturn(result)\n self.mox.ReplayAll()\n\n event_names = stacky_server.get_deployments()\n self.assertEqual(event_names, result)\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_get_deployments", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 136 }, { "content": " def test_get_timings_for_uuid_start_only(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n lc_result = self.mox.CreateMockAnything()\n lifecycle = self.mox.CreateMockAnything()\n models.Lifecycle.objects.filter(instance=INSTANCE_ID_1)\\\n .AndReturn(lc_result)\n lc_result[None:50].AndReturn(lc_result)\n lc_result.__iter__().AndReturn([lifecycle].__iter__())\n t_result = self.mox.CreateMockAnything()\n timing = self.mox.CreateMockAnything()\n models.Timing.objects.filter(lifecycle=lifecycle).AndReturn(t_result)\n t_result.__iter__().AndReturn([timing].__iter__())\n timing.name = 'name'\n timing.start_raw = self.mox.CreateMockAnything()\n timing.end_raw = None\n timing.diff = None\n self.mox.ReplayAll()\n\n event_names = stacky_server.get_timings_for_uuid(fake_request,\n INSTANCE_ID_1)\n\n self.assertEqual(len(event_names), 2)\n self.assertEqual(event_names[0], ['?', 'Event', 'Time (secs)'])\n self.assertEqual(event_names[1], ['S', 'name', 'n/a'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_get_timings_for_uuid_start_only", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 147 }, { "content": " def test_get_timings_for_uuid_end_only(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n lc_result = self.mox.CreateMockAnything()\n lifecycle = self.mox.CreateMockAnything()\n models.Lifecycle.objects.filter(instance=INSTANCE_ID_1) \\\n .AndReturn(lc_result)\n lc_result[None:50].AndReturn(lc_result)\n lc_result.__iter__().AndReturn([lifecycle].__iter__())\n t_result = self.mox.CreateMockAnything()\n timing = self.mox.CreateMockAnything()\n models.Timing.objects.filter(lifecycle=lifecycle).AndReturn(t_result)\n t_result.__iter__().AndReturn([timing].__iter__())\n timing.name = 'name'\n timing.start_raw = None\n timing.end_raw = self.mox.CreateMockAnything()\n timing.diff = None\n self.mox.ReplayAll()\n\n event_names = stacky_server.get_timings_for_uuid(fake_request,\n INSTANCE_ID_1)\n\n self.assertEqual(len(event_names), 2)\n self.assertEqual(event_names[0], ['?', 'Event', 'Time (secs)'])\n self.assertEqual(event_names[1], ['E', 'name', 'n/a'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_get_timings_for_uuid_end_only", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 174 }, { "content": " def test_get_timings_for_uuid(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n lc_result = self.mox.CreateMockAnything()\n lifecycle = self.mox.CreateMockAnything()\n models.Lifecycle.objects.filter(instance=INSTANCE_ID_1) \\\n .AndReturn(lc_result)\n lc_result[None:50].AndReturn(lc_result)\n lc_result.__iter__().AndReturn([lifecycle].__iter__())\n t_result = self.mox.CreateMockAnything()\n timing = self.mox.CreateMockAnything()\n models.Timing.objects.filter(lifecycle=lifecycle).AndReturn(t_result)\n t_result.__iter__().AndReturn([timing].__iter__())\n timing.name = 'name'\n timing.start_raw = self.mox.CreateMockAnything()\n timing.end_raw = self.mox.CreateMockAnything()\n timing.diff = 20\n self.mox.ReplayAll()\n event_names = stacky_server.get_timings_for_uuid(fake_request,\n INSTANCE_ID_1)\n\n self.assertEqual(len(event_names), 2)\n self.assertEqual(event_names[0], ['?', 'Event', 'Time (secs)'])\n self.assertEqual(event_names[1], ['.', 'name', '0d 00:00:20'])\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_get_timings_for_uuid", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 201 }, { "content": " def test_do_deployments(self):\n fake_request = self.mox.CreateMockAnything()\n deployment1 = self.mox.CreateMockAnything()\n deployment1.id = 1\n deployment1.name = 'dep1'\n deployment2 = self.mox.CreateMockAnything()\n deployment2.id = 2\n deployment2.name = 'dep2'\n deployments = [deployment1, deployment2]\n self.mox.StubOutWithMock(stacky_server, 'get_deployments')\n stacky_server.get_deployments().AndReturn(deployments)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_deployments(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n self.assertEqual(json_resp[0], ['#', 'Name'])\n self.assertEqual(json_resp[1], [1, 'dep1'])\n self.assertEqual(json_resp[2], [2, 'dep2'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_deployments", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 228 }, { "content": " def test_do_events_of_a_single_service(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'service': 'nova'}\n event1 = {'event': 'some.event.1'}\n event2 = {'event': 'some.event.2'}\n events = [event1, event2]\n self.mox.StubOutWithMock(stacky_server, 'get_event_names')\n stacky_server.get_event_names(service='nova').AndReturn(events)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_events(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n self.assertEqual(json_resp[0], ['Event Name'])\n self.assertEqual(json_resp[1], ['some.event.1'])\n self.assertEqual(json_resp[2], ['some.event.2'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_events_of_a_single_service", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 251 }, { "content": " def test_do_events_of_all_services(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'service': 'all'}\n event1 = {'event': 'some.event.1'}\n event2 = {'event': 'some.event.2'}\n events = [event1, event2]\n self.mox.StubOutWithMock(stacky_server, 'get_event_names')\n stacky_server.get_event_names('nova').AndReturn(events)\n stacky_server.get_event_names('glance').AndReturn(events)\n stacky_server.get_event_names('generic').AndReturn(events)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_events(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 7)\n self.assertEqual(json_resp[0], ['Event Name'])\n self.assertEqual(json_resp[1], ['some.event.1'])\n self.assertEqual(json_resp[2], ['some.event.2'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_events_of_all_services", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 271 }, { "content": " def test_do_hosts(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'service': 'service'}\n host1 = {'host': 'www.demo.com'}\n host2 = {'host': 'www.example.com'}\n hosts = [host1, host2]\n self.mox.StubOutWithMock(stacky_server, 'get_host_names')\n stacky_server.get_host_names('service').AndReturn(hosts)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_hosts(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n self.assertEqual(json_resp[0], ['Host Name'])\n self.assertEqual(json_resp[1], ['www.demo.com'])\n self.assertEqual(json_resp[2], ['www.example.com'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_hosts", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 293 }, { "content": " def test_do_uuid(self):\n search_result = [[\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"State\", \"State'\", \"Task'\"], [1, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"active\", None, None]]\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'uuid': INSTANCE_ID_1}\n result = self.mox.CreateMockAnything()\n models.RawData.objects.select_related().AndReturn(result)\n result.filter(instance=INSTANCE_ID_1).AndReturn(result)\n result.order_by('when').AndReturn(result)\n raw = self._create_raw()\n result[None:50].AndReturn(result)\n result.__iter__().AndReturn([raw].__iter__())\n raw.search_results([], mox.IgnoreArg(), ' ').AndReturn(search_result)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_uuid(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 2)\n header = [\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"State\", \"State'\", \"Task'\"]\n self.assertEqual(json_resp[0], header)\n datetime = dt.dt_from_decimal(raw.when)\n body = [1, \" \", str(datetime), \"deployment\", \"test.start\",\n \"example.com\", \"active\", None, None]\n self.assertEqual(json_resp[1], body)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_uuid", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 313 }, { "content": " def test_do_uuid_when_filters(self):\n search_result = [[\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"State\", \"State'\", \"Task'\"], [1, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"active\", None, None]]\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'uuid': INSTANCE_ID_1,\n 'when_min': '1.1',\n 'when_max': '2.1'}\n result = self.mox.CreateMockAnything()\n models.RawData.objects.select_related().AndReturn(result)\n result.filter(instance=INSTANCE_ID_1,\n when__gte=decimal.Decimal('1.1'),\n when__lte=decimal.Decimal('2.1')).AndReturn(result)\n result.order_by('when').AndReturn(result)\n raw = self._create_raw()\n result[None:50].AndReturn(result)\n result.__iter__().AndReturn([raw].__iter__())\n raw.search_results([], mox.IgnoreArg(), ' ').AndReturn(search_result)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_uuid(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 2)\n header = [\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"State\", \"State'\", \"Task'\"]\n self.assertEqual(json_resp[0], header)\n datetime = dt.dt_from_decimal(raw.when)\n body = [1, \" \", str(datetime), \"deployment\", \"test.start\",\n \"example.com\", \"active\", None, None]\n self.assertEqual(json_resp[1], body)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_uuid_when_filters", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 344 }, { "content": " def test_do_uuid_for_glance(self):\n search_result = [[\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"Status\"], [1, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"state\"]]\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'uuid': INSTANCE_ID_1, 'service': 'glance'}\n result = self.mox.CreateMockAnything()\n models.GlanceRawData.objects.select_related().AndReturn(result)\n result.filter(uuid=INSTANCE_ID_1).AndReturn(result)\n result.order_by('when').AndReturn(result)\n raw = self._create_raw()\n result[None:50].AndReturn(result)\n result.__iter__().AndReturn([raw].__iter__())\n raw.search_results([], mox.IgnoreArg(), ' ').AndReturn(search_result)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_uuid(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 2)\n header = [\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"Status\"]\n self.assertEqual(json_resp[0], header)\n datetime = dt.dt_from_decimal(raw.when)\n body = [1, \" \", str(datetime), \"deployment\", \"test.start\",\n \"example.com\", \"state\"]\n self.assertEqual(json_resp[1], body)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_uuid_for_glance", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 379 }, { "content": " def test_do_uuid_for_glance_when_filters(self):\n search_result = [[\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"Status\"], [1, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"state\"]]\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'uuid': INSTANCE_ID_1,\n 'when_min': '1.1',\n 'when_max': '2.1',\n 'service': 'glance'}\n result = self.mox.CreateMockAnything()\n models.GlanceRawData.objects.select_related().AndReturn(result)\n result.filter(uuid=INSTANCE_ID_1,\n when__gte=decimal.Decimal('1.1'),\n when__lte=decimal.Decimal('2.1')).AndReturn(result)\n result.order_by('when').AndReturn(result)\n raw = self._create_raw()\n result[None:50].AndReturn(result)\n result.__iter__().AndReturn([raw].__iter__())\n raw.search_results([], mox.IgnoreArg(), ' ').AndReturn(search_result)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_uuid(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 2)\n header = [\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"Status\"]\n self.assertEqual(json_resp[0], header)\n datetime = dt.dt_from_decimal(raw.when)\n body = [1, \" \", str(datetime), \"deployment\", \"test.start\",\n \"example.com\", \"state\"]\n self.assertEqual(json_resp[1], body)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_uuid_for_glance_when_filters", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 410 }, { "content": " def test_do_uuid_bad_uuid(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'uuid': \"obviouslybaduuid\"}\n self.mox.ReplayAll()\n\n resp = stacky_server.do_uuid(fake_request)\n\n self.assertEqual(resp.status_code, 400)\n resp_json = json.loads(resp.content)\n self.assertEqual(len(resp_json), 2)\n self.assertEqual(resp_json[0], ['Error', 'Message'])\n msg = 'obviouslybaduuid is not uuid-like'\n self.assertEqual(resp_json[1], ['Bad Request', msg])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_uuid_bad_uuid", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 446 }, { "content": " def test_do_timings_uuid_bad_uuid(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'uuid': \"obviouslybaduuid\"}\n self.mox.ReplayAll()\n\n resp = stacky_server.do_timings_uuid(fake_request)\n\n self.assertEqual(resp.status_code, 400)\n resp_json = json.loads(resp.content)\n self.assertEqual(len(resp_json), 2)\n self.assertEqual(resp_json[0], ['Error', 'Message'])\n msg = 'obviouslybaduuid is not uuid-like'\n self.assertEqual(resp_json[1], ['Bad Request', msg])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_timings_uuid_bad_uuid", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 461 }, { "content": " def test_do_timings(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'name': 'test.event'}\n results = self.mox.CreateMockAnything()\n models.Timing.objects.select_related().AndReturn(results)\n results.filter(name='test.event').AndReturn(results)\n results.exclude(mox.IgnoreArg()).AndReturn(results)\n results.order_by('diff').AndReturn(results)\n timing1 = self.mox.CreateMockAnything()\n timing1.lifecycle = self.mox.CreateMockAnything()\n timing1.lifecycle.instance = INSTANCE_ID_1\n timing1.diff = 10\n timing2 = self.mox.CreateMockAnything()\n timing2.lifecycle = self.mox.CreateMockAnything()\n timing2.lifecycle.instance = INSTANCE_ID_2\n timing2.diff = 20\n results[None:50].AndReturn(results)\n results.__iter__().AndReturn([timing1, timing2].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_timings(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n header = [\"test.event\", \"Time\"]\n self.assertEqual(json_resp[0], header)\n self.assertEqual(json_resp[1], [INSTANCE_ID_1, '0d 00:00:10'])\n self.assertEqual(json_resp[2], [INSTANCE_ID_2, '0d 00:00:20'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_timings", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 476 }, { "content": " def test_do_timings_end_when_min(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'name': 'test.event', 'end_when_min': '1.1'}\n results = self.mox.CreateMockAnything()\n models.Timing.objects.select_related().AndReturn(results)\n results.filter(name='test.event',\n end_when__gte=decimal.Decimal('1.1')).AndReturn(results)\n results.exclude(mox.IgnoreArg()).AndReturn(results)\n results.order_by('diff').AndReturn(results)\n timing1 = self.mox.CreateMockAnything()\n timing1.lifecycle = self.mox.CreateMockAnything()\n timing1.lifecycle.instance = INSTANCE_ID_1\n timing1.diff = 10\n timing2 = self.mox.CreateMockAnything()\n timing2.lifecycle = self.mox.CreateMockAnything()\n timing2.lifecycle.instance = INSTANCE_ID_2\n timing2.diff = 20\n results[None:50].AndReturn(results)\n results.__iter__().AndReturn([timing1, timing2].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_timings(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n header = [\"test.event\", \"Time\"]\n self.assertEqual(json_resp[0], header)\n self.assertEqual(json_resp[1], [INSTANCE_ID_1, '0d 00:00:10'])\n self.assertEqual(json_resp[2], [INSTANCE_ID_2, '0d 00:00:20'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_timings_end_when_min", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 507 }, { "content": " def test_do_timings_end_when_max(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'name': 'test.event', 'end_when_max': '1.1'}\n results = self.mox.CreateMockAnything()\n models.Timing.objects.select_related().AndReturn(results)\n results.filter(name='test.event',\n end_when__lte=decimal.Decimal('1.1')).AndReturn(results)\n results.exclude(mox.IgnoreArg()).AndReturn(results)\n results.order_by('diff').AndReturn(results)\n timing1 = self.mox.CreateMockAnything()\n timing1.lifecycle = self.mox.CreateMockAnything()\n timing1.lifecycle.instance = INSTANCE_ID_1\n timing1.diff = 10\n timing2 = self.mox.CreateMockAnything()\n timing2.lifecycle = self.mox.CreateMockAnything()\n timing2.lifecycle.instance = INSTANCE_ID_2\n timing2.diff = 20\n results[None:50].AndReturn(results)\n results.__iter__().AndReturn([timing1, timing2].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_timings(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n header = [\"test.event\", \"Time\"]\n self.assertEqual(json_resp[0], header)\n self.assertEqual(json_resp[1], [INSTANCE_ID_1, '0d 00:00:10'])\n self.assertEqual(json_resp[2], [INSTANCE_ID_2, '0d 00:00:20'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_timings_end_when_max", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 539 }, { "content": " def test_do_timings_end_when_max_when_min(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'name': 'test.event',\n 'end_when_min': '1.1',\n 'end_when_max': '2.1'}\n results = self.mox.CreateMockAnything()\n models.Timing.objects.select_related().AndReturn(results)\n results.filter(name='test.event',\n end_when__gte=decimal.Decimal('1.1'),\n end_when__lte=decimal.Decimal('2.1')).AndReturn(results)\n results.exclude(mox.IgnoreArg()).AndReturn(results)\n results.order_by('diff').AndReturn(results)\n timing1 = self.mox.CreateMockAnything()\n timing1.lifecycle = self.mox.CreateMockAnything()\n timing1.lifecycle.instance = INSTANCE_ID_1\n timing1.diff = 10\n timing2 = self.mox.CreateMockAnything()\n timing2.lifecycle = self.mox.CreateMockAnything()\n timing2.lifecycle.instance = INSTANCE_ID_2\n timing2.diff = 20\n results[None:50].AndReturn(results)\n results.__iter__().AndReturn([timing1, timing2].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_timings(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n header = [\"test.event\", \"Time\"]\n self.assertEqual(json_resp[0], header)\n self.assertEqual(json_resp[1], [INSTANCE_ID_1, '0d 00:00:10'])\n self.assertEqual(json_resp[2], [INSTANCE_ID_2, '0d 00:00:20'])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_timings_end_when_max_when_min", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 571 }, { "content": " def test_do_summary(self):\n fake_request = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(stacky_server, 'get_event_names')\n events = [{'event': 'test.start'}, {'event': 'test.end'}]\n stacky_server.get_event_names().AndReturn(events)\n fake_request.GET = {'name': 'test.event'}\n results = self.mox.CreateMockAnything()\n models.Timing.objects.filter(name='test').AndReturn(results)\n results.exclude(mox.IgnoreArg()).AndReturn(results)\n results.exclude(diff__lt=0).AndReturn(results)\n timing1 = self.mox.CreateMockAnything()\n timing1.lifecycle = self.mox.CreateMockAnything()\n timing1.lifecycle.instance = INSTANCE_ID_1\n timing1.diff = 10\n timing2 = self.mox.CreateMockAnything()\n timing2.lifecycle = self.mox.CreateMockAnything()\n timing2.lifecycle.instance = INSTANCE_ID_2\n timing2.diff = 20\n results[None:50].AndReturn(results)\n results.__len__().AndReturn(2)\n results.__iter__().AndReturn([timing1, timing2].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_summary(fake_request)\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 2)\n self.assertEqual(json_resp[0], [\"Event\", \"N\", \"Min\", \"Max\", \"Avg\"])\n self.assertEqual(json_resp[1], [u'test', 2, u'0d 00:00:10.0',\n u'0d 00:00:20.0', u'0d 00:00:15'])\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_summary", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 606 }, { "content": " def test_do_request(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'request_id': REQUEST_ID_1}\n raw = self._create_raw()\n results = self.mox.CreateMockAnything()\n models.RawData.objects.filter(request_id=REQUEST_ID_1).AndReturn(results)\n results.order_by('when').AndReturn(results)\n results[None:50].AndReturn(results)\n results.__iter__().AndReturn([raw].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_request(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 2)\n self.assertEqual(json_resp[0], [\"#\", \"?\", \"When\", \"Deployment\",\n \"Event\", \"Host\", \"State\", \"State'\",\n \"Task'\"])\n self.assertEqual(json_resp[1][0], 1)\n self.assertEqual(json_resp[1][1], u' ')\n self.assertEqual(json_resp[1][2], str(dt.dt_from_decimal(raw.when)))\n self.assertEqual(json_resp[1][3], u'deployment')\n self.assertEqual(json_resp[1][4], u'test.start')\n self.assertEqual(json_resp[1][5], u'example.com')\n self.assertEqual(json_resp[1][6], u'active')\n self.assertEqual(json_resp[1][7], None)\n self.assertEqual(json_resp[1][8], None)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_request", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 639 }, { "content": " def test_do_request_when_filters(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'request_id': REQUEST_ID_1,\n 'when_min': '1.1',\n 'when_max': '2.1'}\n raw = self._create_raw()\n results = self.mox.CreateMockAnything()\n when_min = decimal.Decimal('1.1')\n when_max = decimal.Decimal('2.1')\n models.RawData.objects.filter(request_id=REQUEST_ID_1,\n when__gte=when_min,\n when__lte=when_max).AndReturn(results)\n results.order_by('when').AndReturn(results)\n results[None:50].AndReturn(results)\n results.__iter__().AndReturn([raw].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_request(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 2)\n self.assertEqual(json_resp[0], [\"#\", \"?\", \"When\", \"Deployment\",\n \"Event\", \"Host\", \"State\", \"State'\",\n \"Task'\"])\n self.assertEqual(json_resp[1][0], 1)\n self.assertEqual(json_resp[1][1], u' ')\n self.assertEqual(json_resp[1][2], str(dt.dt_from_decimal(raw.when)))\n self.assertEqual(json_resp[1][3], u'deployment')\n self.assertEqual(json_resp[1][4], u'test.start')\n self.assertEqual(json_resp[1][5], u'example.com')\n self.assertEqual(json_resp[1][6], u'active')\n self.assertEqual(json_resp[1][7], None)\n self.assertEqual(json_resp[1][8], None)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_request_when_filters", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 669 }, { "content": " def test_do_request_bad_request_id(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'request_id': \"obviouslybaduuid\"}\n self.mox.ReplayAll()\n\n resp = stacky_server.do_request(fake_request)\n\n self.assertEqual(resp.status_code, 400)\n resp_json = json.loads(resp.content)\n self.assertEqual(len(resp_json), 2)\n self.assertEqual(resp_json[0], ['Error', 'Message'])\n msg = 'obviouslybaduuid is not request-id-like'\n self.assertEqual(resp_json[1], ['Bad Request', msg])\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_request_bad_request_id", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 705 }, { "content": " def _assert_on_show_nova(self, json_resp, raw):\n self.assertEqual(len(json_resp), 3)\n values = json_resp[0]\n self.assertEqual(len(values), 12)\n self.assertEqual(values[0], [\"Key\", \"Value\"])\n self.assertEqual(values[1], [\"#\", raw.id])\n self.assertEqual(values[2], [\"When\",\n str(dt.dt_from_decimal(raw.when))])\n self.assertEqual(values[3], [\"Deployment\", raw.deployment.name])\n self.assertEqual(values[4], [\"Category\", raw.routing_key])\n self.assertEqual(values[5], [\"Publisher\", raw.publisher])\n self.assertEqual(values[6], [\"State\", raw.state])\n self.assertEqual(values[7], [\"Event\", raw.event])\n self.assertEqual(values[8], [\"Service\", raw.service])\n self.assertEqual(values[9], [\"Host\", raw.host])\n self.assertEqual(values[10],[\"UUID\", raw.instance])\n self.assertEqual(values[11], [\"Req ID\", raw.request_id])", "metadata": "root.StackyServerTestCase._assert_on_show_nova", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 720 }, { "content": " def _assert_on_show_glance(self, json_resp, raw):\n self.assertEqual(len(json_resp), 3)\n values = json_resp[0]\n self.assertEqual(len(values), 12)\n self.assertEqual(values[0], [\"Key\", \"Value\"])\n self.assertEqual(values[1], [\"#\", raw.id])\n self.assertEqual(values[2], [\"When\",\n str(dt.dt_from_decimal(raw.when))])\n self.assertEqual(values[3], [\"Deployment\", raw.deployment.name])\n self.assertEqual(values[4], [\"Category\", raw.routing_key])\n self.assertEqual(values[5], [\"Publisher\", raw.publisher])\n self.assertEqual(values[6], [\"Status\", raw.status])\n self.assertEqual(values[7], [\"Event\", raw.event])\n self.assertEqual(values[8], [\"Service\", raw.service])\n self.assertEqual(values[9], [\"Host\", raw.host])\n self.assertEqual(values[10],[\"UUID\", raw.uuid])\n self.assertEqual(values[11], [\"Req ID\", raw.request_id])", "metadata": "root.StackyServerTestCase._assert_on_show_glance", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 738 }, { "content": " def test_do_show(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n raw = self._create_raw()\n models.RawData.objects.get(id=1).AndReturn(raw)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_show(fake_request, 1)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self._assert_on_show_nova(json_resp, raw)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_show", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 756 }, { "content": " def test_do_show_for_glance_rawdata(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'service':'glance'}\n raw = self._create_raw()\n models.GlanceRawData.objects.get(id=1).AndReturn(raw)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_show(fake_request, 1)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self._assert_on_show_glance(json_resp, raw)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_show_for_glance_rawdata", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 770 }, { "content": " def test_do_show_for_generic_rawdata(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'service':'generic'}\n raw = self._create_raw()\n models.GenericRawData.objects.get(id=1).AndReturn(raw)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_show(fake_request, 1)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self._assert_on_show_nova(json_resp, raw)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_show_for_generic_rawdata", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 784 }, { "content": " def test_do_show_should_return_empty_result_on_object_not_found_exception(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n\n raw = self._create_raw()\n models.RawData.objects.get(id=1).AndReturn(raw)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_show(fake_request, 1)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self._assert_on_show_nova(json_resp, raw)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_show_should_return_empty_result_on_object_not_found_exception", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 798 }, { "content": " def test_do_watch_for_glance(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'service': 'glance'}\n self.mox.StubOutWithMock(stacky_server, 'get_deployments')\n deployment1 = self.mox.CreateMockAnything()\n deployment1.id = 1\n deployment1.name = 'dep1'\n deployments = [deployment1]\n stacky_server.get_deployments().AndReturn(deployments)\n self.mox.StubOutWithMock(stacky_server, 'get_event_names')\n events = [{'event': 'test.start'}, {'event': 'test.end'}]\n stacky_server.get_event_names().AndReturn(events)\n results = self.mox.CreateMockAnything()\n models.GlanceRawData.objects.order_by('when').AndReturn(results)\n results.filter(when__gt=mox.IgnoreArg()).AndReturn(results)\n results.filter(when__lte=mox.IgnoreArg()).AndReturn(results)\n results.__iter__().AndReturn([self._create_raw()].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_watch(fake_request, 0)\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n self.assertEqual(json_resp[0], [10, 1, 15, 20, 10, 36])\n self.assertEqual(json_resp[1][0][0], 1)\n self.assertEqual(json_resp[1][0][1], u' ')\n time_str = \"%s %s\" % (json_resp[1][0][2], json_resp[1][0][3])\n datetime.datetime.strptime(time_str, \"%Y-%m-%d %H:%M:%S.%f\")\n self.assertEqual(json_resp[1][0][4], u'dep1')\n self.assertEqual(json_resp[1][0][5], u'test.start')\n self.assertEqual(json_resp[1][0][6], u'%s' % 'uuid')\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_watch_for_glance", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 813 }, { "content": " def test_do_watch(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n self.mox.StubOutWithMock(stacky_server, 'get_deployments')\n deployment1 = self.mox.CreateMockAnything()\n deployment1.id = 1\n deployment1.name = 'dep1'\n deployments = [deployment1]\n stacky_server.get_deployments().AndReturn(deployments)\n self.mox.StubOutWithMock(stacky_server, 'get_event_names')\n events = [{'event': 'test.start'}, {'event': 'test.end'}]\n stacky_server.get_event_names().AndReturn(events)\n results = self.mox.CreateMockAnything()\n model = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(stacky_server, '_model_factory')\n stacky_server._model_factory('nova').AndReturn(model)\n model.order_by('when').AndReturn(results)\n results.filter(when__gt=mox.IgnoreArg()).AndReturn(results)\n results.filter(when__lte=mox.IgnoreArg()).AndReturn(results)\n results.__iter__().AndReturn([self._create_raw()].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_watch(fake_request, 0)\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n self.assertEqual(json_resp[0], [10, 1, 15, 20, 10, 36])\n self.assertEqual(json_resp[1][0][0], 1)\n self.assertEqual(json_resp[1][0][1], u' ')\n time_str = \"%s %s\" % (json_resp[1][0][2], json_resp[1][0][3])\n datetime.datetime.strptime(time_str, \"%Y-%m-%d %H:%M:%S.%f\")\n self.assertEqual(json_resp[1][0][4], u'dep1')\n self.assertEqual(json_resp[1][0][5], u'test.start')\n self.assertEqual(json_resp[1][0][6], u'%s' % 'uuid')\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_watch", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 846 }, { "content": " def test_do_watch_with_deployment(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'deployment': 1}\n self.mox.StubOutWithMock(stacky_server, 'get_deployments')\n deployment1 = self.mox.CreateMockAnything()\n deployment1.id = 1\n deployment1.name = 'dep1'\n deployments = [deployment1]\n stacky_server.get_deployments().AndReturn(deployments)\n self.mox.StubOutWithMock(stacky_server, 'get_event_names')\n events = [{'event': 'test.start'}, {'event': 'test.end'}]\n stacky_server.get_event_names().AndReturn(events)\n results = self.mox.CreateMockAnything()\n model = self.mox.CreateMockAnything()\n self.mox.StubOutWithMock(stacky_server, '_model_factory')\n stacky_server._model_factory('nova').AndReturn(model)\n model.order_by('when').AndReturn(results)\n\n results.filter(deployment=1).AndReturn(results)\n results.filter(when__gt=mox.IgnoreArg()).AndReturn(results)\n results.filter(when__lte=mox.IgnoreArg()).AndReturn(results)\n results.__iter__().AndReturn([self._create_raw()].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_watch(fake_request, 1)\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n self.assertEqual(json_resp[0], [10, 1, 15, 20, 10, 36])\n self.assertEqual(json_resp[1][0][0], 1)\n self.assertEqual(json_resp[1][0][1], u' ')\n time_str = \"%s %s\" % (json_resp[1][0][2], json_resp[1][0][3])\n datetime.datetime.strptime(time_str, \"%Y-%m-%d %H:%M:%S.%f\")\n self.assertEqual(json_resp[1][0][4], u'dep1')\n self.assertEqual(json_resp[1][0][5], u'test.start')\n self.assertEqual(json_resp[1][0][6], u'%s' % 'uuid')\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_watch_with_deployment", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 882 }, { "content": " def test_do_watch_with_event_name(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'event_name': 'test.start','service': 'nova'}\n self.mox.StubOutWithMock(stacky_server, 'get_deployments')\n deployment1 = self.mox.CreateMockAnything()\n deployment1.id = 1\n deployment1.name = 'dep1'\n deployments = [deployment1]\n stacky_server.get_deployments().AndReturn(deployments)\n self.mox.StubOutWithMock(stacky_server, 'get_event_names')\n events = [{'event': 'test.start'}, {'event': 'test.end'}]\n stacky_server.get_event_names().AndReturn(events)\n results = self.mox.CreateMockAnything()\n models.RawData.objects.order_by('when').AndReturn(results)\n results.filter(event='test.start').AndReturn(results)\n results.filter(when__gt=mox.IgnoreArg()).AndReturn(results)\n results.filter(when__lte=mox.IgnoreArg()).AndReturn(results)\n results.__iter__().AndReturn([self._create_raw()].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_watch(fake_request, 0)\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n self.assertEqual(json_resp[0], [10, 1, 15, 20, 10, 36])\n self.assertEqual(json_resp[1][0][0], 1)\n self.assertEqual(json_resp[1][0][1], u' ')\n time_str = \"%s %s\" % (json_resp[1][0][2], json_resp[1][0][3])\n datetime.datetime.strptime(time_str, \"%Y-%m-%d %H:%M:%S.%f\")\n self.assertEqual(json_resp[1][0][4], u'dep1')\n self.assertEqual(json_resp[1][0][5], u'test.start')\n self.assertEqual(json_resp[1][0][6], u'%s' % 'uuid')\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_watch_with_event_name", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 920 }, { "content": " def test_do_kpi(self):\n fake_request = self.mox.CreateMockAnything()\n results = self.mox.CreateMockAnything()\n models.RequestTracker.objects.select_related().AndReturn(results)\n results.exclude(last_timing=None).AndReturn(results)\n results.exclude(start__lt=mox.IgnoreArg()).AndReturn(results)\n results.order_by('duration').AndReturn(results)\n tracker = self.mox.CreateMockAnything()\n tracker.last_timing = self.mox.CreateMockAnything()\n tracker.last_timing.end_raw = self.mox.CreateMockAnything()\n tracker.last_timing.end_raw.event = 'test.end'\n deployment = self.mox.CreateMockAnything()\n deployment.name = 'dep1'\n tracker.last_timing.end_raw.deployment = deployment\n tracker.lifecycle = self.mox.CreateMockAnything()\n tracker.lifecycle.instance = INSTANCE_ID_1\n tracker.duration = 10\n results.__iter__().AndReturn([tracker].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_kpi(fake_request)\n self.assertEqual(resp.status_code, 200)\n body = resp.content\n body = json.loads(body)\n self.assertEqual(len(body), 2)\n self.assertEqual(body[0], [\"Event\", \"Time\", \"UUID\", \"Deployment\"])\n time = u'%s' % stacky_server.sec_to_time(10)\n self.assertEqual(body[1], [u'test', time, INSTANCE_ID_1, u'dep1'])\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_kpi", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 954 }, { "content": " def test_do_kpi_with_tenant(self):\n fake_request = self.mox.CreateMockAnything()\n objects = self.mox.CreateMockAnything()\n models.RawData.objects.filter(tenant='55555').AndReturn(objects)\n objects.count().AndReturn(1)\n results = self.mox.CreateMockAnything()\n models.RequestTracker.objects.select_related().AndReturn(results)\n results.exclude(last_timing=None).AndReturn(results)\n results.exclude(start__lt=mox.IgnoreArg()).AndReturn(results)\n results.order_by('duration').AndReturn(results)\n tracker = self.mox.CreateMockAnything()\n tracker.last_timing = self.mox.CreateMockAnything()\n tracker.last_timing.end_raw = self.mox.CreateMockAnything()\n tracker.last_timing.end_raw.event = 'test.end'\n tracker.last_timing.end_raw.tenant = '55555'\n deployment = self.mox.CreateMockAnything()\n deployment.name = 'dep1'\n tracker.last_timing.end_raw.deployment = deployment\n tracker.lifecycle = self.mox.CreateMockAnything()\n tracker.lifecycle.instance = INSTANCE_ID_1\n tracker.duration = 10\n results.__iter__().AndReturn([tracker].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_kpi(fake_request, '55555')\n self.assertEqual(resp.status_code, 200)\n body = resp.content\n body = json.loads(body)\n self.assertEqual(len(body), 2)\n self.assertEqual(body[0], [\"Event\", \"Time\", \"UUID\", \"Deployment\"])\n time = u'%s' % stacky_server.sec_to_time(10)\n self.assertEqual(body[1], [u'test', time, INSTANCE_ID_1, u'dep1'])\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_kpi_with_tenant", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 985 }, { "content": " def test_do_kpi_with_tenant_no_match(self):\n fake_request = self.mox.CreateMockAnything()\n objects = self.mox.CreateMockAnything()\n models.RawData.objects.filter(tenant='55555').AndReturn(objects)\n objects.count().AndReturn(1)\n results = self.mox.CreateMockAnything()\n models.RequestTracker.objects.select_related().AndReturn(results)\n results.exclude(last_timing=None).AndReturn(results)\n results.exclude(start__lt=mox.IgnoreArg()).AndReturn(results)\n results.order_by('duration').AndReturn(results)\n tracker = self.mox.CreateMockAnything()\n tracker.last_timing = self.mox.CreateMockAnything()\n tracker.last_timing.end_raw = self.mox.CreateMockAnything()\n tracker.last_timing.end_raw.event = 'test.end'\n tracker.last_timing.end_raw.tenant = '55556'\n deployment = self.mox.CreateMockAnything()\n deployment.name = 'dep1'\n tracker.last_timing.end_raw.deployment = deployment\n tracker.lifecycle = self.mox.CreateMockAnything()\n tracker.lifecycle.instance = INSTANCE_ID_1\n tracker.duration = 10\n results.__iter__().AndReturn([tracker].__iter__())\n self.mox.ReplayAll()\n\n resp = stacky_server.do_kpi(fake_request, '55555')\n self.assertEqual(resp.status_code, 200)\n body = resp.content\n body = json.loads(body)\n self.assertEqual(len(body), 1)\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_kpi_with_tenant_no_match", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1020 }, { "content": " def test_do_kpi_tenant_doesnt_exist(self):\n fake_request = self.mox.CreateMockAnything()\n objects = self.mox.CreateMockAnything()\n models.RawData.objects.filter(tenant='55555').AndReturn(objects)\n objects.count().AndReturn(0)\n self.mox.ReplayAll()\n\n resp = stacky_server.do_kpi(fake_request, '55555')\n self.assertEqual(resp.status_code, 404)\n body = resp.content\n body = json.loads(body)\n self.assertEqual(len(body), 2)\n self.assertEqual(body[0], ['Error', 'Message'])\n msg = 'Could not find raws for tenant 55555'\n self.assertEqual(body[1], ['Not Found', msg])\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_do_kpi_tenant_doesnt_exist", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1052 }, { "content": " def test_model_factory_for_nova(self):\n self.mox.UnsetStubs()\n nova_model = stacky_server._model_factory('nova')\n self.assertEqual(nova_model.model, models.RawData)", "metadata": "root.StackyServerTestCase.test_model_factory_for_nova", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1070 }, { "content": " def test_model_factory_for_nova(self):\n self.mox.UnsetStubs()\n nova_model = stacky_server._model_factory('glance')\n self.assertEqual(nova_model.model, models.GlanceRawData)", "metadata": "root.StackyServerTestCase.test_model_factory_for_nova", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1075 }, { "content": " def test_model_factory_for_nova(self):\n self.mox.UnsetStubs()\n nova_model = stacky_server._model_factory('generic')\n self.assertEqual(nova_model.model, models.GenericRawData)", "metadata": "root.StackyServerTestCase.test_model_factory_for_nova", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1080 }, { "content": " def _assert_on_search_nova(self, json_resp, raw):\n title = json_resp[0]\n values = json_resp[1]\n self.assertEqual(len(values), 9)\n self.assertEqual([title[0], values[0]],[\"#\", raw.id] )\n self.assertEqual([title[1], values[1]], ['?', ' '])\n self.assertEqual([title[2], values[2]], [\"When\",\n str(dt.dt_from_decimal(raw.when))])\n self.assertEqual([title[3], values[3]], [\"Deployment\", raw.deployment.name])\n self.assertEqual([title[4], values[4]], [\"Event\", raw.event])\n self.assertEqual([title[5], values[5]], [\"Host\", raw.host])\n self.assertEqual([title[6], values[6]], [\"State\", raw.state])\n self.assertEqual([title[7], values[7]], [\"State'\", raw.old_state])", "metadata": "root.StackyServerTestCase._assert_on_search_nova", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1085 }, { "content": " def test_search_by_field_for_nova(self):\n search_result = [[\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"State\", \"State'\", \"Task'\"], [1, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"active\", None, None]]\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'field': 'tenant', 'value': 'tenant'}\n raw = self._create_raw()\n results = self.mox.CreateMockAnything()\n models.RawData.objects.filter(tenant='tenant').AndReturn(results)\n results.order_by('-when').AndReturn([raw])\n raw.search_results([], mox.IgnoreArg(), ' ').AndReturn(search_result)\n self.mox.ReplayAll()\n\n resp = stacky_server.search(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self._assert_on_search_nova(json_resp, raw)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_search_by_field_for_nova", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1099 }, { "content": " def test_search_by_field_for_nova_when_filters(self):\n search_result = [[\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"State\", \"State'\", \"Task'\"], [1, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"active\", None, None]]\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'field': 'tenant', 'value': 'tenant',\n 'when_min': '1.1',\n 'when_max': '2.1'}\n raw = self._create_raw()\n results = self.mox.CreateMockAnything()\n models.RawData.objects.filter(tenant='tenant',\n when__gte=decimal.Decimal('1.1'),\n when__lte=decimal.Decimal('2.1')).AndReturn(results)\n results.order_by('-when').AndReturn([raw])\n raw.search_results([], mox.IgnoreArg(), ' ').AndReturn(search_result)\n self.mox.ReplayAll()\n\n resp = stacky_server.search(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self._assert_on_search_nova(json_resp, raw)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_search_by_field_for_nova_when_filters", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1120 }, { "content": " def test_search_by_field_for_nova_with_limit(self):\n search_result = [[\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"State\", \"State'\", \"Task'\"], [1, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"active\", None, None]]\n search_result_2 = [[\"#\", \"?\", \"When\", \"Deployment\", \"Event\", \"Host\",\n \"State\", \"State'\", \"Task'\"], [1, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"active\", None, None],[2, \" \",\n \"2013-07-17 10:16:10.717219\", \"deployment\",\n \"test.start\", \"example.com\", \"active\", None, None]]\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'field': 'tenant', 'value': 'tenant', 'limit': '2',\n 'service': 'nova'}\n raw1 = self._create_raw()\n raw2 = self._create_raw()\n raw3 = self._create_raw()\n raw2.id = 2\n raw3.id = 3\n results = self.mox.CreateMockAnything()\n models.RawData.objects.filter(tenant='tenant').AndReturn(results)\n results.order_by('-when').AndReturn([raw1, raw2, raw3])\n raw1.search_results([], mox.IgnoreArg(), ' ').AndReturn(search_result)\n raw2.search_results(search_result, mox.IgnoreArg(),' ').AndReturn(search_result_2)\n self.mox.ReplayAll()\n\n resp = stacky_server.search(fake_request)\n\n self.assertEqual(resp.status_code, 200)\n json_resp = json.loads(resp.content)\n self.assertEqual(len(json_resp), 3)\n self._assert_on_search_nova(json_resp, raw1)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_search_by_field_for_nova_with_limit", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1145 }, { "content": " def test_search_with_wrong_field_value_returns_400_error_and_a_message(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'field': 'tenant', 'value': 'tenant'}\n models.RawData.objects.filter(tenant='tenant').AndRaise(FieldError)\n self.mox.ReplayAll()\n\n resp = stacky_server.search(fake_request)\n\n self.assertEqual(resp.status_code, 400)\n json_resp = json.loads(resp.content)\n self.assertEquals(json_resp[0],[u'Error', u'Message'])\n self.assertEquals(json_resp[1],\n [u'Bad Request', u\"The requested field\"\n u\" 'tenant' does not exist for the corresponding object.\\nNote: \"\n u\"The field names of database are case-sensitive.\"])\n\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_search_with_wrong_field_value_returns_400_error_and_a_message", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1179 }, { "content": " def test_model_search_default_limit(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n fake_model = self.mox.CreateMockAnything()\n filters = {'field': 'value'}\n results = self.mox.CreateMockAnything()\n fake_model.filter(**filters).AndReturn(results)\n results[None:50].AndReturn(results)\n self.mox.ReplayAll()\n actual_results = stacky_server.model_search(fake_request, fake_model,\n filters)\n self.assertEqual(actual_results, results)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_model_search_default_limit", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1197 }, { "content": " def test_model_search_default_limit_with_offset(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'offset': '1'}\n fake_model = self.mox.CreateMockAnything()\n filters = {'field': 'value'}\n results = self.mox.CreateMockAnything()\n fake_model.filter(**filters).AndReturn(results)\n results[1:51].AndReturn(results)\n self.mox.ReplayAll()\n actual_results = stacky_server.model_search(fake_request, fake_model,\n filters)\n self.assertEqual(actual_results, results)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_model_search_default_limit_with_offset", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1211 }, { "content": " def test_model_search_default_with_limit(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'limit': '1'}\n fake_model = self.mox.CreateMockAnything()\n filters = {'field': 'value'}\n results = self.mox.CreateMockAnything()\n fake_model.filter(**filters).AndReturn(results)\n results[None:1].AndReturn(results)\n self.mox.ReplayAll()\n actual_results = stacky_server.model_search(fake_request, fake_model,\n filters)\n self.assertEqual(actual_results, results)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_model_search_default_with_limit", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1225 }, { "content": " def test_model_search_default_with_limit_and_offset(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {'limit': '5',\n 'offset': '10'}\n fake_model = self.mox.CreateMockAnything()\n filters = {'field': 'value'}\n results = self.mox.CreateMockAnything()\n fake_model.filter(**filters).AndReturn(results)\n results[10:15].AndReturn(results)\n self.mox.ReplayAll()\n actual_results = stacky_server.model_search(fake_request, fake_model,\n filters)\n self.assertEqual(actual_results, results)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_model_search_default_with_limit_and_offset", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1239 }, { "content": " def test_model_search_related(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n fake_model = self.mox.CreateMockAnything()\n filters = {'field': 'value'}\n results = self.mox.CreateMockAnything()\n fake_model.select_related().AndReturn(results)\n results.filter(**filters).AndReturn(results)\n results[None:50].AndReturn(results)\n self.mox.ReplayAll()\n actual_results = stacky_server.model_search(fake_request, fake_model,\n filters, related=True)\n self.assertEqual(actual_results, results)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_model_search_related", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1254 }, { "content": " def test_model_order_by(self):\n fake_request = self.mox.CreateMockAnything()\n fake_request.GET = {}\n fake_model = self.mox.CreateMockAnything()\n filters = {'field': 'value'}\n results = self.mox.CreateMockAnything()\n fake_model.filter(**filters).AndReturn(results)\n results.order_by('when').AndReturn(results)\n results[None:50].AndReturn(results)\n self.mox.ReplayAll()\n actual_results = stacky_server.model_search(fake_request, fake_model,\n filters, order_by='when')\n self.assertEqual(actual_results, results)\n self.mox.VerifyAll()", "metadata": "root.StackyServerTestCase.test_model_order_by", "header": "['class', 'StackyServerTestCase', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1269 }, { "content": "class JsonReportsSearchAPI(StacktachBaseTestCase):\n\n\n\n\n\n\n\n\n", "metadata": "root.JsonReportsSearchAPI", "header": "['module', '___EOS___']", "index": 1285 }, { "content": " def setUp(self):\n self.mox = mox.Mox()\n self.model = models.JsonReport.objects\n self.model_search_result = self.mox.CreateMockAnything()\n self.model_search_result.id = '5975'\n self.model_search_result.period_start = datetime.datetime(2014, 1, 18,)\n self.model_search_result.period_end = datetime.datetime(2014, 1, 19)\n self.model_search_result.created = 1388569200\n self.model_search_result.name = 'nova usage audit'\n self.model_search_result.version = 4", "metadata": "root.JsonReportsSearchAPI.setUp", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1286 }, { "content": " def tearDown(self):\n self.mox.UnsetStubs()", "metadata": "root.JsonReportsSearchAPI.tearDown", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1297 }, { "content": " def test_jsonreports_search_order_by_id(self):\n request = self.mox.CreateMockAnything()\n request.GET = {\n 'id': 1,\n 'name': 'nova_usage_audit',\n 'period_start': '2014-01-01 00:00:00',\n 'period_end': '2014-01-02 00:00:00',\n 'created': '2014-01-01',\n }\n filters = {\n 'id__exact': 1,\n 'period_start__exact': '2014-01-01 00:00:00',\n 'name__exact': 'nova_usage_audit',\n 'period_end__exact': '2014-01-02 00:00:00',\n 'created__lt': decimal.Decimal('1388620800'),\n 'created__gt': decimal.Decimal('1388534400'),\n }\n self.mox.StubOutWithMock(stacky_server, 'model_search')\n stacky_server.model_search(request, self.model, filters,\n order_by='-id').AndReturn(\n [self.model_search_result])\n self.mox.ReplayAll()\n\n actual_result = stacky_server.do_jsonreports_search(request).content\n expected_result = [\n ['Id', 'Start', 'End', 'Created', 'Name', 'Version'],\n ['5975', '2014-01-18 00:00:00', '2014-01-19 00:00:00',\n '2014-01-01 09:40:00', 'nova usage audit', 4]\n ]\n\n self.assertEquals(ast.literal_eval(actual_result), expected_result)\n self.mox.VerifyAll()", "metadata": "root.JsonReportsSearchAPI.test_jsonreports_search_order_by_id", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1300 }, { "content": " def test_jsonreports_search_with_limit_offset(self):\n request = self.mox.CreateMockAnything()\n request.GET = {\n 'period_start': '2014-01-01 09:40:00',\n 'name': 'nova_usage_audit',\n 'limit': 10,\n 'offset': 5\n }\n filters = {\n 'period_start__exact': '2014-01-01 09:40:00',\n 'name__exact': 'nova_usage_audit',\n }\n self.mox.StubOutWithMock(stacky_server, 'model_search')\n stacky_server.model_search(request, self.model, filters,\n order_by='-id').AndReturn(\n [self.model_search_result])\n self.mox.ReplayAll()\n\n actual_result = stacky_server.do_jsonreports_search(request).content\n expected_result = \\\n [['Id', 'Start', 'End', 'Created', 'Name', 'Version'],\n ['5975', '2014-01-18 00:00:00', '2014-01-19 00:00:00',\n '2014-01-01 09:40:00', 'nova usage audit', 4]]\n\n self.assertEquals(ast.literal_eval(actual_result), expected_result)\n self.mox.VerifyAll()", "metadata": "root.JsonReportsSearchAPI.test_jsonreports_search_with_limit_offset", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1333 }, { "content": " def test_jsonreports_search_with_invalid_fields(self):\n request = self.mox.CreateMockAnything()\n request.GET = {'invalid_column_1': 'value_1',\n 'invalid_column_2': 'value_2',\n 'version': 4,\n 'json': 'json',\n 'period_start': '2014-01-01 00:00:00'}\n self.mox.ReplayAll()\n\n actual_result = stacky_server.do_jsonreports_search(request).content\n expected_result = [\n [\"Error\", \"Message\"],\n [\"Bad Request\", \"The requested fields either do not exist for the \"\n \"corresponding object or are not searchable: invalid_column_1, \"\n \"invalid_column_2, json, version. Note: The field names of \"\n \"database are case-sensitive.\"]\n ]\n self.assertEqual(ast.literal_eval(actual_result), expected_result)\n self.mox.VerifyAll()", "metadata": "root.JsonReportsSearchAPI.test_jsonreports_search_with_invalid_fields", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1360 }, { "content": " def test_jsonreports_search_with_invalid_period_start(self):\n request = self.mox.CreateMockAnything()\n request.GET = {'period_start': '1234'}\n self.mox.ReplayAll()\n\n actual_result = stacky_server.do_jsonreports_search(request).content\n expected_result = [\n [\"Error\", \"Message\"],\n [\"Bad Request\", \"'1234' value has an invalid format. It must be in \"\n \"YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.\"]\n ]\n self.assertEqual(ast.literal_eval(actual_result), expected_result)\n self.mox.VerifyAll()", "metadata": "root.JsonReportsSearchAPI.test_jsonreports_search_with_invalid_period_start", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1380 }, { "content": " def test_jsonreports_search_with_invalid_period_end(self):\n request = self.mox.CreateMockAnything()\n request.GET = {'period_end': '1234'}\n self.mox.ReplayAll()\n\n actual_result = stacky_server.do_jsonreports_search(request).content\n expected_result = [\n [\"Error\", \"Message\"],\n [\"Bad Request\", \"'1234' value has an invalid format. It must be in \"\n \"YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.\"]\n ]\n self.assertEqual(ast.literal_eval(actual_result), expected_result)\n self.mox.VerifyAll()", "metadata": "root.JsonReportsSearchAPI.test_jsonreports_search_with_invalid_period_end", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1394 }, { "content": " def test_jsonreports_search_with_invalid_id(self):\n request = self.mox.CreateMockAnything()\n request.GET = {'id': 'abcd'}\n self.mox.ReplayAll()\n\n actual_result = stacky_server.do_jsonreports_search(request).content\n expected_result = [\n [\"Error\", \"Message\"],\n [\"Bad Request\", \"'abcd' value has an invalid format. It must be in \"\n \"integer format.\"]\n ]\n self.assertEqual(ast.literal_eval(actual_result), expected_result)\n self.mox.VerifyAll()", "metadata": "root.JsonReportsSearchAPI.test_jsonreports_search_with_invalid_id", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1408 }, { "content": " def test_jsonreports_search_with_invalid_created_format(self):\n request = self.mox.CreateMockAnything()\n request.GET = {\n 'created': '2014-01-01 00:00:00'\n }\n self.mox.ReplayAll()\n\n actual_result = stacky_server.do_jsonreports_search(request).content\n expected_result = [\n [\"Error\", \"Message\"],\n [\"Bad Request\", \"'2014-01-01 00:00:00' value has an invalid format.\"\n \" It must be in YYYY-MM-DD format.\"]\n ]\n\n self.assertEqual(ast.literal_eval(actual_result), expected_result)\n self.mox.VerifyAll()", "metadata": "root.JsonReportsSearchAPI.test_jsonreports_search_with_invalid_created_format", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1422 }, { "content": " def test_jsonreports_search_by_invalid_created_400(self):\n request = self.mox.CreateMockAnything()\n request.GET = {\n 'created': '1234'}\n self.mox.ReplayAll()\n\n actual_result = stacky_server.do_jsonreports_search(request).content\n expected_result = \\\n [\n [\"Error\", \"Message\"],\n [\"Bad Request\", \"'1234' value has an invalid format. It must be in \"\n \"YYYY-MM-DD format.\"]\n ]\n self.assertEquals(ast.literal_eval(actual_result), expected_result)\n self.mox.VerifyAll()", "metadata": "root.JsonReportsSearchAPI.test_jsonreports_search_by_invalid_created_400", "header": "['class', 'JsonReportsSearchAPI', '(', 'StacktachBaseTestCase', ')', ':', '___EOS___']", "index": 1439 } ]
[ { "span": "from utils import INSTANCE_ID_1, INSTANCE_TYPE_ID_1", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 51 }, { "span": "from utils import INSTANCE_FLAVOR_ID_1", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 38 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2012", " ", "-", " ", "Rack", "space", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "deal", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rights", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sell", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FROM", ",", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IN", " ", "THE", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "decimal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "exceptions_", "import_", "Field", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "mox_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "stack", "tach", "_", "import_", "datetime", "\\u", "to", "\\u", "decimal_", "as_", "dt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stack", "tach", "_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stack", "tach", "_", "import_", "stack", "y", "\\u", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "import_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "INSTANCE", "\\u", "TYPE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "import_", "INSTANCE", "\\u", "FLA", "VOR", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "import_", "INSTANCE", "\\u", "ID", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "import_", "REQUEST", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tests_", "._", "unit_", "import_", "Stack", "tach", "Base", "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\\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_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u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\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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_", "._", "mox_", "=_", "mox_", "._", "Mo", "x_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Ra", "w", "Data", "'_", ",_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Deployment", "'_", ",_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Glance", "Ra", "w", "Data", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Glance", "Ra", "w", "Data_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Gene", "ric", "Ra", "w", "Data", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Gene", "ric", "Ra", "w", "Data_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Deployment", "_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Life", "cycle", "'_", ",_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Life", "cycle_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Tim", "ing", "'_", ",_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Request", "Track", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Request", "Tracker_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Insta", "nce", "Us", "age", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Insta", "nce", "Usage_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Insta", "nce", "Delete", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Insta", "nce", "Delete", "s_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Insta", "nce", "Exist", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Insta", "nce", "Exists_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "models_", ",_", "'", "Js", "on", "Report", "'_", ",_", "use", "\\u", "mock", "\\u", "anyt", "hing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Js", "on", "Report_", "._", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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_", "._", "mox_", "._", "Unse", "t", "Stu", "bs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "create", "\\u", "raw_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "when_", "=_", "utils_", "._", "decima", "l\\u", "utc_", "(_", "datetime_", "._", "datetime_", "(_", "2013_", ",_", "7_", ",_", "17_", ",_", "10_", ",_", "16_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "10_", ",_", "717", "219_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "routin", "g", "\\u", "key_", "=_", "'", "monit", "or", ".", "info", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "deployment_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "deployment_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "deployment_", "._", "name_", "=_", "'", "deploy", "ment", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "event_", "=_", "'", "test", ".", "start", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "host_", "=_", "'", "example", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "state_", "=_", "'", "active", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "old", "\\u", "state_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "old", "\\u", "task_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "publisher_", "=_", "\"", "api", ".", "example", ".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "service_", "=_", "'", "api", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "host_", "=_", "'", "example", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "status_", "=_", "'", "state", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "request", "\\u", "id_", "=_", "REQUEST", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "json_", "=_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "uuid_", "=_", "'", "uuid", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "tenant_", "=_", "'", "tenan", "t", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "raw_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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", "event", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'\\u", "model", "\\u", "factor", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "\\u", "model", "\\u", "factory_", "(_", "'", "nova", "'_", ")_", "._", "And", "Return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "values_", "(_", "'", "event", "'_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "distinct_", "(_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "names_", "=_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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", "host", "\\u", "names", "\\u", "for", "\\u", "nova_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "values_", "(_", "'", "host", "'_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "distinct_", "(_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "names_", "=_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "host", "\\u", "names_", "(_", "'", "nova", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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", "host", "\\u", "names", "\\u", "for", "\\u", "glance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Glance", "Ra", "w", "Data_", "._", "objects_", "._", "values_", "(_", "'", "host", "'_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "distinct_", "(_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "names_", "=_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "host", "\\u", "names_", "(_", "'", "gla", "nce", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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", "deployments", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Deployment", "_", "._", "objects_", "._", "all_", "(_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "names_", "=_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "deployments", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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", "timings", "\\u", "for", "\\u", "uuid", "\\u", "start", "\\u", "only_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Life", "cycle_", "._", "objects_", "._", "filter_", "(_", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", ")_", "._", "And", "Return_", "(_", "lc", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "lc", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "lifecycle", "_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "._", "filter_", "(_", "lifecycle", "_", "=_", "lifecycle", "_", ")_", "._", "And", "Return_", "(_", "t", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "timing_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "name_", "=_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "start", "\\u", "raw_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "end", "\\u", "raw_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "diff_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "names_", "=_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "timings", "\\u", "for", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "INSTANCE", "\\u", "ID", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "event", "\\u", "names_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", "[_", "0_", "]_", ",_", "[_", "'?'_", ",_", "'", "Event", "'_", ",_", "'", "Time", " ", "(", "secs", ")'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", "[_", "1_", "]_", ",_", "[_", "'", "S", "'_", ",_", "'", "name", "'_", ",_", "'", "n", "/", "a", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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", "timings", "\\u", "for", "\\u", "uuid", "\\u", "end", "\\u", "only_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Life", "cycle_", "._", "objects_", "._", "filter_", "(_", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", ")_", "._", "And", "Return_", "(_", "lc", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "lc", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "lifecycle", "_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "._", "filter_", "(_", "lifecycle", "_", "=_", "lifecycle", "_", ")_", "._", "And", "Return_", "(_", "t", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "timing_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "name_", "=_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "start", "\\u", "raw_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "end", "\\u", "raw_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "diff_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "names_", "=_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "timings", "\\u", "for", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "INSTANCE", "\\u", "ID", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "event", "\\u", "names_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", "[_", "0_", "]_", ",_", "[_", "'?'_", ",_", "'", "Event", "'_", ",_", "'", "Time", " ", "(", "secs", ")'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", "[_", "1_", "]_", ",_", "[_", "'", "E", "'_", ",_", "'", "name", "'_", ",_", "'", "n", "/", "a", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "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", "timings", "\\u", "for", "\\u", "uuid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Life", "cycle_", "._", "objects_", "._", "filter_", "(_", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", ")_", "._", "And", "Return_", "(_", "lc", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "lc", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "lifecycle", "_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "._", "filter_", "(_", "lifecycle", "_", "=_", "lifecycle", "_", ")_", "._", "And", "Return_", "(_", "t", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "timing_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "name_", "=_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "start", "\\u", "raw_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "end", "\\u", "raw_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timing_", "._", "diff_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "names_", "=_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "timings", "\\u", "for", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "INSTANCE", "\\u", "ID", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "event", "\\u", "names_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", "[_", "0_", "]_", ",_", "[_", "'?'_", ",_", "'", "Event", "'_", ",_", "'", "Time", " ", "(", "secs", ")'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "event", "\\u", "names_", "[_", "1_", "]_", ",_", "[_", "'.'_", ",_", "'", "name", "'_", ",_", "'", "0d", " ", "00", ":", "00", ":", "20", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "deployments", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "name_", "=_", "'", "dep", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "2_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "2_", "._", "id_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "2_", "._", "name_", "=_", "'", "dep", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployments", "_", "=_", "[_", "deploy", "ment", "1_", ",_", "deploy", "ment", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "deployments", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "deployments", "_", "(_", ")_", "._", "And", "Return_", "(_", "deployments", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "deployments", "_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "'#'_", ",_", "'", "Name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "1_", ",_", "'", "dep", "1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "2_", "]_", ",_", "[_", "2_", ",_", "'", "dep", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "events", "\\u", "of", "\\u", "a", "\\u", "single", "\\u", "service_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "service", "'_", ":_", "'", "nova", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "1_", "=_", "{_", "'", "event", "'_", ":_", "'", "some", ".", "event", ".1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "2_", "=_", "{_", "'", "event", "'_", ":_", "'", "some", ".", "event", ".2", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events_", "=_", "[_", "event", "1_", ",_", "event", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "event", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", "service_", "=_", "'", "nova", "'_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "events_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "'", "Event", " ", "Name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "'", "some", ".", "event", ".1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "2_", "]_", ",_", "[_", "'", "some", ".", "event", ".2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "events", "\\u", "of", "\\u", "all", "\\u", "services_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "service", "'_", ":_", "'", "all", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "1_", "=_", "{_", "'", "event", "'_", ":_", "'", "some", ".", "event", ".1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "2_", "=_", "{_", "'", "event", "'_", ":_", "'", "some", ".", "event", ".2", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events_", "=_", "[_", "event", "1_", ",_", "event", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "event", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", "'", "nova", "'_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", "'", "gla", "nce", "'_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", "'", "gener", "ic", "'_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "events_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "'", "Event", " ", "Name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "'", "some", ".", "event", ".1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "2_", "]_", ",_", "[_", "'", "some", ".", "event", ".2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "hosts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "service", "'_", ":_", "'", "service", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "1_", "=_", "{_", "'", "host", "'_", ":_", "'", "www", ".", "demo", ".", "com", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "2_", "=_", "{_", "'", "host", "'_", ":_", "'", "www", ".", "example", ".", "com", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "[_", "host", "1_", ",_", "host", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "host", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "host", "\\u", "names_", "(_", "'", "service", "'_", ")_", "._", "And", "Return_", "(_", "hosts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "hosts_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "'", "Host", " ", "Name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "'", "www", ".", "demo", ".", "com", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "2_", "]_", ",_", "[_", "'", "www", ".", "example", ".", "com", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "uuid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "result_", "=_", "[_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\"", "Task", "'\"_", "]_", ",_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "uuid", "'_", ":_", "INSTANCE", "\\u", "ID", "\\u", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "filter_", "(_", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "raw_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "search", "\\u", "results_", "(_", "[_", "]_", ",_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ",_", "'", " ", "'_", ")_", "._", "And", "Return_", "(_", "search", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\"", "Task", "'\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime_", "=_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "str_", "(_", "datetime_", ")_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\"", "test", ".", "start", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "uuid", "\\u", "whe", "n", "\\u", "filters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "result_", "=_", "[_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\"", "Task", "'\"_", "]_", ",_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "uuid", "'_", ":_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "\\u", "min", "'_", ":_", "'", "1.1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "\\u", "max", "'_", ":_", "'", "2.1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "filter_", "(_", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whe", "n", "\\u\\u", "gte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "1.1", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whe", "n", "\\u\\u", "lte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "2.1", "'_", ")_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "raw_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "search", "\\u", "results_", "(_", "[_", "]_", ",_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ",_", "'", " ", "'_", ")_", "._", "And", "Return_", "(_", "search", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\"", "Task", "'\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime_", "=_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "str_", "(_", "datetime_", ")_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\"", "test", ".", "start", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "uuid", "\\u", "for", "\\u", "glance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "result_", "=_", "[_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Status", "\"_", "]_", ",_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "state", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "uuid", "'_", ":_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "'", "service", "'_", ":_", "'", "gla", "nce", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Glance", "Ra", "w", "Data_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "filter_", "(_", "uuid_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "raw_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "search", "\\u", "results_", "(_", "[_", "]_", ",_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ",_", "'", " ", "'_", ")_", "._", "And", "Return_", "(_", "search", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Status", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime_", "=_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "str_", "(_", "datetime_", ")_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\"", "test", ".", "start", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "example", ".", "com", "\"_", ",_", "\"", "state", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "uuid", "\\u", "for", "\\u", "gla", "nce", "\\u", "whe", "n", "\\u", "filters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "result_", "=_", "[_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Status", "\"_", "]_", ",_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "state", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "uuid", "'_", ":_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "\\u", "min", "'_", ":_", "'", "1.1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "\\u", "max", "'_", ":_", "'", "2.1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "'_", ":_", "'", "gla", "nce", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Glance", "Ra", "w", "Data_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "filter_", "(_", "uuid_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whe", "n", "\\u\\u", "gte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "1.1", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whe", "n", "\\u\\u", "lte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "2.1", "'_", ")_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "raw_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "search", "\\u", "results_", "(_", "[_", "]_", ",_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ",_", "'", " ", "'_", ")_", "._", "And", "Return_", "(_", "search", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Status", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime_", "=_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "str_", "(_", "datetime_", ")_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\"", "test", ".", "start", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "example", ".", "com", "\"_", ",_", "\"", "state", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "uuid", "\\u", "bad", "\\u", "uuid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "uuid", "'_", ":_", "\"", "ob", "vio", "usl", "yb", "ad", "uuid", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp", "\\u", "json_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "resp", "\\u", "json_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp", "\\u", "json_", "[_", "0_", "]_", ",_", "[_", "'", "Error", "'_", ",_", "'", "Messag", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "'", "ob", "vio", "usl", "yb", "ad", "uuid", " ", "is", " ", "not", " ", "uuid", "-", "like", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp", "\\u", "json_", "[_", "1_", "]_", ",_", "[_", "'", "Ba", "d", " ", "Request", "'_", ",_", "msg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "timings", "\\u", "uuid", "\\u", "bad", "\\u", "uuid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "uuid", "'_", ":_", "\"", "ob", "vio", "usl", "yb", "ad", "uuid", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "timings", "\\u", "uuid_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp", "\\u", "json_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "resp", "\\u", "json_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp", "\\u", "json_", "[_", "0_", "]_", ",_", "[_", "'", "Error", "'_", ",_", "'", "Messag", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "'", "ob", "vio", "usl", "yb", "ad", "uuid", " ", "is", " ", "not", " ", "uuid", "-", "like", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp", "\\u", "json_", "[_", "1_", "]_", ",_", "[_", "'", "Ba", "d", " ", "Request", "'_", ",_", "msg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "timings", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "name", "'_", ":_", "'", "test", ".", "event", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "name_", "=_", "'", "test", ".", "event", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "diff", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "diff_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "diff_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "tim", "ing", "1_", ",_", "tim", "ing", "2_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "timings", "_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "[_", "\"", "test", ".", "event", "\"_", ",_", "\"", "Time", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "'", "0d", " ", "00", ":", "00", ":", "10", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "2_", "]_", ",_", "[_", "INSTANCE", "\\u", "ID", "\\u", "2_", ",_", "'", "0d", " ", "00", ":", "00", ":", "20", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "timings", "\\u", "end", "\\u", "whe", "n", "\\u", "min_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "name", "'_", ":_", "'", "test", ".", "event", "'_", ",_", "'", "end", "\\u", "whe", "n", "\\u", "min", "'_", ":_", "'", "1.1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "name_", "=_", "'", "test", ".", "event", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "whe", "n", "\\u\\u", "gte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "1.1", "'_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "diff", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "diff_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "diff_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "tim", "ing", "1_", ",_", "tim", "ing", "2_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "timings", "_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "[_", "\"", "test", ".", "event", "\"_", ",_", "\"", "Time", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "'", "0d", " ", "00", ":", "00", ":", "10", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "2_", "]_", ",_", "[_", "INSTANCE", "\\u", "ID", "\\u", "2_", ",_", "'", "0d", " ", "00", ":", "00", ":", "20", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "timings", "\\u", "end", "\\u", "whe", "n", "\\u", "max_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "name", "'_", ":_", "'", "test", ".", "event", "'_", ",_", "'", "end", "\\u", "whe", "n", "\\u", "max", "'_", ":_", "'", "1.1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "name_", "=_", "'", "test", ".", "event", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "whe", "n", "\\u\\u", "lte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "1.1", "'_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "diff", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "diff_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "diff_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "tim", "ing", "1_", ",_", "tim", "ing", "2_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "timings", "_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "[_", "\"", "test", ".", "event", "\"_", ",_", "\"", "Time", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "'", "0d", " ", "00", ":", "00", ":", "10", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "2_", "]_", ",_", "[_", "INSTANCE", "\\u", "ID", "\\u", "2_", ",_", "'", "0d", " ", "00", ":", "00", ":", "20", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "timings", "\\u", "end", "\\u", "whe", "n", "\\u", "max", "\\u", "whe", "n", "\\u", "min_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "name", "'_", ":_", "'", "test", ".", "event", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "whe", "n", "\\u", "min", "'_", ":_", "'", "1.1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "whe", "n", "\\u", "max", "'_", ":_", "'", "2.1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "name_", "=_", "'", "test", ".", "event", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "whe", "n", "\\u\\u", "gte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "1.1", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "whe", "n", "\\u\\u", "lte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "2.1", "'_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "diff", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "diff_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "diff_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "tim", "ing", "1_", ",_", "tim", "ing", "2_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "timings", "_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "[_", "\"", "test", ".", "event", "\"_", ",_", "\"", "Time", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "'", "0d", " ", "00", ":", "00", ":", "10", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "2_", "]_", ",_", "[_", "INSTANCE", "\\u", "ID", "\\u", "2_", ",_", "'", "0d", " ", "00", ":", "00", ":", "20", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "event", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events_", "=_", "[_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "start", "'_", "}_", ",_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "end", "'_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "name", "'_", ":_", "'", "test", ".", "event", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Tim", "ing_", "._", "objects_", "._", "filter_", "(_", "name_", "=_", "'", "test", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "diff", "\\u\\u", "lt_", "=_", "0_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "1_", "._", "diff_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tim", "ing", "2_", "._", "diff_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "len\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "tim", "ing", "1_", ",_", "tim", "ing", "2_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "summary_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "\"", "Event", "\"_", ",_", "\"", "N", "\"_", ",_", "\"", "Min", "\"_", ",_", "\"", "Max", "\"_", ",_", "\"", "Av", "g", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "[_", "u", "'", "test", "'_", ",_", "2_", ",_", "u", "'", "0d", " ", "00", ":", "00", ":", "10.", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "0d", " ", "00", ":", "00", ":", "20.", "0", "'_", ",_", "u", "'", "0d", " ", "00", ":", "00", ":", "15", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "request", "\\u", "id", "'_", ":_", "REQUEST", "\\u", "ID", "\\u", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "request", "\\u", "id_", "=_", "REQUEST", "\\u", "ID", "\\u", "1_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "raw_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "request_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Task", "'\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "1_", "]_", ",_", "u", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "2_", "]_", ",_", "str_", "(_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "3_", "]_", ",_", "u", "'", "deploy", "ment", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "4_", "]_", ",_", "u", "'", "test", ".", "start", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "5_", "]_", ",_", "u", "'", "example", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "6_", "]_", ",_", "u", "'", "active", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "7_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "8_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "request", "\\u", "whe", "n", "\\u", "filters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "request", "\\u", "id", "'_", ":_", "REQUEST", "\\u", "ID", "\\u", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "\\u", "min", "'_", ":_", "'", "1.1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "\\u", "max", "'_", ":_", "'", "2.1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "whe", "n", "\\u", "min_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "1.1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "whe", "n", "\\u", "max_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "2.1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "request", "\\u", "id_", "=_", "REQUEST", "\\u", "ID", "\\u", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whe", "n", "\\u\\u", "gte_", "=_", "whe", "n", "\\u", "min_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whe", "n", "\\u\\u", "lte_", "=_", "whe", "n", "\\u", "max_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "raw_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "request_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Task", "'\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "1_", "]_", ",_", "u", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "2_", "]_", ",_", "str_", "(_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "3_", "]_", ",_", "u", "'", "deploy", "ment", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "4_", "]_", ",_", "u", "'", "test", ".", "start", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "5_", "]_", ",_", "u", "'", "example", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "6_", "]_", ",_", "u", "'", "active", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "7_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "8_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "request", "\\u", "bad", "\\u", "request", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "request", "\\u", "id", "'_", ":_", "\"", "ob", "vio", "usl", "yb", "ad", "uuid", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "request_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp", "\\u", "json_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "resp", "\\u", "json_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp", "\\u", "json_", "[_", "0_", "]_", ",_", "[_", "'", "Error", "'_", ",_", "'", "Messag", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "'", "ob", "vio", "usl", "yb", "ad", "uuid", " ", "is", " ", "not", " ", "request", "-", "id", "-", "like", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp", "\\u", "json_", "[_", "1_", "]_", ",_", "[_", "'", "Ba", "d", " ", "Request", "'_", ",_", "msg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "assert", "\\u", "on", "\\u", "show", "\\u", "nova_", "(_", "self_", ",_", "json", "\\u", "resp_", ",_", "raw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "json", "\\u", "resp_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "values_", ")_", ",_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "0_", "]_", ",_", "[_", "\"", "Key", "\"_", ",_", "\"", "Value", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "1_", "]_", ",_", "[_", "\"#\"_", ",_", "raw_", "._", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "2_", "]_", ",_", "[_", "\"", "Whe", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "3_", "]_", ",_", "[_", "\"", "Deployment", "\"_", ",_", "raw_", "._", "deployment_", "._", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "4_", "]_", ",_", "[_", "\"", "Cate", "gory", "\"_", ",_", "raw_", "._", "routin", "g", "\\u", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "5_", "]_", ",_", "[_", "\"", "Publish", "er", "\"_", ",_", "raw_", "._", "publisher_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "6_", "]_", ",_", "[_", "\"", "State", "\"_", ",_", "raw_", "._", "state_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "7_", "]_", ",_", "[_", "\"", "Event", "\"_", ",_", "raw_", "._", "event_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "8_", "]_", ",_", "[_", "\"", "Service", "\"_", ",_", "raw_", "._", "service_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "9_", "]_", ",_", "[_", "\"", "Host", "\"_", ",_", "raw_", "._", "host_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "10_", "]_", ",_", "[_", "\"", "UU", "ID", "\"_", ",_", "raw_", "._", "instance_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "11_", "]_", ",_", "[_", "\"", "Re", "q", " ", "ID", "\"_", ",_", "raw_", "._", "request", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "assert", "\\u", "on", "\\u", "show", "\\u", "glance_", "(_", "self_", ",_", "json", "\\u", "resp_", ",_", "raw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "json", "\\u", "resp_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "values_", ")_", ",_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "0_", "]_", ",_", "[_", "\"", "Key", "\"_", ",_", "\"", "Value", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "1_", "]_", ",_", "[_", "\"#\"_", ",_", "raw_", "._", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "2_", "]_", ",_", "[_", "\"", "Whe", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "3_", "]_", ",_", "[_", "\"", "Deployment", "\"_", ",_", "raw_", "._", "deployment_", "._", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "4_", "]_", ",_", "[_", "\"", "Cate", "gory", "\"_", ",_", "raw_", "._", "routin", "g", "\\u", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "5_", "]_", ",_", "[_", "\"", "Publish", "er", "\"_", ",_", "raw_", "._", "publisher_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "6_", "]_", ",_", "[_", "\"", "Status", "\"_", ",_", "raw_", "._", "status_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "7_", "]_", ",_", "[_", "\"", "Event", "\"_", ",_", "raw_", "._", "event_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "8_", "]_", ",_", "[_", "\"", "Service", "\"_", ",_", "raw_", "._", "service_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "9_", "]_", ",_", "[_", "\"", "Host", "\"_", ",_", "raw_", "._", "host_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "10_", "]_", ",_", "[_", "\"", "UU", "ID", "\"_", ",_", "raw_", "._", "uuid_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "values_", "[_", "11_", "]_", ",_", "[_", "\"", "Re", "q", " ", "ID", "\"_", ",_", "raw_", "._", "request", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "show_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "1_", ")_", "._", "And", "Return_", "(_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "show_", "(_", "fake", "\\u", "request_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "on", "\\u", "show", "\\u", "nova_", "(_", "json", "\\u", "resp_", ",_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "show", "\\u", "for", "\\u", "gla", "nce", "\\u", "rawdata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "service", "'_", ":_", "'", "gla", "nce", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Glance", "Ra", "w", "Data_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "1_", ")_", "._", "And", "Return_", "(_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "show_", "(_", "fake", "\\u", "request_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "on", "\\u", "show", "\\u", "glance_", "(_", "json", "\\u", "resp_", ",_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "show", "\\u", "for", "\\u", "gener", "ic", "\\u", "rawdata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "service", "'_", ":_", "'", "gener", "ic", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Gene", "ric", "Ra", "w", "Data_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "1_", ")_", "._", "And", "Return_", "(_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "show_", "(_", "fake", "\\u", "request_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "on", "\\u", "show", "\\u", "nova_", "(_", "json", "\\u", "resp_", ",_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "show", "\\u", "shou", "ld", "\\u", "return", "\\u", "empty", "\\u", "result", "\\u", "on", "\\u", "object\\u", "not", "\\u", "found", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "1_", ")_", "._", "And", "Return_", "(_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "show_", "(_", "fake", "\\u", "request_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "on", "\\u", "show", "\\u", "nova_", "(_", "json", "\\u", "resp_", ",_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "watch", "\\u", "for", "\\u", "glance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "service", "'_", ":_", "'", "gla", "nce", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "deployments", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "name_", "=_", "'", "dep", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployments", "_", "=_", "[_", "deploy", "ment", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "deployments", "_", "(_", ")_", "._", "And", "Return_", "(_", "deployments", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "event", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events_", "=_", "[_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "start", "'_", "}_", ",_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "end", "'_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Glance", "Ra", "w", "Data_", "._", "objects_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "whe", "n", "\\u\\u", "gt_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "whe", "n", "\\u\\u", "lte_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "watch_", "(_", "fake", "\\u", "request_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "10_", ",_", "1_", ",_", "15_", ",_", "20_", ",_", "10_", ",_", "36_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "u", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "str_", "=_", "\"%", "s", " ", "%", "s", "\"_", "%_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ",_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "time", "\\u", "str_", ",_", "\"%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", ".", "%", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "4_", "]_", ",_", "u", "'", "dep", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "5_", "]_", ",_", "u", "'", "test", ".", "start", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "6_", "]_", ",_", "u", "'%", "s", "'_", "%_", "'", "uuid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "watch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "deployments", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "name_", "=_", "'", "dep", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployments", "_", "=_", "[_", "deploy", "ment", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "deployments", "_", "(_", ")_", "._", "And", "Return_", "(_", "deployments", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "event", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events_", "=_", "[_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "start", "'_", "}_", ",_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "end", "'_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'\\u", "model", "\\u", "factor", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "\\u", "model", "\\u", "factory_", "(_", "'", "nova", "'_", ")_", "._", "And", "Return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "whe", "n", "\\u\\u", "gt_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "whe", "n", "\\u\\u", "lte_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "watch_", "(_", "fake", "\\u", "request_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "10_", ",_", "1_", ",_", "15_", ",_", "20_", ",_", "10_", ",_", "36_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "u", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "str_", "=_", "\"%", "s", " ", "%", "s", "\"_", "%_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ",_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "time", "\\u", "str_", ",_", "\"%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", ".", "%", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "4_", "]_", ",_", "u", "'", "dep", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "5_", "]_", ",_", "u", "'", "test", ".", "start", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "6_", "]_", ",_", "u", "'%", "s", "'_", "%_", "'", "uuid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "watch", "\\u", "with", "\\u", "deployment_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "deploy", "ment", "'_", ":_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "deployments", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "name_", "=_", "'", "dep", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployments", "_", "=_", "[_", "deploy", "ment", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "deployments", "_", "(_", ")_", "._", "And", "Return_", "(_", "deployments", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "event", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events_", "=_", "[_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "start", "'_", "}_", ",_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "end", "'_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'\\u", "model", "\\u", "factor", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "\\u", "model", "\\u", "factory_", "(_", "'", "nova", "'_", ")_", "._", "And", "Return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "._", "filter_", "(_", "deployment_", "=_", "1_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "whe", "n", "\\u\\u", "gt_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "whe", "n", "\\u\\u", "lte_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "watch_", "(_", "fake", "\\u", "request_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "10_", ",_", "1_", ",_", "15_", ",_", "20_", ",_", "10_", ",_", "36_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "u", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "str_", "=_", "\"%", "s", " ", "%", "s", "\"_", "%_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ",_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "time", "\\u", "str_", ",_", "\"%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", ".", "%", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "4_", "]_", ",_", "u", "'", "dep", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "5_", "]_", ",_", "u", "'", "test", ".", "start", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "6_", "]_", ",_", "u", "'%", "s", "'_", "%_", "'", "uuid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "watch", "\\u", "with", "\\u", "event", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "event", "\\u", "name", "'_", ":_", "'", "test", ".", "start", "'_", ",_", "'", "service", "'_", ":_", "'", "nova", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "deployments", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "1_", "._", "name_", "=_", "'", "dep", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployments", "_", "=_", "[_", "deploy", "ment", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "deployments", "_", "(_", ")_", "._", "And", "Return_", "(_", "deployments", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "get", "\\u", "event", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events_", "=_", "[_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "start", "'_", "}_", ",_", "{_", "'", "event", "'_", ":_", "'", "test", ".", "end", "'_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "get", "\\u", "event", "\\u", "names_", "(_", ")_", "._", "And", "Return_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "event_", "=_", "'", "test", ".", "start", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "whe", "n", "\\u\\u", "gt_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "whe", "n", "\\u\\u", "lte_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "watch_", "(_", "fake", "\\u", "request_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "10_", ",_", "1_", ",_", "15_", ",_", "20_", ",_", "10_", ",_", "36_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "u", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "str_", "=_", "\"%", "s", " ", "%", "s", "\"_", "%_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ",_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "time", "\\u", "str_", ",_", "\"%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", ".", "%", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "4_", "]_", ",_", "u", "'", "dep", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "5_", "]_", ",_", "u", "'", "test", ".", "start", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "6_", "]_", ",_", "u", "'%", "s", "'_", "%_", "'", "uuid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "kp", "i_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Request", "Tracker_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "last", "\\u", "timing_", "=_", "None_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "start", "\\u\\u", "lt_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "duration", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "._", "event_", "=_", "'", "test", ".", "end", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployment_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployment_", "._", "name_", "=_", "'", "dep", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "._", "deployment_", "=_", "deployment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "duration_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "tracker_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "kp", "i_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "resp_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "json_", "._", "loads_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "body_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "body_", "[_", "0_", "]_", ",_", "[_", "\"", "Event", "\"_", ",_", "\"", "Time", "\"_", ",_", "\"", "UU", "ID", "\"_", ",_", "\"", "Deployment", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "u", "'%", "s", "'_", "%_", "stack", "y", "\\u", "server_", "._", "sec", "\\u", "to", "\\u", "time_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "body_", "[_", "1_", "]_", ",_", "[_", "u", "'", "test", "'_", ",_", "time_", ",_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "u", "'", "dep", "1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "kp", "i", "\\u", "with", "\\u", "tenant_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "tenant_", "=_", "'", "5555", "5", "'_", ")_", "._", "And", "Return_", "(_", "objects_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "objects_", "._", "count_", "(_", ")_", "._", "And", "Return_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Request", "Tracker_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "last", "\\u", "timing_", "=_", "None_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "start", "\\u\\u", "lt_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "duration", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "._", "event_", "=_", "'", "test", ".", "end", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "._", "tenant_", "=_", "'", "5555", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployment_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployment_", "._", "name_", "=_", "'", "dep", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "._", "deployment_", "=_", "deployment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "duration_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "tracker_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "kp", "i_", "(_", "fake", "\\u", "request_", ",_", "'", "5555", "5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "resp_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "json_", "._", "loads_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "body_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "body_", "[_", "0_", "]_", ",_", "[_", "\"", "Event", "\"_", ",_", "\"", "Time", "\"_", ",_", "\"", "UU", "ID", "\"_", ",_", "\"", "Deployment", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "u", "'%", "s", "'_", "%_", "stack", "y", "\\u", "server_", "._", "sec", "\\u", "to", "\\u", "time_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "body_", "[_", "1_", "]_", ",_", "[_", "u", "'", "test", "'_", ",_", "time_", ",_", "INSTANCE", "\\u", "ID", "\\u", "1_", ",_", "u", "'", "dep", "1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "kp", "i", "\\u", "with", "\\u", "tenan", "t", "\\u", "no", "\\u", "match_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "tenant_", "=_", "'", "5555", "5", "'_", ")_", "._", "And", "Return_", "(_", "objects_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "objects_", "._", "count_", "(_", ")_", "._", "And", "Return_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Request", "Tracker_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "last", "\\u", "timing_", "=_", "None_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "exclude_", "(_", "start", "\\u\\u", "lt_", "=_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "duration", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "._", "event_", "=_", "'", "test", ".", "end", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "._", "tenant_", "=_", "'", "5555", "6", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployment_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deployment_", "._", "name_", "=_", "'", "dep", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "last", "\\u", "timing_", "._", "end", "\\u", "raw_", "._", "deployment_", "=_", "deployment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "lifecycle", "_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "lifecycle", "_", "._", "instance_", "=_", "INSTANCE", "\\u", "ID", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tracker_", "._", "duration_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "._", "And", "Return_", "(_", "[_", "tracker_", "]_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "kp", "i_", "(_", "fake", "\\u", "request_", ",_", "'", "5555", "5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "resp_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "json_", "._", "loads_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "body_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "do", "\\u", "kp", "i", "\\u", "tenan", "t", "\\u", "doesnt", "\\u", "exist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "objects_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "tenant_", "=_", "'", "5555", "5", "'_", ")_", "._", "And", "Return_", "(_", "objects_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "objects_", "._", "count_", "(_", ")_", "._", "And", "Return_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "kp", "i_", "(_", "fake", "\\u", "request_", ",_", "'", "5555", "5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "resp_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "json_", "._", "loads_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "body_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "body_", "[_", "0_", "]_", ",_", "[_", "'", "Error", "'_", ",_", "'", "Messag", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "'", "Cou", "ld", " ", "not", " ", "find", " ", "raws", " ", "for", " ", "tenan", "t", " ", "5555", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "body_", "[_", "1_", "]_", ",_", "[_", "'", "Not", " ", "Foun", "d", "'_", ",_", "msg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "factor", "y", "\\u", "for", "\\u", "nova_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mox_", "._", "Unse", "t", "Stu", "bs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nova", "\\u", "model_", "=_", "stack", "y", "\\u", "server_", "._", "\\u", "model", "\\u", "factory_", "(_", "'", "nova", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "nova", "\\u", "model_", "._", "model_", ",_", "models_", "._", "Ra", "w", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "factor", "y", "\\u", "for", "\\u", "nova_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mox_", "._", "Unse", "t", "Stu", "bs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nova", "\\u", "model_", "=_", "stack", "y", "\\u", "server_", "._", "\\u", "model", "\\u", "factory_", "(_", "'", "gla", "nce", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "nova", "\\u", "model_", "._", "model_", ",_", "models_", "._", "Glance", "Ra", "w", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "factor", "y", "\\u", "for", "\\u", "nova_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mox_", "._", "Unse", "t", "Stu", "bs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nova", "\\u", "model_", "=_", "stack", "y", "\\u", "server_", "._", "\\u", "model", "\\u", "factory_", "(_", "'", "gener", "ic", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "nova", "\\u", "model_", "._", "model_", ",_", "models_", "._", "Gene", "ric", "Ra", "w", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "assert", "\\u", "on", "\\u", "search", "\\u", "nova_", "(_", "self_", ",_", "json", "\\u", "resp_", ",_", "raw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "json", "\\u", "resp_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "json", "\\u", "resp_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "values_", ")_", ",_", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "title_", "[_", "0_", "]_", ",_", "values_", "[_", "0_", "]_", "]_", ",_", "[_", "\"#\"_", ",_", "raw_", "._", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "title_", "[_", "1_", "]_", ",_", "values_", "[_", "1_", "]_", "]_", ",_", "[_", "'?'_", ",_", "'", " ", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "title_", "[_", "2_", "]_", ",_", "values_", "[_", "2_", "]_", "]_", ",_", "[_", "\"", "Whe", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "dt_", "._", "dt", "\\u", "from", "\\u", "decimal_", "(_", "raw_", "._", "when_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "title_", "[_", "3_", "]_", ",_", "values_", "[_", "3_", "]_", "]_", ",_", "[_", "\"", "Deployment", "\"_", ",_", "raw_", "._", "deployment_", "._", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "title_", "[_", "4_", "]_", ",_", "values_", "[_", "4_", "]_", "]_", ",_", "[_", "\"", "Event", "\"_", ",_", "raw_", "._", "event_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "title_", "[_", "5_", "]_", ",_", "values_", "[_", "5_", "]_", "]_", ",_", "[_", "\"", "Host", "\"_", ",_", "raw_", "._", "host_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "title_", "[_", "6_", "]_", ",_", "values_", "[_", "6_", "]_", "]_", ",_", "[_", "\"", "State", "\"_", ",_", "raw_", "._", "state_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "title_", "[_", "7_", "]_", ",_", "values_", "[_", "7_", "]_", "]_", ",_", "[_", "\"", "State", "'\"_", ",_", "raw_", "._", "old", "\\u", "state_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "search", "\\u", "by", "\\u", "field", "\\u", "for", "\\u", "nova_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "result_", "=_", "[_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\"", "Task", "'\"_", "]_", ",_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "field", "'_", ":_", "'", "tenan", "t", "'_", ",_", "'", "value", "'_", ":_", "'", "tenan", "t", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "tenant_", "=_", "'", "tenan", "t", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'-", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "[_", "raw_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "search", "\\u", "results_", "(_", "[_", "]_", ",_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ",_", "'", " ", "'_", ")_", "._", "And", "Return_", "(_", "search", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "search_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "on", "\\u", "search", "\\u", "nova_", "(_", "json", "\\u", "resp_", ",_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "search", "\\u", "by", "\\u", "field", "\\u", "for", "\\u", "nova", "\\u", "whe", "n", "\\u", "filters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "result_", "=_", "[_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\"", "Task", "'\"_", "]_", ",_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "field", "'_", ":_", "'", "tenan", "t", "'_", ",_", "'", "value", "'_", ":_", "'", "tenan", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "\\u", "min", "'_", ":_", "'", "1.1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "\\u", "max", "'_", ":_", "'", "2.1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "tenant_", "=_", "'", "tenan", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whe", "n", "\\u\\u", "gte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "1.1", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whe", "n", "\\u\\u", "lte_", "=_", "decimal_", "._", "Decimal_", "(_", "'", "2.1", "'_", ")_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'-", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "[_", "raw_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw_", "._", "search", "\\u", "results_", "(_", "[_", "]_", ",_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ",_", "'", " ", "'_", ")_", "._", "And", "Return_", "(_", "search", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "search_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "on", "\\u", "search", "\\u", "nova_", "(_", "json", "\\u", "resp_", ",_", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "search", "\\u", "by", "\\u", "field", "\\u", "for", "\\u", "nova", "\\u", "with", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "result_", "=_", "[_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\"", "Task", "'\"_", "]_", ",_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "\\u", "result", "\\u", "2_", "=_", "[_", "[_", "\"#\"_", ",_", "\"?\"_", ",_", "\"", "Whe", "n", "\"_", ",_", "\"", "Deployment", "\"_", ",_", "\"", "Event", "\"_", ",_", "\"", "Host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "State", "\"_", ",_", "\"", "State", "'\"_", ",_", "\"", "Task", "'\"_", "]_", ",_", "[_", "1_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", ",_", "[_", "2_", ",_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "2013", "-0", "7", "-1", "7", " ", "10", ":", "16", ":", "10.", "717", "219", "\"_", ",_", "\"", "deploy", "ment", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "test", ".", "start", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "\"", "active", "\"_", ",_", "None_", ",_", "None_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "field", "'_", ":_", "'", "tenan", "t", "'_", ",_", "'", "value", "'_", ":_", "'", "tenan", "t", "'_", ",_", "'", "limit", "'_", ":_", "'", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "'_", ":_", "'", "nova", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "1_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "2_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "3_", "=_", "self_", "._", "\\u", "create", "\\u", "raw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "2_", "._", "id_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "3_", "._", "id_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "tenant_", "=_", "'", "tenan", "t", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'-", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "[_", "raw", "1_", ",_", "raw", "2_", ",_", "raw", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "1_", "._", "search", "\\u", "results_", "(_", "[_", "]_", ",_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ",_", "'", " ", "'_", ")_", "._", "And", "Return_", "(_", "search", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "2_", "._", "search", "\\u", "results_", "(_", "search", "\\u", "result_", ",_", "mox_", "._", "Ignor", "e", "Arg_", "(_", ")_", ",_", "'", " ", "'_", ")_", "._", "And", "Return_", "(_", "search", "\\u", "result", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "search_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "json", "\\u", "resp_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "on", "\\u", "search", "\\u", "nova_", "(_", "json", "\\u", "resp_", ",_", "raw", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "search", "\\u", "with", "\\u", "wrong", "\\u", "field", "\\u", "value", "\\u", "return", "s", "\\u", "400", "\\u", "error", "\\u", "and", "\\u", "a", "\\u", "message_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "field", "'_", ":_", "'", "tenan", "t", "'_", ",_", "'", "value", "'_", ":_", "'", "tenan", "t", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "models_", "._", "Ra", "w", "Data_", "._", "objects_", "._", "filter_", "(_", "tenant_", "=_", "'", "tenan", "t", "'_", ")_", "._", "And", "Raise_", "(_", "Field", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "stack", "y", "\\u", "server_", "._", "search_", "(_", "fake", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "json", "\\u", "resp_", "[_", "0_", "]_", ",_", "[_", "u", "'", "Error", "'_", ",_", "u", "'", "Messag", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "json", "\\u", "resp_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "u", "'", "Ba", "d", " ", "Request", "'_", ",_", "u", "\"", "The", " ", "request", "ed", " ", "field", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", " ", "'", "tenan", "t", "'", " ", "doe", "s", " ", "not", " ", "exist", " ", "for", " ", "the", " ", "correspond", "ing", " ", "object", ".\\\\", "n", "Not", "e", ":", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "u", "\"", "The", " ", "field", " ", "names", " ", "of", " ", "databa", "se", " ", "are", " ", "case", "-", "sensi", "tiv", "e", ".\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "search", "\\u", "default", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "{_", "'", "field", "'_", ":_", "'", "value", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "._", "filter_", "(_", "**_", "filters_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "results_", "=_", "stack", "y", "\\u", "server_", "._", "model", "\\u", "search_", "(_", "fake", "\\u", "request_", ",_", "fake", "\\u", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "actual", "\\u", "results_", ",_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "search", "\\u", "default", "\\u", "limit", "\\u", "with", "\\u", "offset_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "offset", "'_", ":_", "'", "1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "{_", "'", "field", "'_", ":_", "'", "value", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "._", "filter_", "(_", "**_", "filters_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "1_", ":_", "51_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "results_", "=_", "stack", "y", "\\u", "server_", "._", "model", "\\u", "search_", "(_", "fake", "\\u", "request_", ",_", "fake", "\\u", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "actual", "\\u", "results_", ",_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "search", "\\u", "default", "\\u", "with", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "limit", "'_", ":_", "'", "1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "{_", "'", "field", "'_", ":_", "'", "value", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "._", "filter_", "(_", "**_", "filters_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "1_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "results_", "=_", "stack", "y", "\\u", "server_", "._", "model", "\\u", "search_", "(_", "fake", "\\u", "request_", ",_", "fake", "\\u", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "actual", "\\u", "results_", ",_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "search", "\\u", "default", "\\u", "with", "\\u", "limit", "\\u", "and", "\\u", "offset_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "'", "limit", "'_", ":_", "'", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "offset", "'_", ":_", "'", "10", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "{_", "'", "field", "'_", ":_", "'", "value", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "._", "filter_", "(_", "**_", "filters_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "10_", ":_", "15_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "results_", "=_", "stack", "y", "\\u", "server_", "._", "model", "\\u", "search_", "(_", "fake", "\\u", "request_", ",_", "fake", "\\u", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "actual", "\\u", "results_", ",_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "search", "\\u", "related_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "{_", "'", "field", "'_", ":_", "'", "value", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "._", "select", "\\u", "related_", "(_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "filter_", "(_", "**_", "filters_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "results_", "=_", "stack", "y", "\\u", "server_", "._", "model", "\\u", "search_", "(_", "fake", "\\u", "request_", ",_", "fake", "\\u", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", ",_", "related_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "actual", "\\u", "results_", ",_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stack", "y", "Server", "Test", "Case_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "model", "\\u", "order", "\\u", "by_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "request_", "._", "GET_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "{_", "'", "field", "'_", ":_", "'", "value", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "\\u", "model_", "._", "filter_", "(_", "**_", "filters_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "order", "\\u", "by_", "(_", "'", "whe", "n", "'_", ")_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "None_", ":_", "50_", "]_", "._", "And", "Return_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "results_", "=_", "stack", "y", "\\u", "server_", "._", "model", "\\u", "search_", "(_", "fake", "\\u", "request_", ",_", "fake", "\\u", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", ",_", "order", "\\u", "by_", "=_", "'", "whe", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "actual", "\\u", "results_", ",_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "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_", "._", "mox_", "=_", "mox_", "._", "Mo", "x_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "=_", "models_", "._", "Js", "on", "Report_", "._", "objects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "._", "id_", "=_", "'", "597", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "._", "period", "\\u", "start_", "=_", "datetime_", "._", "datetime_", "(_", "2014_", ",_", "1_", ",_", "18_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "._", "period", "\\u", "end_", "=_", "datetime_", "._", "datetime_", "(_", "2014_", ",_", "1_", ",_", "19_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "._", "created_", "=_", "138", "856", "9200", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "._", "name_", "=_", "'", "nova", " ", "usage", " ", "audit", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "._", "version_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "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_", "._", "mox_", "._", "Unse", "t", "Stu", "bs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "report", "s", "\\u", "search", "\\u", "order", "\\u", "by", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "GET_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "nova", "\\u", "usage", "\\u", "audit", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "\\u", "start", "'_", ":_", "'", "2014", "-0", "1", "-0", "1", " ", "00", ":", "00", ":", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "\\u", "end", "'_", ":_", "'", "2014", "-0", "1", "-0", "2", " ", "00", ":", "00", ":", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "'_", ":_", "'", "2014", "-0", "1", "-0", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "\\u\\u", "exact", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "\\u", "start", "\\u\\u", "exact", "'_", ":_", "'", "2014", "-0", "1", "-0", "1", " ", "00", ":", "00", ":", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "\\u\\u", "exact", "'_", ":_", "'", "nova", "\\u", "usage", "\\u", "audit", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "\\u", "end", "\\u\\u", "exact", "'_", ":_", "'", "2014", "-0", "1", "-0", "2", " ", "00", ":", "00", ":", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u\\u", "lt", "'_", ":_", "decimal_", "._", "Decimal_", "(_", "'", "138", "862", "0800", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u\\u", "gt", "'_", ":_", "decimal_", "._", "Decimal_", "(_", "'", "138", "853", "440", "0", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "model", "\\u", "search", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "model", "\\u", "search_", "(_", "request_", ",_", "self_", "._", "model_", ",_", "filters_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "order", "\\u", "by_", "=_", "'-", "id", "'_", ")_", "._", "And", "Return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "result_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "json", "report", "s", "\\u", "search_", "(_", "request_", ")_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Id", "'_", ",_", "'", "Start", "'_", ",_", "'", "End", "'_", ",_", "'", "Creat", "ed", "'_", ",_", "'", "Name", "'_", ",_", "'", "Version", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "597", "5", "'_", ",_", "'", "2014", "-0", "1", "-1", "8", " ", "00", ":", "00", ":", "00", "'_", ",_", "'", "2014", "-0", "1", "-1", "9", " ", "00", ":", "00", ":", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "2014", "-0", "1", "-0", "1", " ", "09", ":", "40", ":", "00", "'_", ",_", "'", "nova", " ", "usage", " ", "audit", "'_", ",_", "4_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "ast_", "._", "literal", "\\u", "eval_", "(_", "actual", "\\u", "result_", ")_", ",_", "expected", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "report", "s", "\\u", "search", "\\u", "with", "\\u", "limit", "\\u", "offset_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "GET_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "\\u", "start", "'_", ":_", "'", "2014", "-0", "1", "-0", "1", " ", "09", ":", "40", ":", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "nova", "\\u", "usage", "\\u", "audit", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "limit", "'_", ":_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "offset", "'_", ":_", "5_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "\\u", "start", "\\u\\u", "exact", "'_", ":_", "'", "2014", "-0", "1", "-0", "1", " ", "09", ":", "40", ":", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "\\u\\u", "exact", "'_", ":_", "'", "nova", "\\u", "usage", "\\u", "audit", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "stack", "y", "\\u", "server_", ",_", "'", "model", "\\u", "search", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "y", "\\u", "server_", "._", "model", "\\u", "search_", "(_", "request_", ",_", "self_", "._", "model_", ",_", "filters_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "order", "\\u", "by_", "=_", "'-", "id", "'_", ")_", "._", "And", "Return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "self_", "._", "model", "\\u", "search", "\\u", "result_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "result_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "json", "report", "s", "\\u", "search_", "(_", "request_", ")_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "[_", "'", "Id", "'_", ",_", "'", "Start", "'_", ",_", "'", "End", "'_", ",_", "'", "Creat", "ed", "'_", ",_", "'", "Name", "'_", ",_", "'", "Version", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "597", "5", "'_", ",_", "'", "2014", "-0", "1", "-1", "8", " ", "00", ":", "00", ":", "00", "'_", ",_", "'", "2014", "-0", "1", "-1", "9", " ", "00", ":", "00", ":", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "2014", "-0", "1", "-0", "1", " ", "09", ":", "40", ":", "00", "'_", ",_", "'", "nova", " ", "usage", " ", "audit", "'_", ",_", "4_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "ast_", "._", "literal", "\\u", "eval_", "(_", "actual", "\\u", "result_", ")_", ",_", "expected", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "report", "s", "\\u", "search", "\\u", "with", "\\u", "invalid", "\\u", "fields_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "GET_", "=_", "{_", "'", "invalid", "\\u", "column", "\\u", "1", "'_", ":_", "'", "value", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invalid", "\\u", "column", "\\u", "2", "'_", ":_", "'", "value", "\\u", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "json", "'_", ":_", "'", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "\\u", "start", "'_", ":_", "'", "2014", "-0", "1", "-0", "1", " ", "00", ":", "00", ":", "00", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "result_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "json", "report", "s", "\\u", "search_", "(_", "request_", ")_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Error", "\"_", ",_", "\"", "Messag", "e", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Ba", "d", " ", "Request", "\"_", ",_", "\"", "The", " ", "request", "ed", " ", "fields", " ", "eit", "her", " ", "do", " ", "not", " ", "exist", " ", "for", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "correspond", "ing", " ", "object", " ", "or", " ", "are", " ", "not", " ", "searcha", "ble", ":", " ", "invalid", "\\u", "column", "\\u", "1", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "invalid", "\\u", "column", "\\u", "2", ",", " ", "json", ",", " ", "version", ".", " ", "Not", "e", ":", " ", "The", " ", "field", " ", "names", " ", "of", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "databa", "se", " ", "are", " ", "case", "-", "sensi", "tiv", "e", ".\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ast_", "._", "literal", "\\u", "eval_", "(_", "actual", "\\u", "result_", ")_", ",_", "expected", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "report", "s", "\\u", "search", "\\u", "with", "\\u", "invalid", "\\u", "period", "\\u", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "GET_", "=_", "{_", "'", "period", "\\u", "start", "'_", ":_", "'", "1234", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "result_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "json", "report", "s", "\\u", "search_", "(_", "request_", ")_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Error", "\"_", ",_", "\"", "Messag", "e", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Ba", "d", " ", "Request", "\"_", ",_", "\"'", "1234", "'", " ", "value", " ", "has", " ", "an", " ", "invalid", " ", "format", ".", " ", "It", " ", "must", " ", "be", " ", "in", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "YYY", "Y", "-", "MM", "-", "DD", " ", "HH", ":", "MM", "[:", "ss", "[.", "uu", "uu", "uu", "]]", "[", "TZ", "]", " ", "format", ".\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ast_", "._", "literal", "\\u", "eval_", "(_", "actual", "\\u", "result_", ")_", ",_", "expected", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "report", "s", "\\u", "search", "\\u", "with", "\\u", "invalid", "\\u", "period", "\\u", "end_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "GET_", "=_", "{_", "'", "period", "\\u", "end", "'_", ":_", "'", "1234", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "result_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "json", "report", "s", "\\u", "search_", "(_", "request_", ")_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Error", "\"_", ",_", "\"", "Messag", "e", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Ba", "d", " ", "Request", "\"_", ",_", "\"'", "1234", "'", " ", "value", " ", "has", " ", "an", " ", "invalid", " ", "format", ".", " ", "It", " ", "must", " ", "be", " ", "in", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "YYY", "Y", "-", "MM", "-", "DD", " ", "HH", ":", "MM", "[:", "ss", "[.", "uu", "uu", "uu", "]]", "[", "TZ", "]", " ", "format", ".\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ast_", "._", "literal", "\\u", "eval_", "(_", "actual", "\\u", "result_", ")_", ",_", "expected", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "report", "s", "\\u", "search", "\\u", "with", "\\u", "invalid", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "GET_", "=_", "{_", "'", "id", "'_", ":_", "'", "abc", "d", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "result_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "json", "report", "s", "\\u", "search_", "(_", "request_", ")_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Error", "\"_", ",_", "\"", "Messag", "e", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Ba", "d", " ", "Request", "\"_", ",_", "\"'", "abc", "d", "'", " ", "value", " ", "has", " ", "an", " ", "invalid", " ", "format", ".", " ", "It", " ", "must", " ", "be", " ", "in", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "integ", "er", " ", "format", ".\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ast_", "._", "literal", "\\u", "eval_", "(_", "actual", "\\u", "result_", ")_", ",_", "expected", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "report", "s", "\\u", "search", "\\u", "with", "\\u", "invalid", "\\u", "created", "\\u", "format_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "GET_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "'_", ":_", "'", "2014", "-0", "1", "-0", "1", " ", "00", ":", "00", ":", "00", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "result_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "json", "report", "s", "\\u", "search_", "(_", "request_", ")_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Error", "\"_", ",_", "\"", "Messag", "e", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Ba", "d", " ", "Request", "\"_", ",_", "\"'", "2014", "-0", "1", "-0", "1", " ", "00", ":", "00", ":", "00", "'", " ", "value", " ", "has", " ", "an", " ", "invalid", " ", "format", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "It", " ", "must", " ", "be", " ", "in", " ", "YYY", "Y", "-", "MM", "-", "DD", " ", "format", ".\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ast_", "._", "literal", "\\u", "eval_", "(_", "actual", "\\u", "result_", ")_", ",_", "expected", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "on", "Report", "s", "Sear", "ch", "API_", "(_", "Stack", "tach", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "report", "s", "\\u", "search", "\\u", "by", "\\u", "invalid", "\\u", "created", "\\u", "400_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "mox_", "._", "Creat", "e", "Moc", "k", "Any", "thing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "GET_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "'_", ":_", "'", "1234", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "result_", "=_", "stack", "y", "\\u", "server_", "._", "do", "\\u", "json", "report", "s", "\\u", "search_", "(_", "request_", ")_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Error", "\"_", ",_", "\"", "Messag", "e", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "Ba", "d", " ", "Request", "\"_", ",_", "\"'", "1234", "'", " ", "value", " ", "has", " ", "an", " ", "invalid", " ", "format", ".", " ", "It", " ", "must", " ", "be", " ", "in", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "YYY", "Y", "-", "MM", "-", "DD", " ", "format", ".\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "ast_", "._", "literal", "\\u", "eval_", "(_", "actual", "\\u", "result_", ")_", ",_", "expected", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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/AppTaskQueue/distributed_tq.py
[ { "content": " def purge_queue(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueuePurgeQueueRequest(http_data)\n response = taskqueue_service_pb.TaskQueuePurgeQueueResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.purge_queue", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 360 }, { "content": " def delete(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueDeleteRequest(http_data)\n response = taskqueue_service_pb.TaskQueueDeleteResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.delete", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 374 }, { "content": " def query_and_own_tasks(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueQueryAndOwnTasksRequest(http_data)\n response = taskqueue_service_pb.TaskQueueQueryAndOwnTasksResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.query_and_own_tasks", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 388 }, { "content": " def __enqueue_push_task(self, request):\n \"\"\" Enqueues a batch of push tasks.\n \n Args:\n request: A taskqueue_service_pb.TaskQueueAddRequest.\n \"\"\"\n self.__validate_push_task(request)\n self.__check_and_store_task_names(request)\n args = self.get_task_args(request)\n headers = self.get_task_headers(request)\n countdown = int(headers['X-AppEngine-TaskETA']) - \\\n int(datetime.datetime.now().strftime(\"%s\"))\n task_func = self.__get_task_function(request)\n result = task_func.apply_async(kwargs={'headers':headers,\n 'args':args},\n expires=args['expires'],\n acks_late=True,\n countdown=countdown,\n queue=TaskQueueConfig.get_celery_queue_name(\n request.app_id(), request.queue_name()),\n routing_key=TaskQueueConfig.get_celery_queue_name(\n request.app_id(), request.queue_name()))", "metadata": "root.DistributedTaskQueue.__enqueue_push_task", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 550 }, { "content": " def modify_task_lease(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueModifyTaskLeaseRequest(http_data)\n response = taskqueue_service_pb.TaskQueueModifyTaskLeaseResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.modify_task_lease", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 769 }, { "content": " def fetch_queue(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueFetchQueuesRequest(http_data)\n response = taskqueue_service_pb.TaskQueueFetchQueuesResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.fetch_queue", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 783 }, { "content": " def query_tasks(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueQueryTasksRequest(http_data)\n response = taskqueue_service_pb.TaskQueueQueryTasksResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.query_tasks", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 797 }, { "content": " def fetch_task(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueFetchTaskRequest(http_data)\n response = taskqueue_service_pb.TaskQueueFetchTaskResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.fetch_task", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 811 }, { "content": " def force_run(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueForceRunRequest(http_data)\n response = taskqueue_service_pb.TaskQueueForceRunResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.force_run", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 825 }, { "content": " def pause_queue(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueuePauseQueueRequest(http_data)\n response = taskqueue_service_pb.TaskQueuePauseQueueResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.pause_queue", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 839 }, { "content": " def delete_group(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueDeleteGroupRequest(http_data)\n response = taskqueue_service_pb.TaskQueueDeleteGroupResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.delete_group", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 853 }, { "content": " def update_storage_limit(self, app_id, http_data):\n \"\"\" \n\n Args:\n app_id: The application ID.\n http_data: The payload containing the protocol buffer request.\n Returns:\n A tuple of a encoded response, error code, and error detail.\n \"\"\"\n # TODO implement.\n request = taskqueue_service_pb.TaskQueueUpdateStorageLimitRequest(http_data)\n response = taskqueue_service_pb.TaskQueueUpdateStorageLimitResponse()\n return (response.Encode(), 0, \"\")", "metadata": "root.DistributedTaskQueue.update_storage_limit", "header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']", "index": 867 } ]
[ { "span": "request ", "start_line": 370, "start_column": 4, "end_line": 370, "end_column": 11 }, { "span": "request ", "start_line": 384, "start_column": 4, "end_line": 384, "end_column": 11 }, { "span": "request ", "start_line": 398, "start_column": 4, "end_line": 398, "end_column": 11 }, { "span": "result ", "start_line": 563, "start_column": 4, "end_line": 563, "end_column": 10 }, { "span": "request ", "start_line": 779, "start_column": 4, "end_line": 779, "end_column": 11 }, { "span": "request ", "start_line": 793, "start_column": 4, "end_line": 793, "end_column": 11 }, { "span": "request ", "start_line": 807, "start_column": 4, "end_line": 807, "end_column": 11 }, { "span": "request ", "start_line": 821, "start_column": 4, "end_line": 821, "end_column": 11 }, { "span": "request ", "start_line": 835, "start_column": 4, "end_line": 835, "end_column": 11 }, { "span": "request ", "start_line": 849, "start_column": 4, "end_line": 849, "end_column": 11 }, { "span": "request ", "start_line": 863, "start_column": 4, "end_line": 863, "end_column": 11 }, { "span": "request ", "start_line": 877, "start_column": 4, "end_line": 877, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pur", "ge", "\\u", "queue_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Purg", "e", "Queue", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Purg", "e", "Queue", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Delete", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Delete", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query", "\\u", "and", "\\u", "own", "\\u", "tasks_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Query", "And", "Own", "Task", "s", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Query", "And", "Own", "Task", "s", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\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", "enqueue", "\\u", "push", "\\u", "task_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Enque", "ues", " ", "a", " ", "batch", " ", "of", " ", "push", " ", "task", "s", ".", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "request", ":", " ", "A", " ", "task", "queue", "\\u", "service", "\\u", "pb", ".", "Task", "Queue", "Add", "Request", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "validat", "e\\u", "push", "\\u", "task_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "check", "\\u", "and", "\\u", "store", "\\u", "task", "\\u", "names_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "self_", "._", "get", "\\u", "task", "\\u", "args_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "self_", "._", "get", "\\u", "task", "\\u", "headers_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "countdown", "_", "=_", "int_", "(_", "headers_", "[_", "'", "X", "-", "App", "Engine", "-", "Task", "ETA", "'_", "]_", ")_", "-_", "int_", "(_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "._", "strftime_", "(_", "\"%", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "func_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "task", "\\u", "function_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "task", "\\u", "func_", "._", "appl", "y", "\\u", "async_", "(_", "kwargs_", "=_", "{_", "'", "header", "s", "'_", ":_", "headers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "args", "'_", ":_", "args_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expires_", "=_", "args_", "[_", "'", "expir", "es", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ack", "s", "\\u", "late", "_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "countdown", "_", "=_", "countdown", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "queue_", "=_", "Task", "Queue", "Config_", "._", "get", "\\u", "celery", "\\u", "queue", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "app", "\\u", "id_", "(_", ")_", ",_", "request_", "._", "queue", "\\u", "name_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "routin", "g", "\\u", "key_", "=_", "Task", "Queue", "Config_", "._", "get", "\\u", "celery", "\\u", "queue", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "app", "\\u", "id_", "(_", ")_", ",_", "request_", "._", "queue", "\\u", "name_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\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_", "modif", "y", "\\u", "task", "\\u", "lease_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Modif", "y", "Task", "Leas", "e", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Modif", "y", "Task", "Leas", "e", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetch", "\\u", "queue_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Fe", "tch", "Queue", "s", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Fe", "tch", "Queue", "s", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query", "\\u", "tasks_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Query", "Task", "s", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Query", "Task", "s", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetch", "\\u", "task_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Fe", "tch", "Task", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Fe", "tch", "Task", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "force", "\\u", "run_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Force", "Run", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Force", "Run", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "paus", "e\\u", "queue_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Pause", "Queue", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Pause", "Queue", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "group_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Delete", "Group", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Delete", "Group", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distribut", "ed", "Task", "Queue_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "storage", "\\u", "limit_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "http", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "app", "\\u", "id", ":", " ", "The", " ", "applica", "tion", " ", "ID", ".", "\\", "10", ";", " ", " ", "http", "\\u", "data", ":", " ", "The", " ", "payload", " ", "contain", "ing", " ", "the", " ", "protoc", "ol", " ", "buffer", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "tuple", " ", "of", " ", "a", " ", "encode", "d", " ", "response", ",", " ", "error", " ", "code", ",", " ", "and", " ", "error", " ", "deta", "il", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "implement", "._", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Update", "Stor", "age", "Limit", "Request_", "(_", "http", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "task", "queue", "\\u", "service", "\\u", "pb_", "._", "Task", "Queue", "Update", "Stor", "age", "Limit", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "response_", "._", "Encode", "_", "(_", ")_", ",_", "0_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 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/vt_plugin/controller/vtAggregateController/forms/forms.py
[ { "content": "'''\nCreated on Apr 29, 2010\n\n@author: jnaous\n'''\n\nfrom django import forms\nfrom vt_plugin.models import VtPlugin\nfrom expedient.common.utils import create_or_update\nfrom django.forms.models import ModelChoiceField\nfrom vt_plugin.models import xmlrpcServerProxy\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class VTAggregateForm(forms.ModelForm):\n '''\n A form to create and edit OpenFlow Aggregates.\n '''\n\n class Meta:\n model = VtPlugin\n #exclude = ['client', 'owner', 'users', \"leaf_name\"]\n exclude = ['client', 'owner', 'users', 'available']", "metadata": "root.VTAggregateForm", "header": "['module', '___EOS___']", "index": 12 }, { "content": "class xmlrpcServerProxyForm(forms.ModelForm):\n '''\n A form to create and edit OpenFlow Aggregates.\n '''\n\n confirm_password = forms.CharField(\n help_text=\"Confirm password.\",\n max_length=40,\n widget=forms.PasswordInput(render_value=False))\n\n\n class Meta:\n model = xmlrpcServerProxy\n # Defines all the fields in the model by ORDER\n fields = ('username', 'password', 'confirm_password', 'url')\n # Form widgets: HTML representation of fields\n widgets = {\n # Shows the password\n 'password': forms.PasswordInput(render_value=True),\n }\n\n # Validation and so on", "metadata": "root.xmlrpcServerProxyForm", "header": "['module', '___EOS___']", "index": 22 }, { "content": " def __init__(self, check_available=False, *args, **kwargs):\n super(xmlrpcServerProxyForm, self).__init__(*args, **kwargs)\n self.check_available = check_available\n # Fix Django's autocompletion of username/password fields when type is password\n self.fields['username'].widget.attrs[\"autocomplete\"] = 'off'\n self.fields['password'].widget.attrs[\"autocomplete\"] = 'off'\n self.fields['confirm_password'].widget.attrs[\"autocomplete\"] = 'off'", "metadata": "root.xmlrpcServerProxyForm.__init__", "header": "['class', 'xmlrpcServerProxyForm', '(', 'forms', '.', 'ModelForm', ')', ':', '___EOS___']", "index": 32 }, { "content": " def clean(self):\n # Check that both passwords (if present) are the same\n password = self.cleaned_data.get('password', None)\n confirm_password = self.cleaned_data.get('confirm_password', None)\n if password and confirm_password and (password != confirm_password):\n raise forms.ValidationError(\"Passwords don't match\")\n # Remove fields that are not in the Model to avoid any mismatch when synchronizing\n d = dict(self.cleaned_data)\n if \"confirm_password\" in d:\n del d[\"confirm_password\"]\n p = self._meta.model(**d)\n return self.cleaned_data", "metadata": "root.xmlrpcServerProxyForm.clean", "header": "['class', 'xmlrpcServerProxyForm', '(', 'forms', '.', 'ModelForm', ')', ':', '___EOS___']", "index": 51 } ]
[ { "span": "from expedient.common.utils import create_or_update", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 51 }, { "span": "from django.forms.models import ModelChoiceField", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 48 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "Creat", "ed", " ", "on", " ", "Ap", "r", " ", "2", "9", ",", " ", "2010", "\\", "10", ";", "\\", "10", ";", "@", "author", ":", " ", "jn", "ao", "us", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "import_", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "plugin_", "._", "models_", "import_", "Vt", "Plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "expe", "die", "nt_", "._", "common_", "._", "utils_", "import_", "create", "\\u", "or", "\\u", "update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "forms_", "._", "models_", "import_", "Model", "Choi", "ce", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "plugin_", "._", "models_", "import_", "xmlrpc", "Server", "Proxy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "VT", "Aggregate", "Form_", "(_", "forms_", "._", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "form", " ", "to", " ", "create", " ", "and", " ", "edit", " ", "Open", "Flow", " ", "Aggregate", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\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 ", " _", "model_", "=_", "Vt", "Plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "exclu", "de", " ", "=", " ", "['", "client", "',", " ", "'", "owner", "',", " ", "'", "users", "',", " ", "\"", "leaf", "\\u", "name", "\"]", "_", "\\u\\u\\uNL\\u\\u\\u_", "exclude_", "=_", "[_", "'", "client", "'_", ",_", "'", "owner", "'_", ",_", "'", "users", "'_", ",_", "'", "avail", "able", "'_", "]_", "\\u\\u\\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_", "xmlrpc", "Server", "Pro", "xy", "Form_", "(_", "forms_", "._", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "form", " ", "to", " ", "create", " ", "and", " ", "edit", " ", "Open", "Flow", " ", "Aggregate", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "confirm", "\\u", "password_", "=_", "forms_", "._", "Char", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "help", "\\u", "text_", "=_", "\"", "Confirm", " ", "password", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "length_", "=_", "40_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget_", "=_", "forms_", "._", "Passw", "ord", "Input_", "(_", "render", "\\u", "value_", "=_", "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\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "xmlrpc", "Server", "Proxy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Define", "s", " ", "all", " ", "the", " ", "fields", " ", "in", " ", "the", " ", "model", " ", "by", " ", "ORDER_", "\\u\\u\\uNL\\u\\u\\u_", "fields_", "=_", "(_", "'", "user", "name", "'_", ",_", "'", "password", "'_", ",_", "'", "confirm", "\\u", "password", "'_", ",_", "'", "url", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Form", " ", "widget", "s", ":", " ", "HTM", "L", " ", "represent", "ation", " ", "of", " ", "fields_", "\\u\\u\\uNL\\u\\u\\u_", "widgets_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Show", "s", " ", "the", " ", "password_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "forms_", "._", "Passw", "ord", "Input_", "(_", "render", "\\u", "value_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Validat", "ion", " ", "and", " ", "so", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "xmlrpc", "Server", "Pro", "xy", "Form_", "(_", "forms_", "._", "Model", "Form_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "check", "\\u", "available_", "=_", "False_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "xmlrpc", "Server", "Pro", "xy", "Form_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "available_", "=_", "check", "\\u", "available_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fix", " ", "Dj", "ang", "o", "'", "s", " ", "autoc", "omp", "let", "ion", " ", "of", " ", "user", "name", "/", "password", " ", "fields", " ", "whe", "n", " ", "type", " ", "is", " ", "password_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fields_", "[_", "'", "user", "name", "'_", "]_", "._", "widget_", "._", "attrs_", "[_", "\"", "autocomplete", "\"_", "]_", "=_", "'", "off", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fields_", "[_", "'", "password", "'_", "]_", "._", "widget_", "._", "attrs_", "[_", "\"", "autocomplete", "\"_", "]_", "=_", "'", "off", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fields_", "[_", "'", "confirm", "\\u", "password", "'_", "]_", "._", "widget_", "._", "attrs_", "[_", "\"", "autocomplete", "\"_", "]_", "=_", "'", "off", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "xmlrpc", "Server", "Pro", "xy", "Form_", "(_", "forms_", "._", "Model", "Form_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "tha", "t", " ", "bot", "h", " ", "passwords", " ", "(", "if", " ", "presen", "t", ")", " ", "are", " ", "the", " ", "same_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "password_", "=_", "self_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "password", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confirm", "\\u", "password_", "=_", "self_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "confirm", "\\u", "password", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "password_", "and_", "confirm", "\\u", "password_", "and_", "(_", "password_", "!=_", "confirm", "\\u", "password_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "forms_", "._", "Validat", "ion", "Error_", "(_", "\"", "Passw", "ords", " ", "don", "'", "t", " ", "match", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "fields", " ", "tha", "t", " ", "are", " ", "not", " ", "in", " ", "the", " ", "Model", " ", "to", " ", "avoid", " ", "any", " ", "mism", "atch", " ", "whe", "n", " ", "synchron", "izi", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "dict_", "(_", "self_", "._", "clean", "ed", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "confirm", "\\u", "password", "\"_", "in_", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "d_", "[_", "\"", "confirm", "\\u", "password", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "=_", "self_", "._", "\\u", "meta_", "._", "model_", "(_", "**_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "clean", "ed", "\\u", "data_" ]
[ 4, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unnecessary delete statement in function
mrknow/filmkodi/plugin.video.specto/resources/lib/libraries/phdialogs.py
[ { "content": "def openDialog(image,audio):\n audio = audio\n print 'MUSIC IS '+audio\n path = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.phstreams/resources/skins/DefaultSkin','media'))\n popimage=os.path.join(path, 'tempimage.jpg')\n downloadFile(image,popimage)\n musicsound=os.path.join(path, 'tempsound.mp3')\n downloadFile(audio,musicsound)\n if xbmc.getCondVisibility('system.platform.ios'):\n if not xbmc.getCondVisibility('system.platform.atv'):\n popup = dialog('pop1.xml',xbmcaddon.Addon().getAddonInfo('path'),'DefaultSkin',close_time=20,logo_path='%s/resources/skins/DefaultSkin/media/Logo/'%xbmcaddon.Addon().getAddonInfo('path'),)\n if xbmc.getCondVisibility('system.platform.android'):\n popup = dialog('pop1.xml',xbmcaddon.Addon().getAddonInfo('path'),'DefaultSkin',close_time=20,logo_path='%s/resources/skins/DefaultSkin/media/Logo/'%xbmcaddon.Addon().getAddonInfo('path'))\n else:\n popup = dialog('pop.xml',xbmcaddon.Addon().getAddonInfo('path'),'DefaultSkin',close_time=20,logo_path='%s/resources/skins/DefaultSkin/media/Logo/'%xbmcaddon.Addon().getAddonInfo('path'))\n popup.doModal()\n del popup", "metadata": "root.openDialog", "header": "['module', '___EOS___']", "index": 26 } ]
[ { "span": "del popup", "start_line": 42, "start_column": 4, "end_line": 42, "end_column": 13 } ]
[ { "span": "def openDialog(image,audio):", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 28 } ]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "delete_", "statement_", "in_", "function_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "open", "Dialog_", "(_", "image_", ",_", "audio_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "audio_", "=_", "audio_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "MUS", "IC", " ", "IS", " ", " ", "'_", "+_", "audio_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "xbmc_", "._", "translat", "e", "Path_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "special", "://", "home", "/", "addon", "s", "/", "plugin", ".", "video", ".", "ph", "stream", "s", "/", "resource", "s", "/", "skin", "s", "/", "Default", "Ski", "n", "'_", ",_", "'", "media", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "popi", "mage_", "=_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "'", "temp", "image", ".", "jp", "g", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "download", "File_", "(_", "image_", ",_", "popi", "mage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "music", "sound_", "=_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "'", "temps", "ound", ".", "mp3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "download", "File_", "(_", "audio_", ",_", "music", "sound_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "xbmc_", "._", "get", "Cond", "Visibility_", "(_", "'", "system", ".", "platform", ".", "ios", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "xbmc_", "._", "get", "Cond", "Visibility_", "(_", "'", "system", ".", "platform", ".", "at", "v", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "popup_", "=_", "dialog_", "(_", "'", "pop", "1", ".", "xml", "'_", ",_", "xbmcaddon_", "._", "Addon_", "(_", ")_", "._", "get", "Add", "on", "Info_", "(_", "'", "path", "'_", ")_", ",_", "'", "Default", "Ski", "n", "'_", ",_", "close", "\\u", "time_", "=_", "20_", ",_", "logo", "\\u", "path_", "=_", "'%", "s", "/", "resource", "s", "/", "skin", "s", "/", "Default", "Ski", "n", "/", "media", "/", "Logo", "/'_", "%_", "xbmcaddon_", "._", "Addon_", "(_", ")_", "._", "get", "Add", "on", "Info_", "(_", "'", "path", "'_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "xbmc_", "._", "get", "Cond", "Visibility_", "(_", "'", "system", ".", "platform", ".", "android", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "popup_", "=_", "dialog_", "(_", "'", "pop", "1", ".", "xml", "'_", ",_", "xbmcaddon_", "._", "Addon_", "(_", ")_", "._", "get", "Add", "on", "Info_", "(_", "'", "path", "'_", ")_", ",_", "'", "Default", "Ski", "n", "'_", ",_", "close", "\\u", "time_", "=_", "20_", ",_", "logo", "\\u", "path_", "=_", "'%", "s", "/", "resource", "s", "/", "skin", "s", "/", "Default", "Ski", "n", "/", "media", "/", "Logo", "/'_", "%_", "xbmcaddon_", "._", "Addon_", "(_", ")_", "._", "get", "Add", "on", "Info_", "(_", "'", "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 ", " _", "popup_", "=_", "dialog_", "(_", "'", "pop", ".", "xml", "'_", ",_", "xbmcaddon_", "._", "Addon_", "(_", ")_", "._", "get", "Add", "on", "Info_", "(_", "'", "path", "'_", ")_", ",_", "'", "Default", "Ski", "n", "'_", ",_", "close", "\\u", "time_", "=_", "20_", ",_", "logo", "\\u", "path_", "=_", "'%", "s", "/", "resource", "s", "/", "skin", "s", "/", "Default", "Ski", "n", "/", "media", "/", "Logo", "/'_", "%_", "xbmcaddon_", "._", "Addon_", "(_", ")_", "._", "get", "Add", "on", "Info_", "(_", "'", "path", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "popup_", "._", "do", "Modal_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "popup_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 3, 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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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, 0, 1, 2 ]
Unused import
mvantellingen/localshop/localshop/apps/permissions/migrations/0002_remove_userena.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(migrations.Migration):\n\n dependencies = [\n ('permissions', '0001_initial'),\n ]\n\n operations = [\n migrations.DeleteModel(\n name='AuthProfile',\n ),\n ]", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 } ]
[ { "span": "from django.db import models, migrations", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", ",_", "migrations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "migrations_", "._", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dependencies_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "permissi", "ons", "'_", ",_", "'", "0001", "\\u", "initial", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "operations_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Delete", "Model_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "Auth", "Profil", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
AppScale/appscale/AppServer/lib/django-1.5/tests/modeltests/empty/tests.py
[ { "content": " def test_empty(self):\n m = Empty()\n self.assertEqual(m.id, None)\n m.save()\n Empty.objects.create()\n self.assertEqual(len(Empty.objects.all()), 2)\n self.assertTrue(m.id is not None)\n existing = Empty(m.id)\n existing.save()", "metadata": "root.EmptyModelTests.test_empty", "header": "['class', 'EmptyModelTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 12 } ]
[ { "span": "self.assertTrue(m.id is not None)", "start_line": 18, "start_column": 8, "end_line": 18, "end_column": 41 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Emp", "ty", "Model", "Tests_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "empty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "Empty_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "id_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Empty_", "._", "objects_", "._", "create_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "Empty_", "._", "objects_", "._", "all_", "(_", ")_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "m_", "._", "id_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "existing_", "=_", "Empty_", "(_", "m_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "existing_", "._", "save_", "(_", ")_", "\\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, 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 ]
Except block handles 'BaseException'
mrknow/filmkodi/plugin.video.specto/resources/lib/resolvers/divxpress.py
[ { "content": "def resolve(url):\n try:\n url = url.replace('/embed-', '/')\n url = re.compile('//.+?/([\\w]+)').findall(url)[0]\n url = 'http://divxpress.com/embed-%s.html' % url\n\n result = client.request(url, close=False)\n\n post = {}\n f = client.parseDOM(result, 'form', attrs = {'method': 'POST'})[0]\n k = client.parseDOM(f, 'input', ret='name', attrs = {'type': 'hidden'})\n for i in k: post.update({i: client.parseDOM(f, 'input', ret='value', attrs = {'name': i})[0]})\n post = post\n\n result = client.request(url, post=post)\n\n result = re.compile('(eval.*?\\)\\)\\))').findall(result)[-1]\n result = jsunpack.unpack(result)\n\n url = client.parseDOM(result, 'embed', ret='src')\n url += re.compile(\"'file' *, *'(.+?)'\").findall(result)\n url = [i for i in url if not i.endswith('.srt')]\n url = 'http://' + url[0].split('://', 1)[-1]\n\n return url\n except:\n return", "metadata": "root.resolve", "header": "['module', '___EOS___']", "index": 26 } ]
[ { "span": "except:", "start_line": 51, "start_column": 4, "end_line": 51, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "resolve_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "url_", "._", "replace_", "(_", "'/", "embed", "-'_", ",_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "re_", "._", "compile_", "(_", "'//", ".+?", "/([", "\\\\", "w", "]+)'_", ")_", "._", "findall_", "(_", "url_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "http", "://", "div", "xpr", "ess", ".", "com", "/", "embed", "-%", "s", ".", "html", "'_", "%_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "close_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "form", "'_", ",_", "attrs_", "=_", "{_", "'", "method", "'_", ":_", "'", "POST", "'_", "}_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "client_", "._", "parse", "DOM_", "(_", "f_", ",_", "'", "input", "'_", ",_", "ret_", "=_", "'", "name", "'_", ",_", "attrs_", "=_", "{_", "'", "type", "'_", ":_", "'", "hidden", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "k_", ":_", "post_", "._", "update_", "(_", "{_", "i_", ":_", "client_", "._", "parse", "DOM_", "(_", "f_", ",_", "'", "input", "'_", ",_", "ret_", "=_", "'", "value", "'_", ",_", "attrs_", "=_", "{_", "'", "name", "'_", ":_", "i_", "}_", ")_", "[_", "0_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "post_", "=_", "post_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "re_", "._", "compile_", "(_", "'(", "eval", ".*?\\\\", ")\\\\", ")\\\\", "))'_", ")_", "._", "findall_", "(_", "result_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "js", "unpack_", "._", "unpack_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "embed", "'_", ",_", "ret_", "=_", "'", "src", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "+=_", "re_", "._", "compile_", "(_", "\"'", "file", "'", " ", "*", ",", " ", "*'", "(.+?)", "'\"_", ")_", "._", "findall_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "[_", "i_", "for_", "i_", "in_", "url_", "if_", "not_", "i_", "._", "endswith_", "(_", "'.", "srt", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "http", "://'_", "+_", "url_", "[_", "0_", "]_", "._", "split_", "(_", "':/", "/'_", ",_", "1_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_" ]
[ 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, 0, 1, 1, 2, 2, 2, 2 ]
Unreachable code
jsoucheiron/pttdm/pttdm.py
[ { "content": "@slide(executable=True)\ndef exceptions_1():\n \"\"\" Exceptions\n\n Disclamer: DON'T EVER DO THIS. Unless:\n - You want everyone to hate you\n - You want the FSM to kill a kitten every time this code runs\n \"\"\"\n\n try:\n \"\"\"Some very dangerous stuff\"\"\"\n except:\n pass\n\n try:\n \"\"\"Some very dangerous stuff\"\"\"\n except Exception:\n pass", "metadata": "root.exceptions_1", "header": "['module', '___EOS___']", "index": 260 }, { "content": "@slide(executable=True)\ndef flow_control_1():\n \"\"\" Full try/except/else/finally flow\n \"\"\"\n\n try:\n a = 0\n except ValueError:\n print(\"The exception won't be raised\")\n else:\n print(\"We'll run the code in else if the exception is not raised\")\n finally:\n print(\"and we'll always run finally (great for cleanup code)\")", "metadata": "root.flow_control_1", "header": "['module', '___EOS___']", "index": 309 }, { "content": "@slide(executable=True)\ndef flow_control_2():\n \"\"\" Weird try/except/else/finally flow considerations\n \"\"\"\n\n try:\n a = 0\n except ValueError:\n print(\"The exception won't be raised\")\n else:\n print(\"We'll run the code in else if the exception is not raised\")\n return 1\n finally:\n print(\"and we'll always run finally even avoiding return calls\")\n print\n return 2", "metadata": "root.flow_control_2", "header": "['module', '___EOS___']", "index": 324 } ]
[ { "span": "except:", "start_line": 271, "start_column": 4, "end_line": 271, "end_column": 11 }, { "span": "except Exception:", "start_line": 276, "start_column": 4, "end_line": 276, "end_column": 21 }, { "span": "except ValueError:", "start_line": 316, "start_column": 4, "end_line": 316, "end_column": 22 }, { "span": "except ValueError:", "start_line": 331, "start_column": 4, "end_line": 331, "end_column": 22 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "slide_", "(_", "executable_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "exception", "s", "\\u", "1_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Except", "ion", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Disc", "lame", "r", ":", " ", "DON", "'", "T", " ", "EVE", "R", " ", "DO", " ", "THIS", ".", " ", "Un", "less", ":", "\\", "10", ";", " ", " ", "-", " ", "You", " ", "want", " ", "everyone", " ", "to", " ", "hat", "e", " ", "you", "\\", "10", ";", " ", " ", "-", " ", "You", " ", "want", " ", "the", " ", "FSM", " ", "to", " ", "kill", " ", "a", " ", "kitt", "en", " ", "every", " ", "time", " ", "this", " ", "code", " ", "runs", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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 ", " _", "\"\"\"", "Some", " ", "very", " ", "danger", "ous", " ", "stu", "ff", "\"\"\"_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Some", " ", "very", " ", "danger", "ous", " ", "stu", "ff", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "slide_", "(_", "executable_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "flow", "\\u", "control", "\\u", "1_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Full", " ", "try", "/", "except", "/", "else", "/", "final", "ly", " ", "flow", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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 ", " _", "a_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "The", " ", "exception", " ", "won", "'", "t", " ", "be", " ", "raise", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "We", "'", "ll", " ", "run", " ", "the", " ", "code", " ", "in", " ", "else", " ", "if", " ", "the", " ", "exception", " ", "is", " ", "not", " ", "raise", "d", "\"_", ")_", "\\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 ", " _", "print_", "(_", "\"", "and", " ", "we", "'", "ll", " ", "alw", "ay", "s", " ", "run", " ", "final", "ly", " ", "(", "great", " ", "for", " ", "clean", "up", " ", "code", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "slide_", "(_", "executable_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "flow", "\\u", "control", "\\u", "2_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Wei", "rd", " ", "try", "/", "except", "/", "else", "/", "final", "ly", " ", "flow", " ", "consider", "ation", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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 ", " _", "a_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "The", " ", "exception", " ", "won", "'", "t", " ", "be", " ", "raise", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "We", "'", "ll", " ", "run", " ", "the", " ", "code", " ", "in", " ", "else", " ", "if", " ", "the", " ", "exception", " ", "is", " ", "not", " ", "raise", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\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 ", " _", "print_", "(_", "\"", "and", " ", "we", "'", "ll", " ", "alw", "ay", "s", " ", "run", " ", "final", "ly", " ", "even", " ", "avoid", "ing", " ", "return", " ", "calls", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 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 ]
Unused local variable
aerosol/django-dilla/dilla/__init__.py
[ { "content": " def spam(self, record):\n \"\"\"This is where the magic happens and AbstractRecords evolve.\"\"\"\n\n log.debug('[ --> Spam %s ]' % record)\n self.current = record\n\n if record.is_app():\n for model in self.appmodels.get(str(record)):\n record.model = model\n record.create_object()\n record.field = None\n self.spam(record)\n\n elif record.is_model():\n for field in [field for field \\\n in record.model._meta.fields \\\n if not field.auto_created]:\n\n record.many_to_many = False\n record.field = field\n self.spam(record)\n record.save()\n self.rows_affected += 1\n\n # after the record is saved, it is safe to fill\n # ManyToMany fields if any\n\n for field in record.model._meta.many_to_many:\n record.field = field\n record.many_to_many = True\n self.spam(record)\n\n elif record.is_field():\n if record.field.blank and (self.use_coin and self._coin_toss()):\n self.fields_omitted += 1\n log.debug(\"Using coin -- simon says, skip this record.\")\n return\n\n handler = self.find_spam_handler(record)\n if handler is not None:\n value = handler(record, record.field)\n if record.field.unique:\n manager = record.model._default_manager\n\n # handlers may not return random values,\n # try 5 times before giving up\n\n for i in range(5):\n try:\n _match = manager.get(**{record.field.name: value})\n value = handler(record, record.field)\n except record.model.DoesNotExist, e:\n break\n\n record.set_object_property(value)\n self.fields_spammed += 1\n else:\n log.warn(\"Handler not found for %s\" % record)", "metadata": "root.Dilla.spam", "header": "['class', 'Dilla', '(', 'object', ')', ':', '___EOS___']", "index": 226 } ]
[ { "span": "_match ", "start_line": 275, "start_column": 28, "end_line": 275, "end_column": 34 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Di", "lla", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "spam_", "(_", "self_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "is", " ", "where", " ", "the", " ", "magic", " ", "happ", "ens", " ", "and", " ", "Abstract", "Record", "s", " ", "evolve", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "debug_", "(_", "'[", " ", "-->", " ", "Spam", " ", "%", "s", " ", "]'_", "%_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "current_", "=_", "record_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "record_", "._", "is", "\\u", "app_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "model_", "in_", "self_", "._", "app", "models_", "._", "get_", "(_", "str_", "(_", "record_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "record_", "._", "model_", "=_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "create", "\\u", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "field_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "spam_", "(_", "record_", ")_", "\\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_", "record_", "._", "is", "\\u", "model_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "field_", "in_", "[_", "field_", "for_", "field_", "in_", "record_", "._", "model_", "._", "\\u", "meta_", "._", "fields_", "if_", "not_", "field_", "._", "auto", "\\u", "created_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "record_", "._", "many", "\\u", "to", "\\u", "many_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "field_", "=_", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "spam_", "(_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "record_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rows", "\\u", "affect", "ed_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "after", " ", "the", " ", "record", " ", "is", " ", "saved", ",", " ", "it", " ", "is", " ", "safe", " ", "to", " ", "fill_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Many", "To", "Many", " ", "fields", " ", "if", " ", "any_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "field_", "in_", "record_", "._", "model_", "._", "\\u", "meta_", "._", "many", "\\u", "to", "\\u", "many_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "record_", "._", "field_", "=_", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "many", "\\u", "to", "\\u", "many_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "spam_", "(_", "record_", ")_", "\\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_", "record_", "._", "is", "\\u", "field_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "record_", "._", "field_", "._", "blank_", "and_", "(_", "self_", "._", "use", "\\u", "coin_", "and_", "self_", "._", "\\u", "coin", "\\u", "tos", "s_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fields", "\\u", "omit", "ted_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "Us", "ing", " ", "coin", " ", "--", " ", "sim", "on", " ", "say", "s", ",", " ", "skip", " ", "this", " ", "record", ".\"_", ")_", "\\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_", "handler_", "=_", "self_", "._", "find", "\\u", "spam", "\\u", "handler_", "(_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "handler_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "handler_", "(_", "record_", ",_", "record_", "._", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record_", "._", "field_", "._", "unique_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "manager_", "=_", "record_", "._", "model_", "._", "\\u", "default", "\\u", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "handler", "s", " ", "may", " ", "not", " ", "return", " ", "random", " ", "values", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "5", " ", "times", " ", "bef", "ore", " ", "gi", "ving", " ", "up_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "\\u", "match_", "=_", "manager_", "._", "get_", "(_", "**_", "{_", "record_", "._", "field_", "._", "name_", ":_", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "handler_", "(_", "record_", ",_", "record_", "._", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "record_", "._", "model_", "._", "Do", "es", "Not", "Exist_", ",_", "e_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "record_", "._", "set\\u", "object\\u", "property_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fields", "\\u", "spam", "med_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
mozilla/moztrap/moztrap/model/__init__.py
[ { "content": "\"\"\"\nAll models.\n\n\"\"\"\nfrom django.db.models import ProtectedError, signals\nfrom django.dispatch import receiver\n\nfrom registration.models import RegistrationProfile\n\nfrom .mtmodel import ConcurrencyError\nfrom .core.models import MTModel, Product, ProductVersion, ApiKey\nfrom .core.auth import User, Role, Permission\nfrom .environments.models import Environment, Profile, Element, Category\nfrom .execution.models import Run, RunSuite, RunCaseVersion, Result, StepResult\nfrom .library.bulk import BulkParser\nfrom .library.models import (\n Case, CaseVersion, CaseAttachment, CaseStep, Suite, SuiteCase)\nfrom .tags.models import Tag\n\n# version of the REST endpoint APIs for TastyPie\nAPI_VERSION = \"v1\"\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@receiver(signals.post_save, sender=Tag)\n@receiver(signals.post_save, sender=User)\n@receiver(signals.post_save, sender=Role)\n@receiver(signals.post_save, sender=Element)\n@receiver(signals.post_save, sender=Suite)\n@receiver(signals.post_save, sender=Run)\n@receiver(signals.post_save, sender=Product)\n@receiver(signals.post_save, sender=ProductVersion)\ndef invalidate_model_choices(sender, instance, **kwargs):\n \"\"\"This makes sure that the model choices for forms related to these\n are invalidated when changes are made.\n\n The place where the caching is set is in\n moztrap.view.lists.filters.ModelFilter\n \"\"\"\n MTModel.delete_modelfilter_choices_cache(sender)", "metadata": "root.invalidate_model_choices", "header": "['module', '___EOS___']", "index": 23 } ]
[ { "span": "from django.db.models import ProtectedError, signals", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 52 }, { "span": "from registration.models import RegistrationProfile", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "All", " ", "model", "s", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "Protect", "ed", "Error_", ",_", "signals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "dispatch_", "import_", "receiver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "registration_", "._", "models_", "import_", "Registration", "Profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "mt", "model_", "import_", "Conc", "urr", "ency", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "core_", "._", "models_", "import_", "MT", "Model_", ",_", "Product_", ",_", "Product", "Version_", ",_", "Ap", "i", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "core_", "._", "auth_", "import_", "User_", ",_", "Role_", ",_", "Permission_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "environments_", "._", "models_", "import_", "Environment_", ",_", "Profile_", ",_", "Element_", ",_", "Category_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "execution_", "._", "models_", "import_", "Run_", ",_", "Run", "Suite_", ",_", "Run", "Case", "Version_", ",_", "Result_", ",_", "Step", "Result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "library_", "._", "bulk_", "import_", "Bul", "k", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "library_", "._", "models_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Case_", ",_", "Case", "Version_", ",_", "Case", "Attachment_", ",_", "Case", "Step_", ",_", "Suite_", ",_", "Suit", "e", "Case_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "tags_", "._", "models_", "import_", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "version", " ", "of", " ", "the", " ", "REST", " ", "endpoint", " ", "API", "s", " ", "for", " ", "Ta", "sty", "Pie", "_", "\\u\\u\\uNL\\u\\u\\u_", "API", "\\u", "VERSION_", "=_", "\"", "v1", "\"_", "\\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_", "@_", "receiver_", "(_", "signals_", "._", "post", "\\u", "save_", ",_", "sender_", "=_", "Tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "receiver_", "(_", "signals_", "._", "post", "\\u", "save_", ",_", "sender_", "=_", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "receiver_", "(_", "signals_", "._", "post", "\\u", "save_", ",_", "sender_", "=_", "Role_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "receiver_", "(_", "signals_", "._", "post", "\\u", "save_", ",_", "sender_", "=_", "Element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "receiver_", "(_", "signals_", "._", "post", "\\u", "save_", ",_", "sender_", "=_", "Suite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "receiver_", "(_", "signals_", "._", "post", "\\u", "save_", ",_", "sender_", "=_", "Run_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "receiver_", "(_", "signals_", "._", "post", "\\u", "save_", ",_", "sender_", "=_", "Product_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "receiver_", "(_", "signals_", "._", "post", "\\u", "save_", ",_", "sender_", "=_", "Product", "Version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "invalidate", "\\u", "model", "\\u", "choices_", "(_", "sender_", ",_", "instance_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "make", "s", " ", "sure", " ", "tha", "t", " ", "the", " ", "model", " ", "choice", "s", " ", "for", " ", "forms", " ", "relate", "d", " ", "to", " ", "these", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "invalidate", "d", " ", "whe", "n", " ", "change", "s", " ", "are", " ", "made", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "place", " ", "where", " ", "the", " ", "caching", " ", "is", " ", "set", " ", "is", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "moz", "trap", ".", "view", ".", "lists", ".", "filter", "s", ".", "Model", "Filter", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "MT", "Model_", "._", "delete", "\\u", "modelf", "ilter", "\\u", "choice", "s", "\\u", "cache_", "(_", "sender_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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 ]
Unused import
viewfinderco/viewfinder/backend/www/auth.py
[ { "content": "# Copyright 2011 Viewfinder Inc. All Rights Reserved.\n\n\"\"\"Base class for various handlers which authenticate user identities and request necessary\npermissions for them:\n\n AuthGoogleHandler: authenticates via Google.\n AuthFacebookHandler: authenticates via Facebook.\n AuthViewfinderHandler: authenticates using Viewfinder's own identity system.\n\"\"\"\n\n__authors__ = ['[email protected] (Spencer Kimball)',\n '[email protected] (Andy Kimball)']\n\nimport logging\nimport validictory\n\nfrom copy import deepcopy\nfrom tornado import gen, options, web\nfrom viewfinder.backend.base import handler, util\nfrom viewfinder.backend.base.exceptions import PermissionError\nfrom viewfinder.backend.db.device import Device\nfrom viewfinder.backend.db.identity import Identity\nfrom viewfinder.backend.db.operation import Operation\nfrom viewfinder.backend.db.user import User\nfrom viewfinder.backend.resources.message.error_messages import ALREADY_LINKED, ALREADY_REGISTERED, NO_USER_ACCOUNT\nfrom viewfinder.backend.resources.message.error_messages import MERGE_REQUIRES_LOGIN, LOGIN_REQUIRES_REGISTER\nfrom viewfinder.backend.www import base, json_schema, www_util\n\n\noptions.define('freeze_new_accounts', False,\n help='disallow creation of new accounts from mobile application')\n\n_NEED_INVITATION_MESSAGE = 'You must receive an invitation to register a Viewfinder account.'\n\n_ACCOUNT_ALREADY_LINKED_MESSAGE = 'There is already a Viewfinder user linked to this account.'\n\n_CANNOT_SET_DEVICE_FOR_USER_MESSAGE = 'Cannot set device for non-existent Viewfinder account.'\n\n_FREEZE_NEW_ACCOUNTS_MESSAGE = 'Due to soaring popularity and demand, we can\\'t provide you ' + \\\n 'with a Viewfinder account right now. But please do try again later.'\n\n_CANNOT_LINK_TO_PROSPECTIVE = 'You have not registered your Viewfinder account. Register your ' + \\\n 'account before adding new email addresses.'\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class AuthHandler(base.BaseHandler):\n \"\"\"Base class for all auth handlers that contains utility methods used\n by multiple derived classes.\n \"\"\"\n _AUTH_ATTRIBUTE_MAP = {'email': 'email',\n 'first': 'given_name',\n 'first_name': 'given_name',\n 'given_name': 'given_name',\n 'last': 'family_name',\n 'last_name': 'family_name',\n 'family_name': 'family_name',\n 'gender': 'gender',\n 'link': 'link',\n 'locale': 'locale',\n 'name': 'name',\n 'phone': 'phone',\n 'picture': 'picture',\n 'timezone': 'timezone',\n 'pwd_hash': 'pwd_hash',\n 'salt': 'salt'}\n \"\"\"Maps from attribute names provided by the various auth handlers to attribute names used\n in the user schema.\n \"\"\"\n\n\n\n\n", "metadata": "root.AuthHandler", "header": "['module', '___EOS___']", "index": 45 }, { "content": " @gen.coroutine\n def _StartJSONRequest(self, action, request, schema, migrators=None):\n \"\"\"Validates the request using the specified schema, and saves the message object as\n self._request_message. A call to this method is matched by a later call to _FinishJSONRequest.\n \"\"\"\n try:\n # Set api_name for use in any error response.\n self.api_name = action\n\n self._action = action\n self._request_message = yield gen.Task(base.BaseHandler._CreateRequestMessage,\n self._client,\n self._LoadJSONRequest(),\n schema,\n migrators=migrators)\n except Exception as e:\n logging.warning('invalid authentication request:\\n%s: %r\\n%s' %\n (type(e).__name__, e.message, util.FormatLogArgument(request.body)))\n raise web.HTTPError(400, 'Invalid registration request.')", "metadata": "root.AuthHandler._StartJSONRequest", "header": "['class', 'AuthHandler', '(', 'base', '.', 'BaseHandler', ')', ':', '___EOS___']", "index": 68 }, { "content": " @gen.engine\n def _FinishJSONRequest(self, op, response_dict, schema):\n \"\"\"Finishes an authentication request by a mobile client and sends back the specified\n response as JSON.\n \"\"\"\n # Add operation id and timestamp to the response header.\n if op is not None:\n scratch_response_dict = deepcopy(response_dict)\n scratch_response_dict['headers'] = {'op_id': op.operation_id,\n 'op_timestamp': op.timestamp}\n else:\n scratch_response_dict = response_dict\n\n self.set_header('Content-Type', 'application/json; charset=UTF-8')\n response_message = yield gen.Task(base.BaseHandler._CreateResponseMessage,\n self._client, scratch_response_dict, schema,\n self._request_message.original_version)\n\n # Write response back to the client.\n self.write(response_message.dict)\n self.finish()", "metadata": "root.AuthHandler._FinishJSONRequest", "header": "['class', 'AuthHandler', '(', 'base', '.', 'BaseHandler', ')', ':', '___EOS___']", "index": 88 }, { "content": " def _StartInteractiveRequest(self, action):\n \"\"\"Called when an interactive requester has started the authentication\n process. Enables HTML exceptions.\n \"\"\"\n self._action = action", "metadata": "root.AuthHandler._StartInteractiveRequest", "header": "['class', 'AuthHandler', '(', 'base', '.', 'BaseHandler', ')', ':', '___EOS___']", "index": 110 }, { "content": " def _FinishInteractiveRequest(self):\n \"\"\"Called when an interactive requester has been authenticated as\n a Viewfinder user. Sets the user cookie and redirects the user to\n either the original URL that was requested, or to the user's photo\n view.\n \"\"\"\n next = self.get_argument('next', None)\n if next is not None:\n self.redirect(next)\n else:\n self.redirect('/view')", "metadata": "root.AuthHandler._FinishInteractiveRequest", "header": "['class', 'AuthHandler', '(', 'base', '.', 'BaseHandler', ')', ':', '___EOS___']", "index": 116 }, { "content": " @gen.coroutine\n def _PrepareAuthUser(self, user_dict, ident_dict, device_dict):\n \"\"\"Validates incoming user, identity, and device information in preparation for login,\n register, or link action. Derives user id and name and sets them into the user dict.\n \"\"\"\n # Create json_attrs from the user_dict returned by the auth service.\n ident_dict['json_attrs'] = user_dict\n\n # Check whether identity is already created.\n identity = yield gen.Task(Identity.Query, self._client, ident_dict['key'], None, must_exist=False)\n\n # Ensure that user id and device id are allocated.\n current_user = self.get_current_user()\n\n # Find or allocate the user id.\n if self._action in ['login', 'login_reset']:\n # Require identity to already be linked to an account.\n if identity is not None and identity.user_id is not None:\n user = yield gen.Task(User.Query, self._client, identity.user_id, None, must_exist=False)\n else:\n user = None\n\n if user is None:\n raise PermissionError(NO_USER_ACCOUNT, account=Identity.GetDescription(ident_dict['key']))\n\n if not user.IsRegistered():\n # Cannot log into an unregistered account.\n raise PermissionError(LOGIN_REQUIRES_REGISTER)\n\n user_dict['user_id'] = identity.user_id\n elif self._action == 'register':\n if identity is not None and identity.user_id is not None:\n # Identity should already be bound to a user, so only proceed if registering a prospective user.\n user = yield gen.Task(User.Query, self._client, identity.user_id, None, must_exist=False)\n if user is None or user.IsRegistered():\n # User can be None if there's a DB corruption, or if it's still in the process of\n # creation. Treat this case the same as if the user exists but is already registered. \n raise PermissionError(ALREADY_REGISTERED, account=Identity.GetDescription(identity.key))\n\n user_dict['user_id'] = user.user_id\n else:\n # Construct a prospective user with newly allocated user id and web device id.\n user_id, webapp_dev_id = yield User.AllocateUserAndWebDeviceIds(self._client)\n user_dict['user_id'] = user_id\n\n request = {'headers': {'synchronous': True},\n 'user_id': user_id,\n 'webapp_dev_id': webapp_dev_id,\n 'identity_key': ident_dict['key'],\n 'reason': 'register'}\n yield gen.Task(Operation.CreateAndExecute,\n self._client,\n user_id,\n webapp_dev_id,\n 'CreateProspectiveOperation.Execute',\n request)\n\n user = yield gen.Task(User.Query, self._client, user_id, None)\n identity = yield gen.Task(Identity.Query, self._client, ident_dict['key'], None)\n\n if options.options.freeze_new_accounts:\n raise web.HTTPError(403, _FREEZE_NEW_ACCOUNTS_MESSAGE)\n else:\n assert self._action == 'link', self._action\n if current_user is None:\n # This case should never happen in the mobile or web clients, since they will not offer\n # the option to link if the user is not already logged in. But it could happen with a\n # direct API call.\n raise PermissionError(MERGE_REQUIRES_LOGIN)\n\n if not current_user.IsRegistered():\n raise web.HTTPError(403, _CANNOT_LINK_TO_PROSPECTIVE)\n\n if identity is not None and identity.user_id is not None and current_user.user_id != identity.user_id:\n raise PermissionError(ALREADY_LINKED, account=Identity.GetDescription(ident_dict['key']))\n\n # Ensure that the new identity is created.\n if identity is None:\n identity = Identity.CreateFromKeywords(key=ident_dict['key'])\n yield gen.Task(identity.Update, self._client)\n\n user = current_user\n user_dict['user_id'] = current_user.user_id\n\n assert user, user_dict\n assert identity, ident_dict\n\n if device_dict is not None:\n if 'device_id' in device_dict:\n # If device_id was specified, it must be owned by the calling user.\n if 'user_id' in user_dict:\n # Raise error if the device specified in the device dict is not owned by the calling user.\n device = yield gen.Task(Device.Query, self._client, user_dict['user_id'], device_dict['device_id'],\n None, must_exist=False)\n if device is None:\n raise web.HTTPError(403, 'user %d does not own device %d' %\n (user_dict['user_id'], device_dict['device_id']))\n else:\n logging.warning('device_id cannot be set when user does not yet exist: %s' % device_dict)\n raise web.HTTPError(403, _CANNOT_SET_DEVICE_FOR_USER_MESSAGE)\n\n raise gen.Return(user)", "metadata": "root.AuthHandler._PrepareAuthUser", "header": "['class', 'AuthHandler', '(', 'base', '.', 'BaseHandler', ')', ':', '___EOS___']", "index": 128 }, { "content": " @gen.engine\n def _AuthUser(self, user_dict, ident_dict, device_dict, confirmed=False):\n \"\"\"Called when a requester has been authenticated as a Viewfinder user by a trusted authority\n that provides additional information about the user, such as name, email, gender, etc. At\n this point, we can trust that the identity key provided in \"ident_dict\" is controlled by the\n calling user.\n\n Completes the authentication action in two steps: first, makes sure the user id and device\n id are retrieved or allocated as necessary; second, starts a user registration operation and\n returns a login cookie. If \"confirmed\" is True, then the \"confirm_time\" field in the user\n cookie is set, indicating the time at which the user confirmed their control of the identity\n via email or SMS. This type of cookie is necessary to perform certain high-privilege\n operations, such as updating the password.\n\n Registration is synchronous, meaning that the caller will wait until it is complete. This\n ensures that when the caller tries to login immediately following this call, the new user\n will be created and ready.\n \"\"\"\n before_user = yield gen.Task(self._PrepareAuthUser, user_dict, ident_dict, device_dict)\n\n # Map auth attribute names to those used by User schema and exclude any attributes that are not yet stored\n # in the User table.\n scratch_user_dict = {'user_id': user_dict['user_id']}\n for k, v in user_dict.items():\n user_key = AuthHandler._AUTH_ATTRIBUTE_MAP.get(k, None)\n if user_key is not None:\n if getattr(before_user, user_key) is None:\n scratch_user_dict[user_key] = v\n\n # Set facebook email if it has not yet been set.\n if user_key == 'email' and ident_dict['authority'] == 'Facebook':\n if getattr(before_user, 'facebook_email') is None:\n scratch_user_dict['facebook_email'] = v\n\n # If the device id is not present, then allocate it now.\n if device_dict is not None and 'device_id' not in device_dict:\n device_dict['device_id'] = yield gen.Task(Device._allocator.NextId, self._client)\n\n # Make synchronous request to ensure user is fully created before returning.\n request = {'headers': {'synchronous': True},\n 'user_dict': scratch_user_dict,\n 'ident_dict': ident_dict,\n 'device_dict': device_dict}\n op = yield gen.Task(Operation.CreateAndExecute,\n self._client,\n user_dict['user_id'],\n device_dict['device_id'] if device_dict is not None else before_user.webapp_dev_id,\n 'RegisterUserOperation.Execute',\n request)\n\n if self._action == 'link':\n # Now make asynchronous request (or synchronous if requested by client) to fetch contacts.\n # Fetching contacts can take a long time, so best to do this in the background by default.\n request = {'key': ident_dict['key'],\n 'user_id': user_dict['user_id']}\n if self._IsInteractiveRequest() or self._request_message.dict['headers'].get('synchronous', False):\n request['headers'] = {'synchronous': True}\n\n op = yield gen.Task(Operation.CreateAndExecute,\n self._client,\n user_dict['user_id'],\n device_dict['device_id'] if device_dict is not None else before_user.webapp_dev_id,\n 'FetchContactsOperation.Execute',\n request)\n\n # Get the user that was registered by the operation.\n after_user = yield gen.Task(User.Query, self._client, user_dict['user_id'], None)\n\n # If the identity was confirmed via email/SMS, set the cookie \"confirm_time\", which allows\n # the cookie to authorize higher privilege operations, such as setting the user password.\n confirm_time = util.GetCurrentTimestamp() if confirmed else None\n\n # Create the user cookie dict that will be returned to the caller.\n device_id = after_user.webapp_dev_id if device_dict is None else device_dict['device_id']\n user_cookie_dict = self.CreateUserCookieDict(after_user.user_id,\n device_id,\n after_user.name,\n confirm_time=confirm_time)\n\n # Sets the user cookie and finishes the request.\n if self._IsInteractiveRequest():\n self.SetUserCookie(user_cookie_dict)\n self._FinishInteractiveRequest()\n else:\n response_dict = {'user_id': user_dict['user_id']}\n if device_dict is not None:\n response_dict['device_id'] = device_dict['device_id']\n\n use_session_cookie = self._request_message.dict.get('use_session_cookie', None)\n util.SetIfNotNone(user_cookie_dict, 'is_session_cookie', use_session_cookie)\n\n self.SetUserCookie(user_cookie_dict)\n self._FinishJSONRequest(op, response_dict, json_schema.AUTH_RESPONSE)", "metadata": "root.AuthHandler._AuthUser", "header": "['class', 'AuthHandler', '(', 'base', '.', 'BaseHandler', ')', ':', '___EOS___']", "index": 231 }, { "content": "class AuthFormHandler(base.BaseHandler):\n \"\"\"Displays a form allowing users to sign in or register. The form will be adjusted depending\n on if this is a 'cold' login, or a registration by a prospective user.\n \"\"\"\n", "metadata": "root.AuthFormHandler", "header": "['module', '___EOS___']", "index": 326 }, { "content": " @handler.asynchronous(datastore=True)\n @gen.engine\n def get(self):\n current_user = self.get_current_user()\n\n if self.get_argument('clear', None) is not None:\n self.ClearUserCookie()\n current_user = None\n\n if not current_user:\n self.render('auth_login.html')\n elif not current_user.IsRegistered():\n signup_ident = yield gen.Task(current_user.QueryPrimaryIdentity, self._client)\n\n # The user will have a confirmed cookie in some cases - the signup process does\n # not need to reconfirm the user's identity in this case. To handle the merge\n # case, we need to provide the original confirmed user cookie in the page's html.\n is_confirmed = base.ViewfinderContext.current().IsConfirmedUser()\n merge_cookie = self.get_cookie(base._USER_COOKIE_NAME) if is_confirmed else None\n self.render('auth_register.html',\n signup_ident=signup_ident.key,\n merge_cookie=merge_cookie)\n else:\n self.redirect('/view')", "metadata": "root.AuthFormHandler.get", "header": "['class', 'AuthFormHandler', '(', 'base', '.', 'BaseHandler', ')', ':', '___EOS___']", "index": 331 }, { "content": "class LogoutHandler(base.BaseHandler):\n \"\"\"Simple handler to log out the current user by clearing their cookie.\"\"\"\n", "metadata": "root.LogoutHandler", "header": "['module', '___EOS___']", "index": 357 }, { "content": " def get(self):\n self.ClearUserCookie()\n self.redirect('/')", "metadata": "root.LogoutHandler.get", "header": "['class', 'LogoutHandler', '(', 'base', '.', 'BaseHandler', ')', ':', '___EOS___']", "index": 360 } ]
[ { "span": "import validictory", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 18 }, { "span": "from viewfinder.backend.www import base, json_schema, www_util", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 62 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2011", " ", "View", "finde", "r", " ", "Inc", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Base", " ", "class", " ", "for", " ", "vari", "ous", " ", "handler", "s", " ", "whi", "ch", " ", "authenticat", "e", " ", "user", " ", "identities", " ", "and", " ", "request", " ", "necessar", "y", "\\", "10", ";", "permissi", "ons", " ", "for", " ", "them", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", "Auth", "Goo", "gle", "Handle", "r", ":", " ", "authenticat", "es", " ", "via", " ", "Goo", "gle", ".", "\\", "10", ";", " ", " ", "Auth", "Face", "book", "Handle", "r", ":", " ", "authenticat", "es", " ", "via", " ", "Face", "book", ".", "\\", "10", ";", " ", " ", "Auth", "View", "finde", "r", "Handle", "r", ":", " ", "authenticat", "es", " ", "usi", "ng", " ", "View", "finde", "r", "'", "s", " ", "own", " ", "identi", "ty", " ", "system", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "authors\\u", "\\u_", "=_", "[_", "'", "spe", "nce", "r", "@", "email", "scrub", "bed", ".", "com", " ", "(", "Spe", "nce", "r", " ", "Ki", "mba", "ll", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "and", "y", "@", "email", "scrub", "bed", ".", "com", " ", "(", "And", "y", " ", "Ki", "mba", "ll", ")'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "valid", "ict", "ory", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "copy_", "import_", "deepcopy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "import_", "gen_", ",_", "options_", ",_", "web_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "base_", "import_", "handler_", ",_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "base_", "._", "exceptions_", "import_", "Permi", "ssion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "._", "device_", "import_", "Device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "._", "identity_", "import_", "Identity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "._", "operation_", "import_", "Operation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "._", "user_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "resources_", "._", "message_", "._", "error", "\\u", "messages_", "import_", "ALREADY", "\\u", "LINK", "ED_", ",_", "ALREADY", "\\u", "REGISTER", "ED_", ",_", "NO", "\\u", "USER", "\\u", "ACCOUNT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "resources_", "._", "message_", "._", "error", "\\u", "messages_", "import_", "MERGE", "\\u", "REQUIRE", "S", "\\u", "LOGIN", "_", ",_", "LOGIN", "\\u", "REQUIRE", "S", "\\u", "REGISTER", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "www", "_", "import_", "base_", ",_", "json", "\\u", "schema_", ",_", "www", "\\u", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "define_", "(_", "'", "freez", "e\\u", "new", "\\u", "account", "s", "'_", ",_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "disallow", " ", "creati", "on", " ", "of", " ", "new", " ", "account", "s", " ", "from", " ", "mobile", " ", "applica", "tion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "NEED", "\\u", "INVI", "TAT", "ION", "\\u", "MESSAGE_", "=_", "'", "You", " ", "must", " ", "receive", " ", "an", " ", "invitation", " ", "to", " ", "register", " ", "a", " ", "View", "finde", "r", " ", "account", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "ACCOUNT", "\\u", "ALREADY", "\\u", "LINK", "ED", "\\u", "MESSAGE_", "=_", "'", "There", " ", "is", " ", "alr", "ead", "y", " ", "a", " ", "View", "finde", "r", " ", "user", " ", "linked", " ", "to", " ", "this", " ", "account", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "CANNO", "T", "\\u", "SET", "\\u", "DEV", "ICE", "\\u", "FOR", "\\u", "USER", "\\u", "MESSAGE_", "=_", "'", "Cann", "ot", " ", "set", " ", "device", " ", "for", " ", "non", "-", "existen", "t", " ", "View", "finde", "r", " ", "account", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "FREE", "ZE", "\\u", "NEW", "\\u", "ACCOUNT", "S", "\\u", "MESSAGE_", "=_", "'", "Du", "e", " ", "to", " ", "soa", "ring", " ", "popular", "it", "y", " ", "and", " ", "demand", ",", " ", "we", " ", "can", "\\\\'", "t", " ", "provide", " ", "you", " ", "'_", "+_", "'", "with", " ", "a", " ", "View", "finde", "r", " ", "account", " ", "right", " ", "now", ".", " ", "Bu", "t", " ", "plea", "se", " ", "do", " ", "try", " ", "again", " ", "late", "r", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "CANNO", "T", "\\u", "LINK", "\\u", "TO", "\\u", "PRO", "SPEC", "TIVE", "_", "=_", "'", "You", " ", "have", " ", "not", " ", "register", "ed", " ", "your", " ", "View", "finde", "r", " ", "account", ".", " ", "Register", " ", "your", " ", "'_", "+_", "'", "account", " ", "bef", "ore", " ", "addin", "g", " ", "new", " ", "email", " ", "addresse", "s", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Auth", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "all", " ", "auth", " ", "handler", "s", " ", "tha", "t", " ", "contain", "s", " ", "utility", " ", "method", "s", " ", "used", "\\", "10", ";", " ", " ", "by", " ", "multiple", " ", "derive", "d", " ", "classe", "s", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "AUTH", "\\u", "ATTRIBUTE", "\\u", "MAP_", "=_", "{_", "'", "email", "'_", ":_", "'", "email", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "'_", ":_", "'", "give", "n", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "'", "give", "n", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "give", "n", "\\u", "name", "'_", ":_", "'", "give", "n", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "'_", ":_", "'", "famil", "y", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "'", "famil", "y", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "\\u", "name", "'_", ":_", "'", "famil", "y", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gender", "'_", ":_", "'", "gender", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "'", "link", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "locale", "'_", ":_", "'", "locale", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "'_", ":_", "'", "phone", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pic", "ture", "'_", ":_", "'", "pic", "ture", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timezon", "e", "'_", ":_", "'", "timezon", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pwd", "\\u", "hash", "'_", ":_", "'", "pwd", "\\u", "hash", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "salt", "'_", ":_", "'", "salt", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "Map", "s", " ", "from", " ", "attribute", " ", "names", " ", "provided", " ", "by", " ", "the", " ", "vari", "ous", " ", "auth", " ", "handler", "s", " ", "to", " ", "attribute", " ", "names", " ", "used", "\\", "10", ";", " ", " ", "in", " ", "the", " ", "user", " ", "schema", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Auth", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "gen_", "._", "coroutine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "Start", "JSONR", "eque", "st_", "(_", "self_", ",_", "action_", ",_", "request_", ",_", "schema_", ",_", "migr", "ator", "s_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", "s", " ", "the", " ", "request", " ", "usi", "ng", " ", "the", " ", "specified", " ", "schema", ",", " ", "and", " ", "save", "s", " ", "the", " ", "message", " ", "object", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "self", ".\\u", "request", "\\u", "message", ".", " ", "A", " ", "call", " ", "to", " ", "this", " ", "method", " ", "is", " ", "matche", "d", " ", "by", " ", "a", " ", "late", "r", " ", "call", " ", "to", " ", "\\u", "Finish", "JSONR", "eque", "st", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "api", "\\u", "name", " ", "for", " ", "use", " ", "in", " ", "any", " ", "error", " ", "response", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "api", "\\u", "name_", "=_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "action_", "=_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "request", "\\u", "message_", "=_", "yield_", "gen_", "._", "Task_", "(_", "base_", "._", "Base", "Handler_", "._", "\\u", "Creat", "e", "Request", "Message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "client_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "Load", "JSONR", "eque", "st_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "migr", "ator", "s_", "=_", "migr", "ator", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "warning_", "(_", "'", "invalid", " ", "authenticat", "ion", " ", "request", ":\\\\", "n", "%", "s", ":", " ", "%", "r", "\\\\", "n", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "type_", "(_", "e_", ")_", "._", "\\u\\u", "name\\u\\u_", ",_", "e_", "._", "message_", ",_", "util_", "._", "Format", "Log", "Argument_", "(_", "request_", "._", "body_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "web_", "._", "HTTP", "Error_", "(_", "400_", ",_", "'", "Inva", "lid", " ", "registration", " ", "request", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "Finish", "JSONR", "eque", "st_", "(_", "self_", ",_", "op_", ",_", "response", "\\u", "dict_", ",_", "schema_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Finish", "es", " ", "an", " ", "authenticat", "ion", " ", "request", " ", "by", " ", "a", " ", "mobile", " ", "client", " ", "and", " ", "send", "s", " ", "back", " ", "the", " ", "specified", "\\", "10", ";", " ", " ", " ", " ", "response", " ", "as", " ", "JSO", "N", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "operati", "on", " ", "id", " ", "and", " ", "timestamp", " ", "to", " ", "the", " ", "response", " ", "header", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "op_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scratch", "\\u", "response", "\\u", "dict_", "=_", "deepcopy_", "(_", "response", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scratch", "\\u", "response", "\\u", "dict_", "[_", "'", "header", "s", "'_", "]_", "=_", "{_", "'", "op", "\\u", "id", "'_", ":_", "op_", "._", "operati", "on", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "op", "\\u", "timestamp", "'_", ":_", "op_", "._", "timestamp_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scratch", "\\u", "response", "\\u", "dict_", "=_", "response", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set\\u", "header_", "(_", "'", "Conten", "t", "-", "Type", "'_", ",_", "'", "applica", "tion", "/", "json", ";", " ", "charset", "=", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "message_", "=_", "yield_", "gen_", "._", "Task_", "(_", "base_", "._", "Base", "Handler_", "._", "\\u", "Creat", "e", "Respons", "e", "Message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "client_", ",_", "scratch", "\\u", "response", "\\u", "dict_", ",_", "schema_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "request", "\\u", "message_", "._", "original", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Write", " ", "response", " ", "back", " ", "to", " ", "the", " ", "client", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "write_", "(_", "response", "\\u", "message_", "._", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "finish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Start", "Interact", "ive", "Request_", "(_", "self_", ",_", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", "ed", " ", "whe", "n", " ", "an", " ", "interactive", " ", "requester", " ", "has", " ", "start", "ed", " ", "the", " ", "authenticat", "ion", "\\", "10", ";", " ", " ", " ", " ", "process", ".", " ", "Enable", "s", " ", "HTM", "L", " ", "exception", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "action_", "=_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Finish", "Interact", "ive", "Request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", "ed", " ", "whe", "n", " ", "an", " ", "interactive", " ", "requester", " ", "has", " ", "bee", "n", " ", "authenticat", "ed", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "View", "finde", "r", " ", "user", ".", " ", "Set", "s", " ", "the", " ", "user", " ", "cookie", " ", "and", " ", "redirec", "ts", " ", "the", " ", "user", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "eit", "her", " ", "the", " ", "original", " ", "URL", " ", "tha", "t", " ", "was", " ", "request", "ed", ",", " ", "or", " ", "to", " ", "the", " ", "user", "'", "s", " ", "photo", "\\", "10", ";", " ", " ", " ", " ", "view", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next_", "=_", "self_", "._", "get", "\\u", "argument_", "(_", "'", "next", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "next_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "redirect_", "(_", "next_", ")_", "\\u\\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_", "._", "redirect_", "(_", "'/", "view", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "gen_", "._", "coroutine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "Prepare", "Auth", "User_", "(_", "self_", ",_", "user", "\\u", "dict_", ",_", "ident", "\\u", "dict_", ",_", "device", "\\u", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", "s", " ", "inco", "ming", " ", "user", ",", " ", "identi", "ty", ",", " ", "and", " ", "device", " ", "informati", "on", " ", "in", " ", "preparation", " ", "for", " ", "login", ",", "\\", "10", ";", " ", " ", " ", " ", "register", ",", " ", "or", " ", "link", " ", "action", ".", " ", "Derive", "s", " ", "user", " ", "id", " ", "and", " ", "name", " ", "and", " ", "sets", " ", "them", " ", "int", "o", " ", "the", " ", "user", " ", "dict", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "json", "\\u", "attr", "s", " ", "from", " ", "the", " ", "user", "\\u", "dict", " ", "return", "ed", " ", "by", " ", "the", " ", "auth", " ", "service", "._", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "[_", "'", "json", "\\u", "attr", "s", "'_", "]_", "=_", "user", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "whe", "ther", " ", "identi", "ty", " ", "is", " ", "alr", "ead", "y", " ", "created", "._", "\\u\\u\\uNL\\u\\u\\u_", "identity_", "=_", "yield_", "gen_", "._", "Task_", "(_", "Identity_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "ident", "\\u", "dict_", "[_", "'", "key", "'_", "]_", ",_", "None_", ",_", "must", "\\u", "exist_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "tha", "t", " ", "user", " ", "id", " ", "and", " ", "device", " ", "id", " ", "are", " ", "allocated", "._", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "user_", "=_", "self_", "._", "get", "\\u", "current", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "or", " ", "allocate", " ", "the", " ", "user", " ", "id", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "action_", "in_", "[_", "'", "login", "'_", ",_", "'", "login", "\\u", "reset", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Requ", "ire", " ", "identi", "ty", " ", "to", " ", "alr", "ead", "y", " ", "be", " ", "linked", " ", "to", " ", "an", " ", "account", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "identity_", "is_", "not_", "None_", "and_", "identity_", "._", "user", "\\u", "id_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "yield_", "gen_", "._", "Task_", "(_", "User_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "identity_", "._", "user", "\\u", "id_", ",_", "None_", ",_", "must", "\\u", "exist_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "user_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Permi", "ssion", "Error_", "(_", "NO", "\\u", "USER", "\\u", "ACCOUNT", "_", ",_", "account_", "=_", "Identity_", "._", "Get", "Description_", "(_", "ident", "\\u", "dict_", "[_", "'", "key", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "user_", "._", "Is", "Register", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cann", "ot", " ", "log", " ", "int", "o", " ", "an", " ", "unregister", "ed", " ", "account", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Permi", "ssion", "Error_", "(_", "LOGIN", "\\u", "REQUIRE", "S", "\\u", "REGISTER", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", "=_", "identity_", "._", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "\\u", "action_", "==_", "'", "register", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "identity_", "is_", "not_", "None_", "and_", "identity_", "._", "user", "\\u", "id_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ident", "it", "y", " ", "shou", "ld", " ", "alr", "ead", "y", " ", "be", " ", "bound", " ", "to", " ", "a", " ", "user", ",", " ", "so", " ", "only", " ", "proceed", " ", "if", " ", "register", "ing", " ", "a", " ", "prospe", "ctive", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "yield_", "gen_", "._", "Task_", "(_", "User_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "identity_", "._", "user", "\\u", "id_", ",_", "None_", ",_", "must", "\\u", "exist_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "user_", "is_", "None_", "or_", "user_", "._", "Is", "Register", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "User", " ", "can", " ", "be", " ", "Non", "e", " ", "if", " ", "there", "'", "s", " ", "a", " ", "DB", " ", "corrupt", "ion", ",", " ", "or", " ", "if", " ", "it", "'", "s", " ", "still", " ", "in", " ", "the", " ", "process", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "creati", "on", ".", " ", "Treat", " ", "this", " ", "case", " ", "the", " ", "same", " ", "as", " ", "if", " ", "the", " ", "user", " ", "exist", "s", " ", "but", " ", "is", " ", "alr", "ead", "y", " ", "register", "ed", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Permi", "ssion", "Error_", "(_", "ALREADY", "\\u", "REGISTER", "ED_", ",_", "account_", "=_", "Identity_", "._", "Get", "Description_", "(_", "identity_", "._", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", "=_", "user_", "._", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Construct", " ", "a", " ", "prospe", "ctive", " ", "user", " ", "with", " ", "newl", "y", " ", "allocated", " ", "user", " ", "id", " ", "and", " ", "web", " ", "device", " ", "id", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "id_", ",_", "weba", "pp", "\\u", "dev", "\\u", "id_", "=_", "yield_", "User_", "._", "Allocate", "User", "And", "Web", "Dev", "ice", "Ids_", "(_", "self_", "._", "\\u", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", "=_", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "{_", "'", "header", "s", "'_", ":_", "{_", "'", "synchron", "ous", "'_", ":_", "True_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "id", "'_", ":_", "user", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "weba", "pp", "\\u", "dev", "\\u", "id", "'_", ":_", "weba", "pp", "\\u", "dev", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "identi", "ty", "\\u", "key", "'_", ":_", "ident", "\\u", "dict_", "[_", "'", "key", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reason", "'_", ":_", "'", "register", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "gen_", "._", "Task_", "(_", "Operation_", "._", "Creat", "e", "And", "Execute_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "client_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "weba", "pp", "\\u", "dev", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Creat", "e", "Pro", "spect", "ive", "Opera", "tion", ".", "Execut", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "yield_", "gen_", "._", "Task_", "(_", "User_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "user", "\\u", "id_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "identity_", "=_", "yield_", "gen_", "._", "Task_", "(_", "Identity_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "ident", "\\u", "dict_", "[_", "'", "key", "'_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "options_", "._", "freez", "e\\u", "new", "\\u", "accounts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "web_", "._", "HTTP", "Error_", "(_", "403_", ",_", "\\u", "FREE", "ZE", "\\u", "NEW", "\\u", "ACCOUNT", "S", "\\u", "MESSAGE_", ")_", "\\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 ", " _", "assert_", "self_", "._", "\\u", "action_", "==_", "'", "link", "'_", ",_", "self_", "._", "\\u", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "current", "\\u", "user_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "case", " ", "shou", "ld", " ", "neve", "r", " ", "happ", "en", " ", "in", " ", "the", " ", "mobile", " ", "or", " ", "web", " ", "clients", ",", " ", "sinc", "e", " ", "the", "y", " ", "will", " ", "not", " ", "offer_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "option", " ", "to", " ", "link", " ", "if", " ", "the", " ", "user", " ", "is", " ", "not", " ", "alr", "ead", "y", " ", "logged", " ", "in", ".", " ", "Bu", "t", " ", "it", " ", "coul", "d", " ", "happ", "en", " ", "with", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "direct", " ", "API", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Permi", "ssion", "Error_", "(_", "MERGE", "\\u", "REQUIRE", "S", "\\u", "LOGIN", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "current", "\\u", "user_", "._", "Is", "Register", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "web_", "._", "HTTP", "Error_", "(_", "403_", ",_", "\\u", "CANNO", "T", "\\u", "LINK", "\\u", "TO", "\\u", "PRO", "SPEC", "TIVE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "identity_", "is_", "not_", "None_", "and_", "identity_", "._", "user", "\\u", "id_", "is_", "not_", "None_", "and_", "current", "\\u", "user_", "._", "user", "\\u", "id_", "!=_", "identity_", "._", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Permi", "ssion", "Error_", "(_", "ALREADY", "\\u", "LINK", "ED_", ",_", "account_", "=_", "Identity_", "._", "Get", "Description_", "(_", "ident", "\\u", "dict_", "[_", "'", "key", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "tha", "t", " ", "the", " ", "new", " ", "identi", "ty", " ", "is", " ", "created", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "identity_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "identity_", "=_", "Identity_", "._", "Creat", "e", "Fro", "m", "Keywords_", "(_", "key_", "=_", "ident", "\\u", "dict_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "gen_", "._", "Task_", "(_", "identity_", "._", "Update_", ",_", "self_", "._", "\\u", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user_", "=_", "current", "\\u", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", "=_", "current", "\\u", "user_", "._", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "user_", ",_", "user", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "identity_", ",_", "ident", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "device", "\\u", "dict_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "device", "\\u", "id", "'_", "in_", "device", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "device", "\\u", "id", " ", "was", " ", "specified", ",", " ", "it", " ", "must", " ", "be", " ", "owned", " ", "by", " ", "the", " ", "calling", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "user", "\\u", "id", "'_", "in_", "user", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Rai", "se", " ", "error", " ", "if", " ", "the", " ", "device", " ", "specified", " ", "in", " ", "the", " ", "device", " ", "dict", " ", "is", " ", "not", " ", "owned", " ", "by", " ", "the", " ", "calling", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "device_", "=_", "yield_", "gen_", "._", "Task_", "(_", "Device_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "device", "\\u", "dict_", "[_", "'", "device", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "must", "\\u", "exist_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "device_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "web_", "._", "HTTP", "Error_", "(_", "403_", ",_", "'", "user", " ", "%", "d", " ", "doe", "s", " ", "not", " ", "own", " ", "device", " ", "%", "d", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "device", "\\u", "dict_", "[_", "'", "device", "\\u", "id", "'_", "]_", ")_", ")_", "\\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 ", " _", "logging_", "._", "warning_", "(_", "'", "device", "\\u", "id", " ", "cann", "ot", " ", "be", " ", "set", " ", "whe", "n", " ", "user", " ", "doe", "s", " ", "not", " ", "ye", "t", " ", "exist", ":", " ", "%", "s", "'_", "%_", "device", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "web_", "._", "HTTP", "Error_", "(_", "403_", ",_", "\\u", "CANNO", "T", "\\u", "SET", "\\u", "DEV", "ICE", "\\u", "FOR", "\\u", "USER", "\\u", "MESSAGE_", ")_", "\\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_", "raise_", "gen_", "._", "Return_", "(_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "Auth", "User_", "(_", "self_", ",_", "user", "\\u", "dict_", ",_", "ident", "\\u", "dict_", ",_", "device", "\\u", "dict_", ",_", "confirmed_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", "ed", " ", "whe", "n", " ", "a", " ", "requester", " ", "has", " ", "bee", "n", " ", "authenticat", "ed", " ", "as", " ", "a", " ", "View", "finde", "r", " ", "user", " ", "by", " ", "a", " ", "trusted", " ", "authori", "ty", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "provide", "s", " ", "addition", "al", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "user", ",", " ", "suc", "h", " ", "as", " ", "name", ",", " ", "email", ",", " ", "gender", ",", " ", "etc", ".", " ", "At", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "point", ",", " ", "we", " ", "can", " ", "trust", " ", "tha", "t", " ", "the", " ", "identi", "ty", " ", "key", " ", "provided", " ", "in", " ", "\"", "ident", "\\u", "dict", "\"", " ", "is", " ", "controlle", "d", " ", "by", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "calling", " ", "user", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Complete", "s", " ", "the", " ", "authenticat", "ion", " ", "action", " ", "in", " ", "two", " ", "step", "s", ":", " ", "first", ",", " ", "make", "s", " ", "sure", " ", "the", " ", "user", " ", "id", " ", "and", " ", "device", "\\", "10", ";", " ", " ", " ", " ", "id", " ", "are", " ", "retrieved", " ", "or", " ", "allocated", " ", "as", " ", "necessar", "y", ";", " ", "second", ",", " ", "starts", " ", "a", " ", "user", " ", "registration", " ", "operati", "on", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "return", "s", " ", "a", " ", "login", " ", "cookie", ".", " ", "If", " ", "\"", "confirm", "ed", "\"", " ", "is", " ", "Tru", "e", ",", " ", "then", " ", "the", " ", "\"", "confirm", "\\u", "time", "\"", " ", "field", " ", "in", " ", "the", " ", "user", "\\", "10", ";", " ", " ", " ", " ", "cookie", " ", "is", " ", "set", ",", " ", "indicati", "ng", " ", "the", " ", "time", " ", "at", " ", "whi", "ch", " ", "the", " ", "user", " ", "confirm", "ed", " ", "thei", "r", " ", "control", " ", "of", " ", "the", " ", "identi", "ty", "\\", "10", ";", " ", " ", " ", " ", "via", " ", "email", " ", "or", " ", "SMS", ".", " ", "Thi", "s", " ", "type", " ", "of", " ", "cookie", " ", "is", " ", "necessar", "y", " ", "to", " ", "perform", " ", "cert", "ain", " ", "high", "-", "privilege", "\\", "10", ";", " ", " ", " ", " ", "operati", "ons", ",", " ", "suc", "h", " ", "as", " ", "updat", "ing", " ", "the", " ", "password", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Registration", " ", "is", " ", "synchron", "ous", ",", " ", "meaning", " ", "tha", "t", " ", "the", " ", "caller", " ", "will", " ", "wait", " ", "unti", "l", " ", "it", " ", "is", " ", "complete", ".", " ", "Thi", "s", "\\", "10", ";", " ", " ", " ", " ", "ensure", "s", " ", "tha", "t", " ", "whe", "n", " ", "the", " ", "caller", " ", "trie", "s", " ", "to", " ", "login", " ", "immediate", "ly", " ", "follow", "ing", " ", "this", " ", "call", ",", " ", "the", " ", "new", " ", "user", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "be", " ", "created", " ", "and", " ", "read", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bef", "ore", "\\u", "user_", "=_", "yield_", "gen_", "._", "Task_", "(_", "self_", "._", "\\u", "Prepare", "Auth", "User_", ",_", "user", "\\u", "dict_", ",_", "ident", "\\u", "dict_", ",_", "device", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Map", " ", "auth", " ", "attribute", " ", "names", " ", "to", " ", "tho", "se", " ", "used", " ", "by", " ", "User", " ", "schema", " ", "and", " ", "exclu", "de", " ", "any", " ", "attribute", "s", " ", "tha", "t", " ", "are", " ", "not", " ", "ye", "t", " ", "stored_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "User", " ", "table", "._", "\\u\\u\\uNL\\u\\u\\u_", "scratch", "\\u", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "user", "\\u", "dict_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "key_", "=_", "Auth", "Handler_", "._", "\\u", "AUTH", "\\u", "ATTRIBUTE", "\\u", "MAP_", "._", "get_", "(_", "k_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "user", "\\u", "key_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "getattr_", "(_", "bef", "ore", "\\u", "user_", ",_", "user", "\\u", "key_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scratch", "\\u", "user", "\\u", "dict_", "[_", "user", "\\u", "key_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "facebook", " ", "email", " ", "if", " ", "it", " ", "has", " ", "not", " ", "ye", "t", " ", "bee", "n", " ", "set", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "user", "\\u", "key_", "==_", "'", "email", "'_", "and_", "ident", "\\u", "dict_", "[_", "'", "authori", "ty", "'_", "]_", "==_", "'", "Face", "book", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "getattr_", "(_", "bef", "ore", "\\u", "user_", ",_", "'", "facebook", "\\u", "email", "'_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scratch", "\\u", "user", "\\u", "dict_", "[_", "'", "facebook", "\\u", "email", "'_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "device", " ", "id", " ", "is", " ", "not", " ", "presen", "t", ",", " ", "then", " ", "allocate", " ", "it", " ", "now", "._", "\\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_", "device", "\\u", "dict_", "is_", "not_", "None_", "and_", "'", "device", "\\u", "id", "'_", "not_", "in_", "device", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "device", "\\u", "dict_", "[_", "'", "device", "\\u", "id", "'_", "]_", "=_", "yield_", "gen_", "._", "Task_", "(_", "Device_", "._", "\\u", "allocat", "or_", "._", "Ne", "xt", "Id_", ",_", "self_", "._", "\\u", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "synchron", "ous", " ", "request", " ", "to", " ", "ensure", " ", "user", " ", "is", " ", "full", "y", " ", "created", " ", "bef", "ore", " ", "return", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "request_", "=_", "{_", "'", "header", "s", "'_", ":_", "{_", "'", "synchron", "ous", "'_", ":_", "True_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "dict", "'_", ":_", "scratch", "\\u", "user", "\\u", "dict_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ident", "\\u", "dict", "'_", ":_", "ident", "\\u", "dict_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "device", "\\u", "dict", "'_", ":_", "device", "\\u", "dict_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op_", "=_", "yield_", "gen_", "._", "Task_", "(_", "Operation_", "._", "Creat", "e", "And", "Execute_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "client_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "[_", "'", "device", "\\u", "id", "'_", "]_", "if_", "device", "\\u", "dict_", "is_", "not_", "None_", "else_", "bef", "ore", "\\u", "user_", "._", "weba", "pp", "\\u", "dev", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Register", "User", "Opera", "tion", ".", "Execut", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "action_", "==_", "'", "link", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "make", " ", "async", "hronous", " ", "request", " ", "(", "or", " ", "synchron", "ous", " ", "if", " ", "request", "ed", " ", "by", " ", "client", ")", " ", "to", " ", "fetch", " ", "contact", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fe", "tch", "ing", " ", "contact", "s", " ", "can", " ", "take", " ", "a", " ", "long", " ", "time", ",", " ", "so", " ", "best", " ", "to", " ", "do", " ", "this", " ", "in", " ", "the", " ", "background", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "{_", "'", "key", "'_", ":_", "ident", "\\u", "dict_", "[_", "'", "key", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "id", "'_", ":_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "Is", "Interact", "ive", "Request_", "(_", ")_", "or_", "self_", "._", "\\u", "request", "\\u", "message_", "._", "dict_", "[_", "'", "header", "s", "'_", "]_", "._", "get_", "(_", "'", "synchron", "ous", "'_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "[_", "'", "header", "s", "'_", "]_", "=_", "{_", "'", "synchron", "ous", "'_", ":_", "True_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "op_", "=_", "yield_", "gen_", "._", "Task_", "(_", "Operation_", "._", "Creat", "e", "And", "Execute_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "client_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "[_", "'", "device", "\\u", "id", "'_", "]_", "if_", "device", "\\u", "dict_", "is_", "not_", "None_", "else_", "bef", "ore", "\\u", "user_", "._", "weba", "pp", "\\u", "dev", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Fe", "tch", "Conta", "ct", "s", "Opera", "tion", ".", "Execut", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "user", " ", "tha", "t", " ", "was", " ", "register", "ed", " ", "by", " ", "the", " ", "operati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "after", "\\u", "user_", "=_", "yield_", "gen_", "._", "Task_", "(_", "User_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "identi", "ty", " ", "was", " ", "confirm", "ed", " ", "via", " ", "email", "/", "SMS", ",", " ", "set", " ", "the", " ", "cookie", " ", "\"", "confirm", "\\u", "time", "\",", " ", "whi", "ch", " ", "allow", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "cookie", " ", "to", " ", "authoriz", "e", " ", "higher", " ", "privilege", " ", "operati", "ons", ",", " ", "suc", "h", " ", "as", " ", "setti", "ng", " ", "the", " ", "user", " ", "password", "._", "\\u\\u\\uNL\\u\\u\\u_", "confirm", "\\u", "time_", "=_", "util_", "._", "Get", "Curr", "ent", "Timestamp_", "(_", ")_", "if_", "confirmed_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "user", " ", "cookie", " ", "dict", " ", "tha", "t", " ", "will", " ", "be", " ", "return", "ed", " ", "to", " ", "the", " ", "caller", "._", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "id_", "=_", "after", "\\u", "user_", "._", "weba", "pp", "\\u", "dev", "\\u", "id_", "if_", "device", "\\u", "dict_", "is_", "None_", "else_", "device", "\\u", "dict_", "[_", "'", "device", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "cookie", "\\u", "dict_", "=_", "self_", "._", "Creat", "e", "User", "Cooki", "e", "Dict_", "(_", "after", "\\u", "user_", "._", "user", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "after", "\\u", "user_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confirm", "\\u", "time_", "=_", "confirm", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", "s", " ", "the", " ", "user", " ", "cookie", " ", "and", " ", "finish", "es", " ", "the", " ", "request", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "Is", "Interact", "ive", "Request_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Set", "User", "Cookie_", "(_", "user", "\\u", "cookie", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Finish", "Interact", "ive", "Request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "user", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "device", "\\u", "dict_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response", "\\u", "dict_", "[_", "'", "device", "\\u", "id", "'_", "]_", "=_", "device", "\\u", "dict_", "[_", "'", "device", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "use", "\\u", "session", "\\u", "cookie_", "=_", "self_", "._", "\\u", "request", "\\u", "message_", "._", "dict_", "._", "get_", "(_", "'", "use", "\\u", "session", "\\u", "cookie", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "util_", "._", "Set", "If", "Not", "None_", "(_", "user", "\\u", "cookie", "\\u", "dict_", ",_", "'", "is", "\\u", "session", "\\u", "cookie", "'_", ",_", "use", "\\u", "session", "\\u", "cookie_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Set", "User", "Cookie_", "(_", "user", "\\u", "cookie", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Finish", "JSONR", "eque", "st_", "(_", "op_", ",_", "response", "\\u", "dict_", ",_", "json", "\\u", "schema_", "._", "AUTH", "\\u", "RESPONSE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Auth", "Form", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Display", "s", " ", "a", " ", "form", " ", "allow", "ing", " ", "users", " ", "to", " ", "sign", " ", "in", " ", "or", " ", "register", ".", " ", " ", "The", " ", "form", " ", "will", " ", "be", " ", "adjusted", " ", "depend", "ing", "\\", "10", ";", " ", " ", "on", " ", "if", " ", "this", " ", "is", " ", "a", " ", "'", "cold", "'", " ", "login", ",", " ", "or", " ", "a", " ", "registration", " ", "by", " ", "a", " ", "prospe", "ctive", " ", "user", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Auth", "Form", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "handler_", "._", "async", "hronous", "_", "(_", "datastore_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "user_", "=_", "self_", "._", "get", "\\u", "current", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "argument_", "(_", "'", "clear", "'_", ",_", "None_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Clear", "User", "Cookie_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "user_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "current", "\\u", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "render_", "(_", "'", "auth", "\\u", "login", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "current", "\\u", "user_", "._", "Is", "Register", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signup", "\\u", "ident_", "=_", "yield_", "gen_", "._", "Task_", "(_", "current", "\\u", "user_", "._", "Query", "Prim", "ary", "Identity_", ",_", "self_", "._", "\\u", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "user", " ", "will", " ", "have", " ", "a", " ", "confirm", "ed", " ", "cookie", " ", "in", " ", "some", " ", "case", "s", " ", "-", " ", "the", " ", "signup", " ", "process", " ", "doe", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "need", " ", "to", " ", "recon", "firm", " ", "the", " ", "user", "'", "s", " ", "identi", "ty", " ", "in", " ", "this", " ", "case", ".", " ", " ", "To", " ", "handle", " ", "the", " ", "merge_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "case", ",", " ", "we", " ", "need", " ", "to", " ", "provide", " ", "the", " ", "original", " ", "confirm", "ed", " ", "user", " ", "cookie", " ", "in", " ", "the", " ", "page", "'", "s", " ", "html", "._", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "confirmed_", "=_", "base_", "._", "View", "finde", "r", "Context_", "._", "current_", "(_", ")_", "._", "Is", "Confirm", "ed", "User_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "merge", "\\u", "cookie_", "=_", "self_", "._", "get", "\\u", "cookie_", "(_", "base_", "._", "\\u", "USER", "\\u", "COOKIE", "\\u", "NAME_", ")_", "if_", "is", "\\u", "confirmed_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "render_", "(_", "'", "auth", "\\u", "register", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "signup", "\\u", "ident_", "=_", "signup", "\\u", "ident_", "._", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "merge", "\\u", "cookie_", "=_", "merge", "\\u", "cookie_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "redirect_", "(_", "'/", "view", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Logo", "ut", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Simple", " ", "handler", " ", "to", " ", "log", " ", "out", " ", "the", " ", "current", " ", "user", " ", "by", " ", "clear", "ing", " ", "thei", "r", " ", "cookie", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "Handler_", "(_", "base_", "._", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Clear", "User", "Cookie_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "redirect_", "(_", "'/'_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
femmerling/EmeraldBox/app/controllers/__init__.py
[ { "content": "from base import base_view", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from base import base_view", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 26 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "base_", "import_", "base", "\\u", "view_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1 ]
Unused import
bmander/graphserver/pygs/graphserver/ext/ned/elevation/elevation.py
[ { "content": "import os\nimport re\nimport struct\nfrom math import floor\nfrom graphserver.vincenty import vincenty\n\n \n\n \n\n \n \n\n\n \nif __name__=='__main__':\n #selftest()\n \n BASENAME = \"83892907\"\n HOMEAREA = \"./data/\"+BASENAME\n \n gf = GridFloat( HOMEAREA, BASENAME )\n for x in gf.extent:\n print x\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def floatrange(start, stop, step):\n i = start\n while i <= stop:\n yield i\n i += step", "metadata": "root.floatrange", "header": "['module', '___EOS___']", "index": 6 }, { "content": "def cons(ary):\n for i in range(len(ary)-1):\n yield ary[i], ary[i+1]", "metadata": "root.cons", "header": "['module', '___EOS___']", "index": 12 }, { "content": "def split_line_segment(lng1, lat1, lng2, lat2, max_section_length):\n # Split line segment defined by (x1, y1, x2, y2) into a set of points \n # (x,y,displacement) spaced less than max_section_length apart\n \n if lng1==lng2 and lat1==lat2:\n yield [lng1, lat1, 0]\n yield [lng2, lat2, 0]\n return\n \n street_len = vincenty(lat1, lng1, lat2, lng2)\n n_sections = int(street_len/max_section_length)+1\n \n geolen = ((lat2-lat1)**2 + (lng2-lng1)**2)**0.5\n section_len = geolen/n_sections\n street_vector = (lng2-lng1, lat2-lat1)\n unit_vector = [x/geolen for x in street_vector]\n \n for i in range(n_sections+1):\n vec = [x*section_len*i for x in unit_vector]\n vec = [lng1+vec[0], lat1+vec[1], (street_len/n_sections)*i]\n yield vec", "metadata": "root.split_line_segment", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def split_line_string(points, max_section_length):\n \n #Split each line segment in the linestring into segment smaller than max_section_length\n split_segs = []\n for (lng1, lat1), (lng2,lat2) in cons(points):\n split_seg = list(split_line_segment(lng1, lat1, lng2, lat2, max_section_length))\n split_segs.append( split_seg )\n \n #String together the sub linestrings into a single linestring\n ret = []\n segstart_s = 0\n for i, split_seg in enumerate(split_segs):\n for x, y, s in split_seg[:-1]:\n ret.append( (x, y, s+segstart_s) )\n \n if i==len(split_segs)-1:\n x, y, s = split_seg[-1]\n ret.append( (x, y, s+segstart_s) )\n \n segstart_s += split_seg[-1][2]\n \n return ret", "metadata": "root.split_line_string", "header": "['module', '___EOS___']", "index": 38 }, { "content": "class GridFloat:\n \n \n \n \n \n \n \n ", "metadata": "root.GridFloat", "header": "['module', '___EOS___']", "index": 61 }, { "content": " def __init__(self, basename):\n self._read_header( basename + \".hdr\" )\n self.fp = open( basename + \".flt\", \"rb\" )", "metadata": "root.GridFloat.__init__", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 62 }, { "content": " def _read_header(self, filename):\n fp = open( filename, \"r\" )\n \n self.ncols = int( fp.readline()[14:].strip() )\n self.nrows = int( fp.readline()[14:].strip() )\n self.xllcorner = float( fp.readline()[14:].strip() )\n self.yllcorner = float( fp.readline()[14:].strip() )\n self.cellsize = float( fp.readline()[14:].strip() )\n self.NODATA_value = int( fp.readline()[14:].strip() )\n self.byteorder = \"<\" if fp.readline()[14:].strip()==\"LSBFIRST\" else \">\"\n \n self.left = self.xllcorner\n self.right = self.xllcorner + (self.ncols-1)*self.cellsize\n self.bottom = self.yllcorner\n self.top = self.yllcorner + (self.nrows-1)*self.cellsize", "metadata": "root.GridFloat._read_header", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 66 }, { "content": " @property\n def extent(self):\n return ( self.xllcorner, \n self.yllcorner, \n self.xllcorner+self.cellsize*(self.ncols-1), \n self.yllcorner+self.cellsize*(self.nrows-1) )", "metadata": "root.GridFloat.extent", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 82 }, { "content": " def contains(self, lng, lat):\n return not( lng < self.left or lng >= self.right or lat <= self.bottom or lat > self.top )", "metadata": "root.GridFloat.contains", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 89 }, { "content": " def allcells(self):\n self.fp.seek(0)\n return struct.unpack( \"%s%df\"%(self.byteorder, self.nrows*self.ncols), self.fp.read())", "metadata": "root.GridFloat.allcells", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 92 }, { "content": " def extremes(self):\n mem = self.allcells()\n return (min(mem), max(mem))", "metadata": "root.GridFloat.extremes", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 96 }, { "content": " def cell( self, x, y ):\n position = (y*self.ncols+x)*4\n self.fp.seek(position)\n return struct.unpack( \"%sf\"%(self.byteorder), self.fp.read( 4 ) )[0]", "metadata": "root.GridFloat.cell", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 100 }, { "content": " def elevation( self, lng, lat, interpolate=True ):\n if lng < self.left or lng >= self.right or lat <= self.bottom or lat > self.top:\n return None\n \n x = (lng-self.left)/self.cellsize\n y = (self.top-lat)/self.cellsize\n \n ulx = int(floor(x))\n uly = int(floor(y))\n \n ul = self.cell( ulx, uly )\n if not interpolate:\n return ul\n ur = self.cell( ulx+1, uly ) \n ll = self.cell( ulx, uly+1 )\n lr = self.cell( ulx+1, uly+1 )\n \n cellleft = x%1\n celltop = y%1\n um = (ur-ul)*cellleft+ul #uppermiddle\n lm = (lr-ll)*cellleft+ll #lowermiddle\n \n return (lm-um)*celltop+um", "metadata": "root.GridFloat.elevation", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 105 }, { "content": " def profile(self, points, resolution=10):\n return [(s, self.elevation( lng, lat )) for lng, lat, s in split_line_string(points, resolution)]", "metadata": "root.GridFloat.profile", "header": "['class', 'GridFloat', ':', '___EOS___']", "index": 129 }, { "content": "class BIL:\n \n \n \n \n \n \n \n ", "metadata": "root.BIL", "header": "['module', '___EOS___']", "index": 132 }, { "content": " def __init__(self, basename):\n self._read_header( basename + \".hdr\" )\n self.fp = open( basename + \".bil\", \"rb\" )", "metadata": "root.BIL.__init__", "header": "['class', 'BIL', ':', '___EOS___']", "index": 133 }, { "content": " def _read_header(self, filename):\n HCW = 15 #header column width\n \n fp = open( filename, \"r\" )\n \n raw_header = dict([x.strip().split() for x in fp.read().strip().split(\"\\n\")])\n \n self.byteorder = \"<\" if raw_header['BYTEORDER']==\"I\" else \">\"\n self.layout = raw_header['LAYOUT']\n self.ncols = int( raw_header['NCOLS'] )\n self.nrows = int( raw_header['NROWS'] )\n self.nbands = int( raw_header['NBANDS'] )\n self.nbits = int( raw_header['NBITS'] )\n self.bandrowbytes = int( raw_header['BANDROWBYTES'] )\n self.totalrowbytes = int( raw_header['TOTALROWBYTES'] )\n self.pixeltype = raw_header['PIXELTYPE']\n self.ulxmap = float( raw_header['ULXMAP'] )\n self.ulymap = float( raw_header['ULYMAP'] )\n self.xdim = float( raw_header['XDIM'] )\n self.ydim = float( raw_header['YDIM'] )\n self.nodata = float( raw_header['NODATA'] )\n \n self.left = self.ulxmap\n self.right = self.ulxmap + (self.ncols-1)*self.xdim\n self.bottom = self.ulymap - (self.nrows-1)*self.ydim\n self.top = self.ulymap", "metadata": "root.BIL._read_header", "header": "['class', 'BIL', ':', '___EOS___']", "index": 137 }, { "content": " @property\n def extent(self):\n return ( self.left, \n self.bottom, \n self.right, \n self.top )", "metadata": "root.BIL.extent", "header": "['class', 'BIL', ':', '___EOS___']", "index": 164 }, { "content": " def contains(self, lng, lat):\n return not( lng < self.left or lng >= self.right or lat <= self.bottom or lat > self.top )", "metadata": "root.BIL.contains", "header": "['class', 'BIL', ':', '___EOS___']", "index": 171 }, { "content": " def allcells(self):\n self.fp.seek(0)\n return struct.unpack( \"%s%df\"%(self.byteorder, self.nrows*self.ncols), self.fp.read())", "metadata": "root.BIL.allcells", "header": "['class', 'BIL', ':', '___EOS___']", "index": 174 }, { "content": " def extremes(self):\n mem = self.allcells()\n return (min(mem), max(mem))", "metadata": "root.BIL.extremes", "header": "['class', 'BIL', ':', '___EOS___']", "index": 178 }, { "content": " def cell( self, x, y ):\n position = (y*self.ncols+x)*4\n self.fp.seek(position)\n return struct.unpack( \"%sf\"%(self.byteorder), self.fp.read( 4 ) )[0]", "metadata": "root.BIL.cell", "header": "['class', 'BIL', ':', '___EOS___']", "index": 182 }, { "content": " def elevation( self, lng, lat, interpolate=True ):\n if lng < self.left or lng >= self.right or lat <= self.bottom or lat > self.top:\n return None\n \n x = (lng-self.left)/self.xdim\n y = (self.top-lat)/self.ydim\n \n ulx = int(floor(x))\n uly = int(floor(y))\n \n ul = self.cell( ulx, uly )\n if not interpolate:\n return ul\n ur = self.cell( ulx+1, uly ) \n ll = self.cell( ulx, uly+1 )\n lr = self.cell( ulx+1, uly+1 )\n \n cellleft = x%1\n celltop = y%1\n um = (ur-ul)*cellleft+ul #uppermiddle\n lm = (lr-ll)*cellleft+ll #lowermiddle\n \n return (lm-um)*celltop+um", "metadata": "root.BIL.elevation", "header": "['class', 'BIL', ':', '___EOS___']", "index": 187 }, { "content": " def profile(self, points, resolution=10):\n return [(s, self.elevation( lng, lat )) for lng, lat, s in split_line_string(points, resolution)]", "metadata": "root.BIL.profile", "header": "['class', 'BIL', ':', '___EOS___']", "index": 211 }, { "content": "class ElevationPile:\n \n \n ", "metadata": "root.ElevationPile", "header": "['module', '___EOS___']", "index": 214 }, { "content": " def __init__(self):\n self.tiles = []", "metadata": "root.ElevationPile.__init__", "header": "['class', 'ElevationPile', ':', '___EOS___']", "index": 215 }, { "content": " def add(self, dem_basename):\n base_basename = \"\".join(dem_basename.split(\".\")[0:-1])\n format = dem_basename.split(\".\")[-1]\n if format == \"flt\":\n dem = GridFloat( base_basename )\n elif format == \"bil\":\n dem = BIL( base_basename )\n else:\n raise Exception( \"Unknown DEM format '%s'\"%format )\n \n self.tiles.append( dem )", "metadata": "root.ElevationPile.add", "header": "['class', 'ElevationPile', ':', '___EOS___']", "index": 218 }, { "content": " def elevation(self, lng, lat, interpolate=True):\n for tile in self.tiles:\n if tile.contains( lng, lat ):\n return tile.elevation( lng, lat, interpolate )", "metadata": "root.ElevationPile.elevation", "header": "['class', 'ElevationPile', ':', '___EOS___']", "index": 230 }, { "content": " def profile(self, points, resolution=10):\n return [(s, self.elevation( lng, lat )) for lng, lat, s in split_line_string(points, resolution)]", "metadata": "root.ElevationPile.profile", "header": "['class', 'ElevationPile', ':', '___EOS___']", "index": 235 }, { "content": "def selftest():\n BASENAME = \"64883885\"\n HOMEAREA = \"./data/\"+BASENAME\n \n gf = GridFloat(HOMEAREA, BASENAME)\n \n print gf\n print gf.extent\n \n toprow = [gf.cell(x, 0) for x in range(gf.ncols)]\n assert gf.elevation( gf.left, gf.top )==toprow[0]\n assert round(gf.elevation( gf.right-0.00000000001, gf.top ),5)==round(toprow[-1],5)\n \n bottomrow = [gf.cell(x,gf.nrows-2) for x in range(gf.ncols)]\n assert gf.elevation( gf.left, gf.bottom+0.000000001 ) == bottomrow[0]\n assert gf.elevation( gf.right-0.00000001, gf.bottom+0.00000001 ) == bottomrow[-2]\n \n assert gf.extremes() == (4.7509551048278809, 144.3404541015625)\n \n assert round(gf.elevation( (gf.right-gf.left)/2+gf.left, (gf.top-gf.bottom)/2+gf.bottom ),6) == round(89.278957367,6)", "metadata": "root.selftest", "header": "['module', '___EOS___']", "index": 238 }, { "content": "def create_elev_circles():\n from renderer.processing import MapRenderer\n \n BASENAME = \"64883885\"\n HOMEAREA = \"./data/\"+BASENAME\n \n gf = GridFloat(HOMEAREA, BASENAME)\n mr = MapRenderer(\"./renderer/application.linux/renderer\")\n mr.start( gf.left, gf.bottom, gf.right, gf.top, 2000 )\n mr.smooth()\n mr.fill(250,230,230)\n mr.background(255,255,255)\n mr.strokeWeight(0.00007)\n \n for y in floatrange( gf.bottom, gf.top, (gf.top-gf.bottom)/50 ):\n for x in floatrange( gf.left, gf.right, (gf.right-gf.left)/50 ):\n elev = gf.elevation( x, y )\n mr.ellipse( x, y, elev*0.00001, elev*0.00001 )\n\n mr.saveLocal( \"elevs.png\" )\n mr.stop()", "metadata": "root.create_elev_circles", "header": "['module', '___EOS___']", "index": 259 } ]
[ { "span": "import os", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "import re", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "math_", "import_", "floor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "graph", "server_", "._", "vin", "cent", "y_", "import_", "vin", "cent", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", "self", "test", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "BASE", "NAME_", "=_", "\"", "838", "929", "0", "7", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HOM", "EAR", "EA", "_", "=_", "\"./", "data", "/\"_", "+_", "BASE", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gf_", "=_", "Grid", "Float_", "(_", "HOM", "EAR", "EA", "_", ",_", "BASE", "NAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "gf_", "._", "extent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "x_", "\\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_", "float", "range_", "(_", "start_", ",_", "stop_", ",_", "step_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "i_", "<=_", "stop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "step_", "\\u\\u\\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_", "cons_", "(_", "ary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "ary_", ")_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "ary_", "[_", "i_", "]_", ",_", "ary_", "[_", "i_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "split", "\\u", "line", "\\u", "segment_", "(_", "ln", "g1_", ",_", "lat1_", ",_", "ln", "g2_", ",_", "lat2_", ",_", "max", "\\u", "section", "\\u", "length_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Split", " ", "line", " ", "segment", " ", "defin", "ed", " ", "by", " ", "(", "x1", ",", " ", "y1", ",", " ", "x2", ",", " ", "y2", ")", " ", "int", "o", " ", "a", " ", "set", " ", "of", " ", "points", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "x", ",", "y", ",", "displacement", ")", " ", "space", "d", " ", "less", " ", "than", " ", "max", "\\u", "section", "\\u", "length", " ", "apart", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ln", "g1_", "==_", "ln", "g2_", "and_", "lat1_", "==_", "lat2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "[_", "ln", "g1_", ",_", "lat1_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "[_", "ln", "g2_", ",_", "lat2_", ",_", "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_", "street", "\\u", "len_", "=_", "vin", "cent", "y_", "(_", "lat1_", ",_", "ln", "g1_", ",_", "lat2_", ",_", "ln", "g2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "sections_", "=_", "int_", "(_", "street", "\\u", "len_", "/_", "max", "\\u", "section", "\\u", "length_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "geo", "len_", "=_", "(_", "(_", "lat2_", "-_", "lat1_", ")_", "**_", "2_", "+_", "(_", "ln", "g2_", "-_", "ln", "g1_", ")_", "**_", "2_", ")_", "**_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section", "\\u", "len_", "=_", "geo", "len_", "/_", "n", "\\u", "sections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "street", "\\u", "vector_", "=_", "(_", "ln", "g2_", "-_", "ln", "g1_", ",_", "lat2_", "-_", "lat1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unit", "\\u", "vector_", "=_", "[_", "x_", "/_", "geo", "len_", "for_", "x_", "in_", "street", "\\u", "vector_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "n", "\\u", "sections_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vec_", "=_", "[_", "x_", "*_", "section", "\\u", "len_", "*_", "i_", "for_", "x_", "in_", "unit", "\\u", "vector_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vec_", "=_", "[_", "ln", "g1_", "+_", "vec_", "[_", "0_", "]_", ",_", "lat1_", "+_", "vec_", "[_", "1_", "]_", ",_", "(_", "street", "\\u", "len_", "/_", "n", "\\u", "sections_", ")_", "*_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "vec_", "\\u\\u\\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_", "split", "\\u", "line", "\\u", "string_", "(_", "points_", ",_", "max", "\\u", "section", "\\u", "length_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Split", " ", "each", " ", "line", " ", "segment", " ", "in", " ", "the", " ", "linest", "ring", " ", "int", "o", " ", "segment", " ", "small", "er", " ", "than", " ", "max", "\\u", "section", "\\u", "length_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "split", "\\u", "segs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "ln", "g1_", ",_", "lat1_", ")_", ",_", "(_", "ln", "g2_", ",_", "lat2_", ")_", "in_", "cons_", "(_", "points_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "split", "\\u", "seg_", "=_", "list_", "(_", "split", "\\u", "line", "\\u", "segment_", "(_", "ln", "g1_", ",_", "lat1_", ",_", "ln", "g2_", ",_", "lat2_", ",_", "max", "\\u", "section", "\\u", "length_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split", "\\u", "segs_", "._", "append_", "(_", "split", "\\u", "seg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "String", " ", "tog", "ether", " ", "the", " ", "sub", " ", "linest", "rings", " ", "int", "o", " ", "a", " ", "single", " ", "linest", "ring_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ret_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seg", "start", "\\u", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "split", "\\u", "seg_", "in_", "enumerate_", "(_", "split", "\\u", "segs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", ",_", "y_", ",_", "s_", "in_", "split", "\\u", "seg_", "[_", ":_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "._", "append_", "(_", "(_", "x_", ",_", "y_", ",_", "s_", "+_", "seg", "start", "\\u", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", "==_", "len_", "(_", "split", "\\u", "segs_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", ",_", "y_", ",_", "s_", "=_", "split", "\\u", "seg_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "._", "append_", "(_", "(_", "x_", ",_", "y_", ",_", "s_", "+_", "seg", "start", "\\u", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "seg", "start", "\\u", "s_", "+=_", "split", "\\u", "seg_", "[_", "-_", "1_", "]_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret_", "\\u\\u\\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_", "Grid", "Float_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\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_", ",_", "basename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "read", "\\u", "header_", "(_", "basename_", "+_", "\".", "hdr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fp_", "=_", "open_", "(_", "basename_", "+_", "\".", "flt", "\"_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read", "\\u", "header_", "(_", "self_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "open_", "(_", "filename_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ncols_", "=_", "int_", "(_", "fp_", "._", "readline_", "(_", ")_", "[_", "14_", ":_", "]_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nrows_", "=_", "int_", "(_", "fp_", "._", "readline_", "(_", ")_", "[_", "14_", ":_", "]_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xl", "lco", "rne", "r_", "=_", "float_", "(_", "fp_", "._", "readline_", "(_", ")_", "[_", "14_", ":_", "]_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "yl", "lco", "rne", "r_", "=_", "float_", "(_", "fp_", "._", "readline_", "(_", ")_", "[_", "14_", ":_", "]_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cells", "ize_", "=_", "float_", "(_", "fp_", "._", "readline_", "(_", ")_", "[_", "14_", ":_", "]_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "NOD", "ATA", "\\u", "value_", "=_", "int_", "(_", "fp_", "._", "readline_", "(_", ")_", "[_", "14_", ":_", "]_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "byteorder_", "=_", "\"<\"_", "if_", "fp_", "._", "readline_", "(_", ")_", "[_", "14_", ":_", "]_", "._", "strip_", "(_", ")_", "==_", "\"", "LS", "BF", "IR", "ST", "\"_", "else_", "\">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "left_", "=_", "self_", "._", "xl", "lco", "rne", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "right_", "=_", "self_", "._", "xl", "lco", "rne", "r_", "+_", "(_", "self_", "._", "ncols_", "-_", "1_", ")_", "*_", "self_", "._", "cells", "ize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bottom_", "=_", "self_", "._", "yl", "lco", "rne", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "=_", "self_", "._", "yl", "lco", "rne", "r_", "+_", "(_", "self_", "._", "nrows_", "-_", "1_", ")_", "*_", "self_", "._", "cells", "ize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\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_", "extent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "xl", "lco", "rne", "r_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "yl", "lco", "rne", "r_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "xl", "lco", "rne", "r_", "+_", "self_", "._", "cells", "ize_", "*_", "(_", "self_", "._", "ncols_", "-_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "yl", "lco", "rne", "r_", "+_", "self_", "._", "cells", "ize_", "*_", "(_", "self_", "._", "nrows_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "contains_", "(_", "self_", ",_", "lng_", ",_", "lat_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "lng_", "<_", "self_", "._", "left_", "or_", "lng_", ">=_", "self_", "._", "right_", "or_", "lat_", "<=_", "self_", "._", "bottom_", "or_", "lat_", ">_", "self_", "._", "top_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "allc", "ell", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fp_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "struct_", "._", "unpack_", "(_", "\"%", "s", "%", "df", "\"_", "%_", "(_", "self_", "._", "byteorder_", ",_", "self_", "._", "nrows_", "*_", "self_", "._", "ncols_", ")_", ",_", "self_", "._", "fp_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "extreme", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mem_", "=_", "self_", "._", "allc", "ell", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "min_", "(_", "mem_", ")_", ",_", "max_", "(_", "mem_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cell_", "(_", "self_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "position_", "=_", "(_", "y_", "*_", "self_", "._", "ncols_", "+_", "x_", ")_", "*_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fp_", "._", "seek_", "(_", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "struct_", "._", "unpack_", "(_", "\"%", "sf", "\"_", "%_", "(_", "self_", "._", "byteorder_", ")_", ",_", "self_", "._", "fp_", "._", "read_", "(_", "4_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "elevation_", "(_", "self_", ",_", "lng_", ",_", "lat_", ",_", "interpolate_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "lng_", "<_", "self_", "._", "left_", "or_", "lng_", ">=_", "self_", "._", "right_", "or_", "lat_", "<=_", "self_", "._", "bottom_", "or_", "lat_", ">_", "self_", "._", "top_", ":_", "\\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_", "x_", "=_", "(_", "lng_", "-_", "self_", "._", "left_", ")_", "/_", "self_", "._", "cells", "ize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "(_", "self_", "._", "top_", "-_", "lat_", ")_", "/_", "self_", "._", "cells", "ize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ul", "x_", "=_", "int_", "(_", "floor_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ul", "y_", "=_", "int_", "(_", "floor_", "(_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ul_", "=_", "self_", "._", "cell_", "(_", "ul", "x_", ",_", "ul", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "interpolate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ul_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ur_", "=_", "self_", "._", "cell_", "(_", "ul", "x_", "+_", "1_", ",_", "ul", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ll_", "=_", "self_", "._", "cell_", "(_", "ul", "x_", ",_", "ul", "y_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lr_", "=_", "self_", "._", "cell_", "(_", "ul", "x_", "+_", "1_", ",_", "ul", "y_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cell", "left_", "=_", "x_", "%_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cell", "top_", "=_", "y_", "%_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "=_", "(_", "ur_", "-_", "ul_", ")_", "*_", "cell", "left_", "+_", "ul_", "#", "upper", "middle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lm_", "=_", "(_", "lr_", "-_", "ll_", ")_", "*_", "cell", "left_", "+_", "ll_", "#", "lower", "middle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "lm_", "-_", "um_", ")_", "*_", "cell", "top_", "+_", "um_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Grid", "Float_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "profile_", "(_", "self_", ",_", "points_", ",_", "resolution_", "=_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "s_", ",_", "self_", "._", "elevation_", "(_", "lng_", ",_", "lat_", ")_", ")_", "for_", "lng_", ",_", "lat_", ",_", "s_", "in_", "split", "\\u", "line", "\\u", "string_", "(_", "points_", ",_", "resolution_", ")_", "]_", "\\u\\u\\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_", "BIL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\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_", ",_", "basename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "read", "\\u", "header_", "(_", "basename_", "+_", "\".", "hdr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fp_", "=_", "open_", "(_", "basename_", "+_", "\".", "bil", "\"_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read", "\\u", "header_", "(_", "self_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "HC", "W_", "=_", "15_", "#", "header", " ", "column", " ", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fp_", "=_", "open_", "(_", "filename_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raw", "\\u", "header_", "=_", "dict_", "(_", "[_", "x_", "._", "strip_", "(_", ")_", "._", "split_", "(_", ")_", "for_", "x_", "in_", "fp_", "._", "read_", "(_", ")_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "byteorder_", "=_", "\"<\"_", "if_", "raw", "\\u", "header_", "[_", "'", "BYTE", "ORDE", "R", "'_", "]_", "==_", "\"", "I", "\"_", "else_", "\">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "layout_", "=_", "raw", "\\u", "header_", "[_", "'", "LAYOUT", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ncols_", "=_", "int_", "(_", "raw", "\\u", "header_", "[_", "'", "NC", "OL", "S", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nrows_", "=_", "int_", "(_", "raw", "\\u", "header_", "[_", "'", "NR", "OW", "S", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nba", "nds_", "=_", "int_", "(_", "raw", "\\u", "header_", "[_", "'", "NB", "AND", "S", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nbi", "ts_", "=_", "int_", "(_", "raw", "\\u", "header_", "[_", "'", "NB", "IT", "S", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "band", "row", "bytes_", "=_", "int_", "(_", "raw", "\\u", "header_", "[_", "'", "BAND", "ROW", "BYTES", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "total", "row", "bytes_", "=_", "int_", "(_", "raw", "\\u", "header_", "[_", "'", "TOTAL", "ROW", "BYTES", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pixel", "type_", "=_", "raw", "\\u", "header_", "[_", "'", "PIXEL", "TYPE", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ul", "xma", "p_", "=_", "float_", "(_", "raw", "\\u", "header_", "[_", "'", "UL", "XM", "AP", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ul", "yma", "p_", "=_", "float_", "(_", "raw", "\\u", "header_", "[_", "'", "UL", "YM", "AP", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xdi", "m_", "=_", "float_", "(_", "raw", "\\u", "header_", "[_", "'", "XD", "IM", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ydi", "m_", "=_", "float_", "(_", "raw", "\\u", "header_", "[_", "'", "YD", "IM", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nodata", "_", "=_", "float_", "(_", "raw", "\\u", "header_", "[_", "'", "NOD", "ATA", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "left_", "=_", "self_", "._", "ul", "xma", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "right_", "=_", "self_", "._", "ul", "xma", "p_", "+_", "(_", "self_", "._", "ncols_", "-_", "1_", ")_", "*_", "self_", "._", "xdi", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bottom_", "=_", "self_", "._", "ul", "yma", "p_", "-_", "(_", "self_", "._", "nrows_", "-_", "1_", ")_", "*_", "self_", "._", "ydi", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "=_", "self_", "._", "ul", "yma", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\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_", "extent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "left_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "bottom_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "right_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "contains_", "(_", "self_", ",_", "lng_", ",_", "lat_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "lng_", "<_", "self_", "._", "left_", "or_", "lng_", ">=_", "self_", "._", "right_", "or_", "lat_", "<=_", "self_", "._", "bottom_", "or_", "lat_", ">_", "self_", "._", "top_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "allc", "ell", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fp_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "struct_", "._", "unpack_", "(_", "\"%", "s", "%", "df", "\"_", "%_", "(_", "self_", "._", "byteorder_", ",_", "self_", "._", "nrows_", "*_", "self_", "._", "ncols_", ")_", ",_", "self_", "._", "fp_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "extreme", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mem_", "=_", "self_", "._", "allc", "ell", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "min_", "(_", "mem_", ")_", ",_", "max_", "(_", "mem_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cell_", "(_", "self_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "position_", "=_", "(_", "y_", "*_", "self_", "._", "ncols_", "+_", "x_", ")_", "*_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fp_", "._", "seek_", "(_", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "struct_", "._", "unpack_", "(_", "\"%", "sf", "\"_", "%_", "(_", "self_", "._", "byteorder_", ")_", ",_", "self_", "._", "fp_", "._", "read_", "(_", "4_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "elevation_", "(_", "self_", ",_", "lng_", ",_", "lat_", ",_", "interpolate_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "lng_", "<_", "self_", "._", "left_", "or_", "lng_", ">=_", "self_", "._", "right_", "or_", "lat_", "<=_", "self_", "._", "bottom_", "or_", "lat_", ">_", "self_", "._", "top_", ":_", "\\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_", "x_", "=_", "(_", "lng_", "-_", "self_", "._", "left_", ")_", "/_", "self_", "._", "xdi", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "(_", "self_", "._", "top_", "-_", "lat_", ")_", "/_", "self_", "._", "ydi", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ul", "x_", "=_", "int_", "(_", "floor_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ul", "y_", "=_", "int_", "(_", "floor_", "(_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ul_", "=_", "self_", "._", "cell_", "(_", "ul", "x_", ",_", "ul", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "interpolate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ul_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ur_", "=_", "self_", "._", "cell_", "(_", "ul", "x_", "+_", "1_", ",_", "ul", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ll_", "=_", "self_", "._", "cell_", "(_", "ul", "x_", ",_", "ul", "y_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lr_", "=_", "self_", "._", "cell_", "(_", "ul", "x_", "+_", "1_", ",_", "ul", "y_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cell", "left_", "=_", "x_", "%_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cell", "top_", "=_", "y_", "%_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "=_", "(_", "ur_", "-_", "ul_", ")_", "*_", "cell", "left_", "+_", "ul_", "#", "upper", "middle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lm_", "=_", "(_", "lr_", "-_", "ll_", ")_", "*_", "cell", "left_", "+_", "ll_", "#", "lower", "middle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "lm_", "-_", "um_", ")_", "*_", "cell", "top_", "+_", "um_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "BIL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "profile_", "(_", "self_", ",_", "points_", ",_", "resolution_", "=_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "s_", ",_", "self_", "._", "elevation_", "(_", "lng_", ",_", "lat_", ")_", ")_", "for_", "lng_", ",_", "lat_", ",_", "s_", "in_", "split", "\\u", "line", "\\u", "string_", "(_", "points_", ",_", "resolution_", ")_", "]_", "\\u\\u\\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_", "Elevat", "ion", "Pil", "e_", ":_", "\\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_", "Elevat", "ion", "Pil", "e_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tiles_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Elevat", "ion", "Pil", "e_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add_", "(_", "self_", ",_", "dem", "\\u", "basename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "basename_", "=_", "\"\"_", "._", "join_", "(_", "dem", "\\u", "basename_", "._", "split_", "(_", "\".\"_", ")_", "[_", "0_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "format_", "=_", "dem", "\\u", "basename_", "._", "split_", "(_", "\".\"_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format_", "==_", "\"", "flt", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dem", "_", "=_", "Grid", "Float_", "(_", "base", "\\u", "basename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "format_", "==_", "\"", "bil", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dem", "_", "=_", "BIL", "_", "(_", "base", "\\u", "basename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Un", "know", "n", " ", "DEM", " ", "format", " ", "'%", "s", "'\"_", "%_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "tiles_", "._", "append_", "(_", "dem", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Elevat", "ion", "Pil", "e_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "elevation_", "(_", "self_", ",_", "lng_", ",_", "lat_", ",_", "interpolate_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tile_", "in_", "self_", "._", "tiles_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "tile_", "._", "contains_", "(_", "lng_", ",_", "lat_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tile_", "._", "elevation_", "(_", "lng_", ",_", "lat_", ",_", "interpolate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Elevat", "ion", "Pil", "e_", ":_", "\\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_", "profile_", "(_", "self_", ",_", "points_", ",_", "resolution_", "=_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "s_", ",_", "self_", "._", "elevation_", "(_", "lng_", ",_", "lat_", ")_", ")_", "for_", "lng_", ",_", "lat_", ",_", "s_", "in_", "split", "\\u", "line", "\\u", "string_", "(_", "points_", ",_", "resolution_", ")_", "]_", "\\u\\u\\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_", "self", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "BASE", "NAME_", "=_", "\"", "648", "838", "85", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HOM", "EAR", "EA", "_", "=_", "\"./", "data", "/\"_", "+_", "BASE", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gf_", "=_", "Grid", "Float_", "(_", "HOM", "EAR", "EA", "_", ",_", "BASE", "NAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "gf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "gf_", "._", "extent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topr", "ow_", "=_", "[_", "gf_", "._", "cell_", "(_", "x_", ",_", "0_", ")_", "for_", "x_", "in_", "range_", "(_", "gf_", "._", "ncols_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "gf_", "._", "elevation_", "(_", "gf_", "._", "left_", ",_", "gf_", "._", "top_", ")_", "==_", "topr", "ow_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "round_", "(_", "gf_", "._", "elevation_", "(_", "gf_", "._", "right_", "-_", "0.000000000", "01_", ",_", "gf_", "._", "top_", ")_", ",_", "5_", ")_", "==_", "round_", "(_", "topr", "ow_", "[_", "-_", "1_", "]_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bottom", "row_", "=_", "[_", "gf_", "._", "cell_", "(_", "x_", ",_", "gf_", "._", "nrows_", "-_", "2_", ")_", "for_", "x_", "in_", "range_", "(_", "gf_", "._", "ncols_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "gf_", "._", "elevation_", "(_", "gf_", "._", "left_", ",_", "gf_", "._", "bottom_", "+_", "0.00000000", "1_", ")_", "==_", "bottom", "row_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "gf_", "._", "elevation_", "(_", "gf_", "._", "right_", "-_", "0.0000000", "1_", ",_", "gf_", "._", "bottom_", "+_", "0.0000000", "1_", ")_", "==_", "bottom", "row_", "[_", "-_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "gf_", "._", "extreme", "s_", "(_", ")_", "==_", "(_", "4.7", "509", "551", "048", "278", "809", "_", ",_", "144", ".3", "404", "541", "015", "625_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "round_", "(_", "gf_", "._", "elevation_", "(_", "(_", "gf_", "._", "right_", "-_", "gf_", "._", "left_", ")_", "/_", "2_", "+_", "gf_", "._", "left_", ",_", "(_", "gf_", "._", "top_", "-_", "gf_", "._", "bottom_", ")_", "/_", "2_", "+_", "gf_", "._", "bottom_", ")_", ",_", "6_", ")_", "==_", "round_", "(_", "89", ".2", "789", "573", "67_", ",_", "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_", "def_", "create", "\\u", "elev", "\\u", "circles", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "renderer_", "._", "processing_", "import_", "Map", "Renderer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "BASE", "NAME_", "=_", "\"", "648", "838", "85", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HOM", "EAR", "EA", "_", "=_", "\"./", "data", "/\"_", "+_", "BASE", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gf_", "=_", "Grid", "Float_", "(_", "HOM", "EAR", "EA", "_", ",_", "BASE", "NAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr_", "=_", "Map", "Renderer_", "(_", "\"./", "render", "er", "/", "applica", "tion", ".", "linux", "/", "render", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr_", "._", "start_", "(_", "gf_", "._", "left_", ",_", "gf_", "._", "bottom_", ",_", "gf_", "._", "right_", ",_", "gf_", "._", "top_", ",_", "2000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr_", "._", "smooth_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr_", "._", "fill_", "(_", "250_", ",_", "230_", ",_", "230_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr_", "._", "background_", "(_", "255_", ",_", "255_", ",_", "255_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr_", "._", "strok", "e", "Weight_", "(_", "0.0000", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "y_", "in_", "float", "range_", "(_", "gf_", "._", "bottom_", ",_", "gf_", "._", "top_", ",_", "(_", "gf_", "._", "top_", "-_", "gf_", "._", "bottom_", ")_", "/_", "50_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "float", "range_", "(_", "gf_", "._", "left_", ",_", "gf_", "._", "right_", ",_", "(_", "gf_", "._", "right_", "-_", "gf_", "._", "left_", ")_", "/_", "50_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elev", "_", "=_", "gf_", "._", "elevation_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr_", "._", "ellipse_", "(_", "x_", ",_", "y_", ",_", "elev", "_", "*_", "0.00001", "_", ",_", "elev", "_", "*_", "0.00001", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mr_", "._", "save", "Local_", "(_", "\"", "elev", "s", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mr_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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 ]
Unguarded next in generator
cloudera/hue/desktop/libs/indexer/src/indexer/utils.py
[ { "content": "def field_values_from_separated_file(fh, delimiter, quote_character, fields=None):\n if fields is None:\n field_names = None\n else:\n field_names = [field['name'].strip() for field in fields]\n\n if fields is None:\n timestamp_fields = None\n else:\n timestamp_fields = [field['name'].strip() for field in fields if field['type'] in DATE_FIELD_TYPES]\n\n if fields is None:\n integer_fields = None\n else:\n integer_fields = [field['name'].strip() for field in fields if field['type'] in INTEGER_FIELD_TYPES]\n\n if fields is None:\n decimal_fields = None\n else:\n decimal_fields = [field['name'].strip() for field in fields if field['type'] in DECIMAL_FIELD_TYPES]\n\n if fields is None:\n boolean_fields = None\n else:\n boolean_fields = [field['name'].strip() for field in fields if field['type'] in BOOLEAN_FIELD_TYPES]\n\n content = fh.read()\n headers = None\n\n while content:\n last_newline = content.rfind('\\n')\n if last_newline > -1:\n next_chunk = fh.read()\n # If new line is quoted, skip this iteration and try again.\n if content[last_newline - 1] == '\"' and next_chunk:\n content += next_chunk\n continue\n else:\n if headers is None:\n csvfile = StringIO.StringIO(content[:last_newline])\n else:\n csvfile = StringIO.StringIO('\\n' + content[:last_newline])\n content = content[last_newline + 1:] + next_chunk\n else:\n if headers is None:\n csvfile = StringIO.StringIO(content)\n else:\n csvfile = StringIO.StringIO('\\n' + content)\n content = fh.read()\n\n # First line is headers\n if headers is None:\n headers = next(csv.reader(csvfile, delimiter=smart_str(delimiter), quotechar=smart_str(quote_character)))\n headers = [name.strip() for name in headers]\n\n # User dict reader\n reader = csv.DictReader(csvfile, fieldnames=headers, delimiter=smart_str(delimiter), quotechar=smart_str(quote_character))\n\n remove_keys = None\n for row in reader:\n row = dict([(force_unicode(k), force_unicode(v, errors='ignore')) for k, v in row.iteritems()]) # Get rid of invalid binary chars and convert to unicode from DictReader\n\n # Remove keys that aren't in collection\n if remove_keys is None:\n if field_names is None:\n remove_keys = []\n else:\n remove_keys = set(row.keys()) - set(field_names)\n if remove_keys:\n for key in remove_keys:\n del row[key]\n\n # Parse dates\n if timestamp_fields:\n tzinfo = pytz.timezone(settings.TIME_ZONE)\n for key in timestamp_fields:\n if key in row:\n dt = parse(row[key])\n if not dt.tzinfo:\n dt = tzinfo.localize(dt)\n row[key] = dt.astimezone(pytz.utc).strftime('%Y-%m-%dT%H:%M:%SZ')\n\n # Parse decimal\n if decimal_fields:\n for key in decimal_fields:\n if key in row:\n row[key] = float(row[key])\n\n # Parse integer\n if integer_fields:\n for key in integer_fields:\n if key in row:\n row[key] = int(row[key])\n\n # Parse boolean\n if boolean_fields:\n for key in boolean_fields:\n if key in row:\n row[key] = str(row[key]).lower() == \"true\"\n\n # Add mock id random value\n if 'id' not in row:\n row['id'] = str(uuid.uuid4())\n\n yield row", "metadata": "root.field_values_from_separated_file", "header": "['module', '___EOS___']", "index": 199 }, { "content": "def field_values_from_log(fh, fields=[ {'name': 'message', 'type': 'text_general'}, {'name': 'tdate', 'type': 'timestamp'} ]):\n \"\"\"\n Only timestamp and message\n \"\"\"\n buf = \"\"\n prev = content = fh.read()\n if fields is None:\n timestamp_key = 'timestamp'\n message_key = 'message'\n else:\n try:\n timestamp_key = next(iter(filter(lambda field: field['type'] in DATE_FIELD_TYPES, fields)))['name']\n except:\n LOG.exception('failed to get timestamp key')\n timestamp_key = None\n try:\n message_key = next(iter(filter(lambda field: field['type'] in TEXT_FIELD_TYPES, fields)))['name']\n except:\n LOG.exception('failed to get message key')\n message_key = None\n\n def value_generator(buf):\n rows = buf.split('\\n')\n for row in rows:\n if row:\n data = {}\n matches = re.search(TIMESTAMP_PATTERN, row)\n if matches and timestamp_key:\n data[timestamp_key] = parse(matches.groups()[0]).astimezone(pytz.utc).strftime('%Y-%m-%dT%H:%M:%SZ')\n if message_key:\n data[message_key] = row\n yield data\n\n while prev:\n last_newline = content.rfind('\\n')\n if last_newline > -1:\n buf = content[:last_newline]\n content = content[last_newline+1:]\n for row in value_generator(buf):\n yield row\n prev = fh.read()\n content += prev\n\n if content:\n for row in value_generator(content):\n yield row", "metadata": "root.field_values_from_log", "header": "['module', '___EOS___']", "index": 306 } ]
[ { "span": "next(csv.reader(csvfile, delimiter=smart_str(delimiter), quotechar=smart_str(quote_character)))", "start_line": 251, "start_column": 16, "end_line": 251, "end_column": 111 }, { "span": "next(iter(filter(lambda field: field['type'] in DATE_FIELD_TYPES, fields)))[", "start_line": 317, "start_column": 22, "end_line": 317, "end_column": 97 }, { "span": "next(iter(filter(lambda field: field['type'] in TEXT_FIELD_TYPES, fields)))[", "start_line": 322, "start_column": 20, "end_line": 322, "end_column": 95 } ]
[]
1
true
[ "[CLS]_", "Un", "guard", "ed_", "next_", "in_", "generator_", "[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_", "field", "\\u", "values", "\\u", "from", "\\u", "separate", "d\\u", "file_", "(_", "fh_", ",_", "delimiter_", ",_", "quote", "\\u", "character_", ",_", "fields_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "fields_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "\\u", "names_", "=_", "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 ", " _", "field", "\\u", "names_", "=_", "[_", "field_", "[_", "'", "name", "'_", "]_", "._", "strip_", "(_", ")_", "for_", "field_", "in_", "fields_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fields_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timestamp", "\\u", "fields_", "=_", "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 ", " _", "timestamp", "\\u", "fields_", "=_", "[_", "field_", "[_", "'", "name", "'_", "]_", "._", "strip_", "(_", ")_", "for_", "field_", "in_", "fields_", "if_", "field_", "[_", "'", "type", "'_", "]_", "in_", "DAT", "E", "\\u", "FIE", "LD", "\\u", "TYPES_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fields_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "integ", "er", "\\u", "fields_", "=_", "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 ", " _", "integ", "er", "\\u", "fields_", "=_", "[_", "field_", "[_", "'", "name", "'_", "]_", "._", "strip_", "(_", ")_", "for_", "field_", "in_", "fields_", "if_", "field_", "[_", "'", "type", "'_", "]_", "in_", "INTEG", "ER", "\\u", "FIE", "LD", "\\u", "TYPES_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fields_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decima", "l\\u", "fields_", "=_", "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 ", " _", "decima", "l\\u", "fields_", "=_", "[_", "field_", "[_", "'", "name", "'_", "]_", "._", "strip_", "(_", ")_", "for_", "field_", "in_", "fields_", "if_", "field_", "[_", "'", "type", "'_", "]_", "in_", "DECIMAL", "\\u", "FIE", "LD", "\\u", "TYPES_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fields_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "boolean", "\\u", "fields_", "=_", "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 ", " _", "boolean", "\\u", "fields_", "=_", "[_", "field_", "[_", "'", "name", "'_", "]_", "._", "strip_", "(_", ")_", "for_", "field_", "in_", "fields_", "if_", "field_", "[_", "'", "type", "'_", "]_", "in_", "BOOLEAN", "\\u", "FIE", "LD", "\\u", "TYPES_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", "=_", "fh_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "newline_", "=_", "content_", "._", "rfind_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last", "\\u", "newline_", ">_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "chunk_", "=_", "fh_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "new", " ", "line", " ", "is", " ", "quoted", ",", " ", "skip", " ", "this", " ", "iterati", "on", " ", "and", " ", "try", " ", "again", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "content_", "[_", "last", "\\u", "newline_", "-_", "1_", "]_", "==_", "'\"'_", "and_", "next", "\\u", "chunk_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "+=_", "next", "\\u", "chunk_", "\\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 ", " _", "if_", "headers_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csvfile_", "=_", "String", "IO_", "._", "String", "IO_", "(_", "content_", "[_", ":_", "last", "\\u", "newline_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csvfile_", "=_", "String", "IO_", "._", "String", "IO_", "(_", "'\\\\", "n", "'_", "+_", "content_", "[_", ":_", "last", "\\u", "newline_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", "=_", "content_", "[_", "last", "\\u", "newline_", "+_", "1_", ":_", "]_", "+_", "next", "\\u", "chunk_", "\\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_", "headers_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csvfile_", "=_", "String", "IO_", "._", "String", "IO_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csvfile_", "=_", "String", "IO_", "._", "String", "IO_", "(_", "'\\\\", "n", "'_", "+_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", "=_", "fh_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "line", " ", "is", " ", "headers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "headers_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "next_", "(_", "csv_", "._", "reader_", "(_", "csvfile_", ",_", "delimiter_", "=_", "smart", "\\u", "str_", "(_", "delimiter_", ")_", ",_", "quotechar", "_", "=_", "smart", "\\u", "str_", "(_", "quote", "\\u", "character_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "[_", "name_", "._", "strip_", "(_", ")_", "for_", "name_", "in_", "headers_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "User", " ", "dict", " ", "reader_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reader_", "=_", "csv_", "._", "Dict", "Reader_", "(_", "csvfile_", ",_", "fieldnames_", "=_", "headers_", ",_", "delimiter_", "=_", "smart", "\\u", "str_", "(_", "delimiter_", ")_", ",_", "quotechar", "_", "=_", "smart", "\\u", "str_", "(_", "quote", "\\u", "character_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "\\u", "keys_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "reader_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "dict_", "(_", "[_", "(_", "force", "\\u", "unicode_", "(_", "k_", ")_", ",_", "force", "\\u", "unicode_", "(_", "v_", ",_", "errors_", "=_", "'", "ignore", "'_", ")_", ")_", "for_", "k_", ",_", "v_", "in_", "row_", "._", "iteritems_", "(_", ")_", "]_", ")_", "#", " ", "Get", " ", "rid", " ", "of", " ", "invalid", " ", "binar", "y", " ", "char", "s", " ", "and", " ", "convert", " ", "to", " ", "unicode", " ", "from", " ", "Dict", "Reader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "keys", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "in", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "remove", "\\u", "keys_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "field", "\\u", "names_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remove", "\\u", "keys_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remove", "\\u", "keys_", "=_", "set_", "(_", "row_", "._", "keys_", "(_", ")_", ")_", "-_", "set_", "(_", "field", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "remove", "\\u", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", "in_", "remove", "\\u", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "row_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pars", "e", " ", "dates_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "timestamp", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tzinfo_", "=_", "pytz_", "._", "timezone_", "(_", "settings_", "._", "TIME", "\\u", "ZONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "timestamp", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "in_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dt_", "=_", "parse_", "(_", "row_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "dt_", "._", "tzinfo_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dt_", "=_", "tzinfo_", "._", "localize_", "(_", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "row_", "[_", "key_", "]_", "=_", "dt_", "._", "asti", "mezone", "_", "(_", "pytz_", "._", "utc_", ")_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", "T", "%", "H", ":", "%", "M", ":", "%", "SZ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pars", "e", " ", "decimal_", "\\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_", "decima", "l\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", "in_", "decima", "l\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "in_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "[_", "key_", "]_", "=_", "float_", "(_", "row_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pars", "e", " ", "integer_", "\\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_", "integ", "er", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", "in_", "integ", "er", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "in_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "[_", "key_", "]_", "=_", "int_", "(_", "row_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pars", "e", " ", "boolean_", "\\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_", "boolean", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", "in_", "boolean", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "in_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "[_", "key_", "]_", "=_", "str_", "(_", "row_", "[_", "key_", "]_", ")_", "._", "lower_", "(_", ")_", "==_", "\"", "true", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "mock", " ", "id", " ", "random", " ", "value_", "\\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_", "'", "id", "'_", "not_", "in_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "[_", "'", "id", "'_", "]_", "=_", "str_", "(_", "uuid_", "._", "uuid4_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "field", "\\u", "values", "\\u", "from", "\\u", "log_", "(_", "fh_", ",_", "fields_", "=_", "[_", "{_", "'", "name", "'_", ":_", "'", "message", "'_", ",_", "'", "type", "'_", ":_", "'", "text", "\\u", "genera", "l", "'_", "}_", ",_", "{_", "'", "name", "'_", ":_", "'", "td", "ate", "'_", ",_", "'", "type", "'_", ":_", "'", "timestamp", "'_", "}_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "On", "ly", " ", "timestamp", " ", "and", " ", "message", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buf_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev_", "=_", "content_", "=_", "fh_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fields_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timestamp", "\\u", "key_", "=_", "'", "timestamp", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "key_", "=_", "'", "message", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timestamp", "\\u", "key_", "=_", "next_", "(_", "iter_", "(_", "filter_", "(_", "lambda_", "field_", ":_", "field_", "[_", "'", "type", "'_", "]_", "in_", "DAT", "E", "\\u", "FIE", "LD", "\\u", "TYPES_", ",_", "fields_", ")_", ")_", ")_", "[_", "'", "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 ", " _", "LOG_", "._", "exception_", "(_", "'", "fail", "ed", " ", "to", " ", "get", " ", "timestamp", " ", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timestamp", "\\u", "key_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message", "\\u", "key_", "=_", "next_", "(_", "iter_", "(_", "filter_", "(_", "lambda_", "field_", ":_", "field_", "[_", "'", "type", "'_", "]_", "in_", "TEXT", "\\u", "FIE", "LD", "\\u", "TYPES_", ",_", "fields_", ")_", ")_", ")_", "[_", "'", "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 ", " _", "LOG_", "._", "exception_", "(_", "'", "fail", "ed", " ", "to", " ", "get", " ", "message", " ", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "key_", "=_", "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_", "def_", "value", "\\u", "generator_", "(_", "buf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rows_", "=_", "buf_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matches_", "=_", "re_", "._", "search_", "(_", "TIMES", "TAM", "P", "\\u", "PATTERN_", ",_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "and_", "timestamp", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "timestamp", "\\u", "key_", "]_", "=_", "parse_", "(_", "matches_", "._", "groups_", "(_", ")_", "[_", "0_", "]_", ")_", "._", "asti", "mezone", "_", "(_", "pytz_", "._", "utc_", ")_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", "T", "%", "H", ":", "%", "M", ":", "%", "SZ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "message", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "message", "\\u", "key_", "]_", "=_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "prev_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "newline_", "=_", "content_", "._", "rfind_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last", "\\u", "newline_", ">_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buf_", "=_", "content_", "[_", ":_", "last", "\\u", "newline_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "content_", "[_", "last", "\\u", "newline_", "+_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "value", "\\u", "generator_", "(_", "buf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prev_", "=_", "fh_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "row_", "in_", "value", "\\u", "generator_", "(_", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "row_", "\\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,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
uwdata/termite-visualizations/web2py/scripts/cpdb.py
[ { "content": " def __init__(self, prompt, banner=None):\n self.prompt = prompt\n self.banner = banner\n self.commands = {}\n self.commandSort = []\n self.db = None\n\n for i in dir(self):\n if \"cmd_\" == i[:4]:\n cmd = i.split(\"cmd_\")[1].lower()\n self.commands[cmd] = getattr(self, i)\n try:\n self.commandSort.append((int(self\n .commands[cmd].__doc__.split(\n \"|\")[0]), cmd))\n except:\n pass\n\n self.commandSort.sort()\n self.commandSort = [i[1] for i in self.commandSort]\n\n self.var_DEBUG = False\n self.var_tableStyle = ''\n\n self.configvars = {}\n for i in dir(self):\n if \"var_\" == i[:4]:\n var = i.split(\"var_\")[1]\n self.configvars[var] = i", "metadata": "root.console.__init__", "header": "['class', 'console', ':', '___EOS___']", "index": 154 }, { "content": " def execCmd(self, db):\n self.db = db\n print self.banner\n while True:\n try:\n command = raw_input(self.prompt)\n try:\n self.execCommand(command)\n except:\n self.execute(command)\n except KeyboardInterrupt:\n break\n except EOFError:\n break\n except Exception, a:\n self.printError(a)\n print (\"\\r\\n\\r\\nBye!...\")\n sys.exit(0)", "metadata": "root.console.execCmd", "header": "['class', 'console', ':', '___EOS___']", "index": 187 }, { "content": " def cmd_table(self, tbl, file=None, fields=[]):\n \"\"\"-4|-table [TABLENAME] optional[file=None] [fields=None]|\\\nthe default tableStyle is no_wrap - use the 'set x y' command to change the style\\n\\\nstyle choices:\n\\twrap_always\n\\twrap_onspace\n\\twrap_onspace_strict\n\\tno_wrap (value '')\\n\n\\t the 2nd optional param is a path to a file where the table will be written\n\\t the 3rd optional param is a list of fields you want displayed\\n\"\"\"\n table = None\n for mTbl in db.tables:\n if tbl in mTbl:\n if mTbl.startswith(tbl):\n table = mTbl\n break\n oTable = tableHelper()\n '''---\n tablestyle:\n wrap_always\n wrap_onspace\n wrap_onspace_strict\n or set set to \"\" for no wrapping\n ---'''\n tableStyle = self.var_tableStyle\n filedNotFound = []\n table_fields = None\n if len(fields) == 0:\n table_fields = self.db[table].fields\n else:\n table_fields = fields\n\n for field in fields:\n if not field in self.db[table].fields:\n filedNotFound.append(field)\n if len(filedNotFound) == 0:\n rows = self.db(self.db[table].id > 0).select()\n rows_data = []\n for row in rows:\n rowdata = []\n for f in table_fields:\n rowdata.append('{0}'.format(row[f]))\n rows_data.append(string.join(rowdata, ','))\n data = string.join(rows_data, '\\n')\n dataTable = oTable.getTable_Wrap(data, tableStyle, table_fields)\n print('TABLE {0}\\n{1}'.format(table, dataTable))\n if file is not None:\n try:\n tail, head = os.path.split(file)\n try:\n os.makedirs(tail)\n except:\n 'do nothing, folders exist'\n oFile = open(file, 'w')\n oFile.write('TABLE: {0}\\n{1}'.format(table, dataTable))\n oFile.close()\n print('{0} has been created and populated with all available data from table {1}\\n'.format(file, table))\n except Exception, err:\n print(\"EXCEPTION: could not create table {0}\\n{1}\".format(\n table, err))\n else:\n print('the following fields are not valid [{0}]'.format(\n string.join(filedNotFound, ',')))", "metadata": "root.console.cmd_table", "header": "['class', 'console', ':', '___EOS___']", "index": 291 } ]
[ { "span": "except:", "start_line": 169, "start_column": 16, "end_line": 169, "end_column": 23 }, { "span": "except:", "start_line": 195, "start_column": 16, "end_line": 195, "end_column": 23 }, { "span": "except:", "start_line": 342, "start_column": 20, "end_line": 342, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "console_", ":_", "\\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_", ",_", "prompt_", ",_", "banner_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "prompt_", "=_", "prompt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "banner_", "=_", "banner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "commands_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command", "Sort_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "dir_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "cmd", "\\u\"_", "==_", "i_", "[_", ":_", "4_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "i_", "._", "split_", "(_", "\"", "cmd", "\\u\"_", ")_", "[_", "1_", "]_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "commands_", "[_", "cmd_", "]_", "=_", "getattr_", "(_", "self_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "command", "Sort_", "._", "append_", "(_", "(_", "int_", "(_", "self_", "\\u\\u\\uNL\\u\\u\\u_", "._", "commands_", "[_", "cmd_", "]_", "._", "\\u\\u", "doc\\u\\u_", "._", "split_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"|\"_", ")_", "[_", "0_", "]_", ")_", ",_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "command", "Sort_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command", "Sort_", "=_", "[_", "i_", "[_", "1_", "]_", "for_", "i_", "in_", "self_", "._", "command", "Sort_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "var", "\\u", "DEBUG_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "var", "\\u", "table", "Style_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config", "vars_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "dir_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "var", "\\u\"_", "==_", "i_", "[_", ":_", "4_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var_", "=_", "i_", "._", "split_", "(_", "\"", "var", "\\u\"_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config", "vars_", "[_", "var_", "]_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exec", "Cmd_", "(_", "self_", ",_", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db_", "=_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "self_", "._", "banner_", "\\u\\u\\uNEWLINE\\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 ", " _", "command_", "=_", "raw", "\\u", "input_", "(_", "self_", "._", "prompt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "exec", "Command_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "execute_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "except_", "EO", "FE", "rror_", ":_", "\\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_", "except_", "Exception_", ",_", "a_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "print", "Error_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"\\\\", "r", "\\\\", "n", "\\\\", "r", "\\\\", "n", "By", "e", "!.", "..\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\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_", "cmd", "\\u", "table_", "(_", "self_", ",_", "tbl_", ",_", "file_", "=_", "None_", ",_", "fields_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "-", "4", "|", "-", "table", " ", "[", "TAB", "LEN", "AME", "]", " ", "option", "al", "[", "file", "=", "Non", "e", "]", " ", "[", "fields", "=", "Non", "e", "]|", "\\\\", "\\", "10", ";", "the", " ", "default", " ", "table", "Style", " ", "is", " ", "no", "\\u", "wrap", " ", "-", " ", "use", " ", "the", " ", "'", "set", " ", "x", " ", "y", "'", " ", "command", " ", "to", " ", "change", " ", "the", " ", "style", "\\\\", "n", "\\\\", "\\", "10", ";", "style", " ", "choice", "s", ":", "\\", "10", ";\\\\", "tw", "rap", "\\u", "alw", "ay", "s", "\\", "10", ";\\\\", "tw", "rap", "\\u", "ons", "pace", "\\", "10", ";\\\\", "tw", "rap", "\\u", "ons", "pace\\u", "strict", "\\", "10", ";\\\\", "tno", "\\u", "wrap", " ", "(", "value", " ", "''", ")\\\\", "n", "\\", "10", ";\\\\", "t", " ", "the", " ", "2n", "d", " ", "option", "al", " ", "param", " ", "is", " ", "a", " ", "path", " ", "to", " ", "a", " ", "file", " ", "where", " ", "the", " ", "table", " ", "will", " ", "be", " ", "writt", "en", "\\", "10", ";\\\\", "t", " ", "the", " ", "3", "rd", " ", "option", "al", " ", "param", " ", "is", " ", "a", " ", "list", " ", "of", " ", "fields", " ", "you", " ", "want", " ", "displaye", "d", "\\\\", "n", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m", "Tb", "l_", "in_", "db_", "._", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "tbl_", "in_", "m", "Tb", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "m", "Tb", "l_", "._", "startswith_", "(_", "tbl_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "table_", "=_", "m", "Tb", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "o", "Table_", "=_", "table", "Helper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", "---", "\\", "10", ";", " ", " ", " ", " ", "tables", "tyl", "e", ":", "\\", "10", ";", " ", " ", "wrap", "\\u", "alw", "ay", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "wrap", "\\u", "ons", "pace", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "wrap", "\\u", "ons", "pace\\u", "strict", "\\", "10", ";", " ", " ", "or", " ", "set", " ", "set", " ", "to", " ", "\"\"", " ", "for", " ", "no", " ", "wrapp", "ing", "\\", "10", ";", " ", " ", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "Style_", "=_", "self_", "._", "var", "\\u", "table", "Style_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filed", "Not", "Found_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "\\u", "fields_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "fields_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table", "\\u", "fields_", "=_", "self_", "._", "db_", "[_", "table_", "]_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table", "\\u", "fields_", "=_", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "field_", "in_", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "field_", "in_", "self_", "._", "db_", "[_", "table_", "]_", "._", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filed", "Not", "Found_", "._", "append_", "(_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "filed", "Not", "Found_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rows_", "=_", "self_", "._", "db_", "(_", "self_", "._", "db_", "[_", "table_", "]_", "._", "id_", ">_", "0_", ")_", "._", "select_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows", "\\u", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f_", "in_", "table", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "row", "data_", "._", "append_", "(_", "'{", "0", "}'_", "._", "format_", "(_", "row_", "[_", "f_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rows", "\\u", "data_", "._", "append_", "(_", "string_", "._", "join_", "(_", "row", "data_", ",_", "','_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "string_", "._", "join_", "(_", "rows", "\\u", "data_", ",_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data", "Table_", "=_", "o", "Table_", "._", "get", "Table", "\\u", "Wrap_", "(_", "data_", ",_", "table", "Style_", ",_", "table", "\\u", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "TAB", "LE", " ", "{", "0", "}\\\\", "n", "{", "1", "}'_", "._", "format_", "(_", "table_", ",_", "data", "Table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "file_", "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 ", " ", "_", "tail_", ",_", "head_", "=_", "os_", "._", "path_", "._", "split_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "makedirs_", "(_", "tail_", ")_", "\\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 ", " ", " _", "'", "do", " ", "not", "hing", ",", " ", "folder", "s", " ", "exist", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "o", "File_", "=_", "open_", "(_", "file_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "File_", "._", "write_", "(_", "'", "TAB", "LE", ":", " ", "{", "0", "}\\\\", "n", "{", "1", "}'_", "._", "format_", "(_", "table_", ",_", "data", "Table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'{", "0", "}", " ", "has", " ", "bee", "n", " ", "created", " ", "and", " ", "populate", "d", " ", "with", " ", "all", " ", "avail", "able", " ", "data", " ", "from", " ", "table", " ", "{", "1", "}\\\\", "n", "'_", "._", "format_", "(_", "file_", ",_", "table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "\"", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "create", " ", "table", " ", "{", "0", "}\\\\", "n", "{", "1", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "table_", ",_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "the", " ", "follow", "ing", " ", "fields", " ", "are", " ", "not", " ", "valid", " ", "[{", "0", "}]'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "._", "join_", "(_", "filed", "Not", "Found_", ",_", "','_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\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, 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 ]
Unused import
dimagi/commcare-hq/corehq/apps/reminders/views.py
[ { "content": "from datetime import timedelta, datetime, time\nimport json\nfrom couchdbkit import ResourceNotFound\nfrom django.contrib import messages\nfrom django.utils.decorators import method_decorator\nimport pytz\nfrom django.core.urlresolvers import reverse\nfrom django.http import HttpResponseRedirect, Http404, HttpResponse\nfrom django.shortcuts import render\nfrom corehq.apps.app_manager.dbaccessors import get_apps_in_domain\nfrom corehq.apps.style.decorators import use_bootstrap3, use_datatables, use_jquery_ui, \\\n use_timepicker, use_select2\nfrom corehq.apps.translations.models import StandaloneTranslationDoc\nfrom corehq.const import SERVER_DATETIME_FORMAT\nfrom corehq.util.timezones.conversions import ServerTime\nfrom dimagi.utils.couch.cache.cache_core import get_redis_client\nfrom django.utils.translation import ugettext as _, ugettext_noop, ugettext_lazy\nfrom corehq import privileges\nfrom corehq.apps.accounting.decorators import requires_privilege_with_fallback\nfrom corehq.apps.app_manager.models import Form\nfrom corehq.apps.app_manager.util import get_case_properties\nfrom corehq.apps.hqwebapp.views import (CRUDPaginatedViewMixin,\n DataTablesAJAXPaginationMixin)\nfrom corehq import toggles\nfrom dimagi.utils.logging import notify_exception\n\nfrom corehq.apps.reminders.forms import (\n BroadcastForm,\n SimpleScheduleCaseReminderForm,\n CaseReminderEventForm,\n CaseReminderEventMessageForm,\n ComplexScheduleCaseReminderForm,\n KeywordForm,\n NO_RESPONSE,\n)\nfrom corehq.apps.reminders.models import (\n CaseReminderHandler,\n CaseReminderEvent,\n CaseReminder,\n REPEAT_SCHEDULE_INDEFINITELY,\n EVENT_AS_OFFSET,\n EVENT_AS_SCHEDULE,\n SurveyKeyword,\n SurveyKeywordAction,\n SURVEY_METHOD_LIST,\n ON_DATETIME,\n RECIPIENT_SURVEY_SAMPLE,\n QUESTION_RETRY_CHOICES,\n REMINDER_TYPE_ONE_TIME,\n REMINDER_TYPE_DEFAULT,\n REMINDER_TYPE_SURVEY_MANAGEMENT,\n SEND_NOW, SEND_LATER,\n METHOD_SMS,\n METHOD_SMS_SURVEY,\n METHOD_STRUCTURED_SMS,\n METHOD_EMAIL,\n RECIPIENT_USER_GROUP,\n RECIPIENT_SENDER,\n METHOD_IVR_SURVEY,\n get_events_scheduling_info,\n)\nfrom corehq.apps.sms.views import BaseMessagingSectionView\nfrom corehq.apps.users.decorators import require_permission\nfrom corehq.apps.users.models import CommCareUser, Permissions\nfrom dimagi.utils.decorators.memoized import memoized\nfrom .models import UI_SIMPLE_FIXED, UI_COMPLEX\nfrom .util import get_form_list, get_sample_list, get_recipient_name, get_form_name, can_use_survey_reminders\nfrom corehq.apps.sms.mixin import VerifiedNumber\nfrom corehq.apps.sms.util import register_sms_contact, update_contact\nfrom corehq.apps.domain.models import Domain\nfrom corehq.apps.groups.models import Group\nfrom casexml.apps.case.models import CommCareCase\nfrom dateutil.parser import parse\nfrom corehq.util.timezones.utils import get_timezone_for_user\nfrom dimagi.utils.couch.database import is_bigcouch, bigcouch_quorum_count, iter_docs\nfrom custom.ewsghana.forms import EWSBroadcastForm\n\nACTION_ACTIVATE = 'activate'\nACTION_DEACTIVATE = 'deactivate'\nACTION_DELETE = 'delete'\n\nreminders_framework_permission = lambda *args, **kwargs: (\n require_permission(Permissions.edit_data)(\n requires_privilege_with_fallback(privileges.REMINDERS_FRAMEWORK)(*args, **kwargs)\n )\n)\n\nsurvey_reminders_permission = lambda *args, **kwargs: (\n require_permission(Permissions.edit_data)(\n requires_privilege_with_fallback(privileges.INBOUND_SMS)(*args, **kwargs)\n )\n)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_project_time_info(domain):\n timezone = get_timezone_for_user(None, domain)\n now = pytz.utc.localize(datetime.utcnow())\n timezone_now = now.astimezone(timezone)\n return (timezone, now, timezone_now)", "metadata": "root.get_project_time_info", "header": "['module', '___EOS___']", "index": 93 }, { "content": "class ScheduledRemindersCalendarView(BaseMessagingSectionView):\n urlname = 'scheduled_reminders'\n page_title = ugettext_noop(\"Reminder Calendar\")\n template_name = 'reminders/partial/scheduled_reminders.html'\n\n", "metadata": "root.ScheduledRemindersCalendarView", "header": "['module', '___EOS___']", "index": 100 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @method_decorator(reminders_framework_permission)\n @use_bootstrap3\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.ScheduledRemindersCalendarView.dispatch", "header": "['class', 'ScheduledRemindersCalendarView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 105 }, { "content": " @property\n def page_context(self):\n page_context = super(ScheduledRemindersCalendarView, self).page_context\n timezone = Domain.get_by_name(self.domain).get_default_timezone()\n reminders = CaseReminderHandler.get_all_reminders(self.domain)\n dates = []\n now = datetime.utcnow()\n timezone_now = datetime.now(timezone)\n today = timezone_now.date()\n\n def adjust_next_fire_to_timezone(reminder_utc):\n return ServerTime(reminder_utc.next_fire).user_time(timezone).done()\n\n if reminders:\n start_date = adjust_next_fire_to_timezone(reminders[0]).date()\n if today < start_date:\n start_date = today\n end_date = adjust_next_fire_to_timezone(reminders[-1]).date()\n else:\n start_date = end_date = today\n # make sure start date is a Monday and enddate is a Sunday\n start_date -= timedelta(days=start_date.weekday())\n end_date += timedelta(days=6 - end_date.weekday())\n while start_date <= end_date:\n dates.append(start_date)\n start_date += timedelta(days=1)\n\n reminder_data = []\n for reminder in reminders:\n handler = reminder.handler\n recipient = reminder.recipient\n recipient_desc = get_recipient_name(recipient)\n case = reminder.case\n\n reminder_data.append({\n \"handler_name\": handler.nickname,\n \"next_fire\": adjust_next_fire_to_timezone(reminder),\n \"recipient_desc\": recipient_desc,\n \"recipient_type\": handler.recipient,\n \"case_id\": case.get_id if case is not None else None,\n \"case_name\": case.name if case is not None else None,\n })\n\n page_context.update({\n 'domain': self.domain,\n 'reminder_data': reminder_data,\n 'dates': dates,\n 'today': today,\n 'now': now,\n 'timezone': timezone,\n 'timezone_now': timezone_now,\n })\n return page_context", "metadata": "root.ScheduledRemindersCalendarView.page_context", "header": "['class', 'ScheduledRemindersCalendarView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 111 }, { "content": "class CreateScheduledReminderView(BaseMessagingSectionView):\n urlname = 'create_reminder_schedule'\n page_title = ugettext_noop(\"Schedule Reminder\")\n template_name = 'reminders/manage_scheduled_reminder.html'\n ui_type = UI_SIMPLE_FIXED\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.CreateScheduledReminderView", "header": "['module', '___EOS___']", "index": 166 }, { "content": " @method_decorator(reminders_framework_permission)\n @use_bootstrap3\n @use_jquery_ui\n @use_timepicker\n @use_select2\n def dispatch(self, request, *args, **kwargs):\n return super(CreateScheduledReminderView, self).dispatch(request, *args, **kwargs)", "metadata": "root.CreateScheduledReminderView.dispatch", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 172 }, { "content": " @property\n def reminder_form_class(self):\n return {\n UI_COMPLEX: ComplexScheduleCaseReminderForm,\n UI_SIMPLE_FIXED: SimpleScheduleCaseReminderForm,\n }[self.ui_type]", "metadata": "root.CreateScheduledReminderView.reminder_form_class", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 180 }, { "content": " @property\n @memoized\n def schedule_form(self):\n if self.request.method == 'POST':\n return self.reminder_form_class(\n self.request.POST,\n domain=self.domain,\n is_previewer=self.is_previewer,\n can_use_survey=can_use_survey_reminders(self.request),\n available_languages=self.available_languages,\n )\n return self.reminder_form_class(\n is_previewer=self.is_previewer,\n domain=self.domain,\n can_use_survey=can_use_survey_reminders(self.request),\n available_languages=self.available_languages,\n )", "metadata": "root.CreateScheduledReminderView.schedule_form", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 187 }, { "content": " @property\n def available_languages(self):\n \"\"\"\n Returns a the list of language codes available for the domain, or\n [] if no languages are specified.\n \"\"\"\n translation_doc = StandaloneTranslationDoc.get_obj(self.domain, \"sms\")\n if translation_doc and translation_doc.langs:\n return translation_doc.langs\n return []", "metadata": "root.CreateScheduledReminderView.available_languages", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 205 }, { "content": " @property\n def is_previewer(self):\n return self.request.couch_user.is_previewer()", "metadata": "root.CreateScheduledReminderView.is_previewer", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 216 }, { "content": " @property\n def parent_pages(self):\n return [\n {\n 'title': _(\"Reminders\"),\n 'url': reverse(RemindersListView.urlname, args=[self.domain]),\n },\n ]", "metadata": "root.CreateScheduledReminderView.parent_pages", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 220 }, { "content": " @property\n def page_context(self):\n return {\n 'form': self.schedule_form,\n 'event_form': CaseReminderEventForm(ui_type=self.ui_type),\n 'message_form': CaseReminderEventMessageForm(),\n 'ui_type': self.ui_type,\n 'available_languages': self.available_languages,\n }", "metadata": "root.CreateScheduledReminderView.page_context", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 229 }, { "content": " @property\n def available_case_types(self):\n case_types = []\n for app in self.apps:\n case_types.extend([m.case_type for m in app.modules])\n return set(case_types)", "metadata": "root.CreateScheduledReminderView.available_case_types", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 239 }, { "content": " @property\n def action(self):\n return self.request.POST.get('action')", "metadata": "root.CreateScheduledReminderView.action", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 246 }, { "content": " @property\n def case_type(self):\n return self.request.POST.get('caseType')", "metadata": "root.CreateScheduledReminderView.case_type", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 250 }, { "content": " @property\n @memoized\n def apps(self):\n return get_apps_in_domain(self.domain, include_remote=False)", "metadata": "root.CreateScheduledReminderView.apps", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 254 }, { "content": " @property\n def search_term(self):\n return self.request.POST.get('term')", "metadata": "root.CreateScheduledReminderView.search_term", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 259 }, { "content": " @property\n def search_case_type_response(self):\n return list(self.available_case_types)", "metadata": "root.CreateScheduledReminderView.search_case_type_response", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 263 }, { "content": " def clean_dict_list(self, dict_list):\n \"\"\"\n Takes a dict of {string: list} and returns the same result, only\n removing any duplicate entries in each of the lists.\n \"\"\"\n result = {}\n for key in dict_list:\n result[key] = list(set(dict_list[key]))\n return result", "metadata": "root.CreateScheduledReminderView.clean_dict_list", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 267 }, { "content": " @property\n def search_form_by_id_response(self):\n \"\"\"\n Returns a dict of {\"id\": [form unique id], \"text\": [full form path]}\n \"\"\"\n form_unique_id = self.search_term\n try:\n form = Form.get_form(form_unique_id)\n assert form.get_app().domain == self.domain\n return {\n 'text': form.full_path_name,\n 'id': form_unique_id,\n }\n except:\n return {}", "metadata": "root.CreateScheduledReminderView.search_form_by_id_response", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 277 }, { "content": " @property\n def search_case_property_response(self):\n \"\"\"\n Returns a dict of {case type: [case properties...]}\n \"\"\"\n result = {}\n for app in self.apps:\n case_types = list(set([m.case_type for m in app.modules]))\n for case_type in case_types:\n if case_type not in result:\n result[case_type] = ['name']\n for properties in get_case_properties(app, [case_type]).values():\n result[case_type].extend(properties)\n return self.clean_dict_list(result)", "metadata": "root.CreateScheduledReminderView.search_case_property_response", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 293 }, { "content": " def get_parent_child_types(self):\n \"\"\"\n Returns a dict of {parent case type: [subcase types...]}\n \"\"\"\n parent_child_types = {}\n for app in self.apps:\n for module in app.get_modules():\n case_type = module.case_type\n if case_type not in parent_child_types:\n parent_child_types[case_type] = []\n if module.module_type == 'basic':\n for form in module.get_forms():\n for subcase in form.actions.subcases:\n parent_child_types[case_type].append(subcase.case_type)\n elif module.module_type == 'advanced':\n for form in module.get_forms():\n for subcase in form.actions.get_open_subcase_actions(case_type):\n parent_child_types[case_type].append(subcase.case_type)\n return self.clean_dict_list(parent_child_types)", "metadata": "root.CreateScheduledReminderView.get_parent_child_types", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 308 }, { "content": " @property\n def search_subcase_property_response(self):\n \"\"\"\n Returns a dict of {parent case type: [subcase properties]}\n \"\"\"\n result = {}\n parent_child_types = self.get_parent_child_types()\n all_case_properties = self.search_case_property_response\n\n for parent_type in parent_child_types:\n result[parent_type] = []\n for subcase_type in parent_child_types[parent_type]:\n result[parent_type].extend(all_case_properties[subcase_type])\n return self.clean_dict_list(result)", "metadata": "root.CreateScheduledReminderView.search_subcase_property_response", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 328 }, { "content": " @property\n def search_forms_response(self):\n forms = []\n for app in self.apps:\n for module in app.get_modules():\n for form in module.get_forms():\n forms.append({\n 'text': form.full_path_name,\n 'id': form.unique_id,\n })\n if not self.search_term:\n return forms\n final_forms = []\n search_terms = self.search_term.split(\" \")\n for form in forms:\n matches = [t for t in search_terms if t in form['text']]\n if len(matches) == len(search_terms):\n final_forms.append(form)\n return final_forms", "metadata": "root.CreateScheduledReminderView.search_forms_response", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 343 }, { "content": " def _filter_by_term(self, filter_list):\n return [f for f in filter_list if self.search_term in f]", "metadata": "root.CreateScheduledReminderView._filter_by_term", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 363 }, { "content": " def _format_response(self, resp_list):\n return [{'text': r, 'id': r} for r in resp_list]", "metadata": "root.CreateScheduledReminderView._format_response", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 366 }, { "content": " def post(self, *args, **kwargs):\n if self.action in [\n 'search_case_type',\n 'search_case_property',\n 'search_subcase_property',\n 'search_forms',\n 'search_form_by_id',\n ]:\n return HttpResponse(json.dumps(getattr(self, '%s_response' % self.action)))\n if self.schedule_form.is_valid():\n self.process_schedule_form()\n return HttpResponseRedirect(reverse(RemindersListView.urlname, args=[self.domain]))\n else:\n messages.error(self.request, \"There were errors saving your reminder.\")\n return self.get(*args, **kwargs)", "metadata": "root.CreateScheduledReminderView.post", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 369 }, { "content": " def process_schedule_form(self):\n new_handler = CaseReminderHandler(use_today_if_start_date_is_blank=False)\n self.schedule_form.save(new_handler)", "metadata": "root.CreateScheduledReminderView.process_schedule_form", "header": "['class', 'CreateScheduledReminderView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 385 }, { "content": "class CreateComplexScheduledReminderView(CreateScheduledReminderView):\n urlname = 'create_complex_reminder_schedule'\n page_title = ugettext_noop(\"Schedule Multi Event Reminder\")\n ui_type = UI_COMPLEX", "metadata": "root.CreateComplexScheduledReminderView", "header": "['module', '___EOS___']", "index": 390 }, { "content": "class EditScheduledReminderView(CreateScheduledReminderView):\n urlname = 'edit_reminder_schedule'\n page_title = ugettext_noop(\"Edit Scheduled Reminder\")\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.EditScheduledReminderView", "header": "['module', '___EOS___']", "index": 396 }, { "content": " @property\n def handler_id(self):\n return self.kwargs.get('handler_id')", "metadata": "root.EditScheduledReminderView.handler_id", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 400 }, { "content": " @property\n def page_name(self):\n if self.ui_type == UI_COMPLEX:\n return _(\"Edit Scheduled Multi Event Reminder\")\n return self.page_title", "metadata": "root.EditScheduledReminderView.page_name", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 404 }, { "content": " @property\n def available_languages(self):\n \"\"\"\n When editing a reminder, add in any languages that are used by the\n reminder but that are not in the result from\n CreateScheduledReminderView's available_languages property.\n\n This is needed to be backwards-compatible with reminders created\n with the old ui that would let you specify any language, regardless\n of whether it was in the domain's list of languages or not.\n \"\"\"\n result = super(EditScheduledReminderView, self).available_languages\n handler = self.reminder_handler\n for event in handler.events:\n if event.message:\n for (lang, text) in event.message.items():\n if lang not in result:\n result.append(lang)\n return result", "metadata": "root.EditScheduledReminderView.available_languages", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 410 }, { "content": " @property\n @memoized\n def schedule_form(self):\n initial = self.reminder_form_class.compute_initial(\n self.reminder_handler, self.available_languages,\n )\n if self.request.method == 'POST':\n return self.reminder_form_class(\n self.request.POST,\n initial=initial,\n is_previewer=self.is_previewer,\n domain=self.domain,\n is_edit=True,\n can_use_survey=can_use_survey_reminders(self.request),\n use_custom_content_handler=self.reminder_handler.custom_content_handler is not None,\n custom_content_handler=self.reminder_handler.custom_content_handler,\n available_languages=self.available_languages,\n )\n return self.reminder_form_class(\n initial=initial,\n is_previewer=self.is_previewer,\n domain=self.domain,\n is_edit=True,\n can_use_survey=can_use_survey_reminders(self.request),\n use_custom_content_handler=self.reminder_handler.custom_content_handler is not None,\n custom_content_handler=self.reminder_handler.custom_content_handler,\n available_languages=self.available_languages,\n )", "metadata": "root.EditScheduledReminderView.schedule_form", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 430 }, { "content": " @property\n @memoized\n def reminder_handler(self):\n try:\n handler = CaseReminderHandler.get(self.handler_id)\n assert handler.domain == self.domain\n assert handler.doc_type == \"CaseReminderHandler\"\n return handler\n except (ResourceNotFound, AssertionError):\n raise Http404()", "metadata": "root.EditScheduledReminderView.reminder_handler", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 459 }, { "content": " @property\n def ui_type(self):\n return self.reminder_handler.ui_type", "metadata": "root.EditScheduledReminderView.ui_type", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 470 }, { "content": " @property\n def page_context(self):\n page_context = super(EditScheduledReminderView, self).page_context\n page_context.update({\n 'handler_id': self.handler_id,\n })\n return page_context", "metadata": "root.EditScheduledReminderView.page_context", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 474 }, { "content": " @property\n def page_url(self):\n return reverse(self.urlname, args=[self.domain, self.handler_id])", "metadata": "root.EditScheduledReminderView.page_url", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 482 }, { "content": " def process_schedule_form(self):\n self.schedule_form.save(self.reminder_handler)", "metadata": "root.EditScheduledReminderView.process_schedule_form", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 486 }, { "content": " def rule_in_progress(self):\n messages.error(self.request, _(\"Please wait until the rule finishes \"\n \"processing before making further changes.\"))\n return HttpResponseRedirect(reverse(RemindersListView.urlname, args=[self.domain]))", "metadata": "root.EditScheduledReminderView.rule_in_progress", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 489 }, { "content": " def get(self, *args, **kwargs):\n if self.reminder_handler.locked:\n return self.rule_in_progress()\n else:\n return super(EditScheduledReminderView, self).get(*args, **kwargs)", "metadata": "root.EditScheduledReminderView.get", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 494 }, { "content": " def post(self, *args, **kwargs):\n if self.reminder_handler.locked:\n return self.rule_in_progress()\n else:\n return super(EditScheduledReminderView, self).post(*args, **kwargs)", "metadata": "root.EditScheduledReminderView.post", "header": "['class', 'EditScheduledReminderView', '(', 'CreateScheduledReminderView', ')', ':', '___EOS___']", "index": 500 }, { "content": "class AddStructuredKeywordView(BaseMessagingSectionView):\n urlname = 'add_structured_keyword'\n page_title = ugettext_noop(\"New Structured Keyword\")\n template_name = 'reminders/keyword.html'\n process_structured_message = True\n\n\n\n\n\n\n", "metadata": "root.AddStructuredKeywordView", "header": "['module', '___EOS___']", "index": 507 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.AddStructuredKeywordView.dispatch", "header": "['class', 'AddStructuredKeywordView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 513 }, { "content": " @property\n def parent_pages(self):\n return [\n {\n 'title': KeywordsListView.page_title,\n 'url': reverse(KeywordsListView.urlname, args=[self.domain]),\n },\n ]", "metadata": "root.AddStructuredKeywordView.parent_pages", "header": "['class', 'AddStructuredKeywordView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 518 }, { "content": " @property\n @memoized\n def keyword(self):\n return SurveyKeyword(domain=self.domain)", "metadata": "root.AddStructuredKeywordView.keyword", "header": "['class', 'AddStructuredKeywordView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 527 }, { "content": " @property\n def keyword_form(self):\n raise NotImplementedError(\"you must implement keyword_form\")", "metadata": "root.AddStructuredKeywordView.keyword_form", "header": "['class', 'AddStructuredKeywordView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 532 }, { "content": " @property\n def page_context(self):\n def _fmt_choices(val, text):\n return {'value': val, 'text': text}\n return {\n 'form': self.keyword_form,\n 'form_list': get_form_list(self.domain),\n }", "metadata": "root.AddStructuredKeywordView.page_context", "header": "['class', 'AddStructuredKeywordView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 536 }, { "content": " @property\n @memoized\n def keyword_form(self):\n if self.request.method == 'POST':\n return KeywordForm(\n self.request.POST, domain=self.domain,\n process_structured=self.process_structured_message,\n )\n return KeywordForm(\n domain=self.domain,\n process_structured=self.process_structured_message,\n )", "metadata": "root.AddStructuredKeywordView.keyword_form", "header": "['class', 'AddStructuredKeywordView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 545 }, { "content": " def post(self, request, *args, **kwargs):\n if self.keyword_form.is_valid():\n self.keyword.keyword = self.keyword_form.cleaned_data['keyword']\n self.keyword.description = self.keyword_form.cleaned_data['description']\n self.keyword.delimiter = self.keyword_form.cleaned_data['delimiter']\n self.keyword.override_open_sessions = self.keyword_form.cleaned_data['override_open_sessions']\n\n self.keyword.initiator_doc_type_filter = []\n if self.keyword_form.cleaned_data['allow_keyword_use_by'] == 'users':\n self.keyword.initiator_doc_type_filter.append('CommCareUser')\n if self.keyword_form.cleaned_data['allow_keyword_use_by'] == 'cases':\n self.keyword.initiator_doc_type_filter.append('CommCareCase')\n\n self.keyword.actions = []\n if self.keyword_form.cleaned_data['sender_content_type'] != NO_RESPONSE:\n self.keyword.actions.append(\n SurveyKeywordAction(\n recipient=RECIPIENT_SENDER,\n action=self.keyword_form.cleaned_data['sender_content_type'],\n message_content=self.keyword_form.cleaned_data['sender_message'],\n form_unique_id=self.keyword_form.cleaned_data['sender_form_unique_id'],\n )\n )\n if self.process_structured_message:\n self.keyword.actions.append(\n SurveyKeywordAction(\n recipient=RECIPIENT_SENDER,\n action=METHOD_STRUCTURED_SMS,\n form_unique_id=self.keyword_form.cleaned_data['structured_sms_form_unique_id'],\n use_named_args=self.keyword_form.cleaned_data['use_named_args'],\n named_args=self.keyword_form.cleaned_data['named_args'],\n named_args_separator=self.keyword_form.cleaned_data['named_args_separator'],\n )\n )\n if self.keyword_form.cleaned_data['other_recipient_content_type'] != NO_RESPONSE:\n self.keyword.actions.append(\n SurveyKeywordAction(\n recipient=self.keyword_form.cleaned_data['other_recipient_type'],\n recipient_id=self.keyword_form.cleaned_data['other_recipient_id'],\n action=self.keyword_form.cleaned_data['other_recipient_content_type'],\n message_content=self.keyword_form.cleaned_data['other_recipient_message'],\n form_unique_id=self.keyword_form.cleaned_data['other_recipient_form_unique_id'],\n )\n )\n\n self.keyword.save()\n return HttpResponseRedirect(reverse(KeywordsListView.urlname, args=[self.domain]))\n return self.get(request, *args, **kwargs)", "metadata": "root.AddStructuredKeywordView.post", "header": "['class', 'AddStructuredKeywordView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 558 }, { "content": "class AddNormalKeywordView(AddStructuredKeywordView):\n urlname = 'add_normal_keyword'\n page_title = ugettext_noop(\"New Keyword\")\n process_structured_message = False", "metadata": "root.AddNormalKeywordView", "header": "['module', '___EOS___']", "index": 608 }, { "content": "class EditStructuredKeywordView(AddStructuredKeywordView):\n urlname = 'edit_structured_keyword'\n page_title = ugettext_noop(\"Edit Structured Keyword\")\n\n\n\n\n", "metadata": "root.EditStructuredKeywordView", "header": "['module', '___EOS___']", "index": 614 }, { "content": " @property\n def page_url(self):\n return reverse(self.urlname, args=[self.domain, self.keyword_id])", "metadata": "root.EditStructuredKeywordView.page_url", "header": "['class', 'EditStructuredKeywordView', '(', 'AddStructuredKeywordView', ')', ':', '___EOS___']", "index": 618 }, { "content": " @property\n def keyword_id(self):\n return self.kwargs.get('keyword_id')", "metadata": "root.EditStructuredKeywordView.keyword_id", "header": "['class', 'EditStructuredKeywordView', '(', 'AddStructuredKeywordView', ')', ':', '___EOS___']", "index": 622 }, { "content": " @property\n @memoized\n def keyword(self):\n if self.keyword_id is None:\n raise Http404()\n sk = SurveyKeyword.get(self.keyword_id)\n if sk.domain != self.domain:\n raise Http404()\n return sk", "metadata": "root.EditStructuredKeywordView.keyword", "header": "['class', 'EditStructuredKeywordView', '(', 'AddStructuredKeywordView', ')', ':', '___EOS___']", "index": 626 }, { "content": " @property\n @memoized\n def keyword_form(self):\n initial = self.get_initial_values()\n if self.request.method == 'POST':\n form = KeywordForm(\n self.request.POST, domain=self.domain, initial=initial,\n process_structured=self.process_structured_message,\n )\n form._sk_id = self.keyword_id\n return form\n return KeywordForm(\n domain=self.domain, initial=initial,\n process_structured=self.process_structured_message,\n )", "metadata": "root.EditStructuredKeywordView.keyword_form", "header": "['class', 'EditStructuredKeywordView', '(', 'AddStructuredKeywordView', ')', ':', '___EOS___']", "index": 636 }, { "content": " def get_initial_values(self):\n initial = {\n 'keyword': self.keyword.keyword,\n 'description': self.keyword.description,\n 'delimiter': self.keyword.delimiter,\n 'override_open_sessions': self.keyword.override_open_sessions,\n 'sender_content_type': NO_RESPONSE,\n }\n is_case_filter = \"CommCareCase\" in self.keyword.initiator_doc_type_filter\n is_user_filter = \"CommCareUser\" in self.keyword.initiator_doc_type_filter\n if is_case_filter and not is_user_filter:\n initial.update({\n 'allow_keyword_use_by': 'cases',\n })\n elif is_user_filter and not is_case_filter:\n initial.update({\n 'allow_keyword_use_by': 'users',\n })\n for action in self.keyword.actions:\n if action.action == METHOD_STRUCTURED_SMS:\n if self.process_structured_message:\n initial.update({\n 'structured_sms_form_unique_id': action.form_unique_id,\n 'use_custom_delimiter': self.keyword.delimiter is not None,\n 'use_named_args_separator': action.named_args_separator is not None,\n 'use_named_args': action.use_named_args,\n 'named_args_separator': action.named_args_separator,\n 'named_args': [{\"name\" : k, \"xpath\" : v} for k, v in action.named_args.items()],\n })\n elif action.recipient == RECIPIENT_SENDER:\n initial.update({\n 'sender_content_type': action.action,\n 'sender_message': action.message_content,\n 'sender_form_unique_id': action.form_unique_id,\n })\n else:\n initial.update({\n 'other_recipient_type': action.recipient,\n 'other_recipient_id': action.recipient_id,\n 'other_recipient_content_type': action.action,\n 'other_recipient_message': action.message_content,\n 'other_recipient_form_unique_id': action.form_unique_id,\n })\n return initial", "metadata": "root.EditStructuredKeywordView.get_initial_values", "header": "['class', 'EditStructuredKeywordView', '(', 'AddStructuredKeywordView', ')', ':', '___EOS___']", "index": 652 }, { "content": "class EditNormalKeywordView(EditStructuredKeywordView):\n urlname = 'edit_normal_keyword'\n page_title = ugettext_noop(\"Edit Normal Keyword\")\n process_structured_message = False\n", "metadata": "root.EditNormalKeywordView", "header": "['module', '___EOS___']", "index": 698 }, { "content": " @property\n @memoized\n def keyword(self):\n sk = super(EditNormalKeywordView, self).keyword\n # don't allow structured keywords to be edited in this view.\n if METHOD_STRUCTURED_SMS in [a.action for a in sk.actions]:\n raise Http404()\n return sk", "metadata": "root.EditNormalKeywordView.keyword", "header": "['class', 'EditNormalKeywordView', '(', 'EditStructuredKeywordView', ')', ':', '___EOS___']", "index": 703 }, { "content": "class CreateBroadcastView(BaseMessagingSectionView):\n urlname = 'add_broadcast'\n page_title = ugettext_lazy('New Broadcast')\n template_name = 'reminders/broadcast.html'\n force_create_new_broadcast = False\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.CreateBroadcastView", "header": "['module', '___EOS___']", "index": 713 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n @use_jquery_ui\n @use_timepicker\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.CreateBroadcastView.dispatch", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 719 }, { "content": " @property\n @memoized\n def project_timezone(self):\n return get_timezone_for_user(None, self.domain)", "metadata": "root.CreateBroadcastView.project_timezone", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 726 }, { "content": " @property\n def parent_pages(self):\n return [\n {\n 'title': BroadcastListView.page_title,\n 'url': reverse(BroadcastListView.urlname, args=[self.domain]),\n },\n ]", "metadata": "root.CreateBroadcastView.parent_pages", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 731 }, { "content": " def create_new_broadcast(self):\n return CaseReminderHandler(\n domain=self.domain,\n nickname='One-time Reminder',\n reminder_type=REMINDER_TYPE_ONE_TIME,\n )", "metadata": "root.CreateBroadcastView.create_new_broadcast", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 740 }, { "content": " @property\n @memoized\n def broadcast(self):\n return self.create_new_broadcast()", "metadata": "root.CreateBroadcastView.broadcast", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 747 }, { "content": " @property\n def form_kwargs(self):\n return {\n 'domain': self.domain,\n 'can_use_survey': can_use_survey_reminders(self.request),\n }", "metadata": "root.CreateBroadcastView.form_kwargs", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 752 }, { "content": " @property\n def form_class(self):\n if toggles.EWS_BROADCAST_BY_ROLE.enabled(self.domain):\n return EWSBroadcastForm\n else:\n return BroadcastForm", "metadata": "root.CreateBroadcastView.form_class", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 759 }, { "content": " @property\n @memoized\n def broadcast_form(self):\n if self.request.method == 'POST':\n return self.form_class(self.request.POST, **self.form_kwargs)\n else:\n return self.form_class(**self.form_kwargs)", "metadata": "root.CreateBroadcastView.broadcast_form", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 766 }, { "content": " @property\n def page_context(self):\n return {\n 'form': self.broadcast_form,\n }", "metadata": "root.CreateBroadcastView.page_context", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 774 }, { "content": " def save_model(self, broadcast, form):\n broadcast.default_lang = 'xx'\n broadcast.method = form.cleaned_data.get('content_type')\n broadcast.recipient = form.cleaned_data.get('recipient_type')\n broadcast.start_condition_type = ON_DATETIME\n broadcast.start_datetime = form.cleaned_data.get('datetime')\n broadcast.start_offset = 0\n broadcast.events = [CaseReminderEvent(\n day_num=0,\n fire_time=time(0, 0),\n form_unique_id=form.cleaned_data.get('form_unique_id'),\n message=({broadcast.default_lang: form.cleaned_data.get('message')}\n if form.cleaned_data.get('message') else {}),\n subject=({broadcast.default_lang: form.cleaned_data.get('subject')}\n if form.cleaned_data.get('subject') else {}),\n callback_timeout_intervals=[],\n )]\n broadcast.schedule_length = 1\n broadcast.event_interpretation = EVENT_AS_OFFSET\n broadcast.max_iteration_count = 1\n broadcast.sample_id = form.cleaned_data.get('case_group_id')\n broadcast.user_group_id = form.cleaned_data.get('user_group_id')\n broadcast.location_ids = form.cleaned_data.get('location_ids')\n broadcast.include_child_locations = form.cleaned_data.get('include_child_locations')\n if toggles.EWS_BROADCAST_BY_ROLE.enabled(self.domain):\n broadcast.user_data_filter = form.get_user_data_filter()\n broadcast.save()", "metadata": "root.CreateBroadcastView.save_model", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 780 }, { "content": " def post(self, request, *args, **kwargs):\n if self.broadcast_form.is_valid():\n if self.force_create_new_broadcast:\n broadcast = self.create_new_broadcast()\n else:\n broadcast = self.broadcast\n\n self.save_model(broadcast, self.broadcast_form)\n return HttpResponseRedirect(reverse(BroadcastListView.urlname, args=[self.domain]))\n return self.get(request, *args, **kwargs)", "metadata": "root.CreateBroadcastView.post", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 808 }, { "content": "class EditBroadcastView(CreateBroadcastView):\n urlname = 'edit_broadcast'\n page_title = ugettext_lazy('Edit Broadcast')\n\n\n\n", "metadata": "root.EditBroadcastView", "header": "['module', '___EOS___']", "index": 820 }, { "content": " @property\n def page_url(self):\n return reverse(self.urlname, args=[self.domain, self.broadcast_id])", "metadata": "root.EditBroadcastView.page_url", "header": "['class', 'EditBroadcastView', '(', 'CreateBroadcastView', ')', ':', '___EOS___']", "index": 824 }, { "content": " @property\n def broadcast_id(self):\n return self.kwargs.get('broadcast_id')", "metadata": "root.EditBroadcastView.broadcast_id", "header": "['class', 'EditBroadcastView', '(', 'CreateBroadcastView', ')', ':', '___EOS___']", "index": 828 }, { "content": " @property\n @memoized\n def broadcast(self):\n try:\n broadcast = CaseReminderHandler.get(self.broadcast_id)\n except:\n raise Http404()\n\n if (\n broadcast.doc_type != 'CaseReminderHandler' or\n broadcast.domain != self.domain or\n broadcast.reminder_type != REMINDER_TYPE_ONE_TIME\n ):\n raise Http404()\n\n return broadcast", "metadata": "root.EditBroadcastView.broadcast", "header": "['class', 'EditBroadcastView', '(', 'CreateBroadcastView', ')', ':', '___EOS___']", "index": 832 }, { "content": " @property\n @memoized\n def broadcast_form(self):\n if self.request.method == 'POST':\n return self.form_class(self.request.POST, **self.form_kwargs)\n\n broadcast = self.broadcast\n start_user_time = ServerTime(broadcast.start_datetime).user_time(self.project_timezone)\n initial = {\n 'timing': SEND_LATER,\n 'date': start_user_time.ui_string('%Y-%m-%d'),\n 'time': start_user_time.ui_string('%H:%M'),\n 'recipient_type': broadcast.recipient,\n 'case_group_id': broadcast.sample_id,\n 'user_group_id': broadcast.user_group_id,\n 'content_type': broadcast.method,\n 'message': broadcast.events[0].message.get(broadcast.default_lang, None),\n 'subject': broadcast.events[0].subject.get(broadcast.default_lang, None),\n 'form_unique_id': broadcast.events[0].form_unique_id,\n 'location_ids': ','.join(broadcast.location_ids),\n 'include_child_locations': broadcast.include_child_locations,\n }\n if toggles.EWS_BROADCAST_BY_ROLE.enabled(self.domain):\n initial['role'] = broadcast.user_data_filter.get('role', [None])[0]\n return self.form_class(initial=initial, **self.form_kwargs)", "metadata": "root.EditBroadcastView.broadcast_form", "header": "['class', 'EditBroadcastView', '(', 'CreateBroadcastView', ')', ':', '___EOS___']", "index": 849 }, { "content": "class CopyBroadcastView(EditBroadcastView):\n urlname = 'copy_broadcast'\n page_title = ugettext_lazy('Copy Broadcast')\n force_create_new_broadcast = True", "metadata": "root.CopyBroadcastView", "header": "['module', '___EOS___']", "index": 876 }, { "content": "class RemindersListView(BaseMessagingSectionView):\n template_name = 'reminders/reminders_list.html'\n urlname = \"list_reminders_new\"\n page_title = ugettext_noop(\"Reminder Definitions\")\n\n\n\n\n\n\n\n\n\n", "metadata": "root.RemindersListView", "header": "['module', '___EOS___']", "index": 882 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n @use_datatables\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.RemindersListView.dispatch", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 887 }, { "content": " @property\n def page_url(self):\n return reverse(self.urlname, args=[self.domain])", "metadata": "root.RemindersListView.page_url", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 893 }, { "content": " @property\n def can_use_survey(self):\n return can_use_survey_reminders(self.request)", "metadata": "root.RemindersListView.can_use_survey", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 897 }, { "content": " @property\n def reminders(self):\n all_handlers = CaseReminderHandler.get_handlers(self.domain,\n reminder_type_filter=REMINDER_TYPE_DEFAULT)\n if not self.can_use_survey:\n all_handlers = filter(\n lambda x: x.method not in [METHOD_IVR_SURVEY, METHOD_SMS_SURVEY],\n all_handlers\n )\n for handler in all_handlers:\n yield self._fmt_reminder_data(handler)", "metadata": "root.RemindersListView.reminders", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 901 }, { "content": " @property\n def page_context(self):\n return {\n 'reminders': list(self.reminders),\n }", "metadata": "root.RemindersListView.page_context", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 913 }, { "content": " @property\n def reminder_id(self):\n return self.request.POST['reminderId']", "metadata": "root.RemindersListView.reminder_id", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 919 }, { "content": " @property\n @memoized\n def reminder(self):\n return CaseReminderHandler.get(self.reminder_id)", "metadata": "root.RemindersListView.reminder", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 923 }, { "content": " def _fmt_reminder_data(self, reminder):\n return {\n 'id': reminder._id,\n 'isActive': reminder.active,\n 'caseType': reminder.case_type,\n 'name': reminder.nickname,\n 'url': reverse(EditScheduledReminderView.urlname, args=[self.domain, reminder._id]),\n }", "metadata": "root.RemindersListView._fmt_reminder_data", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 928 }, { "content": " def get_action_response(self, action):\n try:\n assert self.reminder.domain == self.domain\n assert self.reminder.doc_type == \"CaseReminderHandler\"\n if self.reminder.locked:\n return {\n 'success': False,\n 'locked': True,\n }\n\n if action in [ACTION_ACTIVATE, ACTION_DEACTIVATE]:\n self.reminder.active = (action == ACTION_ACTIVATE)\n self.reminder.save()\n elif action == ACTION_DELETE:\n self.reminder.retire()\n return {\n 'success': True,\n }\n except Exception as e:\n msg = (\"Couldn't process action '%s' for reminder definition\"\n % action)\n notify_exception(None, message=msg, details={\n 'domain': self.domain,\n 'handler_id': self.reminder_id,\n })\n return {\n 'success': False,\n }", "metadata": "root.RemindersListView.get_action_response", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 937 }, { "content": " def post(self, *args, **kwargs):\n action = self.request.POST.get('action')\n if action in [ACTION_ACTIVATE, ACTION_DEACTIVATE, ACTION_DELETE]:\n return HttpResponse(json.dumps(self.get_action_response(action)))\n return HttpResponse(status=400)", "metadata": "root.RemindersListView.post", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 966 }, { "content": "class BroadcastListView(BaseMessagingSectionView, DataTablesAJAXPaginationMixin):\n template_name = 'reminders/broadcasts_list.html'\n urlname = 'list_broadcasts'\n page_title = ugettext_lazy('Broadcasts')\n\n LIST_UPCOMING = 'list_upcoming'\n LIST_PAST = 'list_past'\n DELETE_BROADCAST = 'delete_broadcast'\n\n\n\n\n\n\n\n\n\n", "metadata": "root.BroadcastListView", "header": "['module', '___EOS___']", "index": 973 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n @use_datatables\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.BroadcastListView.dispatch", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 982 }, { "content": " @property\n @memoized\n def project_timezone(self):\n return get_timezone_for_user(None, self.domain)", "metadata": "root.BroadcastListView.project_timezone", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 988 }, { "content": " def format_recipients(self, broadcast):\n reminders = broadcast.get_reminders()\n if len(reminders) == 0:\n return _('(none)')\n return get_recipient_name(reminders[0].recipient, include_desc=False)", "metadata": "root.BroadcastListView.format_recipients", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 993 }, { "content": " def format_content(self, broadcast):\n if broadcast.method == METHOD_SMS_SURVEY:\n content = get_form_name(broadcast.events[0].form_unique_id)\n else:\n message = broadcast.events[0].message[broadcast.default_lang]\n if len(message) > 50:\n content = '\"%s...\"' % message[:47]\n else:\n content = '\"%s\"' % message\n return content", "metadata": "root.BroadcastListView.format_content", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 999 }, { "content": " def format_broadcast_name(self, broadcast):\n user_time = ServerTime(broadcast.start_datetime).user_time(self.project_timezone)\n return user_time.ui_string(SERVER_DATETIME_FORMAT)", "metadata": "root.BroadcastListView.format_broadcast_name", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 1010 }, { "content": " def format_broadcast_data(self, ids):\n broadcasts = CaseReminderHandler.get_handlers_from_ids(ids)\n result = []\n for broadcast in broadcasts:\n display = self.format_broadcast_name(broadcast)\n result.append([\n display,\n self.format_recipients(broadcast),\n self.format_content(broadcast),\n broadcast._id,\n reverse(EditBroadcastView.urlname, args=[self.domain, broadcast._id]),\n reverse(CopyBroadcastView.urlname, args=[self.domain, broadcast._id]),\n ])\n return result", "metadata": "root.BroadcastListView.format_broadcast_data", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 1014 }, { "content": " def get_broadcast_ajax_response(self, upcoming=True):\n \"\"\"\n upcoming - True to include only upcoming broadcasts, False to include\n only past broadcasts.\n \"\"\"\n if upcoming:\n ids = CaseReminderHandler.get_upcoming_broadcast_ids(self.domain)\n else:\n ids = CaseReminderHandler.get_past_broadcast_ids(self.domain)\n\n total_records = len(ids)\n ids = ids[self.display_start:self.display_start + self.display_length]\n data = self.format_broadcast_data(ids)\n return self.datatables_ajax_response(data, total_records)", "metadata": "root.BroadcastListView.get_broadcast_ajax_response", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 1029 }, { "content": " def delete_broadcast(self, broadcast_id):\n try:\n broadcast = CaseReminderHandler.get(broadcast_id)\n except:\n raise Http404()\n\n if broadcast.doc_type != 'CaseReminderHandler' or broadcast.domain != self.domain:\n raise Http404()\n\n broadcast.retire()\n return HttpResponse()", "metadata": "root.BroadcastListView.delete_broadcast", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 1044 }, { "content": " def get(self, *args, **kwargs):\n action = self.request.GET.get('action')\n if action in (self.LIST_UPCOMING, self.LIST_PAST):\n upcoming = (action == self.LIST_UPCOMING)\n return self.get_broadcast_ajax_response(upcoming)\n else:\n return super(BroadcastListView, self).get(*args, **kwargs)", "metadata": "root.BroadcastListView.get", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 1056 }, { "content": " def post(self, *args, **kwargs):\n action = self.request.POST.get('action')\n if action == self.DELETE_BROADCAST:\n return self.delete_broadcast(self.request.POST.get('broadcast_id', None))\n else:\n return HttpResponse(status=400)", "metadata": "root.BroadcastListView.post", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 1064 }, { "content": "class KeywordsListView(BaseMessagingSectionView, CRUDPaginatedViewMixin):\n template_name = 'reminders/keyword_list.html'\n urlname = 'keyword_list'\n page_title = ugettext_noop(\"Keywords\")\n\n limit_text = ugettext_noop(\"keywords per page\")\n empty_notification = ugettext_noop(\"You have no keywords. Please add one!\")\n loading_message = ugettext_noop(\"Loading keywords...\")\n\n\n\n\n\n\n\n\n\n", "metadata": "root.KeywordsListView", "header": "['module', '___EOS___']", "index": 1072 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.KeywordsListView.dispatch", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1081 }, { "content": " @property\n def page_url(self):\n return reverse(self.urlname, args=[self.domain])", "metadata": "root.KeywordsListView.page_url", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1086 }, { "content": " @property\n def parameters(self):\n return self.request.POST if self.request.method == 'POST' else self.request.GET", "metadata": "root.KeywordsListView.parameters", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1090 }, { "content": " @property\n @memoized\n def total(self):\n data = SurveyKeyword.get_db().view(\n 'reminders/survey_keywords',\n reduce=True,\n startkey=[self.domain],\n endkey=[self.domain, {}],\n ).first()\n return data['value'] if data else 0", "metadata": "root.KeywordsListView.total", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1094 }, { "content": " @property\n def column_names(self):\n return [\n _(\"Keyword\"),\n _(\"Description\"),\n _(\"Action\"),\n ]", "metadata": "root.KeywordsListView.column_names", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1105 }, { "content": " @property\n def page_context(self):\n return self.pagination_context", "metadata": "root.KeywordsListView.page_context", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1113 }, { "content": " @property\n def paginated_list(self):\n for keyword in SurveyKeyword.get_by_domain(\n self.domain,\n limit=self.limit,\n skip=self.skip,\n ):\n yield {\n 'itemData': self._fmt_keyword_data(keyword),\n 'template': 'keyword-row-template',\n }", "metadata": "root.KeywordsListView.paginated_list", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1117 }, { "content": " def _fmt_keyword_data(self, keyword):\n return {\n 'id': keyword._id,\n 'keyword': keyword.keyword,\n 'description': keyword.description,\n 'editUrl': reverse(\n EditStructuredKeywordView.urlname,\n args=[self.domain, keyword._id]\n ) if keyword.is_structured_sms() else reverse(\n EditNormalKeywordView.urlname,\n args=[self.domain, keyword._id]\n ),\n 'deleteModalId': 'delete-%s' % keyword._id,\n }", "metadata": "root.KeywordsListView._fmt_keyword_data", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1129 }, { "content": " def get_deleted_item_data(self, item_id):\n try:\n s = SurveyKeyword.get(item_id)\n except ResourceNotFound:\n raise Http404()\n if s.domain != self.domain or s.doc_type != \"SurveyKeyword\":\n raise Http404()\n s.retire()\n return {\n 'itemData': self._fmt_keyword_data(s),\n 'template': 'keyword-deleted-template',\n }", "metadata": "root.KeywordsListView.get_deleted_item_data", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1144 }, { "content": " def post(self, *args, **kwargs):\n return self.paginate_crud_response", "metadata": "root.KeywordsListView.post", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1157 }, { "content": "def int_or_none(i):\n try:\n i = int(i)\n except (ValueError, TypeError):\n i = None\n return i", "metadata": "root.int_or_none", "header": "['module', '___EOS___']", "index": 1161 }, { "content": "@reminders_framework_permission\ndef rule_progress(request, domain):\n client = get_redis_client()\n handlers = CaseReminderHandler.get_handlers(domain,\n reminder_type_filter=REMINDER_TYPE_DEFAULT)\n\n response = {}\n for handler in handlers:\n info = {}\n if handler.locked:\n info['complete'] = False\n current = None\n total = None\n\n try:\n current = client.get('reminder-rule-processing-current-%s' % handler._id)\n total = client.get('reminder-rule-processing-total-%s' % handler._id)\n except:\n continue\n\n info['current'] = int_or_none(current)\n info['total'] = int_or_none(total)\n else:\n info['complete'] = True\n\n response[handler._id] = info\n\n return HttpResponse(json.dumps(response))", "metadata": "root.rule_progress", "header": "['module', '___EOS___']", "index": 1169 } ]
[ { "span": "from django.shortcuts import render", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 35 }, { "span": "from corehq.apps.reminders.models import (\n CaseReminderHandler,\n CaseReminderEvent,\n CaseReminder,\n REPEAT_SCHEDULE_INDEFINITELY,\n EVENT_AS_OFFSET,\n EVENT_AS_SCHEDULE,\n SurveyKeyword,\n SurveyKeywordAction,\n SURVEY_METHOD_LIST,\n ON_DATETIME,\n RECIPIENT_SURVEY_SAMPLE,\n QUESTION_RETRY_CHOICES,\n REMINDER_TYPE_ONE_TIME,\n REMINDER_TYPE_DEFAULT,\n REMINDER_TYPE_SURVEY_MANAGEMENT,\n SEND_NOW, SEND_LATER,\n METHOD_SMS,\n METHOD_SMS_SURVEY,\n METHOD_STRUCTURED_SMS,\n METHOD_EMAIL,\n RECIPIENT_USER_GROUP,\n RECIPIENT_SENDER,\n METHOD_IVR_SURVEY,\n get_events_scheduling_info,\n)", "start_line": 35, "start_column": 0, "end_line": 60, "end_column": 1 }, { "span": "from corehq.apps.users.models import CommCareUser, Permissions", "start_line": 63, "start_column": 0, "end_line": 63, "end_column": 62 }, { "span": "from corehq.apps.sms.mixin import VerifiedNumber", "start_line": 67, "start_column": 0, "end_line": 67, "end_column": 48 }, { "span": "from corehq.apps.sms.util import register_sms_contact, update_contact", "start_line": 68, "start_column": 0, "end_line": 68, "end_column": 69 }, { "span": "from corehq.apps.groups.models import Group", "start_line": 70, "start_column": 0, "end_line": 70, "end_column": 43 }, { "span": "from casexml.apps.case.models import CommCareCase", "start_line": 71, "start_column": 0, "end_line": 71, "end_column": 49 }, { "span": "from dateutil.parser import parse", "start_line": 72, "start_column": 0, "end_line": 72, "end_column": 33 }, { "span": "from dimagi.utils.couch.database import is_bigcouch, bigcouch_quorum_count, iter_docs", "start_line": 74, "start_column": 0, "end_line": 74, "end_column": 85 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "datetime_", "import_", "timedelta_", ",_", "datetime_", ",_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "couchdb", "kit_", "import_", "Reso", "urc", "e", "Not", "Found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "import_", "messages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "decorators_", "import_", "method", "\\u", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pytz_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Respons", "e", "Redirect_", ",_", "Http404_", ",_", "Http", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "app", "\\u", "manager_", "._", "dba", "ccess", "ors_", "import_", "get", "\\u", "apps", "\\u", "in", "\\u", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "style_", "._", "decorators_", "import_", "use", "\\u", "boots", "trap", "3_", ",_", "use", "\\u", "datata", "bles_", ",_", "use", "\\u", "jq", "uer", "y", "\\u", "ui_", ",_", "use", "\\u", "timep", "ick", "er_", ",_", "use", "\\u", "select", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "translations_", "._", "models_", "import_", "Stand", "alo", "ne", "Translat", "ion", "Doc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "const_", "import_", "SERVER", "\\u", "DATETIME", "\\u", "FORMAT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "util_", "._", "timezones", "_", "._", "conversions", "_", "import_", "Server", "Time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dim", "agi", "_", "._", "utils_", "._", "couch", "_", "._", "cache_", "._", "cache", "\\u", "core_", "import_", "get", "\\u", "redis", "\\u", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "ugettext_", "as_", "\\u_", ",_", "uge", "ttext", "\\u", "noop_", ",_", "uge", "ttext", "\\u", "lazy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "import_", "privilege", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "accounti", "ng_", "._", "decorators_", "import_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "app", "\\u", "manager_", "._", "models_", "import_", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "app", "\\u", "manager_", "._", "util_", "import_", "get", "\\u", "case", "\\u", "properties_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "hq", "webapp_", "._", "views_", "import_", "(_", "CRUD", "Pagina", "ted", "View", "Mixin_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "import_", "toggle", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dim", "agi", "_", "._", "utils_", "._", "logging_", "import_", "notif", "y", "\\u", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "reminder", "s_", "._", "forms_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Broad", "cast", "Form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Simple", "Schedule", "Case", "Remi", "nder", "Form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Case", "Remi", "nder", "Event", "Form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Case", "Remi", "nder", "Event", "Messag", "e", "Form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comple", "x", "Schedule", "Case", "Remi", "nder", "Form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Key", "word", "Form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "NO", "\\u", "RESPONSE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "reminder", "s_", "._", "models_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Case", "Remi", "nder", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Case", "Remi", "nder", "Event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Case", "Remi", "nder", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "REPEAT", "\\u", "SCHEDULE", "\\u", "INDE", "FIN", "ITE", "LY_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "EVENT", "\\u", "AS", "\\u", "OFFSET_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "EVENT", "\\u", "AS", "\\u", "SCHEDULE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Surv", "ey", "Keyword_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Surv", "ey", "Key", "word", "Action_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "SUR", "VE", "Y", "\\u", "METH", "OD", "\\u", "LIST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ON", "\\u", "DATETIME", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "RECIP", "IENT", "\\u", "SUR", "VE", "Y", "\\u", "SAMPLE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "QUESTION", "\\u", "RETRY", "\\u", "CHOICES_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "REM", "INDE", "R", "\\u", "TYPE", "\\u", "ONE", "\\u", "TIME_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "REM", "INDE", "R", "\\u", "TYPE", "\\u", "DEFAULT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "REM", "INDE", "R", "\\u", "TYPE", "\\u", "SUR", "VE", "Y", "\\u", "MANAGE", "MENT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "SEND", "\\u", "NOW", "_", ",_", "SEND", "\\u", "LATE", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "METH", "OD", "\\u", "SMS", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "METH", "OD", "\\u", "SMS", "\\u", "SUR", "VE", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "METH", "OD", "\\u", "STRUCTUR", "ED", "\\u", "SMS", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "METH", "OD", "\\u", "EMAIL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "RECIP", "IENT", "\\u", "USER", "\\u", "GROUP_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "RECIP", "IENT", "\\u", "SEND", "ER_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "METH", "OD", "\\u", "IV", "R", "\\u", "SUR", "VE", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "events", "\\u", "sched", "ulin", "g", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "sms_", "._", "views_", "import_", "Base", "Messag", "ing", "Sect", "ion", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "users_", "._", "decorators_", "import_", "require", "\\u", "permission_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "users_", "._", "models_", "import_", "Comm", "Care", "User_", ",_", "Permissions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dim", "agi", "_", "._", "utils_", "._", "decorators_", "._", "memoized", "_", "import_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "models_", "import_", "UI", "\\u", "SIMPLE", "\\u", "FIXED", "_", ",_", "UI", "\\u", "COMPL", "EX_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "util_", "import_", "get", "\\u", "form", "\\u", "list_", ",_", "get", "\\u", "sample", "\\u", "list_", ",_", "get", "\\u", "recip", "ient", "\\u", "name_", ",_", "get", "\\u", "form", "\\u", "name_", ",_", "can", "\\u", "use", "\\u", "survey", "\\u", "reminder", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "sms_", "._", "mixin_", "import_", "Verifie", "d", "Number_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "sms_", "._", "util_", "import_", "register", "\\u", "sms", "\\u", "contact_", ",_", "update", "\\u", "contact_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "domain_", "._", "models_", "import_", "Domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "groups_", "._", "models_", "import_", "Group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "case", "xml_", "._", "apps_", "._", "case_", "._", "models_", "import_", "Comm", "Care", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dateutil_", "._", "parser_", "import_", "parse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "util_", "._", "timezones", "_", "._", "utils_", "import_", "get", "\\u", "timezon", "e\\u", "for", "\\u", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dim", "agi", "_", "._", "utils_", "._", "couch", "_", "._", "database_", "import_", "is", "\\u", "big", "couch", "_", ",_", "big", "couch", "\\u", "quorum", "\\u", "count_", ",_", "iter", "\\u", "docs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "custom_", "._", "ew", "sg", "han", "a_", "._", "forms_", "import_", "EW", "SB", "road", "cast", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ACTI", "ON", "\\u", "ACTIVAT", "E_", "=_", "'", "activat", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ACTI", "ON", "\\u", "DEA", "CTIV", "ATE_", "=_", "'", "deactivate", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ACTI", "ON", "\\u", "DELETE_", "=_", "'", "delete", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reminder", "s", "\\u", "frame", "work", "\\u", "permission_", "=_", "lambda_", "*_", "args_", ",_", "**_", "kwargs_", ":_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "permission_", "(_", "Permissions_", "._", "edit", "\\u", "data_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "REM", "INDE", "RS", "\\u", "FRAME", "WORK", "_", ")_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "survey", "\\u", "reminder", "s", "\\u", "permission_", "=_", "lambda_", "*_", "args_", ",_", "**_", "kwargs_", ":_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "permission_", "(_", "Permissions_", "._", "edit", "\\u", "data_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "IN", "BOUND", "\\u", "SMS", "_", ")_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "get", "\\u", "project", "\\u", "time", "\\u", "info_", "(_", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timezone_", "=_", "get", "\\u", "timezon", "e\\u", "for", "\\u", "user_", "(_", "None_", ",_", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "pytz_", "._", "utc_", "._", "localize_", "(_", "datetime_", "._", "utcnow_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timezon", "e\\u", "now_", "=_", "now_", "._", "asti", "mezone", "_", "(_", "timezone_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "timezone_", ",_", "now_", ",_", "timezon", "e\\u", "now_", ")_", "\\u\\u\\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_", "Schedule", "d", "Remi", "nder", "s", "Cal", "enda", "r", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "schedule", "d\\u", "reminder", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Remi", "nder", " ", "Cal", "enda", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "name_", "=_", "'", "reminder", "s", "/", "partial", "/", "schedule", "d\\u", "reminder", "s", ".", "html", "'_", "\\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_", "Schedule", "d", "Remi", "nder", "s", "Cal", "enda", "r", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "reminder", "s", "\\u", "frame", "work", "\\u", "permission_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\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_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Schedule", "d", "Remi", "nder", "s", "Cal", "enda", "r", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "page", "\\u", "context_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "page", "\\u", "context_", "=_", "super_", "(_", "Schedule", "d", "Remi", "nder", "s", "Cal", "enda", "r", "View_", ",_", "self_", ")_", "._", "page", "\\u", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timezone_", "=_", "Domain_", "._", "get", "\\u", "by", "\\u", "name_", "(_", "self_", "._", "domain_", ")_", "._", "get", "\\u", "default", "\\u", "timezone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reminder", "s_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get", "\\u", "all", "\\u", "reminder", "s_", "(_", "self_", "._", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dates_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timezon", "e\\u", "now_", "=_", "datetime_", "._", "now_", "(_", "timezone_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "today_", "=_", "timezon", "e\\u", "now_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "adjust", "\\u", "next", "\\u", "fire", "\\u", "to", "\\u", "timezone_", "(_", "reminder", "\\u", "utc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Server", "Time_", "(_", "reminder", "\\u", "utc_", "._", "next", "\\u", "fire_", ")_", "._", "user", "\\u", "time_", "(_", "timezone_", ")_", "._", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "reminder", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "date_", "=_", "adjust", "\\u", "next", "\\u", "fire", "\\u", "to", "\\u", "timezone_", "(_", "reminder", "s_", "[_", "0_", "]_", ")_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "today_", "<_", "start", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "date_", "=_", "today_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "end", "\\u", "date_", "=_", "adjust", "\\u", "next", "\\u", "fire", "\\u", "to", "\\u", "timezone_", "(_", "reminder", "s_", "[_", "-_", "1_", "]_", ")_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "date_", "=_", "end", "\\u", "date_", "=_", "today_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "start", " ", "date", " ", "is", " ", "a", " ", "Mon", "day", " ", "and", " ", "enddate", " ", "is", " ", "a", " ", "Sun", "day_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start", "\\u", "date_", "-=_", "timedelta_", "(_", "days_", "=_", "start", "\\u", "date_", "._", "weekday_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "date_", "+=_", "timedelta_", "(_", "days_", "=_", "6_", "-_", "end", "\\u", "date_", "._", "weekday_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "start", "\\u", "date_", "<=_", "end", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dates_", "._", "append_", "(_", "start", "\\u", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "date_", "+=_", "timedelta_", "(_", "days_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reminder", "\\u", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "reminder", "_", "in_", "reminder", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "=_", "reminder", "_", "._", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recipient_", "=_", "reminder", "_", "._", "recipient_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "\\u", "desc_", "=_", "get", "\\u", "recip", "ient", "\\u", "name_", "(_", "recipient_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "reminder", "_", "._", "case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reminder", "\\u", "data_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "handler", "\\u", "name", "\"_", ":_", "handler_", "._", "nickname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "next", "\\u", "fire", "\"_", ":_", "adjust", "\\u", "next", "\\u", "fire", "\\u", "to", "\\u", "timezone_", "(_", "reminder", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "recip", "ient", "\\u", "desc", "\"_", ":_", "recip", "ient", "\\u", "desc_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "recip", "ient", "\\u", "type", "\"_", ":_", "handler_", "._", "recipient_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "case", "\\u", "id", "\"_", ":_", "case_", "._", "get", "\\u", "id_", "if_", "case_", "is_", "not_", "None_", "else_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "case", "\\u", "name", "\"_", ":_", "case_", "._", "name_", "if_", "case_", "is_", "not_", "None_", "else_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "page", "\\u", "context_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reminder", "\\u", "data", "'_", ":_", "reminder", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dates", "'_", ":_", "dates_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "toda", "y", "'_", ":_", "today_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "now", "'_", ":_", "now_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timezon", "e", "'_", ":_", "timezone_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timezon", "e\\u", "now", "'_", ":_", "timezon", "e\\u", "now_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "page", "\\u", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "create", "\\u", "reminder", "\\u", "schedule", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Schedule", " ", "Remi", "nder", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "name_", "=_", "'", "reminder", "s", "/", "manage", "\\u", "schedule", "d\\u", "reminder", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui", "\\u", "type_", "=_", "UI", "\\u", "SIMPLE", "\\u", "FIXED", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "reminder", "s", "\\u", "frame", "work", "\\u", "permission_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "jq", "uer", "y", "\\u", "ui_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "timep", "ick", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "select", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "reminder", "\\u", "form", "\\u", "class_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "UI", "\\u", "COMPL", "EX_", ":_", "Comple", "x", "Schedule", "Case", "Remi", "nder", "Form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "UI", "\\u", "SIMPLE", "\\u", "FIXED", "_", ":_", "Simple", "Schedule", "Case", "Remi", "nder", "Form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "[_", "self_", "._", "ui", "\\u", "type_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "schedule", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "reminder", "\\u", "form", "\\u", "class_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "POST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "previe", "wer", "_", "=_", "self_", "._", "is", "\\u", "previe", "wer", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "use", "\\u", "survey_", "=_", "can", "\\u", "use", "\\u", "survey", "\\u", "reminder", "s_", "(_", "self_", "._", "request_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "avail", "able", "\\u", "languages_", "=_", "self_", "._", "avail", "able", "\\u", "languages_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "reminder", "\\u", "form", "\\u", "class_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "previe", "wer", "_", "=_", "self_", "._", "is", "\\u", "previe", "wer", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "use", "\\u", "survey_", "=_", "can", "\\u", "use", "\\u", "survey", "\\u", "reminder", "s_", "(_", "self_", "._", "request_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "avail", "able", "\\u", "languages_", "=_", "self_", "._", "avail", "able", "\\u", "languages_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "avail", "able", "\\u", "languages_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "the", " ", "list", " ", "of", " ", "language", " ", "codes", " ", "avail", "able", " ", "for", " ", "the", " ", "domain", ",", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "[]", " ", "if", " ", "no", " ", "language", "s", " ", "are", " ", "specified", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "translatio", "n", "\\u", "doc_", "=_", "Stand", "alo", "ne", "Translat", "ion", "Doc_", "._", "get", "\\u", "obj_", "(_", "self_", "._", "domain_", ",_", "\"", "sms", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "translatio", "n", "\\u", "doc_", "and_", "translatio", "n", "\\u", "doc_", "._", "langs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "translatio", "n", "\\u", "doc_", "._", "langs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "previe", "wer", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "request_", "._", "couch", "\\u", "user_", "._", "is", "\\u", "previe", "wer", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "parent", "\\u", "pages_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "\\u_", "(_", "\"", "Remi", "nder", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "reverse_", "(_", "Remi", "nder", "s", "List", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "page", "\\u", "context_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "'_", ":_", "self_", "._", "schedule", "\\u", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "\\u", "form", "'_", ":_", "Case", "Remi", "nder", "Event", "Form_", "(_", "ui", "\\u", "type_", "=_", "self_", "._", "ui", "\\u", "type_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "form", "'_", ":_", "Case", "Remi", "nder", "Event", "Messag", "e", "Form_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ui", "\\u", "type", "'_", ":_", "self_", "._", "ui", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "avail", "able", "\\u", "language", "s", "'_", ":_", "self_", "._", "avail", "able", "\\u", "languages_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "avail", "able", "\\u", "case", "\\u", "types_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case", "\\u", "types_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "app_", "in_", "self_", "._", "apps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case", "\\u", "types_", "._", "extend_", "(_", "[_", "m_", "._", "case", "\\u", "type_", "for_", "m_", "in_", "app_", "._", "modules_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "set_", "(_", "case", "\\u", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "action_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "request_", "._", "POST_", "._", "get_", "(_", "'", "action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "case", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "request_", "._", "POST_", "._", "get_", "(_", "'", "case", "Type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "apps_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "\\u", "apps", "\\u", "in", "\\u", "domain_", "(_", "self_", "._", "domain_", ",_", "include", "\\u", "remote_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "search", "\\u", "term_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "request_", "._", "POST_", "._", "get_", "(_", "'", "term", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "search", "\\u", "case", "\\u", "type", "\\u", "response_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "list_", "(_", "self_", "._", "avail", "able", "\\u", "case", "\\u", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean", "\\u", "dict", "\\u", "list_", "(_", "self_", ",_", "dict", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Tak", "es", " ", "a", " ", "dict", " ", "of", " ", "{", "string", ":", " ", "list", "}", " ", "and", " ", "return", "s", " ", "the", " ", "same", " ", "result", ",", " ", "only", "\\", "10", ";", " ", " ", " ", " ", "remo", "ving", " ", "any", " ", "duplicat", "e", " ", "entri", "es", " ", "in", " ", "each", " ", "of", " ", "the", " ", "lists", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "dict", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "key_", "]_", "=_", "list_", "(_", "set_", "(_", "dict", "\\u", "list_", "[_", "key_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "search", "\\u", "form", "\\u", "by", "\\u", "id", "\\u", "response_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "dict", " ", "of", " ", "{", "\"", "id", "\":", " ", "[", "form", " ", "unique", " ", "id", "],", " ", "\"", "text", "\":", " ", "[", "full", " ", "form", " ", "path", "]}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "\\u", "unique", "\\u", "id_", "=_", "self_", "._", "search", "\\u", "term_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "Form_", "._", "get", "\\u", "form_", "(_", "form", "\\u", "unique", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "form_", "._", "get", "\\u", "app_", "(_", ")_", "._", "domain_", "==_", "self_", "._", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "form_", "._", "full", "\\u", "path", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "form", "\\u", "unique", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "search", "\\u", "case", "\\u", "property", "\\u", "response_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "dict", " ", "of", " ", "{", "case", " ", "type", ":", " ", "[", "case", " ", "proper", "ties", "...]", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "app_", "in_", "self_", "._", "apps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case", "\\u", "types_", "=_", "list_", "(_", "set_", "(_", "[_", "m_", "._", "case", "\\u", "type_", "for_", "m_", "in_", "app_", "._", "modules_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "case", "\\u", "type_", "in_", "case", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "case", "\\u", "type_", "not_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "[_", "case", "\\u", "type_", "]_", "=_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "properties_", "in_", "get", "\\u", "case", "\\u", "properties_", "(_", "app_", ",_", "[_", "case", "\\u", "type_", "]_", ")_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "[_", "case", "\\u", "type_", "]_", "._", "extend_", "(_", "properties_", ")_", "\\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_", "self_", "._", "clean", "\\u", "dict", "\\u", "list_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "parent", "\\u", "child", "\\u", "types_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "dict", " ", "of", " ", "{", "parent", " ", "case", " ", "type", ":", " ", "[", "subc", "ase", " ", "types", "...]", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent", "\\u", "child", "\\u", "types_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "app_", "in_", "self_", "._", "apps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "module_", "in_", "app_", "._", "get", "\\u", "modules_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case", "\\u", "type_", "=_", "module_", "._", "case", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "case", "\\u", "type_", "not_", "in_", "parent", "\\u", "child", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parent", "\\u", "child", "\\u", "types_", "[_", "case", "\\u", "type_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "module_", "._", "module", "\\u", "type_", "==_", "'", "basic", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "form_", "in_", "module_", "._", "get", "\\u", "forms_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "subc", "ase_", "in_", "form_", "._", "actions_", "._", "subc", "ases", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "parent", "\\u", "child", "\\u", "types_", "[_", "case", "\\u", "type_", "]_", "._", "append_", "(_", "subc", "ase_", "._", "case", "\\u", "type_", ")_", "\\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_", "module_", "._", "module", "\\u", "type_", "==_", "'", "advanced", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "form_", "in_", "module_", "._", "get", "\\u", "forms_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "subc", "ase_", "in_", "form_", "._", "actions_", "._", "get", "\\u", "open", "\\u", "subc", "ase", "\\u", "actions_", "(_", "case", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "parent", "\\u", "child", "\\u", "types_", "[_", "case", "\\u", "type_", "]_", "._", "append_", "(_", "subc", "ase_", "._", "case", "\\u", "type_", ")_", "\\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_", "return_", "self_", "._", "clean", "\\u", "dict", "\\u", "list_", "(_", "parent", "\\u", "child", "\\u", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "search", "\\u", "subc", "ase", "\\u", "property", "\\u", "response_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "dict", " ", "of", " ", "{", "parent", " ", "case", " ", "type", ":", " ", "[", "subc", "ase", " ", "proper", "ties", "]}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent", "\\u", "child", "\\u", "types_", "=_", "self_", "._", "get", "\\u", "parent", "\\u", "child", "\\u", "types_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "case", "\\u", "properties_", "=_", "self_", "._", "search", "\\u", "case", "\\u", "property", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "parent", "\\u", "type_", "in_", "parent", "\\u", "child", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "parent", "\\u", "type_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "subc", "ase", "\\u", "type_", "in_", "parent", "\\u", "child", "\\u", "types_", "[_", "parent", "\\u", "type_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "parent", "\\u", "type_", "]_", "._", "extend_", "(_", "all", "\\u", "case", "\\u", "properties_", "[_", "subc", "ase", "\\u", "type_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "clean", "\\u", "dict", "\\u", "list_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "search", "\\u", "forms", "\\u", "response_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "forms_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "app_", "in_", "self_", "._", "apps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "module_", "in_", "app_", "._", "get", "\\u", "modules_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "form_", "in_", "module_", "._", "get", "\\u", "forms_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "forms_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "form_", "._", "full", "\\u", "path", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "form_", "._", "unique", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "search", "\\u", "term_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "\\u", "forms_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "\\u", "terms_", "=_", "self_", "._", "search", "\\u", "term_", "._", "split_", "(_", "\"", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "form_", "in_", "forms_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matches_", "=_", "[_", "t_", "for_", "t_", "in_", "search", "\\u", "terms_", "if_", "t_", "in_", "form_", "[_", "'", "text", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "matches_", ")_", "==_", "len_", "(_", "search", "\\u", "terms_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "final", "\\u", "forms_", "._", "append_", "(_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "final", "\\u", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "filter", "\\u", "by", "\\u", "term_", "(_", "self_", ",_", "filter", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "f_", "for_", "f_", "in_", "filter", "\\u", "list_", "if_", "self_", "._", "search", "\\u", "term_", "in_", "f_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "format\\u", "response_", "(_", "self_", ",_", "resp", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "{_", "'", "text", "'_", ":_", "r_", ",_", "'", "id", "'_", ":_", "r_", "}_", "for_", "r_", "in_", "resp", "\\u", "list_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "action_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "\\u", "case", "\\u", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "\\u", "case", "\\u", "property", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "\\u", "subc", "ase", "\\u", "property", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "\\u", "forms", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "\\u", "form", "\\u", "by", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Response_", "(_", "json_", "._", "dumps_", "(_", "getattr_", "(_", "self_", ",_", "'%", "s", "\\u", "response", "'_", "%_", "self_", "._", "action_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "schedule", "\\u", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "process", "\\u", "schedule", "\\u", "form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "reverse_", "(_", "Remi", "nder", "s", "List", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "messages_", "._", "error_", "(_", "self_", "._", "request_", ",_", "\"", "There", " ", "wer", "e", " ", "error", "s", " ", "saving", " ", "your", " ", "reminder", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "get_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "schedule", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "handler_", "=_", "Case", "Remi", "nder", "Handler_", "(_", "use", "\\u", "toda", "y", "\\u", "if", "\\u", "start", "\\u", "date", "\\u", "is", "\\u", "blank_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "schedule", "\\u", "form_", "._", "save_", "(_", "new", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Creat", "e", "Comple", "x", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "create", "\\u", "complex", "\\u", "reminder", "\\u", "schedule", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Schedule", " ", "Multi", " ", "Event", " ", "Remi", "nder", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui", "\\u", "type_", "=_", "UI", "\\u", "COMPL", "EX_", "\\u\\u\\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_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "edit", "\\u", "reminder", "\\u", "schedule", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Edit", " ", "Schedule", "d", " ", "Remi", "nder", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handler", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "handler", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\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_", "page", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "ui", "\\u", "type_", "==_", "UI", "\\u", "COMPL", "EX_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u_", "(_", "\"", "Edit", " ", "Schedule", "d", " ", "Multi", " ", "Event", " ", "Remi", "nder", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "page", "\\u", "title_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\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_", "avail", "able", "\\u", "languages_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "editin", "g", " ", "a", " ", "reminder", ",", " ", "add", " ", "in", " ", "any", " ", "language", "s", " ", "tha", "t", " ", "are", " ", "used", " ", "by", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "reminder", " ", "but", " ", "tha", "t", " ", "are", " ", "not", " ", "in", " ", "the", " ", "result", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", "Schedule", "d", "Remi", "nder", "View", "'", "s", " ", "avail", "able", "\\u", "language", "s", " ", "property", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "need", "ed", " ", "to", " ", "be", " ", "back", "ward", "s", "-", "compatible", " ", "with", " ", "reminder", "s", " ", "created", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "the", " ", "old", " ", "ui", " ", "tha", "t", " ", "wou", "ld", " ", "let", " ", "you", " ", "speci", "fy", " ", "any", " ", "language", ",", " ", "rega", "rd", "less", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "whe", "ther", " ", "it", " ", "was", " ", "in", " ", "the", " ", "domain", "'", "s", " ", "list", " ", "of", " ", "language", "s", " ", "or", " ", "not", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "super_", "(_", "Edit", "Schedule", "d", "Remi", "nder", "View_", ",_", "self_", ")_", "._", "avail", "able", "\\u", "languages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "self_", "._", "reminder", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "event_", "in_", "handler_", "._", "events_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event_", "._", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "lang_", ",_", "text_", ")_", "in_", "event_", "._", "message_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "lang_", "not_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "result_", "._", "append_", "(_", "lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "schedule", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "=_", "self_", "._", "reminder", "\\u", "form", "\\u", "class_", "._", "compute", "\\u", "initial_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reminder", "\\u", "handler_", ",_", "self_", "._", "avail", "able", "\\u", "languages_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "reminder", "\\u", "form", "\\u", "class_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "POST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "initial_", "=_", "initial_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "previe", "wer", "_", "=_", "self_", "._", "is", "\\u", "previe", "wer", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "edit_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "use", "\\u", "survey_", "=_", "can", "\\u", "use", "\\u", "survey", "\\u", "reminder", "s_", "(_", "self_", "._", "request_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "custom", "\\u", "content", "\\u", "handler_", "=_", "self_", "._", "reminder", "\\u", "handler_", "._", "custom", "\\u", "content", "\\u", "handler_", "is_", "not_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "custom", "\\u", "content", "\\u", "handler_", "=_", "self_", "._", "reminder", "\\u", "handler_", "._", "custom", "\\u", "content", "\\u", "handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "avail", "able", "\\u", "languages_", "=_", "self_", "._", "avail", "able", "\\u", "languages_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "reminder", "\\u", "form", "\\u", "class_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "initial_", "=_", "initial_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "previe", "wer", "_", "=_", "self_", "._", "is", "\\u", "previe", "wer", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "edit_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "use", "\\u", "survey_", "=_", "can", "\\u", "use", "\\u", "survey", "\\u", "reminder", "s_", "(_", "self_", "._", "request_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "custom", "\\u", "content", "\\u", "handler_", "=_", "self_", "._", "reminder", "\\u", "handler_", "._", "custom", "\\u", "content", "\\u", "handler_", "is_", "not_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "custom", "\\u", "content", "\\u", "handler_", "=_", "self_", "._", "reminder", "\\u", "handler_", "._", "custom", "\\u", "content", "\\u", "handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "avail", "able", "\\u", "languages_", "=_", "self_", "._", "avail", "able", "\\u", "languages_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "reminder", "\\u", "handler_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get_", "(_", "self_", "._", "handler", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handler_", "._", "domain_", "==_", "self_", "._", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handler_", "._", "doc", "\\u", "type_", "==_", "\"", "Case", "Remi", "nder", "Handle", "r", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Reso", "urc", "e", "Not", "Found_", ",_", "Assert", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ui", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "reminder", "\\u", "handler_", "._", "ui", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\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_", "page", "\\u", "context_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "page", "\\u", "context_", "=_", "super_", "(_", "Edit", "Schedule", "d", "Remi", "nder", "View_", ",_", "self_", ")_", "._", "page", "\\u", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "context_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "handler", "\\u", "id", "'_", ":_", "self_", "._", "handler", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "page", "\\u", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\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_", "page", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "reverse_", "(_", "self_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", ",_", "self_", "._", "handler", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "schedule", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "schedule", "\\u", "form_", "._", "save_", "(_", "self_", "._", "reminder", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rule", "\\u", "in", "\\u", "progress_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "messages_", "._", "error_", "(_", "self_", "._", "request_", ",_", "\\u_", "(_", "\"", "Ple", "ase", " ", "wait", " ", "unti", "l", " ", "the", " ", "rule", " ", "finish", "es", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "process", "ing", " ", "bef", "ore", " ", "mak", "ing", " ", "fur", "ther", " ", "change", "s", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "reverse_", "(_", "Remi", "nder", "s", "List", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "reminder", "\\u", "handler_", "._", "locked_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "rule", "\\u", "in", "\\u", "progress_", "(_", ")_", "\\u\\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_", "super_", "(_", "Edit", "Schedule", "d", "Remi", "nder", "View_", ",_", "self_", ")_", "._", "get_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "(_", "Creat", "e", "Schedule", "d", "Remi", "nder", "View_", ")_", ":_", "\\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_", "post_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "reminder", "\\u", "handler_", "._", "locked_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "rule", "\\u", "in", "\\u", "progress_", "(_", ")_", "\\u\\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_", "super_", "(_", "Edit", "Schedule", "d", "Remi", "nder", "View_", ",_", "self_", ")_", "._", "post_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "add", "\\u", "structure", "d\\u", "keyw", "ord", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "New", " ", "Structur", "ed", " ", "Key", "word", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "name_", "=_", "'", "reminder", "s", "/", "keyw", "ord", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "structure", "d\\u", "message_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\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_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "parent", "\\u", "pages_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "Key", "words", "List", "View_", "._", "page", "\\u", "title_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "reverse_", "(_", "Key", "words", "List", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "keyword_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Surv", "ey", "Keyword_", "(_", "domain_", "=_", "self_", "._", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "keyw", "ord", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"", "you", " ", "must", " ", "implement", " ", "keyw", "ord", "\\u", "form", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "page", "\\u", "context_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "fmt", "\\u", "choices_", "(_", "val_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "value", "'_", ":_", "val_", ",_", "'", "text", "'_", ":_", "text_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "'_", ":_", "self_", "._", "keyw", "ord", "\\u", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "\\u", "list", "'_", ":_", "get", "\\u", "form", "\\u", "list_", "(_", "self_", "._", "domain_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "keyw", "ord", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Key", "word", "Form_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "POST_", ",_", "domain_", "=_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "process", "\\u", "structure", "d_", "=_", "self_", "._", "process", "\\u", "structure", "d\\u", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Key", "word", "Form_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "process", "\\u", "structure", "d_", "=_", "self_", "._", "process", "\\u", "structure", "d\\u", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "keyword_", "._", "keyword_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "keyw", "ord", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyword_", "._", "description_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "description", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyword_", "._", "delimiter_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "delimiter", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyword_", "._", "override", "\\u", "open", "\\u", "sessions_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "override", "\\u", "open", "\\u", "session", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "keyword_", "._", "initiator", "\\u", "doc", "\\u", "type", "\\u", "filter_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "allow", "\\u", "keyw", "ord", "\\u", "use", "\\u", "by", "'_", "]_", "==_", "'", "users", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "keyword_", "._", "initiator", "\\u", "doc", "\\u", "type", "\\u", "filter_", "._", "append_", "(_", "'", "Comm", "Care", "User", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "allow", "\\u", "keyw", "ord", "\\u", "use", "\\u", "by", "'_", "]_", "==_", "'", "case", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "keyword_", "._", "initiator", "\\u", "doc", "\\u", "type", "\\u", "filter_", "._", "append_", "(_", "'", "Comm", "Care", "Case", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "keyword_", "._", "actions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "sender", "\\u", "content", "\\u", "type", "'_", "]_", "!=_", "NO", "\\u", "RESPONSE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "keyword_", "._", "actions_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Surv", "ey", "Key", "word", "Action_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "recipient_", "=_", "RECIP", "IENT", "\\u", "SEND", "ER_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "sender", "\\u", "content", "\\u", "type", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "\\u", "content_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "sender", "\\u", "message", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "unique", "\\u", "id_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "sender", "\\u", "form", "\\u", "unique", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "process", "\\u", "structure", "d\\u", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "keyword_", "._", "actions_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Surv", "ey", "Key", "word", "Action_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "recipient_", "=_", "RECIP", "IENT", "\\u", "SEND", "ER_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "METH", "OD", "\\u", "STRUCTUR", "ED", "\\u", "SMS", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "unique", "\\u", "id_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "structure", "d\\u", "sms", "\\u", "form", "\\u", "unique", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "named", "\\u", "args_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "use", "\\u", "named", "\\u", "args", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "named", "\\u", "args_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "named", "\\u", "args", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "named", "\\u", "args", "\\u", "separator_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "named", "\\u", "args", "\\u", "separator", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "other", "\\u", "recip", "ient", "\\u", "content", "\\u", "type", "'_", "]_", "!=_", "NO", "\\u", "RESPONSE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "keyword_", "._", "actions_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Surv", "ey", "Key", "word", "Action_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "recipient_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "other", "\\u", "recip", "ient", "\\u", "type", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "recip", "ient", "\\u", "id_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "other", "\\u", "recip", "ient", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "other", "\\u", "recip", "ient", "\\u", "content", "\\u", "type", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "\\u", "content_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "other", "\\u", "recip", "ient", "\\u", "message", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "unique", "\\u", "id_", "=_", "self_", "._", "keyw", "ord", "\\u", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "other", "\\u", "recip", "ient", "\\u", "form", "\\u", "unique", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\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_", "._", "keyword_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "reverse_", "(_", "Key", "words", "List", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "get_", "(_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Add", "Normal", "Key", "word", "View_", "(_", "Add", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "add", "\\u", "normal", "\\u", "keyw", "ord", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "New", " ", "Key", "word", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "structure", "d\\u", "message_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Edit", "Structur", "ed", "Key", "word", "View_", "(_", "Add", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "edit", "\\u", "structure", "d\\u", "keyw", "ord", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Edit", " ", "Structur", "ed", " ", "Key", "word", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Edit", "Structur", "ed", "Key", "word", "View_", "(_", "Add", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "page", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "reverse_", "(_", "self_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", ",_", "self_", "._", "keyw", "ord", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Structur", "ed", "Key", "word", "View_", "(_", "Add", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\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_", "keyw", "ord", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "keyw", "ord", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Structur", "ed", "Key", "word", "View_", "(_", "Add", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "keyword_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "keyw", "ord", "\\u", "id_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sk_", "=_", "Surv", "ey", "Keyword_", "._", "get_", "(_", "self_", "._", "keyw", "ord", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sk_", "._", "domain_", "!=_", "self_", "._", "domain_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Structur", "ed", "Key", "word", "View_", "(_", "Add", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "keyw", "ord", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "=_", "self_", "._", "get", "\\u", "initial", "\\u", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "Key", "word", "Form_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "POST_", ",_", "domain_", "=_", "self_", "._", "domain_", ",_", "initial_", "=_", "initial_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "process", "\\u", "structure", "d_", "=_", "self_", "._", "process", "\\u", "structure", "d\\u", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "\\u", "sk", "\\u", "id_", "=_", "self_", "._", "keyw", "ord", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Key", "word", "Form_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "self_", "._", "domain_", ",_", "initial_", "=_", "initial_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "process", "\\u", "structure", "d_", "=_", "self_", "._", "process", "\\u", "structure", "d\\u", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Structur", "ed", "Key", "word", "View_", "(_", "Add", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "initial", "\\u", "values_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyw", "ord", "'_", ":_", "self_", "._", "keyword_", "._", "keyword_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "self_", "._", "keyword_", "._", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delimiter", "'_", ":_", "self_", "._", "keyword_", "._", "delimiter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "override", "\\u", "open", "\\u", "session", "s", "'_", ":_", "self_", "._", "keyword_", "._", "override", "\\u", "open", "\\u", "sessions_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sender", "\\u", "content", "\\u", "type", "'_", ":_", "NO", "\\u", "RESPONSE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "case", "\\u", "filter_", "=_", "\"", "Comm", "Care", "Case", "\"_", "in_", "self_", "._", "keyword_", "._", "initiator", "\\u", "doc", "\\u", "type", "\\u", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "user", "\\u", "filter_", "=_", "\"", "Comm", "Care", "User", "\"_", "in_", "self_", "._", "keyword_", "._", "initiator", "\\u", "doc", "\\u", "type", "\\u", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "case", "\\u", "filter_", "and_", "not_", "is", "\\u", "user", "\\u", "filter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "allow", "\\u", "keyw", "ord", "\\u", "use", "\\u", "by", "'_", ":_", "'", "case", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "user", "\\u", "filter_", "and_", "not_", "is", "\\u", "case", "\\u", "filter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "allow", "\\u", "keyw", "ord", "\\u", "use", "\\u", "by", "'_", ":_", "'", "users", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "action_", "in_", "self_", "._", "keyword_", "._", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "action_", "._", "action_", "==_", "METH", "OD", "\\u", "STRUCTUR", "ED", "\\u", "SMS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "process", "\\u", "structure", "d\\u", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "initial_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "structure", "d\\u", "sms", "\\u", "form", "\\u", "unique", "\\u", "id", "'_", ":_", "action_", "._", "form", "\\u", "unique", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "use", "\\u", "custom", "\\u", "delimiter", "'_", ":_", "self_", "._", "keyword_", "._", "delimiter_", "is_", "not_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "use", "\\u", "named", "\\u", "args", "\\u", "separator", "'_", ":_", "action_", "._", "named", "\\u", "args", "\\u", "separator_", "is_", "not_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "use", "\\u", "named", "\\u", "args", "'_", ":_", "action_", "._", "use", "\\u", "named", "\\u", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "named", "\\u", "args", "\\u", "separator", "'_", ":_", "action_", "._", "named", "\\u", "args", "\\u", "separator_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "named", "\\u", "args", "'_", ":_", "[_", "{_", "\"", "name", "\"_", ":_", "k_", ",_", "\"", "xpa", "th", "\"_", ":_", "v_", "}_", "for_", "k_", ",_", "v_", "in_", "action_", "._", "named", "\\u", "args_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "._", "recipient_", "==_", "RECIP", "IENT", "\\u", "SEND", "ER_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sender", "\\u", "content", "\\u", "type", "'_", ":_", "action_", "._", "action_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sender", "\\u", "message", "'_", ":_", "action_", "._", "message", "\\u", "content_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sender", "\\u", "form", "\\u", "unique", "\\u", "id", "'_", ":_", "action_", "._", "form", "\\u", "unique", "\\u", "id_", ",_", "\\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 ", " _", "initial_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", "\\u", "recip", "ient", "\\u", "type", "'_", ":_", "action_", "._", "recipient_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", "\\u", "recip", "ient", "\\u", "id", "'_", ":_", "action_", "._", "recip", "ient", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", "\\u", "recip", "ient", "\\u", "content", "\\u", "type", "'_", ":_", "action_", "._", "action_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", "\\u", "recip", "ient", "\\u", "message", "'_", ":_", "action_", "._", "message", "\\u", "content_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", "\\u", "recip", "ient", "\\u", "form", "\\u", "unique", "\\u", "id", "'_", ":_", "action_", "._", "form", "\\u", "unique", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "initial_", "\\u\\u\\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_", "Edit", "Normal", "Key", "word", "View_", "(_", "Edit", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "edit", "\\u", "normal", "\\u", "keyw", "ord", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Edit", " ", "Normal", " ", "Key", "word", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "structure", "d\\u", "message_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Normal", "Key", "word", "View_", "(_", "Edit", "Structur", "ed", "Key", "word", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "keyword_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sk_", "=_", "super_", "(_", "Edit", "Normal", "Key", "word", "View_", ",_", "self_", ")_", "._", "keyword_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "allow", " ", "structure", "d", " ", "keywords", " ", "to", " ", "be", " ", "edited", " ", "in", " ", "this", " ", "view", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "METH", "OD", "\\u", "STRUCTUR", "ED", "\\u", "SMS", "_", "in_", "[_", "a_", "._", "action_", "for_", "a_", "in_", "sk_", "._", "actions_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "add", "\\u", "broadcast", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "lazy_", "(_", "'", "New", " ", "Broad", "cast", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "name_", "=_", "'", "reminder", "s", "/", "broadcast", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "force", "\\u", "create", "\\u", "new", "\\u", "broadcast_", "=_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "jq", "uer", "y", "\\u", "ui_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "timep", "ick", "er_", "\\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_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "project", "\\u", "timezone_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "\\u", "timezon", "e\\u", "for", "\\u", "user_", "(_", "None_", ",_", "self_", "._", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "parent", "\\u", "pages_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "Broad", "cast", "List", "View_", "._", "page", "\\u", "title_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "reverse_", "(_", "Broad", "cast", "List", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "new", "\\u", "broadcast_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Case", "Remi", "nder", "Handler_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nickname_", "=_", "'", "One", "-", "time", " ", "Remi", "nder", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reminder", "\\u", "type_", "=_", "REM", "INDE", "R", "\\u", "TYPE", "\\u", "ONE", "\\u", "TIME_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "broadcast_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "create", "\\u", "new", "\\u", "broadcast_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "form", "\\u", "kwargs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "can", "\\u", "use", "\\u", "survey", "'_", ":_", "can", "\\u", "use", "\\u", "survey", "\\u", "reminder", "s_", "(_", "self_", "._", "request_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "form", "\\u", "class_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "toggle", "s_", "._", "EW", "S", "\\u", "BROADCAST", "\\u", "BY", "\\u", "ROLE", "_", "._", "enabled_", "(_", "self_", "._", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "EW", "SB", "road", "cast", "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_", "Broad", "cast", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "broadcast", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "form", "\\u", "class_", "(_", "self_", "._", "request_", "._", "POST_", ",_", "**_", "self_", "._", "form", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "form", "\\u", "class_", "(_", "**_", "self_", "._", "form", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "page", "\\u", "context_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "'_", ":_", "self_", "._", "broadcast", "\\u", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "model_", "(_", "self_", ",_", "broadcast_", ",_", "form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broadcast_", "._", "default", "\\u", "lang_", "=_", "'", "xx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "method_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "content", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "recipient_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "recip", "ient", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "start", "\\u", "condition", "\\u", "type_", "=_", "ON", "\\u", "DATETIME", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "start", "\\u", "datetime_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "datetime", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "start", "\\u", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "events_", "=_", "[_", "Case", "Remi", "nder", "Event_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "day", "\\u", "num_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fire", "\\u", "time_", "=_", "time_", "(_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "unique", "\\u", "id_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "form", "\\u", "unique", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "(_", "{_", "broadcast_", "._", "default", "\\u", "lang_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "message", "'_", ")_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "message", "'_", ")_", "else_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subject_", "=_", "(_", "{_", "broadcast_", "._", "default", "\\u", "lang_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "subject", "'_", ")_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "subject", "'_", ")_", "else_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "callback", "\\u", "timeo", "ut", "\\u", "intervals_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "schedule", "\\u", "length_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "event", "\\u", "interpretation", "_", "=_", "EVENT", "\\u", "AS", "\\u", "OFFSET_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "max", "\\u", "iterati", "on", "\\u", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "sample", "\\u", "id_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "case", "\\u", "group", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "user", "\\u", "group", "\\u", "id_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "user", "\\u", "group", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "location", "\\u", "ids_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "location", "\\u", "ids", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broadcast_", "._", "include", "\\u", "child", "\\u", "locations_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "include", "\\u", "child", "\\u", "location", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "toggle", "s_", "._", "EW", "S", "\\u", "BROADCAST", "\\u", "BY", "\\u", "ROLE", "_", "._", "enabled_", "(_", "self_", "._", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broadcast_", "._", "user", "\\u", "data\\u", "filter_", "=_", "form_", "._", "get", "\\u", "user", "\\u", "data\\u", "filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "broadcast_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "broadcast", "\\u", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "force", "\\u", "create", "\\u", "new", "\\u", "broadcast_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broadcast_", "=_", "self_", "._", "create", "\\u", "new", "\\u", "broadcast_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broadcast_", "=_", "self_", "._", "broadcast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "save", "\\u", "model_", "(_", "broadcast_", ",_", "self_", "._", "broadcast", "\\u", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "reverse_", "(_", "Broad", "cast", "List", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "get_", "(_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Edit", "Broad", "cast", "View_", "(_", "Creat", "e", "Broad", "cast", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "edit", "\\u", "broadcast", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "lazy_", "(_", "'", "Edit", " ", "Broad", "cast", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Edit", "Broad", "cast", "View_", "(_", "Creat", "e", "Broad", "cast", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "page", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "reverse_", "(_", "self_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", ",_", "self_", "._", "broadcast", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Broad", "cast", "View_", "(_", "Creat", "e", "Broad", "cast", "View_", ")_", ":_", "\\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_", "broadcast", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "broadcast", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Broad", "cast", "View_", "(_", "Creat", "e", "Broad", "cast", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "broadcast_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broadcast_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get_", "(_", "self_", "._", "broadcast", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "broadcast_", "._", "doc", "\\u", "type_", "!=_", "'", "Case", "Remi", "nder", "Handle", "r", "'_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "broadcast_", "._", "domain_", "!=_", "self_", "._", "domain_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "broadcast_", "._", "reminder", "\\u", "type_", "!=_", "REM", "INDE", "R", "\\u", "TYPE", "\\u", "ONE", "\\u", "TIME_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "broadcast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Edit", "Broad", "cast", "View_", "(_", "Creat", "e", "Broad", "cast", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "broadcast", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "form", "\\u", "class_", "(_", "self_", "._", "request_", "._", "POST_", ",_", "**_", "self_", "._", "form", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "broadcast_", "=_", "self_", "._", "broadcast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "user", "\\u", "time_", "=_", "Server", "Time_", "(_", "broadcast_", "._", "start", "\\u", "datetime_", ")_", "._", "user", "\\u", "time_", "(_", "self_", "._", "project", "\\u", "timezone_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tim", "ing", "'_", ":_", "SEND", "\\u", "LATE", "R_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "start", "\\u", "user", "\\u", "time_", "._", "ui", "\\u", "string_", "(_", "'%", "Y", "-%", "m", "-%", "d", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "start", "\\u", "user", "\\u", "time_", "._", "ui", "\\u", "string_", "(_", "'%", "H", ":", "%", "M", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "recip", "ient", "\\u", "type", "'_", ":_", "broadcast_", "._", "recipient_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "case", "\\u", "group", "\\u", "id", "'_", ":_", "broadcast_", "._", "sample", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "group", "\\u", "id", "'_", ":_", "broadcast_", "._", "user", "\\u", "group", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "broadcast_", "._", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "'_", ":_", "broadcast_", "._", "events_", "[_", "0_", "]_", "._", "message_", "._", "get_", "(_", "broadcast_", "._", "default", "\\u", "lang_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subject", "'_", ":_", "broadcast_", "._", "events_", "[_", "0_", "]_", "._", "subject_", "._", "get_", "(_", "broadcast_", "._", "default", "\\u", "lang_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "\\u", "unique", "\\u", "id", "'_", ":_", "broadcast_", "._", "events_", "[_", "0_", "]_", "._", "form", "\\u", "unique", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "\\u", "ids", "'_", ":_", "','_", "._", "join_", "(_", "broadcast_", "._", "location", "\\u", "ids_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "include", "\\u", "child", "\\u", "location", "s", "'_", ":_", "broadcast_", "._", "include", "\\u", "child", "\\u", "locations_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "toggle", "s_", "._", "EW", "S", "\\u", "BROADCAST", "\\u", "BY", "\\u", "ROLE", "_", "._", "enabled_", "(_", "self_", "._", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "[_", "'", "role", "'_", "]_", "=_", "broadcast_", "._", "user", "\\u", "data\\u", "filter_", "._", "get_", "(_", "'", "role", "'_", ",_", "[_", "None_", "]_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "form", "\\u", "class_", "(_", "initial_", "=_", "initial_", ",_", "**_", "self_", "._", "form", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Copy", "Broad", "cast", "View_", "(_", "Edit", "Broad", "cast", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "name_", "=_", "'", "copy", "\\u", "broadcast", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "lazy_", "(_", "'", "Copy", " ", "Broad", "cast", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "force", "\\u", "create", "\\u", "new", "\\u", "broadcast_", "=_", "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_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "reminder", "s", "/", "reminder", "s", "\\u", "list", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "name_", "=_", "\"", "list", "\\u", "reminder", "s", "\\u", "new", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Remi", "nder", " ", "Definit", "ion", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "datata", "bles_", "\\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_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "page", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "reverse_", "(_", "self_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "can", "\\u", "use", "\\u", "survey_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "can", "\\u", "use", "\\u", "survey", "\\u", "reminder", "s_", "(_", "self_", "._", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "reminder", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "handlers_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get", "\\u", "handlers_", "(_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reminder", "\\u", "type", "\\u", "filter_", "=_", "REM", "INDE", "R", "\\u", "TYPE", "\\u", "DEFAULT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "can", "\\u", "use", "\\u", "survey_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "handlers_", "=_", "filter_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "x_", ":_", "x_", "._", "method_", "not_", "in_", "[_", "METH", "OD", "\\u", "IV", "R", "\\u", "SUR", "VE", "Y_", ",_", "METH", "OD", "\\u", "SMS", "\\u", "SUR", "VE", "Y_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "all", "\\u", "handlers_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "handler_", "in_", "all", "\\u", "handlers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "self_", "._", "\\u", "fmt", "\\u", "reminder", "\\u", "data_", "(_", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "page", "\\u", "context_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reminder", "s", "'_", ":_", "list_", "(_", "self_", "._", "reminder", "s_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "reminder", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "request_", "._", "POST_", "[_", "'", "reminder", "Id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "reminder", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Case", "Remi", "nder", "Handler_", "._", "get_", "(_", "self_", "._", "reminder", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "fmt", "\\u", "reminder", "\\u", "data_", "(_", "self_", ",_", "reminder", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "reminder", "_", "._", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "Activ", "e", "'_", ":_", "reminder", "_", "._", "active_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "case", "Type", "'_", ":_", "reminder", "_", "._", "case", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "reminder", "_", "._", "nickname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "reverse_", "(_", "Edit", "Schedule", "d", "Remi", "nder", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", ",_", "reminder", "_", "._", "\\u", "id_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "action", "\\u", "response_", "(_", "self_", ",_", "action_", ")_", ":_", "\\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_", "self_", "._", "reminder", "_", "._", "domain_", "==_", "self_", "._", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "reminder", "_", "._", "doc", "\\u", "type_", "==_", "\"", "Case", "Remi", "nder", "Handle", "r", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "reminder", "_", "._", "locked_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "success", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lock", "ed", "'_", ":_", "True_", ",_", "\\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_", "action_", "in_", "[_", "ACTI", "ON", "\\u", "ACTIVAT", "E_", ",_", "ACTI", "ON", "\\u", "DEA", "CTIV", "ATE_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reminder", "_", "._", "active_", "=_", "(_", "action_", "==_", "ACTI", "ON", "\\u", "ACTIVAT", "E_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reminder", "_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "ACTI", "ON", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reminder", "_", "._", "retire", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "success", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\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 ", " _", "msg_", "=_", "(_", "\"", "Cou", "ld", "n", "'", "t", " ", "process", " ", "action", " ", "'%", "s", "'", " ", "for", " ", "reminder", " ", "definit", "ion", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notif", "y", "\\u", "exception_", "(_", "None_", ",_", "message_", "=_", "msg_", ",_", "details_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "handler", "\\u", "id", "'_", ":_", "self_", "._", "reminder", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "success", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\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_", "post_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "action_", "=_", "self_", "._", "request_", "._", "POST_", "._", "get_", "(_", "'", "action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "action_", "in_", "[_", "ACTI", "ON", "\\u", "ACTIVAT", "E_", ",_", "ACTI", "ON", "\\u", "DEA", "CTIV", "ATE_", ",_", "ACTI", "ON", "\\u", "DELETE_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Response_", "(_", "json_", "._", "dumps_", "(_", "self_", "._", "get", "\\u", "action", "\\u", "response_", "(_", "action_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Response_", "(_", "status_", "=_", "400_", ")_", "\\u\\u\\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_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "reminder", "s", "/", "broadcast", "s", "\\u", "list", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "name_", "=_", "'", "list", "\\u", "broadcast", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "lazy_", "(_", "'", "Broad", "cast", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LIST", "\\u", "UP", "COM", "ING_", "=_", "'", "list", "\\u", "upcom", "ing", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LIST", "\\u", "PAS", "T_", "=_", "'", "list", "\\u", "past", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DELET", "E", "\\u", "BROADCAST", "_", "=_", "'", "delete", "\\u", "broadcast", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "datata", "bles_", "\\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_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "project", "\\u", "timezone_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "\\u", "timezon", "e\\u", "for", "\\u", "user_", "(_", "None_", ",_", "self_", "._", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "recipients_", "(_", "self_", ",_", "broadcast_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reminder", "s_", "=_", "broadcast_", "._", "get", "\\u", "reminder", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "reminder", "s_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u_", "(_", "'(", "none", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "get", "\\u", "recip", "ient", "\\u", "name_", "(_", "reminder", "s_", "[_", "0_", "]_", "._", "recipient_", ",_", "include", "\\u", "desc_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "content_", "(_", "self_", ",_", "broadcast_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "broadcast_", "._", "method_", "==_", "METH", "OD", "\\u", "SMS", "\\u", "SUR", "VE", "Y_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "get", "\\u", "form", "\\u", "name_", "(_", "broadcast_", "._", "events_", "[_", "0_", "]_", "._", "form", "\\u", "unique", "\\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 ", " _", "message_", "=_", "broadcast_", "._", "events_", "[_", "0_", "]_", "._", "message_", "[_", "broadcast_", "._", "default", "\\u", "lang_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "message_", ")_", ">_", "50_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "'\"", "%", "s", "...\"", "'_", "%_", "message_", "[_", ":_", "47_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "'\"", "%", "s", "\"'_", "%_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "broadcast", "\\u", "name_", "(_", "self_", ",_", "broadcast_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "time_", "=_", "Server", "Time_", "(_", "broadcast_", "._", "start", "\\u", "datetime_", ")_", "._", "user", "\\u", "time_", "(_", "self_", "._", "project", "\\u", "timezone_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "user", "\\u", "time_", "._", "ui", "\\u", "string_", "(_", "SERVER", "\\u", "DATETIME", "\\u", "FORMAT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "broadcast", "\\u", "data_", "(_", "self_", ",_", "ids_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "broadcast", "s_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get", "\\u", "handler", "s", "\\u", "from", "\\u", "ids_", "(_", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "broadcast_", "in_", "broadcast", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "display_", "=_", "self_", "._", "format\\u", "broadcast", "\\u", "name_", "(_", "broadcast_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "append_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "display_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "format\\u", "recipients_", "(_", "broadcast_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "format\\u", "content_", "(_", "broadcast_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "broadcast_", "._", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "Edit", "Broad", "cast", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", ",_", "broadcast_", "._", "\\u", "id_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "Copy", "Broad", "cast", "View_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", ",_", "broadcast_", "._", "\\u", "id_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "broadcast", "\\u", "aja", "x", "\\u", "response_", "(_", "self_", ",_", "upcom", "ing_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "upcom", "ing", " ", "-", " ", "Tru", "e", " ", "to", " ", "include", " ", "only", " ", "upcom", "ing", " ", "broadcast", "s", ",", " ", "Fal", "se", " ", "to", " ", "include", "\\", "10", ";", " ", "only", " ", "past", " ", "broadcast", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "upcom", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ids_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get", "\\u", "upcom", "ing", "\\u", "broadcast", "\\u", "ids_", "(_", "self_", "._", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ids_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get", "\\u", "past", "\\u", "broadcast", "\\u", "ids_", "(_", "self_", "._", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total", "\\u", "records_", "=_", "len_", "(_", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ids_", "=_", "ids_", "[_", "self_", "._", "display", "\\u", "start_", ":_", "self_", "._", "display", "\\u", "start_", "+_", "self_", "._", "display", "\\u", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "self_", "._", "format\\u", "broadcast", "\\u", "data_", "(_", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "datata", "bles", "\\u", "aja", "x", "\\u", "response_", "(_", "data_", ",_", "total", "\\u", "records_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "broadcast_", "(_", "self_", ",_", "broadcast", "\\u", "id_", ")_", ":_", "\\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 ", " _", "broadcast_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get_", "(_", "broadcast", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "broadcast_", "._", "doc", "\\u", "type_", "!=_", "'", "Case", "Remi", "nder", "Handle", "r", "'_", "or_", "broadcast_", "._", "domain_", "!=_", "self_", "._", "domain_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "broadcast_", "._", "retire", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "action_", "=_", "self_", "._", "request_", "._", "GET_", "._", "get_", "(_", "'", "action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "action_", "in_", "(_", "self_", "._", "LIST", "\\u", "UP", "COM", "ING_", ",_", "self_", "._", "LIST", "\\u", "PAS", "T_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "upcom", "ing_", "=_", "(_", "action_", "==_", "self_", "._", "LIST", "\\u", "UP", "COM", "ING_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "\\u", "broadcast", "\\u", "aja", "x", "\\u", "response_", "(_", "upcom", "ing_", ")_", "\\u\\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_", "super_", "(_", "Broad", "cast", "List", "View_", ",_", "self_", ")_", "._", "get_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "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_", "post_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "action_", "=_", "self_", "._", "request_", "._", "POST_", "._", "get_", "(_", "'", "action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "action_", "==_", "self_", "._", "DELET", "E", "\\u", "BROADCAST", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "delete", "\\u", "broadcast_", "(_", "self_", "._", "request_", "._", "POST_", "._", "get_", "(_", "'", "broadcast", "\\u", "id", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Response_", "(_", "status_", "=_", "400_", ")_", "\\u\\u\\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_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "reminder", "s", "/", "keyw", "ord", "\\u", "list", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "name_", "=_", "'", "keyw", "ord", "\\u", "list", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "title_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Key", "words", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "limit", "\\u", "text_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "keywords", " ", "per", " ", "page", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "empty", "\\u", "notification_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "You", " ", "have", " ", "no", " ", "keywords", ".", " ", "Ple", "ase", " ", "add", " ", "one", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "load", "ing", "\\u", "message_", "=_", "uge", "ttext", "\\u", "noop_", "(_", "\"", "Load", "ing", " ", "keywords", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\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_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "page", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "reverse_", "(_", "self_", "._", "url", "name_", ",_", "args_", "=_", "[_", "self_", "._", "domain_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "parameters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "request_", "._", "POST_", "if_", "self_", "._", "request_", "._", "method_", "==_", "'", "POST", "'_", "else_", "self_", "._", "request_", "._", "GET_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "total_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "Surv", "ey", "Keyword_", "._", "get", "\\u", "db_", "(_", ")_", "._", "view_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reminder", "s", "/", "survey", "\\u", "keywords", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reduce_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "key_", "=_", "[_", "self_", "._", "domain_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "key_", "=_", "[_", "self_", "._", "domain_", ",_", "{_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "first_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "[_", "'", "value", "'_", "]_", "if_", "data_", "else_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "column", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Key", "word", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Descripti", "on", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Action", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "page", "\\u", "context_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "pagina", "tion", "\\u", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "paginated", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "keyword_", "in_", "Surv", "ey", "Keyword_", "._", "get", "\\u", "by", "\\u", "domain_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "limit_", "=_", "self_", "._", "limit_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "skip_", "=_", "self_", "._", "skip_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "item", "Data", "'_", ":_", "self_", "._", "\\u", "fmt", "\\u", "keyw", "ord", "\\u", "data_", "(_", "keyword_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "'_", ":_", "'", "keyw", "ord", "-", "row", "-", "template", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "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_", "\\u", "fmt", "\\u", "keyw", "ord", "\\u", "data_", "(_", "self_", ",_", "keyword_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "keyword_", "._", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyw", "ord", "'_", ":_", "keyword_", "._", "keyword_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "keyword_", "._", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "edit", "Ur", "l", "'_", ":_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Edit", "Structur", "ed", "Key", "word", "View_", "._", "url", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "self_", "._", "domain_", ",_", "keyword_", "._", "\\u", "id_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "if_", "keyword_", "._", "is", "\\u", "structure", "d\\u", "sms_", "(_", ")_", "else_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Edit", "Normal", "Key", "word", "View_", "._", "url", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "self_", "._", "domain_", ",_", "keyword_", "._", "\\u", "id_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "Modal", "Id", "'_", ":_", "'", "delete", "-%", "s", "'_", "%_", "keyword_", "._", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "delete", "d\\u", "item", "\\u", "data_", "(_", "self_", ",_", "item", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "Surv", "ey", "Keyword_", "._", "get_", "(_", "item", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Reso", "urc", "e", "Not", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "s_", "._", "domain_", "!=_", "self_", "._", "domain_", "or_", "s_", "._", "doc", "\\u", "type_", "!=_", "\"", "Surv", "ey", "Key", "word", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "._", "retire", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "item", "Data", "'_", ":_", "self_", "._", "\\u", "fmt", "\\u", "keyw", "ord", "\\u", "data_", "(_", "s_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "'_", ":_", "'", "keyw", "ord", "-", "delete", "d", "-", "template", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "paginate", "\\u", "crud", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "int\\u", "or", "\\u", "none_", "(_", "i_", ")_", ":_", "\\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 ", " _", "i_", "=_", "int_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Value", "Error_", ",_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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_", "@_", "reminder", "s", "\\u", "frame", "work", "\\u", "permission_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rule", "\\u", "progress_", "(_", "request_", ",_", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "get", "\\u", "redis", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handlers_", "=_", "Case", "Remi", "nder", "Handler_", "._", "get", "\\u", "handlers_", "(_", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reminder", "\\u", "type", "\\u", "filter_", "=_", "REM", "INDE", "R", "\\u", "TYPE", "\\u", "DEFAULT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "handler_", "in_", "handlers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "handler_", "._", "locked_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info_", "[_", "'", "complete", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current_", "=_", "client_", "._", "get_", "(_", "'", "reminder", "-", "rule", "-", "process", "ing", "-", "current", "-%", "s", "'_", "%_", "handler_", "._", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "client_", "._", "get_", "(_", "'", "reminder", "-", "rule", "-", "process", "ing", "-", "total", "-%", "s", "'_", "%_", "handler_", "._", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "info_", "[_", "'", "current", "'_", "]_", "=_", "int\\u", "or", "\\u", "none_", "(_", "current_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "[_", "'", "total", "'_", "]_", "=_", "int\\u", "or", "\\u", "none_", "(_", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info_", "[_", "'", "complete", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "[_", "handler_", "._", "\\u", "id_", "]_", "=_", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Response_", "(_", "json_", "._", "dumps_", "(_", "response_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 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 ]
Unused import
gkno/gkno_launcher/src/gkno/stringOperations.py
[ { "content": "#!/bin/bash/python\n\nfrom __future__ import print_function\nfrom difflib import SequenceMatcher\n\nimport json\nimport os\nimport random\nimport string\nimport sys\n\n# Given a list of values and a string, return a reordered list, ranked by similarity\n# the string.\n\n# Return a random string of length n.\n\n# Find the value from a list that is most similar to the query string.\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def rankListByString(inputList, queryString):\n\n # Loop over the list and store the value with it's match score.\n scores = []\n for listString in inputList: scores.append((int( 1000 * SequenceMatcher(None, listString.lower(), queryString.lower()).ratio()), listString))\n\n # Generate the ranked list.\n rankedList = []\n for score, listString in sorted(scores): rankedList.append(listString)\n rankedList.reverse()\n\n # Return the ranked list.\n return rankedList", "metadata": "root.rankListByString", "header": "['module', '___EOS___']", "index": 13 }, { "content": "def getRandomString(n):\n return ''.join(random.SystemRandom().choice(string.uppercase + string.digits) for _ in xrange(n))", "metadata": "root.getRandomString", "header": "['module', '___EOS___']", "index": 28 }, { "content": "def findMostSimilar(referenceList, queryString):\n score = 0\n for referenceString in referenceList:\n queryScore = int( 100 * SequenceMatcher(None, referenceString.lower(), queryString.lower()).ratio())\n if queryScore > score:\n score = queryScore\n matchString = referenceString\n\n # Return the most closely matched string.\n return matchString", "metadata": "root.findMostSimilar", "header": "['module', '___EOS___']", "index": 32 } ]
[ { "span": "import json", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 11 }, { "span": "import os", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 9 }, { "span": "import sys", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "bin", "/", "bash", "/", "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_", "from_", "difflib", "_", "import_", "Sequ", "ence", "Matcher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Give", "n", " ", "a", " ", "list", " ", "of", " ", "values", " ", "and", " ", "a", " ", "string", ",", " ", "return", " ", "a", " ", "reorder", "ed", " ", "list", ",", " ", "ranked", " ", "by", " ", "similarity_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "a", " ", "random", " ", "string", " ", "of", " ", "length", " ", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "the", " ", "value", " ", "from", " ", "a", " ", "list", " ", "tha", "t", " ", "is", " ", "most", " ", "similar", " ", "to", " ", "the", " ", "query", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "rank", "List", "By", "String_", "(_", "input", "List_", ",_", "query", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Loop", " ", "over", " ", "the", " ", "list", " ", "and", " ", "store", " ", "the", " ", "value", " ", "with", " ", "it", "'", "s", " ", "match", " ", "score", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scores_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "list", "String_", "in_", "input", "List_", ":_", "scores_", "._", "append_", "(_", "(_", "int_", "(_", "1000_", "*_", "Sequ", "ence", "Matcher_", "(_", "None_", ",_", "list", "String_", "._", "lower_", "(_", ")_", ",_", "query", "String_", "._", "lower_", "(_", ")_", ")_", "._", "ratio_", "(_", ")_", ")_", ",_", "list", "String_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generate", " ", "the", " ", "ranked", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "ranked", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "score_", ",_", "list", "String_", "in_", "sorted_", "(_", "scores_", ")_", ":_", "ranked", "List_", "._", "append_", "(_", "list", "String_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ranked", "List_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "the", " ", "ranked", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "ranked", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Random", "String_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "._", "join_", "(_", "random_", "._", "System", "Random_", "(_", ")_", "._", "choice_", "(_", "string_", "._", "uppercase_", "+_", "string_", "._", "digits_", ")_", "for_", "\\u_", "in_", "xrange_", "(_", "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_", "def_", "find", "Mos", "t", "Simil", "ar_", "(_", "reference", "List_", ",_", "query", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "reference", "String_", "in_", "reference", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query", "Score_", "=_", "int_", "(_", "100_", "*_", "Sequ", "ence", "Matcher_", "(_", "None_", ",_", "reference", "String_", "._", "lower_", "(_", ")_", ",_", "query", "String_", "._", "lower_", "(_", ")_", ")_", "._", "ratio_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "query", "Score_", ">_", "score_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", "=_", "query", "Score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "String_", "=_", "reference", "String_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "the", " ", "most", " ", "close", "ly", " ", "matche", "d", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "match", "String_" ]
[ 4, 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, 2, 0, 1, 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 ]
Unused import
ARTbio/tools-artbio/helper_scripts/test_upload.py
[ { "content": "from bioblend.galaxy import GalaxyInstance\nfrom tempfile import NamedTemporaryFile\nfrom bioblend.galaxyclient import ConnectionError\nfrom os.path import basename\nimport argparse\nimport datetime\nimport time\nimport ftplib\nimport pysftp\nimport urlparse\nimport urllib2\nimport requests\nimport json\n\n\n\n\n\n\n\n\n\n\n\n \n \n\n \n \n\n\n\n\nif __name__ == \"__main__\":\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def parse_args():\n args = argparse.ArgumentParser(description=\"This script uploads a file to galaxy by ftp or sftp\")\n args.add_argument(\"-fqdn\", \"--fqdn\", required=True, \n help=\"Enter the galaxy server's fully qualified domain name. e.g. usegalaxy.org\")\n args.add_argument(\"-prot\", \"--protocol\", default=\"http\", choices=['http', 'https'],\n help=\"Choose Galaxy server's web protocol\")\n args.add_argument(\"-a\", \"--api_key\", required=True, \n help=\"Enter an exisiting users' API key.\")\n args.add_argument(\"-ftp-prot\", \"--ftp_protocol\", default=\"ftp\", choices=[\"ftp\", \"sftp\"], \n help=\"Upload files by ftp or sftp.\")\n args.add_argument(\"-p\", \"--port\", default=21, type=int, help=\"Upload Port. Typically 21 for FTP\")\n args.add_argument(\"--http_auth_username\", type=str, help=\"Username for http authentification.\" )\n args.add_argument(\"--http_auth_password\", type=str, help=\"Password for http authentification.\" )\n #return args.parse_args(['-fqdn', 'mississippi.snv.jussieu.fr', '-prot', 'https', '-a', \n # 'XXX', '--ftp_protocol', 'ftp', '-p', '21'])\n #return args.parse_args(['-fqdn', 'lbcd41.snv.jussieu.fr', '-prot', 'https', '-a', \n # 'XXX', '--ftp_protocol', 'sftp', '-p', '2121',\n # '--http_auth_username', \"ged\", '--http_auth_password', \"gcn5pcaf\"])\n return args.parse_args()", "metadata": "root.parse_args", "header": "['module', '___EOS___']", "index": 15 }, { "content": "def inject_auth(f, http_auth_username, http_auth_password):\n def auth(*args, **kwargs):\n kwargs[\"auth\"] = (http_auth_username, http_auth_password)\n return f(*args, **kwargs)\n return auth", "metadata": "root.inject_auth", "header": "['module', '___EOS___']", "index": 35 }, { "content": "def make_post_request(self, url, payload, params=None, files_attached=False, **kwargs):\n \"\"\"\n Make a POST request using the provided ``url`` and ``payload``.\n The ``payload`` must be a dict that contains the request values.\n The payload dict may contain file handles (in which case the files_attached\n flag must be set to true).\n If the ``params`` are not provided, use ``default_params`` class field.\n If params are provided and the provided dict does not have ``key`` key,\n the default ``self.key`` value will be included in what's passed to\n the server via the request.\n The return value will contain the response body as a JSON object.\n \"\"\"\n if params is not None and params.get('key', False) is False:\n params['key'] = self.key\n else:\n params = self.default_params\n\n # Compute data, headers, params arguments for request.post,\n # leveraging the requests-toolbelt library if any files have\n # been attached.\n if files_attached:\n payload.update(params)\n payload = MultipartEncoder(fields=payload)\n headers = self.json_headers.copy()\n headers['Content-Type'] = payload.content_type\n post_params = {}\n else:\n payload = json.dumps(payload)\n headers = self.json_headers\n post_params = params\n\n r = requests.post(url, data=payload, headers=headers,\n verify=self.verify, params=post_params, **kwargs)\n if r.status_code == 200:\n return r.json()\n # @see self.body for HTTP response body\n raise ConnectionError(\"Unexpected response from galaxy: %s\" %\n r.status_code, body=r.text)", "metadata": "root.make_post_request", "header": "['module', '___EOS___']", "index": 41 }, { "content": "def make_delete_request(self, url, payload=None, params=None, **kwargs):\n \"\"\"\n Make a DELETE request using the provided ``url`` and the optional\n arguments.\n The ``payload`` must be a dict that can be converted into a JSON\n object (via ``json.dumps``)\n If the ``params`` are not provided, use ``default_params`` class field.\n If params are provided and the provided dict does not have ``key`` key,\n the default ``self.key`` value will be included in what's passed to\n the server via the request.\n \"\"\"\n if params is not None and params.get('key', False) is False:\n params['key'] = self.key\n else:\n params = self.default_params\n r = requests.delete(url, verify=self.verify, data=payload, params=params, **kwargs)\n return r", "metadata": "root.make_delete_request", "header": "['module', '___EOS___']", "index": 80 }, { "content": "def make_put_request(self, url, payload=None, params=None, **kwargs):\n \"\"\"\n Make a PUT request using the provided ``url`` with required payload.\n The ``payload`` must be a dict that can be converted into a JSON\n object (via ``json.dumps``)\n \"\"\"\n if params is not None and params.get('key', False) is False:\n params['key'] = self.key\n else:\n params = self.default_params\n payload = json.dumps(payload)\n r = requests.put(url, verify=self.verify, data=payload, params=params, **kwargs)\n return r", "metadata": "root.make_put_request", "header": "['module', '___EOS___']", "index": 98 }, { "content": "def create_user(url, api_key):\n \"\"\"\n Create a new local galaxy user of name test-`date`,\n with username as password.\n \"\"\"\n gi = GalaxyInstance(url, api_key)\n date=str(datetime.datetime.now().date())\n username = \"test-{date}\".format(date=date)\n user_email = username + \"@test.com\"\n password = user_email\n userlist = gi.users.get_users()\n if not user_exists(username, userlist):\n gi.users.create_local_user(username, user_email, password)\n userlist = gi.users.get_users()\n api_key = create_user_api_key(gi, username, userlist)\n return api_key, user_email, password", "metadata": "root.create_user", "header": "['module', '___EOS___']", "index": 112 }, { "content": "def user_exists(username, userlist):\n return sum([entry[\"username\"]==username for entry in userlist]) == 1", "metadata": "root.user_exists", "header": "['module', '___EOS___']", "index": 130 }, { "content": "def create_user_api_key(gi, username, userlist):\n userid = [user['id'] for user in userlist if user['username'] == username][0]\n return gi.users.create_user_apikey(userid)", "metadata": "root.create_user_api_key", "header": "['module', '___EOS___']", "index": 134 }, { "content": "def ftp_upload_file(fqdn, user_email, password, port, tmpfile):\n \"\"\"\n Use ftplib to upload to galaxy.\n \"\"\"\n session = ftplib.FTP()\n session.connect(fqdn, port)\n session.login(user_email, password)\n tmpfile_basename = basename(tmpfile)\n with open(tmpfile) as file:\n session.storbinary('STOR {fn}'.format(fn=tmpfile_basename), file)\n session.quit()", "metadata": "root.ftp_upload_file", "header": "['module', '___EOS___']", "index": 139 }, { "content": "def sftp_upload_file(fqdn, user_email, password, port, tmpfile):\n \"\"\"\n Use pysftp to upload files to galaxy.\n \"\"\"\n with pysftp.Connection(fqdn, username=user_email, password=password, port=port) as sftp:\n sftp.put(tmpfile)", "metadata": "root.sftp_upload_file", "header": "['module', '___EOS___']", "index": 152 }, { "content": "def successfull_upload(url, new_api_key, tmpfile): \n \"\"\"\n Connect as user, check if tmpfile exists in uploaded ftp files.\n \"\"\"\n gi = GalaxyInstance(url, new_api_key)\n files = [ True for ftp_file in gi.ftpfiles.get_ftp_files() if str(ftp_file[\"path\"]) == basename(tmpfile)]\n if files:\n return True\n else:\n return False", "metadata": "root.successfull_upload", "header": "['module', '___EOS___']", "index": 160 }, { "content": "def main():\n args = parse_args()\n web_protocol, fqdn, ftp_protocol, port, api_key = \\\n args.protocol, args.fqdn, args.ftp_protocol, args.port, args.api_key\n if args.http_auth_username:\n GalaxyInstance.make_delete_request = inject_auth(make_delete_request, args.http_auth_username, args.http_auth_password)\n GalaxyInstance.make_post_request = inject_auth(make_post_request, args.http_auth_username, args.http_auth_password)\n GalaxyInstance.make_put_request = inject_auth(make_put_request, args.http_auth_username, args.http_auth_password)\n GalaxyInstance.make_get_request = inject_auth(GalaxyInstance.make_get_request, args.http_auth_username, args.http_auth_password)\n url = web_protocol + \"://\" + fqdn\n new_api_key, user_email, password = create_user(url, api_key)\n tmpfile = NamedTemporaryFile()\n tmpfile.write(\"1\\n2\\n3\\n\")\n if ftp_protocol == \"ftp\":\n ftp_upload_file(fqdn, user_email, password, port, tmpfile.name)\n else:\n sftp_upload_file(fqdn, user_email, password, port, tmpfile.name)\n if not successfull_upload(url, new_api_key, tmpfile.name):\n sys.exit(\"{ftp_protocol} upload to galaxy server {fqdn} failed.\".format(ftp_protocol = ftp_protocol, fqdn = fqdn))", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 172 } ]
[ { "span": "import time", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 11 }, { "span": "import urlparse", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 15 }, { "span": "import urllib2", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "bio", "blend", "_", "._", "galaxy_", "import_", "Gal", "ax", "y", "Instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tempfile_", "import_", "Name", "d", "Tempora", "ry", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bio", "blend", "_", "._", "galax", "yc", "lient_", "import_", "Connect", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "._", "path_", "import_", "basename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ftp", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pys", "ftp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "parse", "\\u", "args_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "description_", "=_", "\"", "Thi", "s", " ", "script", " ", "uploads", " ", "a", " ", "file", " ", "to", " ", "galax", "y", " ", "by", " ", "ftp", " ", "or", " ", "sftp", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "add", "\\u", "argument_", "(_", "\"-", "fq", "dn", "\"_", ",_", "\"--", "fq", "dn", "\"_", ",_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Enter", " ", "the", " ", "galax", "y", " ", "server", "'", "s", " ", "full", "y", " ", "qualified", " ", "domain", " ", "name", ".", " ", "e", ".", "g", ".", " ", "use", "galax", "y", ".", "org", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "add", "\\u", "argument_", "(_", "\"-", "prot", "\"_", ",_", "\"--", "protoc", "ol", "\"_", ",_", "default_", "=_", "\"", "http", "\"_", ",_", "choices_", "=_", "[_", "'", "http", "'_", ",_", "'", "https", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Choose", " ", "Gal", "ax", "y", " ", "server", "'", "s", " ", "web", " ", "protoc", "ol", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "add", "\\u", "argument_", "(_", "\"-", "a", "\"_", ",_", "\"--", "api", "\\u", "key", "\"_", ",_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Enter", " ", "an", " ", "exi", "siti", "ng", " ", "users", "'", " ", "API", " ", "key", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "add", "\\u", "argument_", "(_", "\"-", "ftp", "-", "prot", "\"_", ",_", "\"--", "ftp", "\\u", "protoc", "ol", "\"_", ",_", "default_", "=_", "\"", "ftp", "\"_", ",_", "choices_", "=_", "[_", "\"", "ftp", "\"_", ",_", "\"", "sftp", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Upload", " ", "files", " ", "by", " ", "ftp", " ", "or", " ", "sftp", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "add", "\\u", "argument_", "(_", "\"-", "p", "\"_", ",_", "\"--", "port", "\"_", ",_", "default_", "=_", "21_", ",_", "type_", "=_", "int_", ",_", "help_", "=_", "\"", "Upload", " ", "Port", ".", " ", "Typical", "ly", " ", "21", " ", "for", " ", "FTP", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "add", "\\u", "argument_", "(_", "\"--", "http", "\\u", "auth", "\\u", "user", "name", "\"_", ",_", "type_", "=_", "str_", ",_", "help_", "=_", "\"", "User", "name", " ", "for", " ", "http", " ", "authe", "nti", "fication", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "add", "\\u", "argument_", "(_", "\"--", "http", "\\u", "auth", "\\u", "password", "\"_", ",_", "type_", "=_", "str_", ",_", "help_", "=_", "\"", "Passw", "ord", " ", "for", " ", "http", " ", "authe", "nti", "fication", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "return", " ", "args", ".", "parse", "\\u", "args", "([", "'-", "fq", "dn", "',", " ", "'", "missi", "ssi", "ppi", ".", "sn", "v", ".", "ju", "ssi", "eu", ".", "fr", "',", " ", "'-", "prot", "',", " ", "'", "https", "',", " ", "'-", "a", "',", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "'", "XX", "X", "',", " ", "'--", "ftp", "\\u", "protoc", "ol", "',", " ", "'", "ftp", "',", " ", "'-", "p", "',", " ", "'", "21", "'])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "args", ".", "parse", "\\u", "args", "([", "'-", "fq", "dn", "',", " ", "'", "lb", "cd", "41.", "sn", "v", ".", "ju", "ssi", "eu", ".", "fr", "',", " ", "'-", "prot", "',", " ", "'", "https", "',", " ", "'-", "a", "',", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "'", "XX", "X", "',", " ", "'--", "ftp", "\\u", "protoc", "ol", "',", " ", "'", "sftp", "',", " ", "'-", "p", "',", " ", "'", "212", "1", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'--", "http", "\\u", "auth", "\\u", "user", "name", "',", " ", "\"", "ged", "\",", " ", "'--", "http", "\\u", "auth", "\\u", "password", "',", " ", "\"", "gc", "n", "5", "pca", "f", "\"]", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "args_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\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_", "inject", "\\u", "auth_", "(_", "f_", ",_", "http", "\\u", "auth", "\\u", "username_", ",_", "http", "\\u", "auth", "\\u", "password_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "auth_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "\"", "auth", "\"_", "]_", "=_", "(_", "http", "\\u", "auth", "\\u", "username_", ",_", "http", "\\u", "auth", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "f_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "auth_", "\\u\\u\\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", "post", "\\u", "request_", "(_", "self_", ",_", "url_", ",_", "payload_", ",_", "params_", "=_", "None_", ",_", "files", "\\u", "attache", "d_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "a", " ", "POST", " ", "request", " ", "usi", "ng", " ", "the", " ", "provided", " ", "``", "url", "``", " ", "and", " ", "``", "payload", "``.", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "``", "payload", "``", " ", "must", " ", "be", " ", "a", " ", "dict", " ", "tha", "t", " ", "contain", "s", " ", "the", " ", "request", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "payload", " ", "dict", " ", "may", " ", "contain", " ", "file", " ", "handle", "s", " ", "(", "in", " ", "whi", "ch", " ", "case", " ", "the", " ", "files", "\\u", "attache", "d", "\\", "10", ";", " ", " ", " ", " ", "flag", " ", "must", " ", "be", " ", "set", " ", "to", " ", "true", ").", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "``", "params", "``", " ", "are", " ", "not", " ", "provided", ",", " ", "use", " ", "``", "default", "\\u", "params", "``", " ", "class", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "params", " ", "are", " ", "provided", " ", "and", " ", "the", " ", "provided", " ", "dict", " ", "doe", "s", " ", "not", " ", "have", " ", "``", "key", "``", " ", "key", ",", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "default", " ", "``", "self", ".", "key", "``", " ", "value", " ", "will", " ", "be", " ", "include", "d", " ", "in", " ", "what", "'", "s", " ", "pass", "ed", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "server", " ", "via", " ", "the", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "return", " ", "value", " ", "will", " ", "contain", " ", "the", " ", "response", " ", "body", " ", "as", " ", "a", " ", "JSO", "N", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "params_", "is_", "not_", "None_", "and_", "params_", "._", "get_", "(_", "'", "key", "'_", ",_", "False_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "'", "key", "'_", "]_", "=_", "self_", "._", "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 ", " _", "params_", "=_", "self_", "._", "default", "\\u", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "data", ",", " ", "header", "s", ",", " ", "params", " ", "argu", "ment", "s", " ", "for", " ", "request", ".", "post", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "leve", "rag", "ing", " ", "the", " ", "request", "s", "-", "toolb", "elt", " ", "librar", "y", " ", "if", " ", "any", " ", "files", " ", "have_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bee", "n", " ", "attache", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "files", "\\u", "attache", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "payload_", "._", "update_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "Multipart", "Encoder_", "(_", "fields_", "=_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "self_", "._", "json", "\\u", "headers_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "[_", "'", "Conten", "t", "-", "Type", "'_", "]_", "=_", "payload_", "._", "content", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "payload_", "=_", "json_", "._", "dumps_", "(_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "self_", "._", "json", "\\u", "headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "params_", "=_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "requests_", "._", "post_", "(_", "url_", ",_", "data_", "=_", "payload_", ",_", "headers_", "=_", "headers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verify_", "=_", "self_", "._", "verify_", ",_", "params_", "=_", "post", "\\u", "params_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "._", "status", "\\u", "code_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "r_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "@", "see", " ", "self", ".", "body", " ", "for", " ", "HTTP", " ", "response", " ", "body_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Connect", "ion", "Error_", "(_", "\"", "Une", "xpe", "cte", "d", " ", "response", " ", "from", " ", "galax", "y", ":", " ", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "status", "\\u", "code_", ",_", "body_", "=_", "r_", "._", "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_", "def_", "make", "\\u", "delete", "\\u", "request_", "(_", "self_", ",_", "url_", ",_", "payload_", "=_", "None_", ",_", "params_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "a", " ", "DELET", "E", " ", "request", " ", "usi", "ng", " ", "the", " ", "provided", " ", "``", "url", "``", " ", "and", " ", "the", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "argu", "ment", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "``", "payload", "``", " ", "must", " ", "be", " ", "a", " ", "dict", " ", "tha", "t", " ", "can", " ", "be", " ", "convert", "ed", " ", "int", "o", " ", "a", " ", "JSO", "N", "\\", "10", ";", " ", " ", " ", " ", "object", " ", "(", "via", " ", "``", "json", ".", "dump", "s", "``)", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "``", "params", "``", " ", "are", " ", "not", " ", "provided", ",", " ", "use", " ", "``", "default", "\\u", "params", "``", " ", "class", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "params", " ", "are", " ", "provided", " ", "and", " ", "the", " ", "provided", " ", "dict", " ", "doe", "s", " ", "not", " ", "have", " ", "``", "key", "``", " ", "key", ",", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "default", " ", "``", "self", ".", "key", "``", " ", "value", " ", "will", " ", "be", " ", "include", "d", " ", "in", " ", "what", "'", "s", " ", "pass", "ed", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "server", " ", "via", " ", "the", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "params_", "is_", "not_", "None_", "and_", "params_", "._", "get_", "(_", "'", "key", "'_", ",_", "False_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "'", "key", "'_", "]_", "=_", "self_", "._", "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 ", " _", "params_", "=_", "self_", "._", "default", "\\u", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "requests_", "._", "delete_", "(_", "url_", ",_", "verify_", "=_", "self_", "._", "verify_", ",_", "data_", "=_", "payload_", ",_", "params_", "=_", "params_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "put", "\\u", "request_", "(_", "self_", ",_", "url_", ",_", "payload_", "=_", "None_", ",_", "params_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "a", " ", "PU", "T", " ", "request", " ", "usi", "ng", " ", "the", " ", "provided", " ", "``", "url", "``", " ", "with", " ", "require", "d", " ", "payload", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "``", "payload", "``", " ", "must", " ", "be", " ", "a", " ", "dict", " ", "tha", "t", " ", "can", " ", "be", " ", "convert", "ed", " ", "int", "o", " ", "a", " ", "JSO", "N", "\\", "10", ";", " ", " ", " ", " ", "object", " ", "(", "via", " ", "``", "json", ".", "dump", "s", "``)", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "params_", "is_", "not_", "None_", "and_", "params_", "._", "get_", "(_", "'", "key", "'_", ",_", "False_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "'", "key", "'_", "]_", "=_", "self_", "._", "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 ", " _", "params_", "=_", "self_", "._", "default", "\\u", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "payload_", "=_", "json_", "._", "dumps_", "(_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "requests_", "._", "put_", "(_", "url_", ",_", "verify_", "=_", "self_", "._", "verify_", ",_", "data_", "=_", "payload_", ",_", "params_", "=_", "params_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "user_", "(_", "url_", ",_", "api", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "new", " ", "local", " ", "galax", "y", " ", "user", " ", "of", " ", "name", " ", "test", "-", "`", "date", "`", ",", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "user", "name", " ", "as", " ", "password", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gi_", "=_", "Gal", "ax", "y", "Instance_", "(_", "url_", ",_", "api", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date_", "=_", "str_", "(_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "._", "date_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", "=_", "\"", "test", "-", "{", "date", "}\"_", "._", "format_", "(_", "date_", "=_", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "email_", "=_", "username_", "+_", "\"@", "test", ".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "user", "\\u", "email_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "userl", "ist_", "=_", "gi_", "._", "users_", "._", "get", "\\u", "users_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "user", "\\u", "exists_", "(_", "username_", ",_", "userl", "ist_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gi_", "._", "users_", "._", "create", "\\u", "local", "\\u", "user_", "(_", "username_", ",_", "user", "\\u", "email_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "userl", "ist_", "=_", "gi_", "._", "users_", "._", "get", "\\u", "users_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "api", "\\u", "key_", "=_", "create", "\\u", "user", "\\u", "api", "\\u", "key_", "(_", "gi_", ",_", "username_", ",_", "userl", "ist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "api", "\\u", "key_", ",_", "user", "\\u", "email_", ",_", "password_", "\\u\\u\\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_", "user", "\\u", "exists_", "(_", "username_", ",_", "userl", "ist_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "sum_", "(_", "[_", "entry_", "[_", "\"", "user", "name", "\"_", "]_", "==_", "username_", "for_", "entry_", "in_", "userl", "ist_", "]_", ")_", "==_", "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_", "create", "\\u", "user", "\\u", "api", "\\u", "key_", "(_", "gi_", ",_", "username_", ",_", "userl", "ist_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "userid_", "=_", "[_", "user_", "[_", "'", "id", "'_", "]_", "for_", "user_", "in_", "userl", "ist_", "if_", "user_", "[_", "'", "user", "name", "'_", "]_", "==_", "username_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "gi_", "._", "users_", "._", "create", "\\u", "user", "\\u", "apikey_", "(_", "userid_", ")_", "\\u\\u\\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_", "ftp", "\\u", "upload", "\\u", "file_", "(_", "fqdn_", ",_", "user", "\\u", "email_", ",_", "password_", ",_", "port_", ",_", "tmpfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "ftp", "lib", " ", "to", " ", "upload", " ", "to", " ", "galax", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "=_", "ftp", "lib_", "._", "FTP", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "connect_", "(_", "fqdn_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "login_", "(_", "user", "\\u", "email_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpfile", "\\u", "basename_", "=_", "basename_", "(_", "tmpfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "tmpfile_", ")_", "as_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "stor", "binary_", "(_", "'", "STOR", " ", "{", "fn", "}'_", "._", "format_", "(_", "fn_", "=_", "tmpfile", "\\u", "basename_", ")_", ",_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "session_", "._", "quit_", "(_", ")_", "\\u\\u\\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_", "sftp", "\\u", "upload", "\\u", "file_", "(_", "fqdn_", ",_", "user", "\\u", "email_", ",_", "password_", ",_", "port_", ",_", "tmpfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "pys", "ftp", " ", "to", " ", "upload", " ", "files", " ", "to", " ", "galax", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pys", "ftp_", "._", "Connection_", "(_", "fqdn_", ",_", "username_", "=_", "user", "\\u", "email_", ",_", "password_", "=_", "password_", ",_", "port_", "=_", "port_", ")_", "as_", "sftp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sftp_", "._", "put_", "(_", "tmpfile_", ")_", "\\u\\u\\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_", "success", "full", "\\u", "upload_", "(_", "url_", ",_", "new", "\\u", "api", "\\u", "key_", ",_", "tmpfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Connect", " ", "as", " ", "user", ",", " ", "check", " ", "if", " ", "tmpfile", " ", "exist", "s", " ", "in", " ", "uploade", "d", " ", "ftp", " ", "files", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gi_", "=_", "Gal", "ax", "y", "Instance_", "(_", "url_", ",_", "new", "\\u", "api", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "files_", "=_", "[_", "True_", "for_", "ftp", "\\u", "file_", "in_", "gi_", "._", "ftp", "files_", "._", "get", "\\u", "ftp", "\\u", "files_", "(_", ")_", "if_", "str_", "(_", "ftp", "\\u", "file_", "[_", "\"", "path", "\"_", "]_", ")_", "==_", "basename_", "(_", "tmpfile_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "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 ", " _", "args_", "=_", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "web", "\\u", "protocol_", ",_", "fqdn_", ",_", "ftp", "\\u", "protocol_", ",_", "port_", ",_", "api", "\\u", "key_", "=_", "args_", "._", "protocol_", ",_", "args_", "._", "fqdn_", ",_", "args_", "._", "ftp", "\\u", "protocol_", ",_", "args_", "._", "port_", ",_", "args_", "._", "api", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "http", "\\u", "auth", "\\u", "username_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Gal", "ax", "y", "Instance_", "._", "make", "\\u", "delete", "\\u", "request_", "=_", "inject", "\\u", "auth_", "(_", "make", "\\u", "delete", "\\u", "request_", ",_", "args_", "._", "http", "\\u", "auth", "\\u", "username_", ",_", "args_", "._", "http", "\\u", "auth", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gal", "ax", "y", "Instance_", "._", "make", "\\u", "post", "\\u", "request_", "=_", "inject", "\\u", "auth_", "(_", "make", "\\u", "post", "\\u", "request_", ",_", "args_", "._", "http", "\\u", "auth", "\\u", "username_", ",_", "args_", "._", "http", "\\u", "auth", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gal", "ax", "y", "Instance_", "._", "make", "\\u", "put", "\\u", "request_", "=_", "inject", "\\u", "auth_", "(_", "make", "\\u", "put", "\\u", "request_", ",_", "args_", "._", "http", "\\u", "auth", "\\u", "username_", ",_", "args_", "._", "http", "\\u", "auth", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gal", "ax", "y", "Instance_", "._", "make", "\\u", "get", "\\u", "request_", "=_", "inject", "\\u", "auth_", "(_", "Gal", "ax", "y", "Instance_", "._", "make", "\\u", "get", "\\u", "request_", ",_", "args_", "._", "http", "\\u", "auth", "\\u", "username_", ",_", "args_", "._", "http", "\\u", "auth", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "web", "\\u", "protocol_", "+_", "\":", "//", "\"_", "+_", "fqdn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "api", "\\u", "key_", ",_", "user", "\\u", "email_", ",_", "password_", "=_", "create", "\\u", "user_", "(_", "url_", ",_", "api", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpfile_", "=_", "Name", "d", "Tempora", "ry", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpfile_", "._", "write_", "(_", "\"", "1", "\\\\", "n2", "\\\\", "n", "3", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftp", "\\u", "protocol_", "==_", "\"", "ftp", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ftp", "\\u", "upload", "\\u", "file_", "(_", "fqdn_", ",_", "user", "\\u", "email_", ",_", "password_", ",_", "port_", ",_", "tmpfile_", "._", "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 ", " _", "sftp", "\\u", "upload", "\\u", "file_", "(_", "fqdn_", ",_", "user", "\\u", "email_", ",_", "password_", ",_", "port_", ",_", "tmpfile_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "success", "full", "\\u", "upload_", "(_", "url_", ",_", "new", "\\u", "api", "\\u", "key_", ",_", "tmpfile_", "._", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "\"{", "ftp", "\\u", "protoc", "ol", "}", " ", "upload", " ", "to", " ", "galax", "y", " ", "server", " ", "{", "fq", "dn", "}", " ", "fail", "ed", ".\"_", "._", "format_", "(_", "ftp", "\\u", "protocol_", "=_", "ftp", "\\u", "protocol_", ",_", "fqdn_", "=_", "fqdn_", ")_", ")_", "\\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, 0, 1, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
kuri65536/python-for-android/python-modules/twisted/twisted/protocols/postfix.py
[ { "content": " def lineReceived(self, line):\n self.resetTimeout()\n try:\n request, params = line.split(None, 1)\n except ValueError:\n request = line\n params = None\n try:\n f = getattr(self, 'do_' + request)\n except AttributeError:\n self.sendCode(400, 'unknown command')\n else:\n try:\n f(params)\n except:\n self.sendCode(400, 'Command %r failed: %s.' % (request, sys.exc_info()[1]))", "metadata": "root.PostfixTCPMapServer.lineReceived", "header": "['class', 'PostfixTCPMapServer', '(', 'basic', '.', 'LineReceiver', ',', 'policies', '.', 'TimeoutMixin', ')', ':', '___EOS___']", "index": 48 } ]
[ { "span": "except:", "start_line": 62, "start_column": 12, "end_line": 62, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Post", "fix", "TC", "PM", "ap", "Server_", "(_", "basic_", "._", "Line", "Receiver_", ",_", "policies_", "._", "Time", "out", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "line", "Received_", "(_", "self_", ",_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reset", "Timeout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", ",_", "params_", "=_", "line_", "._", "split_", "(_", "None_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "getattr_", "(_", "self_", ",_", "'", "do", "\\u'_", "+_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "Code_", "(_", "400_", ",_", "'", "unknown", " ", "command", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "Code_", "(_", "400_", ",_", "'", "Command", " ", "%", "r", " ", "fail", "ed", ":", " ", "%", "s", ".'_", "%_", "(_", "request_", ",_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "1_", "]_", ")_", ")_", "\\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, 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 ]
Imprecise assert
ggventurini/python-deltasigma/deltasigma/tests/test_lollipop.py
[ { "content": " def test_lollipop(self):\n \"\"\"Test function for lollipop()\"\"\"\n t = np.arange(1, 20)*1e-3\n f = 20.\n a = np.sin(2*np.pi*f*t)\n plt.figure()\n with catch_warnings(record=True) as w:\n lollipop(t, a, color=None, lw=1.5, ybot=0.1)\n self.assertTrue(len(w) > 0)", "metadata": "root.TestLollipop.test_lollipop", "header": "['class', 'TestLollipop', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 32 } ]
[ { "span": "self.assertTrue(len(w) > 0)", "start_line": 40, "start_column": 12, "end_line": 40, "end_column": 39 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Lo", "lli", "pop_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lol", "lip", "op_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "function", " ", "for", " ", "lol", "lip", "op", "()\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "np_", "._", "arange_", "(_", "1_", ",_", "20_", ")_", "*_", "1e-3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "20._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "np_", "._", "sin_", "(_", "2_", "*_", "np_", "._", "pi_", "*_", "f_", "*_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "figure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "catch", "\\u", "warnings_", "(_", "record_", "=_", "True_", ")_", "as_", "w_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lol", "lip", "op_", "(_", "t_", ",_", "a_", ",_", "color_", "=_", "None_", ",_", "lw_", "=_", "1.5_", ",_", "ybo", "t_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "w_", ")_", ">_", "0_", ")_" ]
[ 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
'import *' may pollute namespace
coderanger/pychef/chef/rsa.py
[ { "content": "import six\nimport sys\nfrom ctypes import *\nfrom ctypes.util import find_library\n\nif sys.platform == 'win32' or sys.platform == 'cygwin':\n _eay = CDLL('libeay32.dll')\nelse:\n _eay = CDLL(find_library('crypto'))\n\n#unsigned long ERR_get_error(void);\nERR_get_error = _eay.ERR_get_error\nERR_get_error.argtypes = []\nERR_get_error.restype = c_ulong\n\n#void ERR_error_string_n(unsigned long e, char *buf, size_t len);\nERR_error_string_n = _eay.ERR_error_string_n\nERR_error_string_n.argtypes = [c_ulong, c_char_p, c_size_t]\nERR_error_string_n.restype = None\n\n\n\n#BIO * BIO_new(BIO_METHOD *type);\nBIO_new = _eay.BIO_new\nBIO_new.argtypes = [c_void_p]\nBIO_new.restype = c_void_p\n\n# BIO *BIO_new_mem_buf(void *buf, int len);\nBIO_new_mem_buf = _eay.BIO_new_mem_buf\nBIO_new_mem_buf.argtypes = [c_void_p, c_int]\nBIO_new_mem_buf.restype = c_void_p\n\n#BIO_METHOD *BIO_s_mem(void);\nBIO_s_mem = _eay.BIO_s_mem\nBIO_s_mem.argtypes = []\nBIO_s_mem.restype = c_void_p\n\n#long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);\nBIO_ctrl = _eay.BIO_ctrl\nBIO_ctrl.argtypes = [c_void_p, c_int, c_long, c_void_p]\nBIO_ctrl.restype = c_long\n\n#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */\nBIO_CTRL_RESET = 1\n##define BIO_CTRL_INFO 3 /* opt - extra tit-bits */\nBIO_CTRL_INFO = 3\n\n#define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)\n\n##define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)\n\n# int BIO_free(BIO *a)\nBIO_free = _eay.BIO_free\nBIO_free.argtypes = [c_void_p]\nBIO_free.restype = c_int\nBIO_free.errcheck = BIO_free_errcheck\n\n#RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **x,\n# pem_password_cb *cb, void *u);\nPEM_read_bio_RSAPrivateKey = _eay.PEM_read_bio_RSAPrivateKey\nPEM_read_bio_RSAPrivateKey.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p]\nPEM_read_bio_RSAPrivateKey.restype = c_void_p\n\n#RSA *PEM_read_bio_RSAPublicKey(BIO *bp, RSA **x,\n# pem_password_cb *cb, void *u);\nPEM_read_bio_RSAPublicKey = _eay.PEM_read_bio_RSAPublicKey\nPEM_read_bio_RSAPublicKey.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p]\nPEM_read_bio_RSAPublicKey.restype = c_void_p\n\n#int PEM_write_bio_RSAPrivateKey(BIO *bp, RSA *x, const EVP_CIPHER *enc,\n# unsigned char *kstr, int klen,\n# pem_password_cb *cb, void *u);\nPEM_write_bio_RSAPrivateKey = _eay.PEM_write_bio_RSAPrivateKey\nPEM_write_bio_RSAPrivateKey.argtypes = [c_void_p, c_void_p, c_void_p, c_char_p, c_int, c_void_p, c_void_p]\nPEM_write_bio_RSAPrivateKey.restype = c_int\n\n#int PEM_write_bio_RSAPublicKey(BIO *bp, RSA *x);\nPEM_write_bio_RSAPublicKey = _eay.PEM_write_bio_RSAPublicKey\nPEM_write_bio_RSAPublicKey.argtypes = [c_void_p, c_void_p]\nPEM_write_bio_RSAPublicKey.restype = c_int\n\n#int RSA_private_encrypt(int flen, unsigned char *from,\n# unsigned char *to, RSA *rsa,int padding);\nRSA_private_encrypt = _eay.RSA_private_encrypt\nRSA_private_encrypt.argtypes = [c_int, c_void_p, c_void_p, c_void_p, c_int]\nRSA_private_encrypt.restype = c_int\n\n#int RSA_public_decrypt(int flen, unsigned char *from,\n# unsigned char *to, RSA *rsa, int padding);\nRSA_public_decrypt = _eay.RSA_public_decrypt\nRSA_public_decrypt.argtypes = [c_int, c_void_p, c_void_p, c_void_p, c_int]\nRSA_public_decrypt.restype = c_int\n\nRSA_PKCS1_PADDING = 1\nRSA_NO_PADDING = 3\n\n# int RSA_size(const RSA *rsa);\nRSA_size = _eay.RSA_size\nRSA_size.argtypes = [c_void_p]\nRSA_size.restype = c_int\n\n#RSA *RSA_generate_key(int num, unsigned long e,\n# void (*callback)(int,int,void *), void *cb_arg);\nRSA_generate_key = _eay.RSA_generate_key\nRSA_generate_key.argtypes = [c_int, c_ulong, c_void_p, c_void_p]\nRSA_generate_key.restype = c_void_p\n\n##define RSA_F4 0x10001L\nRSA_F4 = 0x10001\n\n# void RSA_free(RSA *rsa);\nRSA_free = _eay.RSA_free\nRSA_free.argtypes = [c_void_p]\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from ctypes import *", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "'", "import", " ", "*'_", "may", "_", "poll", "ute", "_", "namespace_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ctypes_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ctypes_", "._", "util_", "import_", "find", "\\u", "library_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "platform_", "==_", "'", "win32", "'_", "or_", "sys_", "._", "platform_", "==_", "'", "cyg", "win", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "ea", "y_", "=_", "CD", "LL_", "(_", "'", "libe", "ay", "32.", "dll", "'_", ")_", "\\u\\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", "ea", "y_", "=_", "CD", "LL_", "(_", "find", "\\u", "library_", "(_", "'", "crypto", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "unsigned", " ", "long", " ", "ERR", "\\u", "get", "\\u", "error", "(", "voi", "d", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ERR", "\\u", "get", "\\u", "error_", "=_", "\\u", "ea", "y_", "._", "ERR", "\\u", "get", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ERR", "\\u", "get", "\\u", "error_", "._", "argtypes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ERR", "\\u", "get", "\\u", "error_", "._", "restype_", "=_", "c\\u", "ulong_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "voi", "d", " ", "ERR", "\\u", "error", "\\u", "string", "\\u", "n", "(", "unsigned", " ", "long", " ", "e", ",", " ", "char", " ", "*", "buf", ",", " ", "size", "\\u", "t", " ", "len", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "ERR", "\\u", "error", "\\u", "string", "\\u", "n_", "=_", "\\u", "ea", "y_", "._", "ERR", "\\u", "error", "\\u", "string", "\\u", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ERR", "\\u", "error", "\\u", "string", "\\u", "n_", "._", "argtypes_", "=_", "[_", "c\\u", "ulong_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ERR", "\\u", "error", "\\u", "string", "\\u", "n_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "BIO", " ", "*", " ", " ", " ", "BIO", "\\u", "new", "(", "BIO", "\\u", "METH", "OD", " ", "*", "type", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "BIO", "\\u", "new_", "=_", "\\u", "ea", "y_", "._", "BIO", "\\u", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "new_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "new_", "._", "restype_", "=_", "c\\u", "voi", "d\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BIO", " ", "*", "BIO", "\\u", "new", "\\u", "mem", "\\u", "buf", "(", "voi", "d", " ", "*", "buf", ",", " ", "int", " ", "len", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "BIO", "\\u", "new", "\\u", "mem", "\\u", "buf_", "=_", "\\u", "ea", "y_", "._", "BIO", "\\u", "new", "\\u", "mem", "\\u", "buf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "new", "\\u", "mem", "\\u", "buf_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "int_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "new", "\\u", "mem", "\\u", "buf_", "._", "restype_", "=_", "c\\u", "voi", "d\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "BIO", "\\u", "METH", "OD", " ", "*", "BIO", "\\u", "s", "\\u", "mem", "(", "voi", "d", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "BIO", "\\u", "s", "\\u", "mem_", "=_", "\\u", "ea", "y_", "._", "BIO", "\\u", "s", "\\u", "mem_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "s", "\\u", "mem_", "._", "argtypes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "s", "\\u", "mem_", "._", "restype_", "=_", "c\\u", "voi", "d\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "long", " ", " ", " ", " ", "BIO", "\\u", "ctrl", "(", "BIO", " ", "*", "bp", ",", "int", " ", "cmd", ",", "long", " ", "lar", "g", ",", "voi", "d", " ", "*", "par", "g", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "BIO", "\\u", "ctrl_", "=_", "\\u", "ea", "y_", "._", "BIO", "\\u", "ctrl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "ctrl_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "int_", ",_", "c\\u", "long_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "ctrl_", "._", "restype_", "=_", "c\\u", "long_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "defin", "e", " ", "BIO", "\\u", "CTR", "L", "\\u", "RESE", "T", " ", " ", "1", " ", " ", "/*", " ", "opt", " ", "-", " ", "rewi", "nd", "/", "zero", " ", "etc", " ", "*/", "_", "\\u\\u\\uNL\\u\\u\\u_", "BIO", "\\u", "CTR", "L", "\\u", "RESET_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", "defin", "e", " ", "BIO", "\\u", "CTR", "L", "\\u", "INFO", " ", " ", " ", "3", " ", " ", "/*", " ", "opt", " ", "-", " ", "extra", " ", "tit", "-", "bits", " ", "*/", "_", "\\u\\u\\uNL\\u\\u\\u_", "BIO", "\\u", "CTR", "L", "\\u", "INFO_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "defin", "e", " ", "BIO", "\\u", "reset", "(", "b", ")", " ", " ", " ", " ", "(", "int", ")", "BIO", "\\u", "ctrl", "(", "b", ",", "BIO", "\\u", "CTR", "L", "\\u", "RESE", "T", ",", "0", ",", "NULL", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "defin", "e", " ", "BIO", "\\u", "get", "\\u", "mem", "\\u", "data", "(", "b", ",", "pp", ")", " ", " ", "BIO", "\\u", "ctrl", "(", "b", ",", "BIO", "\\u", "CTR", "L", "\\u", "INFO", ",", "0", ",(", "char", " ", "*)", "pp", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "int", " ", " ", " ", " ", "BIO", "\\u", "free", "(", "BIO", " ", "*", "a", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "BIO", "\\u", "free_", "=_", "\\u", "ea", "y_", "._", "BIO", "\\u", "free_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "free_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIO", "\\u", "free_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "BIO", "\\u", "free_", "._", "errc", "heck_", "=_", "BIO", "\\u", "free", "\\u", "errc", "heck_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "RSA", " ", "*", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key", "(", "BIO", " ", "*", "bp", ",", " ", "RSA", " ", "**", "x", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pe", "m", "\\u", "password", "\\u", "cb", " ", "*", "cb", ",", " ", "voi", "d", " ", "*", "u", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key_", "=_", "\\u", "ea", "y_", "._", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key_", "._", "restype_", "=_", "c\\u", "voi", "d\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "RSA", " ", "*", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Public", "Key", "(", "BIO", " ", "*", "bp", ",", " ", "RSA", " ", "**", "x", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pe", "m", "\\u", "password", "\\u", "cb", " ", "*", "cb", ",", " ", "voi", "d", " ", "*", "u", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Public", "Key_", "=_", "\\u", "ea", "y_", "._", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Public", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Public", "Key_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PEM", "\\u", "read", "\\u", "bio", "\\u", "RSA", "Public", "Key_", "._", "restype_", "=_", "c\\u", "voi", "d\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "int", " ", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key", "(", "BIO", " ", "*", "bp", ",", " ", "RSA", " ", "*", "x", ",", " ", "const", " ", "EV", "P", "\\u", "CIP", "HER", " ", "*", "enc", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "unsigned", " ", "char", " ", "*", "kst", "r", ",", " ", "int", " ", "kle", "n", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pe", "m", "\\u", "password", "\\u", "cb", " ", "*", "cb", ",", " ", "voi", "d", " ", "*", "u", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key_", "=_", "\\u", "ea", "y_", "._", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "int_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Priva", "te", "Key_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "int", " ", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Public", "Key", "(", "BIO", " ", "*", "bp", ",", " ", "RSA", " ", "*", "x", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Public", "Key_", "=_", "\\u", "ea", "y_", "._", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Public", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Public", "Key_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PEM", "\\u", "write", "\\u", "bio", "\\u", "RSA", "Public", "Key_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "int", " ", "RSA", "\\u", "private", "\\u", "encrypt", "(", "int", " ", "fle", "n", ",", " ", "unsigned", " ", "char", " ", "*", "from", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "unsigned", " ", "char", " ", "*", "to", ",", " ", "RSA", " ", "*", "rsa", ",", "int", " ", "padd", "ing", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "RSA", "\\u", "private", "\\u", "encrypt_", "=_", "\\u", "ea", "y_", "._", "RSA", "\\u", "private", "\\u", "encrypt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "private", "\\u", "encrypt_", "._", "argtypes_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "int_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "private", "\\u", "encrypt_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "int", " ", "RSA", "\\u", "public", "\\u", "decrypt", "(", "int", " ", "fle", "n", ",", " ", "unsigned", " ", "char", " ", "*", "from", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "unsigned", " ", "char", " ", "*", "to", ",", " ", "RSA", " ", "*", "rsa", ",", " ", "int", " ", "padd", "ing", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "RSA", "\\u", "public", "\\u", "decrypt_", "=_", "\\u", "ea", "y_", "._", "RSA", "\\u", "public", "\\u", "decrypt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "public", "\\u", "decrypt_", "._", "argtypes_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "int_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "public", "\\u", "decrypt_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RSA", "\\u", "PKC", "S1", "\\u", "PADDING", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "NO", "\\u", "PADDING", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "int", " ", "RSA", "\\u", "size", "(", "const", " ", "RSA", " ", "*", "rsa", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "RSA", "\\u", "size_", "=_", "\\u", "ea", "y_", "._", "RSA", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "size_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "size_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "RSA", " ", "*", "RSA", "\\u", "generat", "e\\u", "key", "(", "int", " ", "num", ",", " ", "unsigned", " ", "long", " ", "e", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "voi", "d", " ", "(*", "callback", ")(", "int", ",", "int", ",", "voi", "d", " ", "*)", ",", " ", "voi", "d", " ", "*", "cb", "\\u", "arg", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "RSA", "\\u", "generat", "e\\u", "key_", "=_", "\\u", "ea", "y_", "._", "RSA", "\\u", "generat", "e\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "generat", "e\\u", "key_", "._", "argtypes_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "ulong_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "generat", "e\\u", "key_", "._", "restype_", "=_", "c\\u", "voi", "d\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "defin", "e", " ", "RSA", "\\u", "F4", " ", " ", "0x1000", "1", "L_", "\\u\\u\\uNL\\u\\u\\u_", "RSA", "\\u", "F4_", "=_", "0x1000", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "voi", "d", " ", "RSA", "\\u", "free", "(", "RSA", " ", "*", "rsa", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "RSA", "\\u", "free_", "=_", "\\u", "ea", "y_", "._", "RSA", "\\u", "free_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RSA", "\\u", "free_", "._", "argtypes_", "=_", "[_", "c\\u", "voi", "d\\u", "p_", "]_", "\\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_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
statsmodels/statsmodels/statsmodels/sandbox/distributions/examples/ex_gof.py
[ { "content": "from __future__ import print_function\nimport numpy as np\nfrom scipy import stats\nfrom statsmodels.stats import gof\n\npoissrvs = stats.poisson.rvs(0.6, size = 200)\n\nfreq, expfreq, histsupp = gof.gof_binning_discrete(poissrvs, stats.poisson, (0.6,), nsupp=20)\n(chi2val, pval) = stats.chisquare(freq, expfreq)\nprint(chi2val, pval)\n\nprint(gof.gof_chisquare_discrete(stats.poisson, (0.6,), poissrvs, 0.05,\n 'Poisson'))\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import numpy as np", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 18 } ]
[]
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_", "from_", "scipy_", "import_", "stats_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stats", "models_", "._", "stats_", "import_", "gof", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pois", "srv", "s_", "=_", "stats_", "._", "poisson", "_", "._", "rvs_", "(_", "0.6_", ",_", "size_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "freq_", ",_", "exp", "freq_", ",_", "hist", "supp", "_", "=_", "gof", "_", "._", "gof", "\\u", "binning", "\\u", "discrete", "_", "(_", "pois", "srv", "s_", ",_", "stats_", "._", "poisson", "_", ",_", "(_", "0.6_", ",_", ")_", ",_", "nsu", "pp_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "chi", "2v", "al_", ",_", "pval_", ")_", "=_", "stats_", "._", "chisq", "uar", "e_", "(_", "freq_", ",_", "exp", "freq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "chi", "2v", "al_", ",_", "pval_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "gof", "_", "._", "gof", "\\u", "chisq", "uar", "e\\u", "discrete", "_", "(_", "stats_", "._", "poisson", "_", ",_", "(_", "0.6_", ",_", ")_", ",_", "pois", "srv", "s_", ",_", "0.05_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Pois", "son", "'_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
lsbardel/python-stdnet/tests/all/multifields/set.py
[ { "content": " def test_rank(self):\n c = yield self.fill()\n data = c.data\n vals = yield data.items()\n self.assertEqual(vals, data.cache.cache)\n data.cache.clear()\n self.assertEqual(data.cache.cache, None)\n ranks = []\n for v in vals:\n ranks.append(data.rank(v))\n ranks = yield self.multi_async(ranks)", "metadata": "root.TestOrderedSet.test_rank", "header": "['class', 'TestOrderedSet', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']", "index": 65 } ]
[ { "span": "ranks ", "start_line": 75, "start_column": 8, "end_line": 75, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Order", "ed", "Set_", "(_", "test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "rank_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "yield_", "self_", "._", "fill_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "c_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vals_", "=_", "yield_", "data_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "vals_", ",_", "data_", "._", "cache_", "._", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "cache_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "data_", "._", "cache_", "._", "cache_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ranks_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "vals_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ranks_", "._", "append_", "(_", "data_", "._", "rank_", "(_", "v_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ranks_", "=_", "yield_", "self_", "._", "multi", "\\u", "async_", "(_", "ranks_", ")_" ]
[ 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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
blaze/blaze/blaze/expr/tests/test_symbol.py
[ { "content": "from __future__ import absolute_import, division, print_function\n\nimport pytest\nimport pandas as pd\nfrom operator import (add, sub, mul, floordiv, mod, pow, truediv, eq, ne, lt,\n gt, le, ge, getitem)\n\nfrom functools import partial\nfrom datetime import datetime\nimport datashape\nfrom datashape.predicates import iscollection, isscalar\nfrom blaze import CSV \nfrom blaze.expr import (Symbol, projection, Field, selection, Broadcast,\n join, cos, by, exp, distinct, Apply,\n broadcast, eval_str, merge, common_subexpression, sum,\n Label, ReLabel, Head, Sort, any, summary,\n Summary, count, symbol, Field, discover,\n max, min, label, Symbol, transform\n )\nfrom blaze.compatibility import PY3, builtins\nfrom blaze.utils import raises, tmpfile\nfrom datashape import dshape, var, int32, int64, Record, DataShape\nfrom toolz import identity, first\nimport numpy as np\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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\ninc = lambda x: x + 1\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test_dshape():\n t = Symbol('t', 'var * {name: string, amount: int}')\n assert t.dshape == dshape('var * {name: string, amount: int}')", "metadata": "root.test_dshape", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def test_length():\n t = Symbol('t', '10 * {name: string, amount: int}')\n s = Symbol('s', 'var * {name:string, amount:int}')\n assert t.dshape == dshape('10 * {name: string, amount: int}')\n assert len(t) == 10\n assert len(t.name) == 10\n assert len(t[['name']]) == 10\n assert len(t.sort('name')) == 10\n assert len(t.head(5)) == 5\n assert len(t.head(50)) == 10\n with pytest.raises(ValueError):\n len(s)", "metadata": "root.test_length", "header": "['module', '___EOS___']", "index": 31 }, { "content": "def test_symbol_eq():\n assert not (Symbol('t', 'var * {name: string}') ==\n Symbol('v', 'var * {name: string}'))", "metadata": "root.test_symbol_eq", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def test_symbol_name():\n t = Symbol('t', '10 * {people: string, amount: int}')\n r = Symbol('r', 'var * int64')\n with pytest.raises(AttributeError):\n t.name\n with pytest.raises(AttributeError):\n r.name", "metadata": "root.test_symbol_name", "header": "['module', '___EOS___']", "index": 50 }, { "content": "def test_shape():\n t = Symbol('t', 'var * {name: string, amount: int}')\n assert t.shape\n assert isinstance(t.shape, tuple)\n assert len(t.shape) == 1", "metadata": "root.test_shape", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def test_eq():\n assert Symbol('t', 'var * {a: string, b: int}').isidentical(\n Symbol('t', 'var * {a: string, b: int}'))\n assert not Symbol('t', 'var * {b: string, a: int}').isidentical(\n Symbol('t', 'var * {a: string, b: int}'))", "metadata": "root.test_eq", "header": "['module', '___EOS___']", "index": 66 }, { "content": "def test_arithmetic():\n t = Symbol('t', 'var * {x: int, y: int, z: int}')\n x, y, z = t['x'], t['y'], t['z']\n exprs = [x + 1, x + y, 1 + y,\n x - y, 1 - x, x - 1,\n x ** y, x ** 2, 2 ** x,\n x * y, x ** 2, 2 ** x,\n x / y, x / 2, 2 / x,\n x % y, x % 2, 2 % x]", "metadata": "root.test_arithmetic", "header": "['module', '___EOS___']", "index": 73 }, { "content": "def test_column():\n t = Symbol('t', 'var * {name: string, amount: int}')\n assert t.fields== ['name', 'amount']\n\n assert eval(str(t.name)) == t.name\n assert str(t.name) == \"t.name\"\n with pytest.raises(AttributeError):\n t.name.balance\n with pytest.raises((NotImplementedError, ValueError)):\n getitem(t, set('balance'))", "metadata": "root.test_column", "header": "['module', '___EOS___']", "index": 84 }, { "content": "def test_symbol_projection_failures():\n t = Symbol('t', '10 * {name: string, amount: int}')\n with pytest.raises(ValueError):\n t._project(['name', 'id'])\n with pytest.raises(AttributeError):\n t.foo\n with pytest.raises(TypeError):\n t._project(t.dshape)", "metadata": "root.test_symbol_projection_failures", "header": "['module', '___EOS___']", "index": 96 }, { "content": "def test_Projection():\n t = Symbol('t', 'var * {name: string, amount: int, id: int32}')\n p = projection(t, ['amount', 'name'])\n assert p.schema == dshape('{amount: int32, name: string}')\n print(t['amount'].dshape)\n print(dshape('var * int32'))\n assert t['amount'].dshape == dshape('var * int32')\n assert t['amount']._name == 'amount'\n\n assert eval(str(p)).isidentical(p)\n assert p._project(['amount','name']) == p[['amount','name']]\n with pytest.raises(ValueError):\n p._project('balance')", "metadata": "root.test_Projection", "header": "['module', '___EOS___']", "index": 106 }, { "content": "def test_Projection_retains_shape():\n t = Symbol('t', '5 * {name: string, amount: int, id: int32}')\n\n assert t[['name', 'amount']].dshape == \\\n dshape('5 * {name: string, amount: int}')", "metadata": "root.test_Projection_retains_shape", "header": "['module', '___EOS___']", "index": 121 }, { "content": "def test_indexing():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n assert t[['amount', 'id']] == projection(t, ['amount', 'id'])\n assert t['amount'].isidentical(Field(t, 'amount'))", "metadata": "root.test_indexing", "header": "['module', '___EOS___']", "index": 128 }, { "content": "def test_relational():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n\n r = (t['name'] == 'Alice')\n\n assert 'bool' in str(r.dshape)\n assert r._name", "metadata": "root.test_relational", "header": "['module', '___EOS___']", "index": 134 }, { "content": "def test_selection():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n\n s = selection(t, t['name'] == 'Alice')\n f = selection(t, t['id'] > t['amount'])\n p = t[t['amount'] > 100]\n with pytest.raises(ValueError):\n selection(t, p)\n\n assert s.dshape == t.dshape", "metadata": "root.test_selection", "header": "['module', '___EOS___']", "index": 143 }, { "content": "def test_selection_typecheck():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n\n assert raises(TypeError, lambda: t[t['amount'] + t['id']])\n assert raises(TypeError, lambda: t[t['name']])", "metadata": "root.test_selection_typecheck", "header": "['module', '___EOS___']", "index": 155 }, { "content": "def test_selection_by_indexing():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n\n result = t[t['name'] == 'Alice']\n\n assert t.schema == result.schema\n assert 'Alice' in str(result)", "metadata": "root.test_selection_by_indexing", "header": "['module', '___EOS___']", "index": 162 }, { "content": "def test_selection_by_getattr():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n\n result = t[t.name == 'Alice']\n\n assert t.schema == result.schema\n assert 'Alice' in str(result)", "metadata": "root.test_selection_by_getattr", "header": "['module', '___EOS___']", "index": 171 }, { "content": "def test_selection_path_check():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n t2 = t[t.name == 'Alice']\n t3 = t2[t2.amount > 0]", "metadata": "root.test_selection_path_check", "header": "['module', '___EOS___']", "index": 180 }, { "content": "def test_path_issue():\n t = Symbol('t', \"{topic: string, word: string, result: ?float64}\")\n t2 = transform(t, sizes=t.result.map(lambda x: (x - MIN)*10/(MAX - MIN),\n schema='float64', name='size'))\n\n assert builtins.any(t2.sizes.isidentical(node) for node in t2.children)", "metadata": "root.test_path_issue", "header": "['module', '___EOS___']", "index": 186 }, { "content": "def test_getattr_doesnt_override_properties():\n t = Symbol('t', 'var * {_subs: string, schema: string}')\n assert callable(t._subs)\n assert isinstance(t.schema, DataShape)", "metadata": "root.test_getattr_doesnt_override_properties", "header": "['module', '___EOS___']", "index": 194 }, { "content": "def test_dir_contains_columns():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n result = dir(t)\n columns_set = set(t.fields)\n assert set(result) & columns_set == columns_set", "metadata": "root.test_dir_contains_columns", "header": "['module', '___EOS___']", "index": 200 }, { "content": "def test_selection_consistent_children():\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n\n expr = t['name'][t['amount'] < 0]\n\n assert list(expr.fields) == ['name']", "metadata": "root.test_selection_consistent_children", "header": "['module', '___EOS___']", "index": 207 }, { "content": "def test_str():\n import re\n t = Symbol('t', 'var * {name: string, amount: int, id: int}')\n expr = t[t['amount'] < 0]['id'] * 2\n assert '<class' not in str(expr)\n assert not re.search('0x[0-9a-f]+', str(expr))\n\n assert eval(str(expr)) == expr\n\n assert '*' in str(expr)", "metadata": "root.test_str", "header": "['module', '___EOS___']", "index": 215 }, { "content": "def test_join():\n t = Symbol('t', 'var * {name: string, amount: int}')\n s = Symbol('t', 'var * {name: string, id: int}')\n r = Symbol('r', 'var * {name: string, amount: int}')\n q = Symbol('q', 'var * {name: int}')\n\n j = join(t, s, 'name', 'name')\n\n assert j.schema == dshape('{name: string, amount: int, id: int}')\n\n assert join(t, s, 'name') == join(t, s, 'name')\n\n assert join(t, s, 'name').on_left == 'name'\n assert join(t, s, 'name').on_right == 'name'\n\n assert join(t, r, ('name', 'amount')).on_left == ['name', 'amount']\n with pytest.raises(TypeError):\n join(t, q, 'name')\n with pytest.raises(ValueError):\n join(t, s, how='upside_down')", "metadata": "root.test_join", "header": "['module', '___EOS___']", "index": 227 }, { "content": "def test_join_different_on_right_left_columns():\n t = Symbol('t', 'var * {x: int, y: int}')\n s = Symbol('t', 'var * {a: int, b: int}')\n j = join(t, s, 'x', 'a')\n assert j.on_left == 'x'\n assert j.on_right == 'a'", "metadata": "root.test_join_different_on_right_left_columns", "header": "['module', '___EOS___']", "index": 249 }, { "content": "def test_joined_column_first_in_schema():\n t = Symbol('t', 'var * {x: int, y: int, z: int}')\n s = Symbol('s', 'var * {w: int, y: int}')\n\n assert join(t, s).schema == dshape('{y: int, x: int, z: int, w: int}')", "metadata": "root.test_joined_column_first_in_schema", "header": "['module', '___EOS___']", "index": 257 }, { "content": "def test_outer_join():\n t = Symbol('t', 'var * {name: string, amount: int}')\n s = Symbol('t', 'var * {name: string, id: int}')\n\n jleft = join(t, s, 'name', 'name', how='left')\n jright = join(t, s, 'name', 'name', how='right')\n jinner = join(t, s, 'name', 'name', how='inner')\n jouter = join(t, s, 'name', 'name', how='outer')\n\n js = [jleft, jright, jinner, jouter]\n\n assert len(set(js)) == 4 # not equal\n\n assert jinner.schema == dshape('{name: string, amount: int, id: int}')\n assert jleft.schema == dshape('{name: string, amount: int, id: ?int}')\n assert jright.schema == dshape('{name: string, amount: ?int, id: int}')\n assert jouter.schema == dshape('{name: string, amount: ?int, id: ?int}')\n\n # Default behavior\n assert join(t, s, 'name', 'name', how='inner') == \\\n join(t, s, 'name', 'name')", "metadata": "root.test_outer_join", "header": "['module', '___EOS___']", "index": 264 }, { "content": "def test_join_default_shared_columns():\n t = Symbol('t', 'var * {name: string, amount: int}')\n s = Symbol('t', 'var * {name: string, id: int}')\n assert join(t, s) == join(t, s, 'name', 'name')", "metadata": "root.test_join_default_shared_columns", "header": "['module', '___EOS___']", "index": 287 }, { "content": "def test_multi_column_join():\n a = Symbol('a', 'var * {x: int, y: int, z: int}')\n b = Symbol('b', 'var * {w: int, x: int, y: int}')\n j = join(a, b, ['x', 'y'])\n\n assert set(j.fields) == set('wxyz')\n\n assert j.on_left == j.on_right == ['x', 'y']\n assert hash(j)\n\n assert j.fields == ['x', 'y', 'z', 'w']", "metadata": "root.test_multi_column_join", "header": "['module', '___EOS___']", "index": 293 }, { "content": "def test_traverse():\n t = Symbol('t', 'var * {name: string, amount: int}')\n assert t in list(t._traverse())\n\n expr = t.amount.sum()\n trav = list(expr._traverse())\n assert builtins.any(t.amount.isidentical(x) for x in trav)", "metadata": "root.test_traverse", "header": "['module', '___EOS___']", "index": 306 }, { "content": "def test_unary_ops():\n t = Symbol('t', 'var * {name: string, amount: int}')\n expr = cos(exp(t['amount']))\n assert 'cos' in str(expr)\n\n assert '~' in str(~(t.amount > 0))", "metadata": "root.test_unary_ops", "header": "['module', '___EOS___']", "index": 315 }, { "content": "def test_reduction():\n t = Symbol('t', 'var * {name: string, amount: int32}')\n r = sum(t['amount'])\n assert r.dshape in (dshape('int64'),\n dshape('{amount: int64}'),\n dshape('{amount_sum: int64}'))\n\n assert 'amount' not in str(t.count().dshape)\n\n assert t.count().dshape[0] in (int32, int64)\n\n assert 'int' in str(t.count().dshape)\n assert 'int' in str(t.nunique().dshape)\n assert 'string' in str(t['name'].max().dshape)\n assert 'string' in str(t['name'].min().dshape)\n assert 'string' not in str(t.count().dshape)\n\n t = Symbol('t', 'var * {name: string, amount: real, id: int}')\n\n assert 'int' in str(t['id'].sum().dshape)\n assert 'int' not in str(t['amount'].sum().dshape)", "metadata": "root.test_reduction", "header": "['module', '___EOS___']", "index": 323 }, { "content": "def test_reduction_name():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n assert (t.amount + t.id).sum()._name", "metadata": "root.test_reduction_name", "header": "['module', '___EOS___']", "index": 346 }, { "content": "def test_max_min_class():\n t = Symbol('t', 'var * {name: string, amount: int32}')\n assert str(max(t).dshape) == '{name: string, amount: int32}'\n assert str(min(t).dshape) == '{name: string, amount: int32}'", "metadata": "root.test_max_min_class", "header": "['module', '___EOS___']", "index": 351 }, { "content": "@pytest.fixture\ndef symsum():\n t = Symbol('t', 'var * {name: string, amount: int32}')\n return t, t.amount.sum()", "metadata": "root.symsum", "header": "['module', '___EOS___']", "index": 357 }, { "content": "@pytest.fixture\ndef ds():\n return dshape(\"var * { \"\n \"transaction_key : int64, \"\n \"user_from_key : int64, \"\n \"user_to_key : int64, \"\n \"date : int64, \"\n \"value : float64 \"\n \"}\")", "metadata": "root.ds", "header": "['module', '___EOS___']", "index": 363 }, { "content": "def test_discover_dshape_symbol(ds):\n t_ds = Symbol('t', dshape=ds)\n assert t_ds.fields is not None", "metadata": "root.test_discover_dshape_symbol", "header": "['module', '___EOS___']", "index": 374 }, { "content": "class TestScalarArithmetic(object):\n ops = {'+': add, '-': sub, '*': mul, '/': truediv, '//': floordiv, '%': mod,\n '**': pow, '==': eq, '!=': ne, '<': lt, '>': gt, '<=': le, '>=': ge}\n\n\n", "metadata": "root.TestScalarArithmetic", "header": "['module', '___EOS___']", "index": 379 }, { "content": " def test_scalar_arith(self, symsum):\n def runner(f):\n result = f(r, 1)\n assert eval('r %s 1' % op).isidentical(result)\n\n a = f(r, r)\n b = eval('r %s r' % op)\n assert a is b or a.isidentical(b)\n\n result = f(1, r)\n assert eval('1 %s r' % op).isidentical(result)\n\n t, r = symsum\n r = t.amount.sum()\n for op, f in self.ops.items():\n runner(f)", "metadata": "root.TestScalarArithmetic.test_scalar_arith", "header": "['class', 'TestScalarArithmetic', '(', 'object', ')', ':', '___EOS___']", "index": 383 }, { "content": " def test_scalar_usub(self, symsum):\n t, r = symsum\n result = -r\n assert eval(str(result)).isidentical(result)", "metadata": "root.TestScalarArithmetic.test_scalar_usub", "header": "['class', 'TestScalarArithmetic', '(', 'object', ')', ':', '___EOS___']", "index": 400 }, { "content": " @pytest.mark.xfail\n def test_scalar_uadd(self, symsum):\n t, r = symsum\n +r", "metadata": "root.TestScalarArithmetic.test_scalar_uadd", "header": "['class', 'TestScalarArithmetic', '(', 'object', ')', ':', '___EOS___']", "index": 405 }, { "content": "def test_summary():\n t = Symbol('t', 'var * {id: int32, name: string, amount: int32}')\n s = summary(total=t.amount.sum(), num=t.id.count())\n assert s.dshape == dshape('{num: int32, total: int64}')\n assert hash(s)\n assert eval(str(s)).isidentical(s)\n\n assert 'summary(' in str(s)\n assert 'total=' in str(s)\n assert 'num=' in str(s)\n assert str(t.amount.sum()) in str(s)\n\n assert not summary(total=t.amount.sum())._child.isidentical(\n t.amount.sum())\n assert iscollection(summary(total=t.amount.sum() + 1)._child.dshape)", "metadata": "root.test_summary", "header": "['module', '___EOS___']", "index": 411 }, { "content": "def test_reduction_arithmetic():\n t = Symbol('t', 'var * {id: int32, name: string, amount: int32}')\n expr = t.amount.sum() + 1\n assert eval(str(expr)).isidentical(expr)", "metadata": "root.test_reduction_arithmetic", "header": "['module', '___EOS___']", "index": 428 }, { "content": "def test_Distinct():\n t = Symbol('t', 'var * {name: string, amount: int32}')\n r = distinct(t['name'])\n print(r.dshape)\n assert r.dshape == dshape('var * string')\n assert r._name == 'name'\n\n r = t.distinct()\n assert r.dshape == t.dshape", "metadata": "root.test_Distinct", "header": "['module', '___EOS___']", "index": 434 }, { "content": "def test_by():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n r = by(t['name'], total=sum(t['amount']))\n\n print(r.schema)\n assert isinstance(r.schema[0], Record)\n assert str(r.schema[0]['name']) == 'string'", "metadata": "root.test_by", "header": "['module', '___EOS___']", "index": 445 }, { "content": "def test_by_summary():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n a = by(t['name'], sum=sum(t['amount']))\n b = by(t['name'], summary(sum=sum(t['amount'])))\n\n assert a.isidentical(b)", "metadata": "root.test_by_summary", "header": "['module', '___EOS___']", "index": 454 }, { "content": "def test_by_summary_printing():\n t = symbol('t', 'var * {name: string, amount: int32, id: int32}')\n assert str(by(t.name, total=sum(t.amount))) == \\\n 'by(t.name, total=sum(t.amount))'", "metadata": "root.test_by_summary_printing", "header": "['module', '___EOS___']", "index": 462 }, { "content": "def test_by_columns():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n\n assert len(by(t['id'], total=t['amount'].sum()).fields) == 2\n assert len(by(t['id'], count=t['id'].count()).fields) == 2\n print(by(t, count=t.count()).fields)\n assert len(by(t, count=t.count()).fields) == 4", "metadata": "root.test_by_columns", "header": "['module', '___EOS___']", "index": 468 }, { "content": "def test_sort():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n s = t.sort('amount', ascending=True)\n print(str(s))\n assert eval(str(s)).isidentical(s)\n\n assert s.schema == t.schema\n\n assert t['amount'].sort().key == 'amount'", "metadata": "root.test_sort", "header": "['module', '___EOS___']", "index": 477 }, { "content": "def test_head():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n s = t.head(10)\n assert eval(str(s)).isidentical(s)\n\n assert s.schema == t.schema", "metadata": "root.test_head", "header": "['module', '___EOS___']", "index": 488 }, { "content": "def test_label():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n quantity = (t['amount'] + 100).label('quantity')\n\n assert eval(str(quantity)).isidentical(quantity)\n\n assert quantity.fields == ['quantity']\n\n with pytest.raises(ValueError):\n quantity['balance']", "metadata": "root.test_label", "header": "['module', '___EOS___']", "index": 496 }, { "content": "def test_map_label():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n c = t.amount.map(identity, schema='int32')\n assert c.label('bar')._name == 'bar'\n assert c.label('bar')._child.isidentical(c._child)", "metadata": "root.test_map_label", "header": "['module', '___EOS___']", "index": 508 }, { "content": "def test_columns():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n assert list(t.fields) == ['name', 'amount', 'id']\n assert list(t['name'].fields) == ['name']\n (t['amount'] + 1).fields", "metadata": "root.test_columns", "header": "['module', '___EOS___']", "index": 515 }, { "content": "def test_relabel():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n\n rl = t.relabel({'name': 'NAME', 'id': 'ID'})\n rlc = t['amount'].relabel({'amount': 'BALANCE'})\n\n assert eval(str(rl)).isidentical(rl)\n\n print(rl.fields)\n assert rl.fields == ['NAME', 'amount', 'ID']\n\n assert not isscalar(rl.dshape.measure)\n assert isscalar(rlc.dshape.measure)", "metadata": "root.test_relabel", "header": "['module', '___EOS___']", "index": 522 }, { "content": "def test_relabel_join():\n names = Symbol('names', 'var * {first: string, last: string}')\n\n siblings = join(names.relabel({'last': 'left'}),\n names.relabel({'last': 'right'}), 'first')\n\n assert siblings.fields == ['first', 'left', 'right']", "metadata": "root.test_relabel_join", "header": "['module', '___EOS___']", "index": 537 }, { "content": "def test_map():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n inc = lambda x: x + 1\n assert isscalar(t['amount'].map(inc, schema='int').dshape.measure)\n s = t['amount'].map(inc, schema='{amount: int}')\n assert not isscalar(s.dshape.measure)\n\n assert s.dshape == dshape('var * {amount: int}')\n\n expr = (t[['name', 'amount']]\n .map(identity, schema='{name: string, amount: int}'))\n assert expr._name is None", "metadata": "root.test_map", "header": "['module', '___EOS___']", "index": 546 }, { "content": "@pytest.mark.xfail(reason=\"Not sure that we should even support this\")\ndef test_map_without_any_info():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n assert iscolumn(t['amount'].map(inc, 'int'))\n assert not iscolumn(t[['name', 'amount']].map(identity))", "metadata": "root.test_map_without_any_info", "header": "['module', '___EOS___']", "index": 560 }, { "content": "def test_apply():\n t = Symbol('t', 'var * {name: string, amount: int32, id: int32}')\n s = t['amount'].apply(sum, dshape='real')\n r = t['amount'].apply(sum, dshape='3 * real')\n assert s.dshape == dshape('real')\n assert r.schema == dshape('real')", "metadata": "root.test_apply", "header": "['module', '___EOS___']", "index": 567 }, { "content": "def test_Symbol_printing_is_legible():\n accounts = Symbol('accounts', 'var * {name: string, balance: int, id: int}')\n\n expr = (exp(accounts.balance * 10)) + accounts['id']\n assert \"exp(accounts.balance * 10)\" in str(expr)\n assert \"+ accounts.id\" in str(expr)", "metadata": "root.test_Symbol_printing_is_legible", "header": "['module', '___EOS___']", "index": 575 }, { "content": "def test_merge():\n t = Symbol('t', 'int64')\n p = Symbol('p', 'var * {amount:int}')\n accounts = Symbol('accounts',\n 'var * {name: string, balance: int32, id: int32}')\n new_amount = (accounts.balance * 1.5).label('new')\n\n c = merge(accounts[['name', 'balance']], new_amount)\n assert c.fields == ['name', 'balance', 'new']\n assert c.schema == dshape('{name: string, balance: int32, new: float64}')\n\n with pytest.raises(ValueError):\n merge(t, t)\n with pytest.raises(ValueError):\n merge(t, p)", "metadata": "root.test_merge", "header": "['module', '___EOS___']", "index": 583 }, { "content": "def test_merge_repeats():\n accounts = Symbol('accounts',\n 'var * {name: string, balance: int32, id: int32}')\n with pytest.raises(ValueError):\n merge(accounts, (accounts.balance + 1).label('balance'))", "metadata": "root.test_merge_repeats", "header": "['module', '___EOS___']", "index": 600 }, { "content": "def test_merge_project():\n accounts = Symbol('accounts',\n 'var * {name: string, balance: int32, id: int32}')\n new_amount = (accounts['balance'] * 1.5).label('new')\n c = merge(accounts[['name', 'balance']], new_amount)\n\n assert c['new'].isidentical(new_amount)\n assert c['name'].isidentical(accounts['name'])\n\n assert c[['name', 'new']].isidentical(merge(accounts.name, new_amount))", "metadata": "root.test_merge_project", "header": "['module', '___EOS___']", "index": 607 }, { "content": "def test_subterms():\n a = Symbol('a', 'var * {x: int, y: int, z: int}')\n assert list(a._subterms()) == [a]\n assert set(a['x']._subterms()) == set([a, a['x']])\n assert set(a['x'].map(inc, 'int')._subterms()) == \\\n set([a, a['x'], a['x'].map(inc, 'int')])\n assert a in set((a['x'] + 1)._subterms())", "metadata": "root.test_subterms", "header": "['module', '___EOS___']", "index": 622 }, { "content": "def test_common_subexpression():\n a = Symbol('a', 'var * {x: int, y: int, z: int}')\n\n assert common_subexpression(a).isidentical(a)\n assert common_subexpression(a, a['x']).isidentical(a)\n assert common_subexpression(a['y'] + 1, a['x']).isidentical(a)\n assert common_subexpression(a['x'].map(inc, 'int'), a['x']).isidentical(a['x'])", "metadata": "root.test_common_subexpression", "header": "['module', '___EOS___']", "index": 631 }, { "content": "def test_schema_of_complex_interaction():\n a = Symbol('a', 'var * {x: int, y: int, z: int}')\n expr = (a['x'] + a['y']) / a['z']\n assert expr.schema == dshape('float64')\n\n expr = expr.label('foo')\n assert expr.schema == dshape('float64')", "metadata": "root.test_schema_of_complex_interaction", "header": "['module', '___EOS___']", "index": 640 }, { "content": "def iscolumn(x):\n return isscalar(x.dshape.measure)", "metadata": "root.iscolumn", "header": "['module', '___EOS___']", "index": 649 }, { "content": "def test_iscolumn():\n a = Symbol('a', 'var * {x: int, y: int, z: int}')\n assert not iscolumn(a)\n assert iscolumn(a['x'])\n assert not iscolumn(a[['x', 'y']])\n assert not iscolumn(a[['x']])\n assert iscolumn((a['x'] + a['y']))\n assert iscolumn(a['x'].distinct())\n assert not iscolumn(a[['x']].distinct())\n assert not iscolumn(by(a['x'], total=a['y'].sum()))\n assert iscolumn(a['x'][a['x'] > 1])\n assert not iscolumn(a[['x', 'y']][a['x'] > 1])\n assert iscolumn(a['x'].sort())\n assert not iscolumn(a[['x', 'y']].sort())\n assert iscolumn(a['x'].head())\n assert not iscolumn(a[['x', 'y']].head())\n\n assert iscolumn(Symbol('b', 'int'))\n assert not iscolumn(Symbol('b', 'var * {x: int}'))", "metadata": "root.test_iscolumn", "header": "['module', '___EOS___']", "index": 653 }, { "content": "def test_discover():\n ds = 'var * {x: int, y: int, z: int}'\n a = Symbol('a', ds)\n assert discover(a) == dshape(ds)", "metadata": "root.test_discover", "header": "['module', '___EOS___']", "index": 674 }, { "content": "def test_improper_selection():\n t = Symbol('t', 'var * {x: int, y: int, z: int}')\n\n assert raises(Exception, lambda: t[t['x'] > 0][t.sort()[t['y' > 0]]])", "metadata": "root.test_improper_selection", "header": "['module', '___EOS___']", "index": 680 }, { "content": "def test_serializable():\n t = Symbol('t', 'var * {id: int, name: string, amount: int}')\n import pickle\n t2 = pickle.loads(pickle.dumps(t))\n\n assert t.isidentical(t2)\n\n s = Symbol('t', 'var * {id: int, city: string}')\n expr = join(t[t.amount < 0], s).sort('id').city.head()\n expr2 = pickle.loads(pickle.dumps(expr))\n\n assert expr.isidentical(expr2)", "metadata": "root.test_serializable", "header": "['module', '___EOS___']", "index": 686 }, { "content": "def test_symbol_coercion():\n from datetime import date\n t = Symbol('t', 'var * {name: string, amount: int, timestamp: ?date}')\n assert (t.amount + '10').rhs == 10\n\n assert (t.timestamp < '2014-12-01').rhs == date(2014, 12, 1)", "metadata": "root.test_symbol_coercion", "header": "['module', '___EOS___']", "index": 700 }, { "content": "def test_isnan():\n from blaze import isnan\n t = Symbol('t', 'var * {name: string, amount: real, timestamp: ?date}')\n\n for expr in [t.amount.isnan(), ~t.amount.isnan()]:\n assert eval(str(expr)).isidentical(expr)\n\n assert iscollection(t.amount.isnan().dshape)\n assert 'bool' in str(t.amount.isnan().dshape)", "metadata": "root.test_isnan", "header": "['module', '___EOS___']", "index": 708 }, { "content": "def test_distinct_name():\n t = Symbol('t', 'var * {id: int32, name: string}')\n\n assert t.name.isidentical(t['name'])\n assert t.distinct().name.isidentical(t.distinct()['name'])\n assert t.id.distinct()._name == 'id'\n assert t.name._name == 'name'", "metadata": "root.test_distinct_name", "header": "['module', '___EOS___']", "index": 719 }, { "content": "def test_leaves():\n t = Symbol('t', 'var * {id: int32, name: string}')\n v = Symbol('v', 'var * {id: int32, city: string}')\n x = symbol('x', 'int32')\n\n assert t._leaves() == [t]\n assert t.id._leaves() == [t]\n assert by(t.name, count=t.id.nunique())._leaves() == [t]\n assert join(t, v)._leaves() == [t, v]\n assert join(v, t)._leaves() == [v, t]\n\n assert (x + 1)._leaves() == [x]", "metadata": "root.test_leaves", "header": "['module', '___EOS___']", "index": 728 }, { "content": "@pytest.fixture\ndef t():\n return Symbol('t', 'var * {id: int, amount: float64, name: string}')", "metadata": "root.t", "header": "['module', '___EOS___']", "index": 742 }, { "content": "def funcname(x, y='<lambda>'):\n if PY3:\n return 'TestRepr.%s.<locals>.%s' % (x, y)\n return 'test_symbol.%s' % y", "metadata": "root.funcname", "header": "['module', '___EOS___']", "index": 747 }, { "content": "class TestRepr(object):\n\n\n\n\n", "metadata": "root.TestRepr", "header": "['module', '___EOS___']", "index": 753 }, { "content": " def test_partial_lambda(self, t):\n expr = t.amount.map(partial(lambda x, y: x + y, 1))\n s = str(expr)\n assert s == (\"Map(_child=t.amount, \"\n \"func=partial(%s, 1), \"\n \"_asschema=None, _name0=None)\" %\n funcname('test_partial_lambda'))", "metadata": "root.TestRepr.test_partial_lambda", "header": "['class', 'TestRepr', '(', 'object', ')', ':', '___EOS___']", "index": 754 }, { "content": " def test_lambda(self, t):\n expr = t.amount.map(lambda x: x)\n s = str(expr)\n assert s == (\"Map(_child=t.amount, \"\n \"func=%s, _asschema=None, _name0=None)\" %\n funcname('test_lambda'))", "metadata": "root.TestRepr.test_lambda", "header": "['class', 'TestRepr', '(', 'object', ')', ':', '___EOS___']", "index": 762 }, { "content": " def test_partial(self, t):\n def myfunc(x, y):\n return x + y\n expr = t.amount.map(partial(myfunc, 1))\n s = str(expr)\n assert s == (\"Map(_child=t.amount, \"\n \"func=partial(%s, 1), \"\n \"_asschema=None, _name0=None)\" % funcname('test_partial',\n 'myfunc'))", "metadata": "root.TestRepr.test_partial", "header": "['class', 'TestRepr', '(', 'object', ')', ':', '___EOS___']", "index": 769 }, { "content": " def test_builtin(self, t):\n expr = t.amount.map(datetime.fromtimestamp)\n s = str(expr)\n assert s == (\"Map(_child=t.amount, \"\n \"func=datetime.fromtimestamp, _asschema=None,\"\n \" _name0=None)\")", "metadata": "root.TestRepr.test_builtin", "header": "['class', 'TestRepr', '(', 'object', ')', ':', '___EOS___']", "index": 779 }, { "content": " def test_udf(self, t):\n def myfunc(x):\n return x + 1\n expr = t.amount.map(myfunc)\n s = str(expr)\n assert s == (\"Map(_child=t.amount, \"\n \"func=%s, _asschema=None,\"\n \" _name0=None)\" % funcname('test_udf', 'myfunc'))", "metadata": "root.TestRepr.test_udf", "header": "['class', 'TestRepr', '(', 'object', ')', ':', '___EOS___']", "index": 786 }, { "content": " def test_nested_partial(self, t):\n def myfunc(x, y, z):\n return x + y + z\n f = partial(partial(myfunc, 2), 1)\n expr = t.amount.map(f)\n s = str(expr)\n assert s == (\"Map(_child=t.amount, func=partial(partial(%s, 2), 1),\"\n \" _asschema=None, _name0=None)\" %\n funcname('test_nested_partial', 'myfunc'))", "metadata": "root.TestRepr.test_nested_partial", "header": "['class', 'TestRepr', '(', 'object', ')', ':', '___EOS___']", "index": 795 }, { "content": "def test_count_values():\n t = Symbol('t', 'var * {name: string, amount: int, city: string}')\n assert t.name.count_values(sort=False).isidentical(\n by(t.name, count=t.name.count()))\n assert t.name.count_values(sort=True).isidentical(\n by(t.name, count=t.name.count()).sort('count', ascending=False))", "metadata": "root.test_count_values", "header": "['module', '___EOS___']", "index": 806 }, { "content": "def test_dir():\n t = Symbol('t', 'var * {name: string, amount: int, dt: datetime}')\n assert 'day' in dir(t.dt)\n assert 'mean' not in dir(t.dt)\n assert 'mean' in dir(t.amount)\n assert 'like' not in dir(t[['amount', 'dt']])\n assert 'any' not in dir(t.name)", "metadata": "root.test_dir", "header": "['module', '___EOS___']", "index": 814 }, { "content": "def test_distinct_column():\n t = Symbol('t', 'var * {name: string, amount: int, dt: datetime}')\n assert t.name.distinct().name.dshape == t.name.distinct().dshape\n assert t.name.distinct().name.isidentical(t.name.distinct())", "metadata": "root.test_distinct_column", "header": "['module', '___EOS___']", "index": 823 } ]
[ { "span": "import pandas as pd", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 19 }, { "span": "import datashape", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 16 }, { "span": "from blaze import CSV ", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 21 }, { "span": "from blaze.expr import (Symbol, projection, Field, selection, Broadcast,\n join, cos, by, exp, distinct, Apply,\n broadcast, eval_str, merge, common_subexpression, sum,\n Label, ReLabel, Head, Sort, any, summary,\n Summary, count, symbol, Field, discover,\n max, min, label, Symbol, transform\n )", "start_line": 12, "start_column": 0, "end_line": 18, "end_column": 25 }, { "span": "from blaze.utils import raises, tmpfile", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 39 }, { "span": "from datashape import dshape, var, int32, int64, Record, DataShape", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 66 }, { "span": "from toolz import identity, first", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 33 }, { "span": "import numpy as np", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 18 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "division_", ",_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "operator_", "import_", "(_", "add_", ",_", "sub_", ",_", "mul_", ",_", "floor", "div_", ",_", "mod_", ",_", "pow_", ",_", "true", "div_", ",_", "eq_", ",_", "ne_", ",_", "lt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "gt_", ",_", "le_", ",_", "ge_", ",_", "getitem", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "functools_", "import_", "partial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datas", "hape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datas", "hape_", "._", "predicates_", "import_", "isco", "lle", "ction_", ",_", "iss", "cala", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bla", "ze_", "import_", "CSV_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bla", "ze_", "._", "expr_", "import_", "(_", "Symbol_", ",_", "projection_", ",_", "Field_", ",_", "selection_", ",_", "Broad", "cast_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "join_", ",_", "cos_", ",_", "by_", ",_", "exp_", ",_", "distinct_", ",_", "Apply", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "broadcast_", ",_", "eval", "\\u", "str_", ",_", "merge_", ",_", "common", "\\u", "sube", "xpr", "ession", "_", ",_", "sum_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Label_", ",_", "Re", "Label_", ",_", "Head_", ",_", "Sort_", ",_", "any_", ",_", "summary_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Summary_", ",_", "count_", ",_", "symbol_", ",_", "Field_", ",_", "discover_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max_", ",_", "min_", ",_", "label_", ",_", "Symbol_", ",_", "transform_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bla", "ze_", "._", "compatibility", "_", "import_", "PY", "3_", ",_", "builtins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bla", "ze_", "._", "utils_", "import_", "raises_", ",_", "tmpfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datas", "hape_", "import_", "dsh", "ape_", ",_", "var_", ",_", "int32_", ",_", "int64_", ",_", "Record_", ",_", "Data", "Shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tool", "z_", "import_", "identity_", ",_", "first_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\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"\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "inc_", "=_", "lambda_", "x_", ":_", "x_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "dsh", "ape_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "dsh", "ape_", "==_", "dsh", "ape_", "(_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "length_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "10", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Symbol_", "(_", "'", "s", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", "string", ",", " ", "amo", "unt", ":", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "dsh", "ape_", "==_", "dsh", "ape_", "(_", "'", "10", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "t_", ")_", "==_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "t_", "._", "name_", ")_", "==_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "t_", "[_", "[_", "'", "name", "'_", "]_", "]_", ")_", "==_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "t_", "._", "sort_", "(_", "'", "name", "'_", ")_", ")_", "==_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "t_", "._", "head_", "(_", "5_", ")_", ")_", "==_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "t_", "._", "head_", "(_", "50_", ")_", ")_", "==_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "len_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "symbol", "\\u", "eq_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "not_", "(_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", "}'_", ")_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "Symbol_", "(_", "'", "v", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", "}'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "symbol", "\\u", "name_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "10", " ", "*", " ", "{", "people", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "Symbol_", "(_", "'", "r", "'_", ",_", "'", "var", " ", "*", " ", "int", "64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "shape_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "t_", "._", "shape_", ",_", "tuple_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "t_", "._", "shape_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eq_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "a", ":", " ", "string", ",", " ", "b", ":", " ", "int", "}'_", ")_", "._", "isi", "denti", "cal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "a", ":", " ", "string", ",", " ", "b", ":", " ", "int", "}'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "b", ":", " ", "string", ",", " ", "a", ":", " ", "int", "}'_", ")_", "._", "isi", "denti", "cal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "a", ":", " ", "string", ",", " ", "b", ":", " ", "int", "}'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "arithmetic", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", ",_", "y_", ",_", "z_", "=_", "t_", "[_", "'", "x", "'_", "]_", ",_", "t_", "[_", "'", "y", "'_", "]_", ",_", "t_", "[_", "'", "z", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exprs_", "=_", "[_", "x_", "+_", "1_", ",_", "x_", "+_", "y_", ",_", "1_", "+_", "y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "-_", "y_", ",_", "1_", "-_", "x_", ",_", "x_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "**_", "y_", ",_", "x_", "**_", "2_", ",_", "2_", "**_", "x_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "*_", "y_", ",_", "x_", "**_", "2_", ",_", "2_", "**_", "x_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "/_", "y_", ",_", "x_", "/_", "2_", ",_", "2_", "/_", "x_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "%_", "y_", ",_", "x_", "%_", "2_", ",_", "2_", "%_", "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_", "test\\u", "column_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "fields_", "==_", "[_", "'", "name", "'_", ",_", "'", "amo", "unt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "t_", "._", "name_", ")_", ")_", "==_", "t_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "str_", "(_", "t_", "._", "name_", ")_", "==_", "\"", "t", ".", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "name_", "._", "balance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "(_", "Not", "Impl", "ement", "ed", "Error_", ",_", "Value", "Error_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "getitem", "_", "(_", "t_", ",_", "set_", "(_", "'", "balance", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "symbol", "\\u", "projecti", "on", "\\u", "failures_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "10", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "\\u", "project_", "(_", "[_", "'", "name", "'_", ",_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "\\u", "project_", "(_", "t_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Projection", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "projection_", "(_", "t_", ",_", "[_", "'", "amo", "unt", "'_", ",_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "p_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'{", "amo", "unt", ":", " ", "int", "32", ",", " ", "name", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "dsh", "ape_", "(_", "'", "var", " ", "*", " ", "int", "32", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "dsh", "ape_", "==_", "dsh", "ape_", "(_", "'", "var", " ", "*", " ", "int", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "\\u", "name_", "==_", "'", "amo", "unt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "p_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "p_", "._", "\\u", "project_", "(_", "[_", "'", "amo", "unt", "'_", ",_", "'", "name", "'_", "]_", ")_", "==_", "p_", "[_", "[_", "'", "amo", "unt", "'_", ",_", "'", "name", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "._", "\\u", "project_", "(_", "'", "balance", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Projection", "\\u", "retain", "s", "\\u", "shape_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "5", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t_", "[_", "[_", "'", "name", "'_", ",_", "'", "amo", "unt", "'_", "]_", "]_", "._", "dsh", "ape_", "==_", "dsh", "ape_", "(_", "'", "5", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "indexing", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "[_", "[_", "'", "amo", "unt", "'_", ",_", "'", "id", "'_", "]_", "]_", "==_", "projection_", "(_", "t_", ",_", "[_", "'", "amo", "unt", "'_", ",_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "isi", "denti", "cal_", "(_", "Field_", "(_", "t_", ",_", "'", "amo", "unt", "'_", ")_", ")_", "\\u\\u\\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", "relation", "al_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "(_", "t_", "[_", "'", "name", "'_", "]_", "==_", "'", "Ali", "ce", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "bool", "'_", "in_", "str_", "(_", "r_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "\\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_", "test\\u", "selection_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "selection_", "(_", "t_", ",_", "t_", "[_", "'", "name", "'_", "]_", "==_", "'", "Ali", "ce", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "selection_", "(_", "t_", ",_", "t_", "[_", "'", "id", "'_", "]_", ">_", "t_", "[_", "'", "amo", "unt", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "t_", "[_", "t_", "[_", "'", "amo", "unt", "'_", "]_", ">_", "100_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selection_", "(_", "t_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "s_", "._", "dsh", "ape_", "==_", "t_", "._", "dsh", "ape_", "\\u\\u\\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", "selection", "\\u", "typecheck", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "t_", "[_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "+_", "t_", "[_", "'", "id", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "t_", "[_", "t_", "[_", "'", "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_", "test\\u", "selection", "\\u", "by", "\\u", "indexing", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "t_", "[_", "t_", "[_", "'", "name", "'_", "]_", "==_", "'", "Ali", "ce", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t_", "._", "schema_", "==_", "result_", "._", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "Ali", "ce", "'_", "in_", "str_", "(_", "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_", "def_", "test\\u", "selection", "\\u", "by", "\\u", "getattr_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "t_", "[_", "t_", "._", "name_", "==_", "'", "Ali", "ce", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t_", "._", "schema_", "==_", "result_", "._", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "Ali", "ce", "'_", "in_", "str_", "(_", "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_", "def_", "test\\u", "selection", "\\u", "path", "\\u", "check_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "t_", "[_", "t_", "._", "name_", "==_", "'", "Ali", "ce", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "t2_", "[_", "t2_", "._", "amount_", ">_", "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_", "def_", "test\\u", "path", "\\u", "issue_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "\"{", "topic", ":", " ", "string", ",", " ", "word", ":", " ", "string", ",", " ", "result", ":", " ", "?", "float", "64", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "transform_", "(_", "t_", ",_", "sizes_", "=_", "t_", "._", "result_", "._", "map_", "(_", "lambda_", "x_", ":_", "(_", "x_", "-_", "MIN_", ")_", "*_", "10_", "/_", "(_", "MAX_", "-_", "MIN_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "float", "64", "'_", ",_", "name_", "=_", "'", "size", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "builtins_", "._", "any_", "(_", "t2_", "._", "sizes_", "._", "isi", "denti", "cal_", "(_", "node_", ")_", "for_", "node_", "in_", "t2_", "._", "children_", ")_", "\\u\\u\\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", "getattr", "\\u", "doesnt", "\\u", "override", "\\u", "properties_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{\\u", "subs", ":", " ", "string", ",", " ", "schema", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "callable_", "(_", "t_", "._", "\\u", "subs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "t_", "._", "schema_", ",_", "Data", "Shape_", ")_", "\\u\\u\\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", "dir\\u", "contain", "s", "\\u", "columns_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "dir_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column", "s", "\\u", "set_", "=_", "set_", "(_", "t_", "._", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "set_", "(_", "result_", ")_", "&_", "column", "s", "\\u", "set_", "==_", "column", "s", "\\u", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "selection", "\\u", "consistent", "\\u", "children_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "t_", "[_", "'", "name", "'_", "]_", "[_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "<_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "list_", "(_", "expr_", "._", "fields_", ")_", "==_", "[_", "'", "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_", "test\\u", "str_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expr_", "=_", "t_", "[_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "<_", "0_", "]_", "[_", "'", "id", "'_", "]_", "*_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'<", "class", "'_", "not_", "in_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "re_", "._", "search_", "(_", "'", "0", "x", "[", "0", "-", "9", "a", "-", "f", "]+'_", ",_", "str_", "(_", "expr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "expr_", ")_", ")_", "==_", "expr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'*'_", "in_", "str_", "(_", "expr_", ")_", "\\u\\u\\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", "join_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "Symbol_", "(_", "'", "r", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "q_", "=_", "Symbol_", "(_", "'", "q", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "j_", "=_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ",_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "j_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ")_", "==_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ")_", "._", "on", "\\u", "left_", "==_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ")_", "._", "on", "\\u", "right_", "==_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "join_", "(_", "t_", ",_", "r_", ",_", "(_", "'", "name", "'_", ",_", "'", "amo", "unt", "'_", ")_", ")_", "._", "on", "\\u", "left_", "==_", "[_", "'", "name", "'_", ",_", "'", "amo", "unt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "join_", "(_", "t_", ",_", "q_", ",_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "join_", "(_", "t_", ",_", "s_", ",_", "how_", "=_", "'", "ups", "ide", "\\u", "down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "join", "\\u", "different", "\\u", "on", "\\u", "right", "\\u", "left", "\\u", "columns_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "a", ":", " ", "int", ",", " ", "b", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "x", "'_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "j_", "._", "on", "\\u", "left_", "==_", "'", "x", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "j_", "._", "on", "\\u", "right_", "==_", "'", "a", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "joine", "d\\u", "column", "\\u", "first", "\\u", "in", "\\u", "schema_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Symbol_", "(_", "'", "s", "'_", ",_", "'", "var", " ", "*", " ", "{", "w", ":", " ", "int", ",", " ", "y", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "join_", "(_", "t_", ",_", "s_", ")_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'{", "y", ":", " ", "int", ",", " ", "x", ":", " ", "int", ",", " ", "z", ":", " ", "int", ",", " ", "w", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "outer", "\\u", "join_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "jl", "eft", "_", "=_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ",_", "'", "name", "'_", ",_", "how_", "=_", "'", "left", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jr", "ight_", "=_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ",_", "'", "name", "'_", ",_", "how_", "=_", "'", "right", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jin", "ner_", "=_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ",_", "'", "name", "'_", ",_", "how_", "=_", "'", "inner", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jou", "ter_", "=_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ",_", "'", "name", "'_", ",_", "how_", "=_", "'", "outer", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "js_", "=_", "[_", "jl", "eft", "_", ",_", "jr", "ight_", ",_", "jin", "ner_", ",_", "jou", "ter_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "set_", "(_", "js_", ")_", ")_", "==_", "4_", "#", " ", "not", " ", "equal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "jin", "ner_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "jl", "eft", "_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "id", ":", " ", "?", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "jr", "ight_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "?", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "jou", "ter_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "?", "int", ",", " ", "id", ":", " ", "?", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Default", " ", "behavior_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ",_", "'", "name", "'_", ",_", "how_", "=_", "'", "inner", "'_", ")_", "==_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ",_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "join", "\\u", "default", "\\u", "shared", "\\u", "columns_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "join_", "(_", "t_", ",_", "s_", ")_", "==_", "join_", "(_", "t_", ",_", "s_", ",_", "'", "name", "'_", ",_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "multi", "\\u", "column", "\\u", "join_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Symbol_", "(_", "'", "a", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Symbol_", "(_", "'", "b", "'_", ",_", "'", "var", " ", "*", " ", "{", "w", ":", " ", "int", ",", " ", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "join_", "(_", "a_", ",_", "b_", ",_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "set_", "(_", "j_", "._", "fields_", ")_", "==_", "set_", "(_", "'", "wx", "yz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "j_", "._", "on", "\\u", "left_", "==_", "j_", "._", "on", "\\u", "right_", "==_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "hash_", "(_", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "j_", "._", "fields_", "==_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", ",_", "'", "z", "'_", ",_", "'", "w", "'_", "]_", "\\u\\u\\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", "traverse_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "in_", "list_", "(_", "t_", "._", "\\u", "traverse_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trav", "_", "=_", "list_", "(_", "expr_", "._", "\\u", "traverse_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "builtins_", "._", "any_", "(_", "t_", "._", "amount_", "._", "isi", "denti", "cal_", "(_", "x_", ")_", "for_", "x_", "in_", "trav", "_", ")_", "\\u\\u\\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", "una", "ry", "\\u", "ops_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expr_", "=_", "cos_", "(_", "exp_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "cos", "'_", "in_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'~'_", "in_", "str_", "(_", "~_", "(_", "t_", "._", "amount_", ">_", "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_", "def_", "test\\u", "reduction_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "sum_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "dsh", "ape_", "in_", "(_", "dsh", "ape_", "(_", "'", "int", "64", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dsh", "ape_", "(_", "'{", "amo", "unt", ":", " ", "int", "64", "}'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dsh", "ape_", "(_", "'{", "amo", "unt", "\\u", "sum", ":", " ", "int", "64", "}'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "amo", "unt", "'_", "not_", "in_", "str_", "(_", "t_", "._", "count_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t_", "._", "count_", "(_", ")_", "._", "dsh", "ape_", "[_", "0_", "]_", "in_", "(_", "int32_", ",_", "int64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "int", "'_", "in_", "str_", "(_", "t_", "._", "count_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "int", "'_", "in_", "str_", "(_", "t_", "._", "nun", "ique", "_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "string", "'_", "in_", "str_", "(_", "t_", "[_", "'", "name", "'_", "]_", "._", "max_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "string", "'_", "in_", "str_", "(_", "t_", "[_", "'", "name", "'_", "]_", "._", "min_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "string", "'_", "not_", "in_", "str_", "(_", "t_", "._", "count_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "real", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "int", "'_", "in_", "str_", "(_", "t_", "[_", "'", "id", "'_", "]_", "._", "sum_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "int", "'_", "not_", "in_", "str_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "sum_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\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", "reduc", "tion", "\\u", "name_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "t_", "._", "amount_", "+_", "t_", "._", "id_", ")_", "._", "sum_", "(_", ")_", "._", "\\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_", "test\\u", "max", "\\u", "min", "\\u", "class_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "str_", "(_", "max_", "(_", "t_", ")_", "._", "dsh", "ape_", ")_", "==_", "'{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "str_", "(_", "min_", "(_", "t_", ")_", "._", "dsh", "ape_", ")_", "==_", "'{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", "}'_", "\\u\\u\\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_", "._", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sym", "sum_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "t_", ",_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", "\\u\\u\\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_", "._", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ds_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dsh", "ape_", "(_", "\"", "var", " ", "*", " ", "{", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "transaction", "\\u", "key", " ", ":", " ", "int", "64", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "from", "\\u", "key", " ", ":", " ", "int", "64", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "to", "\\u", "key", " ", ":", " ", "int", "64", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "date", " ", ":", " ", "int", "64", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "value", " ", ":", " ", "float", "64", " ", "\"_", "\\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_", "test\\u", "discove", "r", "\\u", "dsh", "ape", "\\u", "symbol_", "(_", "ds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t", "\\u", "ds_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "dsh", "ape_", "=_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t", "\\u", "ds_", "._", "fields_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Scala", "r", "Arithm", "etic", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ops_", "=_", "{_", "'+'_", ":_", "add_", ",_", "'-'_", ":_", "sub_", ",_", "'*'_", ":_", "mul_", ",_", "'/'_", ":_", "true", "div_", ",_", "'//'_", ":_", "floor", "div_", ",_", "'%'_", ":_", "mod_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "'_", ":_", "pow_", ",_", "'=='_", ":_", "eq_", ",_", "'!='_", ":_", "ne_", ",_", "'<'_", ":_", "lt_", ",_", "'>'_", ":_", "gt_", ",_", "'<='_", ":_", "le_", ",_", "'>='_", ":_", "ge_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Scala", "r", "Arithm", "etic", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "scala", "r", "\\u", "arith", "_", "(_", "self_", ",_", "sym", "sum_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "runner_", "(_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "f_", "(_", "r_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "eval_", "(_", "'", "r", " ", "%", "s", " ", "1", "'_", "%_", "op_", ")_", "._", "isi", "denti", "cal_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "f_", "(_", "r_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "eval_", "(_", "'", "r", " ", "%", "s", " ", "r", "'_", "%_", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "a_", "is_", "b_", "or_", "a_", "._", "isi", "denti", "cal_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "f_", "(_", "1_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "eval_", "(_", "'", "1", " ", "%", "s", " ", "r", "'_", "%_", "op_", ")_", "._", "isi", "denti", "cal_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", ",_", "r_", "=_", "sym", "sum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "op_", ",_", "f_", "in_", "self_", "._", "ops_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "runner_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Scala", "r", "Arithm", "etic", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "scala", "r", "\\u", "usu", "b_", "(_", "self_", ",_", "sym", "sum_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", ",_", "r_", "=_", "sym", "sum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "-_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "result_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Scala", "r", "Arithm", "etic", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "mark_", "._", "xfail_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "scala", "r", "\\u", "uad", "d_", "(_", "self_", ",_", "sym", "sum_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", ",_", "r_", "=_", "sym", "sum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "+_", "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_", "test\\u", "summary_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "id", ":", " ", "int", "32", ",", " ", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "summary_", "(_", "total_", "=_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", ",_", "num_", "=_", "t_", "._", "id_", "._", "count_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "._", "dsh", "ape_", "==_", "dsh", "ape_", "(_", "'{", "num", ":", " ", "int", "32", ",", " ", "total", ":", " ", "int", "64", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "hash_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "s_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "summar", "y", "('_", "in_", "str_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "total", "='_", "in_", "str_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "num", "='_", "in_", "str_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "str_", "(_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", ")_", "in_", "str_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "not_", "summary_", "(_", "total_", "=_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", ")_", "._", "\\u", "child_", "._", "isi", "denti", "cal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isco", "lle", "ction_", "(_", "summary_", "(_", "total_", "=_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", "+_", "1_", ")_", "._", "\\u", "child_", "._", "dsh", "ape_", ")_", "\\u\\u\\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", "reduc", "tion", "\\u", "arithmetic", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "id", ":", " ", "int", "32", ",", " ", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expr_", "=_", "t_", "._", "amount_", "._", "sum_", "(_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "expr_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "expr_", ")_", "\\u\\u\\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", "Dist", "inc", "t_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "distinct_", "(_", "t_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "r_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "dsh", "ape_", "==_", "dsh", "ape_", "(_", "'", "var", " ", "*", " ", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "\\u", "name_", "==_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "t_", "._", "distinct_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "dsh", "ape_", "==_", "t_", "._", "dsh", "ape_", "\\u\\u\\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", "by_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "by_", "(_", "t_", "[_", "'", "name", "'_", "]_", ",_", "total_", "=_", "sum_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "r_", "._", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "r_", "._", "schema_", "[_", "0_", "]_", ",_", "Record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "str_", "(_", "r_", "._", "schema_", "[_", "0_", "]_", "[_", "'", "name", "'_", "]_", ")_", "==_", "'", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "by", "\\u", "summary_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "by_", "(_", "t_", "[_", "'", "name", "'_", "]_", ",_", "sum_", "=_", "sum_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "by_", "(_", "t_", "[_", "'", "name", "'_", "]_", ",_", "summary_", "(_", "sum_", "=_", "sum_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "a_", "._", "isi", "denti", "cal_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "by", "\\u", "summar", "y", "\\u", "printin", "g_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "str_", "(_", "by_", "(_", "t_", "._", "name_", ",_", "total_", "=_", "sum_", "(_", "t_", "._", "amount_", ")_", ")_", ")_", "==_", "'", "by", "(", "t", ".", "name", ",", " ", "total", "=", "sum", "(", "t", ".", "amo", "unt", "))'_", "\\u\\u\\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", "by", "\\u", "columns_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "by_", "(_", "t_", "[_", "'", "id", "'_", "]_", ",_", "total_", "=_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "sum_", "(_", ")_", ")_", "._", "fields_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "by_", "(_", "t_", "[_", "'", "id", "'_", "]_", ",_", "count_", "=_", "t_", "[_", "'", "id", "'_", "]_", "._", "count_", "(_", ")_", ")_", "._", "fields_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "by_", "(_", "t_", ",_", "count_", "=_", "t_", "._", "count_", "(_", ")_", ")_", "._", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "by_", "(_", "t_", ",_", "count_", "=_", "t_", "._", "count_", "(_", ")_", ")_", "._", "fields_", ")_", "==_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "t_", "._", "sort_", "(_", "'", "amo", "unt", "'_", ",_", "ascending_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "str_", "(_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "s_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "s_", "._", "schema_", "==_", "t_", "._", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "sort_", "(_", ")_", "._", "key_", "==_", "'", "amo", "unt", "'_", "\\u\\u\\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", "head_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "t_", "._", "head_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "s_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "s_", "._", "schema_", "==_", "t_", "._", "schema_", "\\u\\u\\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", "label_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "quantity_", "=_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "+_", "100_", ")_", "._", "label_", "(_", "'", "quanti", "ty", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "quantity_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "quantity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "quantity_", "._", "fields_", "==_", "[_", "'", "quanti", "ty", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "quantity_", "[_", "'", "balance", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "map", "\\u", "label_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "t_", "._", "amount_", "._", "map_", "(_", "identity_", ",_", "schema_", "=_", "'", "int", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "label_", "(_", "'", "bar", "'_", ")_", "._", "\\u", "name_", "==_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "label_", "(_", "'", "bar", "'_", ")_", "._", "\\u", "child_", "._", "isi", "denti", "cal_", "(_", "c_", "._", "\\u", "child_", ")_", "\\u\\u\\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", "columns_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "list_", "(_", "t_", "._", "fields_", ")_", "==_", "[_", "'", "name", "'_", ",_", "'", "amo", "unt", "'_", ",_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "list_", "(_", "t_", "[_", "'", "name", "'_", "]_", "._", "fields_", ")_", "==_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "+_", "1_", ")_", "._", "fields_", "\\u\\u\\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", "rela", "bel_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rl_", "=_", "t_", "._", "rela", "bel_", "(_", "{_", "'", "name", "'_", ":_", "'", "NAME", "'_", ",_", "'", "id", "'_", ":_", "'", "ID", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rl", "c_", "=_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "rela", "bel_", "(_", "{_", "'", "amo", "unt", "'_", ":_", "'", "BALA", "NCE", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "eval_", "(_", "str_", "(_", "rl_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "rl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "rl_", "._", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "rl_", "._", "fields_", "==_", "[_", "'", "NAME", "'_", ",_", "'", "amo", "unt", "'_", ",_", "'", "ID", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "not_", "iss", "cala", "r_", "(_", "rl_", "._", "dsh", "ape_", "._", "measure_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "iss", "cala", "r_", "(_", "rl", "c_", "._", "dsh", "ape_", "._", "measure_", ")_", "\\u\\u\\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", "rela", "bel", "\\u", "join_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "=_", "Symbol_", "(_", "'", "names", "'_", ",_", "'", "var", " ", "*", " ", "{", "first", ":", " ", "string", ",", " ", "last", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "siblings", "_", "=_", "join_", "(_", "names_", "._", "rela", "bel_", "(_", "{_", "'", "last", "'_", ":_", "'", "left", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "._", "rela", "bel_", "(_", "{_", "'", "last", "'_", ":_", "'", "right", "'_", "}_", ")_", ",_", "'", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "siblings", "_", "._", "fields_", "==_", "[_", "'", "first", "'_", ",_", "'", "left", "'_", ",_", "'", "right", "'_", "]_", "\\u\\u\\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", "map_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inc_", "=_", "lambda_", "x_", ":_", "x_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "iss", "cala", "r_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "map_", "(_", "inc_", ",_", "schema_", "=_", "'", "int", "'_", ")_", "._", "dsh", "ape_", "._", "measure_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "map_", "(_", "inc_", ",_", "schema_", "=_", "'{", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "iss", "cala", "r_", "(_", "s_", "._", "dsh", "ape_", "._", "measure_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "s_", "._", "dsh", "ape_", "==_", "dsh", "ape_", "(_", "'", "var", " ", "*", " ", "{", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "(_", "t_", "[_", "[_", "'", "name", "'_", ",_", "'", "amo", "unt", "'_", "]_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "._", "map_", "(_", "identity_", ",_", "schema_", "=_", "'{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "expr_", "._", "\\u", "name_", "is_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "mark_", "._", "xfail_", "(_", "reason_", "=_", "\"", "Not", " ", "sure", " ", "tha", "t", " ", "we", " ", "shou", "ld", " ", "even", " ", "support", " ", "this", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "map", "\\u", "with", "out", "\\u", "any", "\\u", "info_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isco", "lum", "n_", "(_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "map_", "(_", "inc_", ",_", "'", "int", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "t_", "[_", "[_", "'", "name", "'_", ",_", "'", "amo", "unt", "'_", "]_", "]_", "._", "map_", "(_", "identity_", ")_", ")_", "\\u\\u\\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", "apply_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "apply_", "(_", "sum_", ",_", "dsh", "ape_", "=_", "'", "real", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "t_", "[_", "'", "amo", "unt", "'_", "]_", "._", "apply_", "(_", "sum_", ",_", "dsh", "ape_", "=_", "'", "3", " ", "*", " ", "real", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "._", "dsh", "ape_", "==_", "dsh", "ape_", "(_", "'", "real", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'", "real", "'_", ")_", "\\u\\u\\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", "Sym", "bol", "\\u", "printin", "g", "\\u", "is", "\\u", "leg", "ible_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "accounts_", "=_", "Symbol_", "(_", "'", "account", "s", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "balance", ":", " ", "int", ",", " ", "id", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "(_", "exp_", "(_", "accounts_", "._", "balance_", "*_", "10_", ")_", ")_", "+_", "accounts_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\"", "exp", "(", "account", "s", ".", "balance", " ", "*", " ", "10", ")\"_", "in_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\"+", " ", "account", "s", ".", "id", "\"_", "in_", "str_", "(_", "expr_", ")_", "\\u\\u\\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", "merge_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "int", "64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Symbol_", "(_", "'", "p", "'_", ",_", "'", "var", " ", "*", " ", "{", "amo", "unt", ":", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accounts_", "=_", "Symbol_", "(_", "'", "account", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "balance", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "amount_", "=_", "(_", "accounts_", "._", "balance_", "*_", "1.5_", ")_", "._", "label_", "(_", "'", "new", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "merge_", "(_", "accounts_", "[_", "[_", "'", "name", "'_", ",_", "'", "balance", "'_", "]_", "]_", ",_", "new", "\\u", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "fields_", "==_", "[_", "'", "name", "'_", ",_", "'", "balance", "'_", ",_", "'", "new", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'{", "name", ":", " ", "string", ",", " ", "balance", ":", " ", "int", "32", ",", " ", "new", ":", " ", "float", "64", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merge_", "(_", "t_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merge_", "(_", "t_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "merge", "\\u", "repeats_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "accounts_", "=_", "Symbol_", "(_", "'", "account", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "balance", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merge_", "(_", "accounts_", ",_", "(_", "accounts_", "._", "balance_", "+_", "1_", ")_", "._", "label_", "(_", "'", "balance", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "merge", "\\u", "project_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "accounts_", "=_", "Symbol_", "(_", "'", "account", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "balance", ":", " ", "int", "32", ",", " ", "id", ":", " ", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "amount_", "=_", "(_", "accounts_", "[_", "'", "balance", "'_", "]_", "*_", "1.5_", ")_", "._", "label_", "(_", "'", "new", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "merge_", "(_", "accounts_", "[_", "[_", "'", "name", "'_", ",_", "'", "balance", "'_", "]_", "]_", ",_", "new", "\\u", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "[_", "'", "new", "'_", "]_", "._", "isi", "denti", "cal_", "(_", "new", "\\u", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "[_", "'", "name", "'_", "]_", "._", "isi", "denti", "cal_", "(_", "accounts_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "[_", "[_", "'", "name", "'_", ",_", "'", "new", "'_", "]_", "]_", "._", "isi", "denti", "cal_", "(_", "merge_", "(_", "accounts_", "._", "name_", ",_", "new", "\\u", "amount_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "subt", "erms", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Symbol_", "(_", "'", "a", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "list_", "(_", "a_", "._", "\\u", "subt", "erms", "_", "(_", ")_", ")_", "==_", "[_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "set_", "(_", "a_", "[_", "'", "x", "'_", "]_", "._", "\\u", "subt", "erms", "_", "(_", ")_", ")_", "==_", "set_", "(_", "[_", "a_", ",_", "a_", "[_", "'", "x", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "set_", "(_", "a_", "[_", "'", "x", "'_", "]_", "._", "map_", "(_", "inc_", ",_", "'", "int", "'_", ")_", "._", "\\u", "subt", "erms", "_", "(_", ")_", ")_", "==_", "set_", "(_", "[_", "a_", ",_", "a_", "[_", "'", "x", "'_", "]_", ",_", "a_", "[_", "'", "x", "'_", "]_", "._", "map_", "(_", "inc_", ",_", "'", "int", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "a_", "in_", "set_", "(_", "(_", "a_", "[_", "'", "x", "'_", "]_", "+_", "1_", ")_", "._", "\\u", "subt", "erms", "_", "(_", ")_", ")_", "\\u\\u\\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", "common", "\\u", "sube", "xpr", "ession", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Symbol_", "(_", "'", "a", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "common", "\\u", "sube", "xpr", "ession", "_", "(_", "a_", ")_", "._", "isi", "denti", "cal_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "common", "\\u", "sube", "xpr", "ession", "_", "(_", "a_", ",_", "a_", "[_", "'", "x", "'_", "]_", ")_", "._", "isi", "denti", "cal_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "common", "\\u", "sube", "xpr", "ession", "_", "(_", "a_", "[_", "'", "y", "'_", "]_", "+_", "1_", ",_", "a_", "[_", "'", "x", "'_", "]_", ")_", "._", "isi", "denti", "cal_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "common", "\\u", "sube", "xpr", "ession", "_", "(_", "a_", "[_", "'", "x", "'_", "]_", "._", "map_", "(_", "inc_", ",_", "'", "int", "'_", ")_", ",_", "a_", "[_", "'", "x", "'_", "]_", ")_", "._", "isi", "denti", "cal_", "(_", "a_", "[_", "'", "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_", "test\\u", "schema", "\\u", "of", "\\u", "complex", "\\u", "interaction_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Symbol_", "(_", "'", "a", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expr_", "=_", "(_", "a_", "[_", "'", "x", "'_", "]_", "+_", "a_", "[_", "'", "y", "'_", "]_", ")_", "/_", "a_", "[_", "'", "z", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "expr_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'", "float", "64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "expr_", "._", "label_", "(_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "expr_", "._", "schema_", "==_", "dsh", "ape_", "(_", "'", "float", "64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "isco", "lum", "n_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "iss", "cala", "r_", "(_", "x_", "._", "dsh", "ape_", "._", "measure_", ")_", "\\u\\u\\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", "isco", "lum", "n_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Symbol_", "(_", "'", "a", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isco", "lum", "n_", "(_", "a_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "a_", "[_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "a_", "[_", "[_", "'", "x", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isco", "lum", "n_", "(_", "(_", "a_", "[_", "'", "x", "'_", "]_", "+_", "a_", "[_", "'", "y", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isco", "lum", "n_", "(_", "a_", "[_", "'", "x", "'_", "]_", "._", "distinct_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "a_", "[_", "[_", "'", "x", "'_", "]_", "]_", "._", "distinct_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "by_", "(_", "a_", "[_", "'", "x", "'_", "]_", ",_", "total_", "=_", "a_", "[_", "'", "y", "'_", "]_", "._", "sum_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isco", "lum", "n_", "(_", "a_", "[_", "'", "x", "'_", "]_", "[_", "a_", "[_", "'", "x", "'_", "]_", ">_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "a_", "[_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", "]_", "[_", "a_", "[_", "'", "x", "'_", "]_", ">_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isco", "lum", "n_", "(_", "a_", "[_", "'", "x", "'_", "]_", "._", "sort_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "a_", "[_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", "]_", "._", "sort_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isco", "lum", "n_", "(_", "a_", "[_", "'", "x", "'_", "]_", "._", "head_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "a_", "[_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", "]_", "._", "head_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "isco", "lum", "n_", "(_", "Symbol_", "(_", "'", "b", "'_", ",_", "'", "int", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isco", "lum", "n_", "(_", "Symbol_", "(_", "'", "b", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", "}'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "discover_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ds_", "=_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Symbol_", "(_", "'", "a", "'_", ",_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "discover_", "(_", "a_", ")_", "==_", "dsh", "ape_", "(_", "ds_", ")_", "\\u\\u\\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", "impro", "per", "\\u", "selection_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "raises_", "(_", "Exception_", ",_", "lambda_", ":_", "t_", "[_", "t_", "[_", "'", "x", "'_", "]_", ">_", "0_", "]_", "[_", "t_", "._", "sort_", "(_", ")_", "[_", "t_", "[_", "'", "y", "'_", ">_", "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_", "def_", "test\\u", "serializable", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "id", ":", " ", "int", ",", " ", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "pickle_", "._", "loads_", "(_", "pickle_", "._", "dumps_", "(_", "t_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t_", "._", "isi", "denti", "cal_", "(_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "id", ":", " ", "int", ",", " ", "city", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expr_", "=_", "join_", "(_", "t_", "[_", "t_", "._", "amount_", "<_", "0_", "]_", ",_", "s_", ")_", "._", "sort_", "(_", "'", "id", "'_", ")_", "._", "city_", "._", "head_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expr", "2_", "=_", "pickle_", "._", "loads_", "(_", "pickle_", "._", "dumps_", "(_", "expr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "expr_", "._", "isi", "denti", "cal_", "(_", "expr", "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_", "def_", "test\\u", "symbol", "\\u", "coe", "rci", "on_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "datetime_", "import_", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "timestamp", ":", " ", "?", "date", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "t_", "._", "amount_", "+_", "'", "10", "'_", ")_", "._", "rhs_", "==_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "t_", "._", "timestamp_", "<_", "'", "2014", "-1", "2", "-0", "1", "'_", ")_", "._", "rhs_", "==_", "date_", "(_", "2014_", ",_", "12_", ",_", "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", "isnan_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "bla", "ze_", "import_", "isnan_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "real", ",", " ", "timestamp", ":", " ", "?", "date", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "expr_", "in_", "[_", "t_", "._", "amount_", "._", "isnan_", "(_", ")_", ",_", "~_", "t_", "._", "amount_", "._", "isnan_", "(_", ")_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "eval_", "(_", "str_", "(_", "expr_", ")_", ")_", "._", "isi", "denti", "cal_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "isco", "lle", "ction_", "(_", "t_", "._", "amount_", "._", "isnan_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "bool", "'_", "in_", "str_", "(_", "t_", "._", "amount_", "._", "isnan_", "(_", ")_", "._", "dsh", "ape_", ")_", "\\u\\u\\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", "distinct", "\\u", "name_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "id", ":", " ", "int", "32", ",", " ", "name", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t_", "._", "name_", "._", "isi", "denti", "cal_", "(_", "t_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "distinct_", "(_", ")_", "._", "name_", "._", "isi", "denti", "cal_", "(_", "t_", "._", "distinct_", "(_", ")_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "id_", "._", "distinct_", "(_", ")_", "._", "\\u", "name_", "==_", "'", "id", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "name_", "._", "\\u", "name_", "==_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "leaves_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "id", ":", " ", "int", "32", ",", " ", "name", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "Symbol_", "(_", "'", "v", "'_", ",_", "'", "var", " ", "*", " ", "{", "id", ":", " ", "int", "32", ",", " ", "city", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "symbol_", "(_", "'", "x", "'_", ",_", "'", "int", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t_", "._", "\\u", "leaves_", "(_", ")_", "==_", "[_", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "id_", "._", "\\u", "leaves_", "(_", ")_", "==_", "[_", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "by_", "(_", "t_", "._", "name_", ",_", "count_", "=_", "t_", "._", "id_", "._", "nun", "ique", "_", "(_", ")_", ")_", "._", "\\u", "leaves_", "(_", ")_", "==_", "[_", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "join_", "(_", "t_", ",_", "v_", ")_", "._", "\\u", "leaves_", "(_", ")_", "==_", "[_", "t_", ",_", "v_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "join_", "(_", "v_", ",_", "t_", ")_", "._", "\\u", "leaves_", "(_", ")_", "==_", "[_", "v_", ",_", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "x_", "+_", "1_", ")_", "._", "\\u", "leaves_", "(_", ")_", "==_", "[_", "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_", "@_", "pytest_", "._", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "t_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "id", ":", " ", "int", ",", " ", "amo", "unt", ":", " ", "float", "64", ",", " ", "name", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "funcname_", "(_", "x_", ",_", "y_", "=_", "'<", "lambda", ">'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "PY", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "Test", "Repr", ".", "%", "s", ".", "<", "locals", ">.", "%", "s", "'_", "%_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'", "test\\u", "symbol", ".", "%", "s", "'_", "%_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Repr", "_", "(_", "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_", "Test", "Repr", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "partial", "\\u", "lambda_", "(_", "self_", ",_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expr_", "=_", "t_", "._", "amount_", "._", "map_", "(_", "partial_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "(_", "\"", "Map", "(\\u", "child", "=", "t", ".", "amo", "unt", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "func", "=", "partial", "(%", "s", ",", " ", "1", "),", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\u", "ass", "chema", "=", "Non", "e", ",", " ", "\\u", "name", "0", "=", "Non", "e", ")\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "funcname_", "(_", "'", "test\\u", "partial", "\\u", "lambda", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Repr", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lambda_", "(_", "self_", ",_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expr_", "=_", "t_", "._", "amount_", "._", "map_", "(_", "lambda_", "x_", ":_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "(_", "\"", "Map", "(\\u", "child", "=", "t", ".", "amo", "unt", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "func", "=", "%", "s", ",", " ", "\\u", "ass", "chema", "=", "Non", "e", ",", " ", "\\u", "name", "0", "=", "Non", "e", ")\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "funcname_", "(_", "'", "test\\u", "lambda", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Repr", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "partial_", "(_", "self_", ",_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "myf", "unc_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "+_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expr_", "=_", "t_", "._", "amount_", "._", "map_", "(_", "partial_", "(_", "myf", "unc_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "(_", "\"", "Map", "(\\u", "child", "=", "t", ".", "amo", "unt", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "func", "=", "partial", "(%", "s", ",", " ", "1", "),", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\u", "ass", "chema", "=", "Non", "e", ",", " ", "\\u", "name", "0", "=", "Non", "e", ")\"_", "%_", "funcname_", "(_", "'", "test\\u", "partial", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "myf", "unc", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Repr", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "builtin_", "(_", "self_", ",_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expr_", "=_", "t_", "._", "amount_", "._", "map_", "(_", "datetime_", "._", "fromtimestamp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "(_", "\"", "Map", "(\\u", "child", "=", "t", ".", "amo", "unt", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "func", "=", "datetime", ".", "from", "timestamp", ",", " ", "\\u", "ass", "chema", "=", "Non", "e", ",\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "\\u", "name", "0", "=", "Non", "e", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Repr", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "udf", "_", "(_", "self_", ",_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "myf", "unc_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expr_", "=_", "t_", "._", "amount_", "._", "map_", "(_", "myf", "unc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "(_", "\"", "Map", "(\\u", "child", "=", "t", ".", "amo", "unt", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "func", "=", "%", "s", ",", " ", "\\u", "ass", "chema", "=", "Non", "e", ",\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "\\u", "name", "0", "=", "Non", "e", ")\"_", "%_", "funcname_", "(_", "'", "test\\u", "udf", "'_", ",_", "'", "myf", "unc", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Repr", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "nest", "ed", "\\u", "partial_", "(_", "self_", ",_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "myf", "unc_", "(_", "x_", ",_", "y_", ",_", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "+_", "y_", "+_", "z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "partial_", "(_", "partial_", "(_", "myf", "unc_", ",_", "2_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expr_", "=_", "t_", "._", "amount_", "._", "map_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "expr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "(_", "\"", "Map", "(\\u", "child", "=", "t", ".", "amo", "unt", ",", " ", "func", "=", "partial", "(", "partial", "(%", "s", ",", " ", "2", "),", " ", "1", "),", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "\\u", "ass", "chema", "=", "Non", "e", ",", " ", "\\u", "name", "0", "=", "Non", "e", ")\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "funcname_", "(_", "'", "test\\u", "nest", "ed", "\\u", "partial", "'_", ",_", "'", "myf", "unc", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "count", "\\u", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "city", ":", " ", "string", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "name_", "._", "count", "\\u", "values_", "(_", "sort_", "=_", "False_", ")_", "._", "isi", "denti", "cal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "by_", "(_", "t_", "._", "name_", ",_", "count_", "=_", "t_", "._", "name_", "._", "count_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "name_", "._", "count", "\\u", "values_", "(_", "sort_", "=_", "True_", ")_", "._", "isi", "denti", "cal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "by_", "(_", "t_", "._", "name_", ",_", "count_", "=_", "t_", "._", "name_", "._", "count_", "(_", ")_", ")_", "._", "sort_", "(_", "'", "count", "'_", ",_", "ascending_", "=_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "dir_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "dt", ":", " ", "datetime", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "day", "'_", "in_", "dir_", "(_", "t_", "._", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "mean", "'_", "not_", "in_", "dir_", "(_", "t_", "._", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "mean", "'_", "in_", "dir_", "(_", "t_", "._", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "like", "'_", "not_", "in_", "dir_", "(_", "t_", "[_", "[_", "'", "amo", "unt", "'_", ",_", "'", "dt", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "any", "'_", "not_", "in_", "dir_", "(_", "t_", "._", "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_", "test\\u", "distinct", "\\u", "column_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "name", ":", " ", "string", ",", " ", "amo", "unt", ":", " ", "int", ",", " ", "dt", ":", " ", "datetime", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "name_", "._", "distinct_", "(_", ")_", "._", "name_", "._", "dsh", "ape_", "==_", "t_", "._", "name_", "._", "distinct_", "(_", ")_", "._", "dsh", "ape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "._", "name_", "._", "distinct_", "(_", ")_", "._", "name_", "._", "isi", "denti", "cal_", "(_", "t_", "._", "name_", "._", "distinct_", "(_", ")_", ")_" ]
[ 4, 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, 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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 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 ]
Variable defined multiple times
treyhunner/django-simple-history/simple_history/tests/tests/test_admin.py
[ { "content": " def test_response_change_change_history_setting_off(self):\n \"\"\"\n Test the response_change method that it works with a _change_history\n in the POST and settings.SIMPLE_HISTORY_EDIT set to False\n \"\"\"\n request = RequestFactory().post('/')\n request.POST = {'_change_history': True}\n request.session = 'session'\n request._messages = FallbackStorage(request)\n request.path = '/awesome/url/'\n request.user = self.user\n\n poll = Poll.objects.create(question=\"why?\", pub_date=today)\n poll.question = \"how?\"\n poll.save()\n\n admin_site = AdminSite()\n admin = SimpleHistoryAdmin(Poll, admin_site)\n\n response = admin.response_change(request, poll)\n\n with patch(\n 'simple_history.admin.admin.ModelAdmin.response_change'\n ) as m_admin:\n m_admin.return_value = 'it was called'\n response = admin.response_change(request, poll)\n\n self.assertEqual(response, 'it was called')", "metadata": "root.AdminSiteTest.test_response_change_change_history_setting_off", "header": "['class', 'AdminSiteTest', '(', 'WebTest', ')', ':', '___EOS___']", "index": 328 } ]
[ { "span": "response ", "start_line": 347, "start_column": 8, "end_line": 347, "end_column": 16 } ]
[ { "span": "response ", "start_line": 353, "start_column": 12, "end_line": 353, "end_column": 20 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Admi", "n", "Site", "Test_", "(_", "Web", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "response", "\\u", "change", "\\u", "change", "\\u", "histo", "ry", "\\u", "setti", "ng", "\\u", "off_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "the", " ", "response", "\\u", "change", " ", "method", " ", "tha", "t", " ", "it", " ", "works", " ", "with", " ", "a", " ", "\\u", "change", "\\u", "histo", "ry", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "POST", " ", "and", " ", "settings", ".", "SIMPLE", "\\u", "HISTORY", "\\u", "EDIT", " ", "set", " ", "to", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "=_", "Request", "Factory_", "(_", ")_", "._", "post_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "POST_", "=_", "{_", "'\\u", "change", "\\u", "histo", "ry", "'_", ":_", "True_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "session_", "=_", "'", "session", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "\\u", "messages_", "=_", "Fallback", "Storage_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "path_", "=_", "'/", "aw", "eso", "me", "/", "url", "/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "user_", "=_", "self_", "._", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "poll_", "=_", "Poll", "_", "._", "objects_", "._", "create_", "(_", "question_", "=_", "\"", "wh", "y", "?\"_", ",_", "pub", "\\u", "date_", "=_", "today_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poll_", "._", "question_", "=_", "\"", "how", "?\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poll_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "site_", "=_", "Admi", "n", "Site_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin_", "=_", "Simple", "Hist", "ory", "Admin_", "(_", "Poll", "_", ",_", "admin", "\\u", "site_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "admin_", "._", "response", "\\u", "change_", "(_", "request_", ",_", "poll_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "patch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "simple", "\\u", "histo", "ry", ".", "admin", ".", "admin", ".", "Model", "Admi", "n", ".", "response", "\\u", "change", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "as_", "m", "\\u", "admin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m", "\\u", "admin_", "._", "return", "\\u", "value_", "=_", "'", "it", " ", "was", " ", "call", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "admin_", "._", "response", "\\u", "change_", "(_", "request_", ",_", "poll_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", ",_", "'", "it", " ", "was", " ", "call", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/misc.py
[ { "content": "\"\"\"\nMiscellaneous function (re)definitions from the Py3.4+ standard library\nfor Python 2.6/2.7.\n\n- math.ceil (for Python 2.7)\n- collections.OrderedDict (for Python 2.6)\n- collections.Counter (for Python 2.6)\n- collections.ChainMap (for all versions prior to Python 3.3)\n- itertools.count (for Python 2.6, with step parameter)\n- subprocess.check_output (for Python 2.6)\n- reprlib.recursive_repr (for Python 2.6+)\n\"\"\"\nfrom __future__ import absolute_import\n\nimport subprocess\nfrom math import ceil as oldceil\nfrom collections import Mapping, MutableMapping\n\nfrom operator import itemgetter as _itemgetter, eq as _eq\nimport sys\nimport heapq as _heapq\nfrom _weakref import proxy as _proxy\nfrom itertools import repeat as _repeat, chain as _chain, starmap as _starmap\nfrom socket import getaddrinfo, SOCK_STREAM, error, socket\n\nfrom future.utils import iteritems, itervalues, PY26, PY3\n\n\n\n\n########################################################################\n### reprlib.recursive_repr decorator from Py3.4\n########################################################################\n\nfrom itertools import islice\n\nif PY3:\n try:\n from _thread import get_ident\n except ImportError:\n from _dummy_thread import get_ident\nelse:\n try:\n from thread import get_ident\n except ImportError:\n from dummy_thread import get_ident\n\n\n\n\n################################################################################\n### OrderedDict\n################################################################################\n\n\n\n\n# {{{ http://code.activestate.com/recipes/576611/ (r11)\n\ntry:\n from operator import itemgetter\n from heapq import nlargest\nexcept ImportError:\n pass\n\n########################################################################\n### Counter\n########################################################################\n\n\n\n\n\n\n\n\n########################################################################\n### ChainMap (helper for configparser and string.Template)\n### From the Py3.4 source code. See also:\n### https://github.com/kkxue/Py2ChainMap/blob/master/py2chainmap.py\n########################################################################\n\n\n\n# Re-use the same sentinel as in the Python stdlib socket module:\nfrom socket import _GLOBAL_DEFAULT_TIMEOUT\n# Was: _GLOBAL_DEFAULT_TIMEOUT = object()\n\n\n\n\n# Back up our definitions above in case they're useful\n_OrderedDict = OrderedDict\n_Counter = Counter\n_check_output = check_output\n_count = count\n_ceil = ceil\n__count_elements = _count_elements\n_recursive_repr = recursive_repr\n_ChainMap = ChainMap\n_create_connection = create_connection\n\n# Overwrite the definitions above with the usual ones\n# from the standard library:\nif sys.version_info >= (2, 7):\n from collections import OrderedDict, Counter\n from subprocess import check_output\n from itertools import count\n from socket import create_connection\n\nif sys.version_info >= (3, 0):\n from math import ceil\n from collections import _count_elements\n\nif sys.version_info >= (3, 3):\n from reprlib import recursive_repr\n from collections import ChainMap\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def ceil(x):\n \"\"\"\n Return the ceiling of x as an int.\n This is the smallest integral value >= x.\n \"\"\"\n return int(oldceil(x))", "metadata": "root.ceil", "header": "['module', '___EOS___']", "index": 28 }, { "content": "def recursive_repr(fillvalue='...'):\n 'Decorator to make a repr function return fillvalue for a recursive call'\n\n def decorating_function(user_function):\n repr_running = set()\n\n def wrapper(self):\n key = id(self), get_ident()\n if key in repr_running:\n return fillvalue\n repr_running.add(key)\n try:\n result = user_function(self)\n finally:\n repr_running.discard(key)\n return result\n\n # Can't use functools.wraps() here because of bootstrap issues\n wrapper.__module__ = getattr(user_function, '__module__')\n wrapper.__doc__ = getattr(user_function, '__doc__')\n wrapper.__name__ = getattr(user_function, '__name__')\n wrapper.__annotations__ = getattr(user_function, '__annotations__', {})\n return wrapper\n\n return decorating_function", "metadata": "root.recursive_repr", "header": "['module', '___EOS___']", "index": 54 }, { "content": "class _Link(object):\n __slots__ = 'prev', 'next', 'key', '__weakref__'", "metadata": "root._Link", "header": "['module', '___EOS___']", "index": 85 }, { "content": "class OrderedDict(dict):\n 'Dictionary that remembers insertion order'\n # An inherited dict maps keys to values.\n # The inherited dict provides __getitem__, __len__, __contains__, and get.\n # The remaining methods are order-aware.\n # Big-O running times for all methods are the same as regular dictionaries.\n\n # The internal self.__map dict maps keys to links in a doubly linked list.\n # The circular doubly linked list starts and ends with a sentinel element.\n # The sentinel element never gets deleted (this simplifies the algorithm).\n # The sentinel is in self.__hardroot with a weakref proxy in self.__root.\n # The prev links are weakref proxies (to prevent circular references).\n # Individual links are kept alive by the hard reference in self.__map.\n # Those hard references disappear when a key is deleted from an OrderedDict.\n\n\n\n\n\n\n\n\n\n\n update = __update = MutableMapping.update\n keys = MutableMapping.keys\n values = MutableMapping.values\n items = MutableMapping.items\n __ne__ = MutableMapping.__ne__\n\n __marker = object()\n\n\n\n\n\n\n", "metadata": "root.OrderedDict", "header": "['module', '___EOS___']", "index": 88 }, { "content": " def __init__(*args, **kwds):\n '''Initialize an ordered dictionary. The signature is the same as\n regular dictionaries, but keyword arguments are not recommended because\n their insertion order is arbitrary.\n\n '''\n if not args:\n raise TypeError(\"descriptor '__init__' of 'OrderedDict' object \"\n \"needs an argument\")\n self = args[0]\n args = args[1:]\n if len(args) > 1:\n raise TypeError('expected at most 1 arguments, got %d' % len(args))\n try:\n self.__root\n except AttributeError:\n self.__hardroot = _Link()\n self.__root = root = _proxy(self.__hardroot)\n root.prev = root.next = root\n self.__map = {}\n self.__update(*args, **kwds)", "metadata": "root.OrderedDict.__init__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 103 }, { "content": " def __setitem__(self, key, value,\n dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link):\n 'od.__setitem__(i, y) <==> od[i]=y'\n # Setting a new item creates a new link at the end of the linked list,\n # and the inherited dictionary is updated with the new key/value pair.\n if key not in self:\n self.__map[key] = link = Link()\n root = self.__root\n last = root.prev\n link.prev, link.next, link.key = last, root, key\n last.next = link\n root.prev = proxy(link)\n dict_setitem(self, key, value)", "metadata": "root.OrderedDict.__setitem__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 125 }, { "content": " def __delitem__(self, key, dict_delitem=dict.__delitem__):\n 'od.__delitem__(y) <==> del od[y]'\n # Deleting an existing item uses self.__map to find the link which gets\n # removed by updating the links in the predecessor and successor nodes.\n dict_delitem(self, key)\n link = self.__map.pop(key)\n link_prev = link.prev\n link_next = link.next\n link_prev.next = link_next\n link_next.prev = link_prev", "metadata": "root.OrderedDict.__delitem__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 139 }, { "content": " def __iter__(self):\n 'od.__iter__() <==> iter(od)'\n # Traverse the linked list in order.\n root = self.__root\n curr = root.next\n while curr is not root:\n yield curr.key\n curr = curr.next", "metadata": "root.OrderedDict.__iter__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 150 }, { "content": " def __reversed__(self):\n 'od.__reversed__() <==> reversed(od)'\n # Traverse the linked list in reverse order.\n root = self.__root\n curr = root.prev\n while curr is not root:\n yield curr.key\n curr = curr.prev", "metadata": "root.OrderedDict.__reversed__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 159 }, { "content": " def clear(self):\n 'od.clear() -> None. Remove all items from od.'\n root = self.__root\n root.prev = root.next = root\n self.__map.clear()\n dict.clear(self)", "metadata": "root.OrderedDict.clear", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 168 }, { "content": " def popitem(self, last=True):\n '''od.popitem() -> (k, v), return and remove a (key, value) pair.\n Pairs are returned in LIFO order if last is true or FIFO order if false.\n\n '''\n if not self:\n raise KeyError('dictionary is empty')\n root = self.__root\n if last:\n link = root.prev\n link_prev = link.prev\n link_prev.next = root\n root.prev = link_prev\n else:\n link = root.next\n link_next = link.next\n root.next = link_next\n link_next.prev = root\n key = link.key\n del self.__map[key]\n value = dict.pop(self, key)\n return key, value", "metadata": "root.OrderedDict.popitem", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 175 }, { "content": " def move_to_end(self, key, last=True):\n '''Move an existing element to the end (or beginning if last==False).\n\n Raises KeyError if the element does not exist.\n When last=True, acts like a fast version of self[key]=self.pop(key).\n\n '''\n link = self.__map[key]\n link_prev = link.prev\n link_next = link.next\n link_prev.next = link_next\n link_next.prev = link_prev\n root = self.__root\n if last:\n last = root.prev\n link.prev = last\n link.next = root\n last.next = root.prev = link\n else:\n first = root.next\n link.prev = root\n link.next = first\n root.next = first.prev = link", "metadata": "root.OrderedDict.move_to_end", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 198 }, { "content": " def __sizeof__(self):\n sizeof = sys.getsizeof\n n = len(self) + 1 # number of links including root\n size = sizeof(self.__dict__) # instance dictionary\n size += sizeof(self.__map) * 2 # internal dict and inherited dict\n size += sizeof(self.__hardroot) * n # link objects\n size += sizeof(self.__root) * n # proxy objects\n return size", "metadata": "root.OrderedDict.__sizeof__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 222 }, { "content": " def pop(self, key, default=__marker):\n '''od.pop(k[,d]) -> v, remove specified key and return the corresponding\n value. If key is not found, d is returned if given, otherwise KeyError\n is raised.\n\n '''\n if key in self:\n result = self[key]\n del self[key]\n return result\n if default is self.__marker:\n raise KeyError(key)\n return default", "metadata": "root.OrderedDict.pop", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 239 }, { "content": " def setdefault(self, key, default=None):\n 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od'\n if key in self:\n return self[key]\n self[key] = default\n return default", "metadata": "root.OrderedDict.setdefault", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 253 }, { "content": " @recursive_repr()\n def __repr__(self):\n 'od.__repr__() <==> repr(od)'\n if not self:\n return '%s()' % (self.__class__.__name__,)\n return '%s(%r)' % (self.__class__.__name__, list(self.items()))", "metadata": "root.OrderedDict.__repr__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 260 }, { "content": " def __reduce__(self):\n 'Return state information for pickling'\n inst_dict = vars(self).copy()\n for k in vars(OrderedDict()):\n inst_dict.pop(k, None)\n return self.__class__, (), inst_dict or None, None, iter(self.items())", "metadata": "root.OrderedDict.__reduce__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 267 }, { "content": " def copy(self):\n 'od.copy() -> a shallow copy of od'\n return self.__class__(self)", "metadata": "root.OrderedDict.copy", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 274 }, { "content": " @classmethod\n def fromkeys(cls, iterable, value=None):\n '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.\n If not specified, the value defaults to None.\n\n '''\n self = cls()\n for key in iterable:\n self[key] = value\n return self", "metadata": "root.OrderedDict.fromkeys", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 278 }, { "content": " def __eq__(self, other):\n '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive\n while comparison to a regular mapping is order-insensitive.\n\n '''\n if isinstance(other, OrderedDict):\n return dict.__eq__(self, other) and all(map(_eq, self, other))\n return dict.__eq__(self, other)", "metadata": "root.OrderedDict.__eq__", "header": "['class', 'OrderedDict', '(', 'dict', ')', ':', '___EOS___']", "index": 289 }, { "content": "def _count_elements(mapping, iterable):\n 'Tally elements from the iterable.'\n mapping_get = mapping.get\n for elem in iterable:\n mapping[elem] = mapping_get(elem, 0) + 1", "metadata": "root._count_elements", "header": "['module', '___EOS___']", "index": 311 }, { "content": "class Counter(dict):\n '''Dict subclass for counting hashable items. Sometimes called a bag\n or multiset. Elements are stored as dictionary keys and their counts\n are stored as dictionary values.\n\n >>> c = Counter('abcdeabcdabcaba') # count elements from a string\n\n >>> c.most_common(3) # three most common elements\n [('a', 5), ('b', 4), ('c', 3)]\n >>> sorted(c) # list all unique elements\n ['a', 'b', 'c', 'd', 'e']\n >>> ''.join(sorted(c.elements())) # list elements with repetitions\n 'aaaaabbbbcccdde'\n >>> sum(c.values()) # total of all counts\n 15\n\n >>> c['a'] # count of letter 'a'\n 5\n >>> for elem in 'shazam': # update counts from an iterable\n ... c[elem] += 1 # by adding 1 to each element's count\n >>> c['a'] # now there are seven 'a'\n 7\n >>> del c['b'] # remove all 'b'\n >>> c['b'] # now there are zero 'b'\n 0\n\n >>> d = Counter('simsalabim') # make another counter\n >>> c.update(d) # add in the second counter\n >>> c['a'] # now there are nine 'a'\n 9\n\n >>> c.clear() # empty the counter\n >>> c\n Counter()\n\n Note: If a count is set to zero or reduced to zero, it will remain\n in the counter until the entry is deleted or the counter is cleared:\n\n >>> c = Counter('aaabbc')\n >>> c['b'] -= 2 # reduce the count of 'b' by two\n >>> c.most_common() # 'b' is still in, but its count is zero\n [('a', 3), ('c', 1), ('b', 0)]\n\n '''\n # References:\n # http://en.wikipedia.org/wiki/Multiset\n # http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html\n # http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm\n # http://code.activestate.com/recipes/259174/\n # Knuth, TAOCP Vol. II section 4.6.3\n\n\n\n\n\n # Override dict methods where necessary\n\n\n\n\n\n\n\n\n # Multiset-style mathematical operations discussed in:\n # Knuth TAOCP Volume II section 4.6.3 exercise 19\n # and at http://en.wikipedia.org/wiki/Multiset\n #\n # Outputs guaranteed to only include positive counts.\n #\n # To strip negative and zero counts, add-in an empty counter:\n # c += Counter()\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Counter", "header": "['module', '___EOS___']", "index": 317 }, { "content": " def __init__(*args, **kwds):\n '''Create a new, empty Counter object. And if given, count elements\n from an input iterable. Or, initialize the count from another mapping\n of elements to their counts.\n\n >>> c = Counter() # a new, empty counter\n >>> c = Counter('gallahad') # a new counter from an iterable\n >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping\n >>> c = Counter(a=4, b=2) # a new counter from keyword args\n\n '''\n if not args:\n raise TypeError(\"descriptor '__init__' of 'Counter' object \"\n \"needs an argument\")\n self = args[0]\n args = args[1:]\n if len(args) > 1:\n raise TypeError('expected at most 1 arguments, got %d' % len(args))\n super(Counter, self).__init__()\n self.update(*args, **kwds)", "metadata": "root.Counter.__init__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 368 }, { "content": " def __missing__(self, key):\n 'The count of elements not in the Counter is zero.'\n # Needed so that self[missing_item] does not raise KeyError\n return 0", "metadata": "root.Counter.__missing__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 389 }, { "content": " def most_common(self, n=None):\n '''List the n most common elements and their counts from the most\n common to the least. If n is None, then list all element counts.\n\n >>> Counter('abcdeabcdabcaba').most_common(3)\n [('a', 5), ('b', 4), ('c', 3)]\n\n '''\n # Emulate Bag.sortedByCount from Smalltalk\n if n is None:\n return sorted(self.items(), key=_itemgetter(1), reverse=True)\n return _heapq.nlargest(n, self.items(), key=_itemgetter(1))", "metadata": "root.Counter.most_common", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 394 }, { "content": " def elements(self):\n '''Iterator over elements repeating each as many times as its count.\n\n >>> c = Counter('ABCABC')\n >>> sorted(c.elements())\n ['A', 'A', 'B', 'B', 'C', 'C']\n\n # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1\n >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})\n >>> product = 1\n >>> for factor in prime_factors.elements(): # loop over factors\n ... product *= factor # and multiply them\n >>> product\n 1836\n\n Note, if an element's count has been set to zero or is a negative\n number, elements() will ignore it.\n\n '''\n # Emulate Bag.do from Smalltalk and Multiset.begin from C++.\n return _chain.from_iterable(_starmap(_repeat, self.items()))", "metadata": "root.Counter.elements", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 407 }, { "content": " @classmethod\n def fromkeys(cls, iterable, v=None):\n # There is no equivalent method for counters because setting v=1\n # means that no element can have a count greater than one.\n raise NotImplementedError(\n 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.')", "metadata": "root.Counter.fromkeys", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 431 }, { "content": " def update(*args, **kwds):\n '''Like dict.update() but add counts instead of replacing them.\n\n Source can be an iterable, a dictionary, or another Counter instance.\n\n >>> c = Counter('which')\n >>> c.update('witch') # add elements from another iterable\n >>> d = Counter('watch')\n >>> c.update(d) # add elements from another counter\n >>> c['h'] # four 'h' in which, witch, and watch\n 4\n\n '''\n # The regular dict.update() operation makes no sense here because the\n # replace behavior results in the some of original untouched counts\n # being mixed-in with all of the other counts for a mismash that\n # doesn't have a straight-forward interpretation in most counting\n # contexts. Instead, we implement straight-addition. Both the inputs\n # and outputs are allowed to contain zero and negative counts.\n\n if not args:\n raise TypeError(\"descriptor 'update' of 'Counter' object \"\n \"needs an argument\")\n self = args[0]\n args = args[1:]\n if len(args) > 1:\n raise TypeError('expected at most 1 arguments, got %d' % len(args))\n iterable = args[0] if args else None\n if iterable is not None:\n if isinstance(iterable, Mapping):\n if self:\n self_get = self.get\n for elem, count in iterable.items():\n self[elem] = count + self_get(elem, 0)\n else:\n super(Counter, self).update(iterable) # fast path when counter is empty\n else:\n _count_elements(self, iterable)\n if kwds:\n self.update(kwds)", "metadata": "root.Counter.update", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 438 }, { "content": " def subtract(*args, **kwds):\n '''Like dict.update() but subtracts counts instead of replacing them.\n Counts can be reduced below zero. Both the inputs and outputs are\n allowed to contain zero and negative counts.\n\n Source can be an iterable, a dictionary, or another Counter instance.\n\n >>> c = Counter('which')\n >>> c.subtract('witch') # subtract elements from another iterable\n >>> c.subtract(Counter('watch')) # subtract elements from another counter\n >>> c['h'] # 2 in which, minus 1 in witch, minus 1 in watch\n 0\n >>> c['w'] # 1 in which, minus 1 in witch, minus 1 in watch\n -1\n\n '''\n if not args:\n raise TypeError(\"descriptor 'subtract' of 'Counter' object \"\n \"needs an argument\")\n self = args[0]\n args = args[1:]\n if len(args) > 1:\n raise TypeError('expected at most 1 arguments, got %d' % len(args))\n iterable = args[0] if args else None\n if iterable is not None:\n self_get = self.get\n if isinstance(iterable, Mapping):\n for elem, count in iterable.items():\n self[elem] = self_get(elem, 0) - count\n else:\n for elem in iterable:\n self[elem] = self_get(elem, 0) - 1\n if kwds:\n self.subtract(kwds)", "metadata": "root.Counter.subtract", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 479 }, { "content": " def copy(self):\n 'Return a shallow copy.'\n return self.__class__(self)", "metadata": "root.Counter.copy", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 514 }, { "content": " def __reduce__(self):\n return self.__class__, (dict(self),)", "metadata": "root.Counter.__reduce__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 518 }, { "content": " def __delitem__(self, elem):\n 'Like dict.__delitem__() but does not raise KeyError for missing values.'\n if elem in self:\n super(Counter, self).__delitem__(elem)", "metadata": "root.Counter.__delitem__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 521 }, { "content": " def __repr__(self):\n if not self:\n return '%s()' % self.__class__.__name__\n try:\n items = ', '.join(map('%r: %r'.__mod__, self.most_common()))\n return '%s({%s})' % (self.__class__.__name__, items)\n except TypeError:\n # handle case where values are not orderable\n return '{0}({1!r})'.format(self.__class__.__name__, dict(self))", "metadata": "root.Counter.__repr__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 526 }, { "content": " def __add__(self, other):\n '''Add counts from two counters.\n\n >>> Counter('abbb') + Counter('bcc')\n Counter({'b': 4, 'c': 2, 'a': 1})\n\n '''\n if not isinstance(other, Counter):\n return NotImplemented\n result = Counter()\n for elem, count in self.items():\n newcount = count + other[elem]\n if newcount > 0:\n result[elem] = newcount\n for elem, count in other.items():\n if elem not in self and count > 0:\n result[elem] = count\n return result", "metadata": "root.Counter.__add__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 545 }, { "content": " def __sub__(self, other):\n ''' Subtract count, but keep only results with positive counts.\n\n >>> Counter('abbbc') - Counter('bccd')\n Counter({'b': 2, 'a': 1})\n\n '''\n if not isinstance(other, Counter):\n return NotImplemented\n result = Counter()\n for elem, count in self.items():\n newcount = count - other[elem]\n if newcount > 0:\n result[elem] = newcount\n for elem, count in other.items():\n if elem not in self and count < 0:\n result[elem] = 0 - count\n return result", "metadata": "root.Counter.__sub__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 564 }, { "content": " def __or__(self, other):\n '''Union is the maximum of value in either of the input counters.\n\n >>> Counter('abbb') | Counter('bcc')\n Counter({'b': 3, 'c': 2, 'a': 1})\n\n '''\n if not isinstance(other, Counter):\n return NotImplemented\n result = Counter()\n for elem, count in self.items():\n other_count = other[elem]\n newcount = other_count if count < other_count else count\n if newcount > 0:\n result[elem] = newcount\n for elem, count in other.items():\n if elem not in self and count > 0:\n result[elem] = count\n return result", "metadata": "root.Counter.__or__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 583 }, { "content": " def __and__(self, other):\n ''' Intersection is the minimum of corresponding counts.\n\n >>> Counter('abbb') & Counter('bcc')\n Counter({'b': 1})\n\n '''\n if not isinstance(other, Counter):\n return NotImplemented\n result = Counter()\n for elem, count in self.items():\n other_count = other[elem]\n newcount = count if count < other_count else other_count\n if newcount > 0:\n result[elem] = newcount\n return result", "metadata": "root.Counter.__and__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 603 }, { "content": " def __pos__(self):\n 'Adds an empty counter, effectively stripping negative and zero counts'\n return self + Counter()", "metadata": "root.Counter.__pos__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 620 }, { "content": " def __neg__(self):\n '''Subtracts from an empty counter. Strips positive and zero counts,\n and flips the sign on negative counts.\n\n '''\n return Counter() - self", "metadata": "root.Counter.__neg__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 624 }, { "content": " def _keep_positive(self):\n '''Internal method to strip elements with a negative or zero count'''\n nonpositive = [elem for elem, count in self.items() if not count > 0]\n for elem in nonpositive:\n del self[elem]\n return self", "metadata": "root.Counter._keep_positive", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 631 }, { "content": " def __iadd__(self, other):\n '''Inplace add from another counter, keeping only positive counts.\n\n >>> c = Counter('abbb')\n >>> c += Counter('bcc')\n >>> c\n Counter({'b': 4, 'c': 2, 'a': 1})\n\n '''\n for elem, count in other.items():\n self[elem] += count\n return self._keep_positive()", "metadata": "root.Counter.__iadd__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 638 }, { "content": " def __isub__(self, other):\n '''Inplace subtract counter, but keep only results with positive counts.\n\n >>> c = Counter('abbbc')\n >>> c -= Counter('bccd')\n >>> c\n Counter({'b': 2, 'a': 1})\n\n '''\n for elem, count in other.items():\n self[elem] -= count\n return self._keep_positive()", "metadata": "root.Counter.__isub__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 651 }, { "content": " def __ior__(self, other):\n '''Inplace union is the maximum of value from either counter.\n\n >>> c = Counter('abbb')\n >>> c |= Counter('bcc')\n >>> c\n Counter({'b': 3, 'c': 2, 'a': 1})\n\n '''\n for elem, other_count in other.items():\n count = self[elem]\n if other_count > count:\n self[elem] = other_count\n return self._keep_positive()", "metadata": "root.Counter.__ior__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 664 }, { "content": " def __iand__(self, other):\n '''Inplace intersection is the minimum of corresponding counts.\n\n >>> c = Counter('abbb')\n >>> c &= Counter('bcc')\n >>> c\n Counter({'b': 1})\n\n '''\n for elem, count in self.items():\n other_count = other[elem]\n if other_count < count:\n self[elem] = other_count\n return self._keep_positive()", "metadata": "root.Counter.__iand__", "header": "['class', 'Counter', '(', 'dict', ')', ':', '___EOS___']", "index": 679 }, { "content": "def check_output(*popenargs, **kwargs):\n \"\"\"\n For Python 2.6 compatibility: see\n http://stackoverflow.com/questions/4814970/\n \"\"\"\n\n if 'stdout' in kwargs:\n raise ValueError('stdout argument not allowed, it will be overridden.')\n process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)\n output, unused_err = process.communicate()\n retcode = process.poll()\n if retcode:\n cmd = kwargs.get(\"args\")\n if cmd is None:\n cmd = popenargs[0]\n raise subprocess.CalledProcessError(retcode, cmd)\n return output", "metadata": "root.check_output", "header": "['module', '___EOS___']", "index": 695 }, { "content": "def count(start=0, step=1):\n \"\"\"\n ``itertools.count`` in Py 2.6 doesn't accept a step\n parameter. This is an enhanced version of ``itertools.count``\n for Py2.6 equivalent to ``itertools.count`` in Python 2.7+.\n \"\"\"\n while True:\n yield start\n start += step", "metadata": "root.count", "header": "['module', '___EOS___']", "index": 714 }, { "content": "class ChainMap(MutableMapping):\n ''' A ChainMap groups multiple dicts (or other mappings) together\n to create a single, updateable view.\n\n The underlying mappings are stored in a list. That list is public and can\n accessed or updated using the *maps* attribute. There is no other state.\n\n Lookups search the underlying mappings successively until a key is found.\n In contrast, writes, updates, and deletions only operate on the first\n mapping.\n\n '''\n\n\n\n\n\n\n\n\n\n # Py2 compatibility:\n __nonzero__ = __bool__\n \n\n\n\n __copy__ = copy\n\n\n\n\n\n\n", "metadata": "root.ChainMap", "header": "['module', '___EOS___']", "index": 731 }, { "content": " def __init__(self, *maps):\n '''Initialize a ChainMap by setting *maps* to the given mappings.\n If no mappings are provided, a single empty dictionary is used.\n\n '''\n self.maps = list(maps) or [{}] # always at least one map", "metadata": "root.ChainMap.__init__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 744 }, { "content": " def __missing__(self, key):\n raise KeyError(key)", "metadata": "root.ChainMap.__missing__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 751 }, { "content": " def __getitem__(self, key):\n for mapping in self.maps:\n try:\n return mapping[key] # can't use 'key in mapping' with defaultdict\n except KeyError:\n pass\n return self.__missing__(key) # support subclasses that define __missing__", "metadata": "root.ChainMap.__getitem__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 754 }, { "content": " def get(self, key, default=None):\n return self[key] if key in self else default", "metadata": "root.ChainMap.get", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 762 }, { "content": " def __len__(self):\n return len(set().union(*self.maps)) # reuses stored hash values if possible", "metadata": "root.ChainMap.__len__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 765 }, { "content": " def __iter__(self):\n return iter(set().union(*self.maps))", "metadata": "root.ChainMap.__iter__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 768 }, { "content": " def __contains__(self, key):\n return any(key in m for m in self.maps)", "metadata": "root.ChainMap.__contains__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 771 }, { "content": " def __bool__(self):\n return any(self.maps)", "metadata": "root.ChainMap.__bool__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 774 }, { "content": " @recursive_repr()\n def __repr__(self):\n return '{0.__class__.__name__}({1})'.format(\n self, ', '.join(map(repr, self.maps)))", "metadata": "root.ChainMap.__repr__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 780 }, { "content": " @classmethod\n def fromkeys(cls, iterable, *args):\n 'Create a ChainMap with a single dict created from the iterable.'\n return cls(dict.fromkeys(iterable, *args))", "metadata": "root.ChainMap.fromkeys", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 785 }, { "content": " def copy(self):\n 'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]'\n return self.__class__(self.maps[0].copy(), *self.maps[1:])", "metadata": "root.ChainMap.copy", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 790 }, { "content": " def new_child(self, m=None): # like Django's Context.push()\n '''\n New ChainMap with a new map followed by all previous maps. If no\n map is provided, an empty dict is used.\n '''\n if m is None:\n m = {}\n return self.__class__(m, *self.maps)", "metadata": "root.ChainMap.new_child", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 796 }, { "content": " @property\n def parents(self): # like Django's Context.pop()\n 'New ChainMap from maps[1:].'\n return self.__class__(*self.maps[1:])", "metadata": "root.ChainMap.parents", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 805 }, { "content": " def __setitem__(self, key, value):\n self.maps[0][key] = value", "metadata": "root.ChainMap.__setitem__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 810 }, { "content": " def __delitem__(self, key):\n try:\n del self.maps[0][key]\n except KeyError:\n raise KeyError('Key not found in the first mapping: {!r}'.format(key))", "metadata": "root.ChainMap.__delitem__", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 813 }, { "content": " def popitem(self):\n 'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'\n try:\n return self.maps[0].popitem()\n except KeyError:\n raise KeyError('No keys found in the first mapping.')", "metadata": "root.ChainMap.popitem", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 819 }, { "content": " def pop(self, key, *args):\n 'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].'\n try:\n return self.maps[0].pop(key, *args)\n except KeyError:\n raise KeyError('Key not found in the first mapping: {!r}'.format(key))", "metadata": "root.ChainMap.pop", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 826 }, { "content": " def clear(self):\n 'Clear maps[0], leaving maps[1:] intact.'\n self.maps[0].clear()", "metadata": "root.ChainMap.clear", "header": "['class', 'ChainMap', '(', 'MutableMapping', ')', ':', '___EOS___']", "index": 833 }, { "content": "def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,\n source_address=None):\n \"\"\"Backport of 3-argument create_connection() for Py2.6.\n\n Connect to *address* and return the socket object.\n\n Convenience function. Connect to *address* (a 2-tuple ``(host,\n port)``) and return the socket object. Passing the optional\n *timeout* parameter will set the timeout on the socket instance\n before attempting to connect. If no *timeout* is supplied, the\n global default timeout setting returned by :func:`getdefaulttimeout`\n is used. If *source_address* is set it must be a tuple of (host, port)\n for the socket to bind as a source address before making the connection.\n An host of '' or port 0 tells the OS to use the default.\n \"\"\"\n\n host, port = address\n err = None\n for res in getaddrinfo(host, port, 0, SOCK_STREAM):\n af, socktype, proto, canonname, sa = res\n sock = None\n try:\n sock = socket(af, socktype, proto)\n if timeout is not _GLOBAL_DEFAULT_TIMEOUT:\n sock.settimeout(timeout)\n if source_address:\n sock.bind(source_address)\n sock.connect(sa)\n return sock\n\n except error as _:\n err = _\n if sock is not None:\n sock.close()\n\n if err is not None:\n raise err\n else:\n raise error(\"getaddrinfo returns an empty list\")", "metadata": "root.create_connection", "header": "['module', '___EOS___']", "index": 843 } ]
[ { "span": "from future.utils import iteritems, itervalues, PY26, PY3", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 57 }, { "span": "from itertools import islice", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 28 }, { "span": "from operator import itemgetter", "start_line": 302, "start_column": 4, "end_line": 302, "end_column": 35 }, { "span": "from heapq import nlargest", "start_line": 303, "start_column": 4, "end_line": 303, "end_column": 30 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Mis", "cell", "ane", "ous", " ", "function", " ", "(", "re", ")", "definit", "ion", "s", " ", "from", " ", "the", " ", "Py", "3.4", "+", " ", "standard", " ", "librar", "y", "\\", "10", ";", "for", " ", "Pyth", "on", " ", "2.6", "/", "2.7", ".", "\\", "10", ";", "\\", "10", ";", "-", " ", "math", ".", "ceil", " ", " ", " ", " ", "(", "for", " ", "Pyth", "on", " ", "2.7", ")", "\\", "10", ";", "-", " ", "collection", "s", ".", "Order", "ed", "Dict", " ", " ", "(", "for", " ", "Pyth", "on", " ", "2.6", ")", "\\", "10", ";", "-", " ", "collection", "s", ".", "Counter", " ", " ", "(", "for", " ", "Pyth", "on", " ", "2.6", ")", "\\", "10", ";", "-", " ", "collection", "s", ".", "Chain", "Map", " ", "(", "for", " ", "all", " ", "version", "s", " ", "prior", " ", "to", " ", "Pyth", "on", " ", "3.3", ")", "\\", "10", ";", "-", " ", "iter", "tool", "s", ".", "count", " ", " ", "(", "for", " ", "Pyth", "on", " ", "2.6", ",", " ", "with", " ", "step", " ", "parameter", ")", "\\", "10", ";", "-", " ", "subproc", "ess", ".", "check", "\\u", "output", " ", " ", "(", "for", " ", "Pyth", "on", " ", "2.6", ")", "\\", "10", ";", "-", " ", "repr", "lib", ".", "recurs", "ive", "\\u", "repr", " ", " ", " ", "(", "for", " ", "Pyth", "on", " ", "2.6", "+)", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "math_", "import_", "ceil_", "as_", "oldc", "eil", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "Mapping_", ",_", "Mut", "able", "Mapping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "operator_", "import_", "itemgetter_", "as_", "\\u", "itemgetter_", ",_", "eq_", "as_", "\\u", "eq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "heapq_", "as_", "\\u", "heapq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u", "weakref_", "import_", "proxy_", "as_", "\\u", "proxy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "repeat_", "as_", "\\u", "repeat_", ",_", "chain_", "as_", "\\u", "chain_", ",_", "star", "map_", "as_", "\\u", "star", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "socket_", "import_", "getadd", "rin", "fo_", ",_", "SOCK", "\\u", "STREAM_", ",_", "error_", ",_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "future_", "._", "utils_", "import_", "iteritems_", ",_", "itervalues_", ",_", "PY", "26_", ",_", "PY", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", " ", "repr", "lib", ".", "recurs", "ive", "\\u", "repr", " ", "decorat", "or", " ", "from", " ", "Py", "3.4", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "itertools_", "import_", "islice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "PY", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "\\u", "thread_", "import_", "get", "\\u", "ident_", "\\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_", "\\u", "dummy", "\\u", "thread_", "import_", "get", "\\u", "ident_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "thread_", "import_", "get", "\\u", "ident_", "\\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_", "dummy", "\\u", "thread_", "import_", "get", "\\u", "ident_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "###", " ", "Order", "ed", "Dict_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "{{", "{", " ", "http", "://", "code", ".", "active", "state", ".", "com", "/", "recip", "es", "/", "576", "611", "/", " ", "(", "r1", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "operator_", "import_", "itemgetter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "heapq_", "import_", "nla", "rge", "st_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", " ", "Counter_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", " ", "Chain", "Map", " ", "(", "help", "er", " ", "for", " ", "config", "parser", " ", "and", " ", "string", ".", "Templa", "te", ")_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", " ", "Fro", "m", " ", "the", " ", "Py", "3.4", " ", "source", " ", "code", ".", " ", "See", " ", "als", "o", ":_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", " ", " ", " ", "https", "://", "git", "hub", ".", "com", "/", "kk", "xu", "e", "/", "Py", "2", "Chain", "Map", "/", "blob", "/", "master", "/", "py2", "chain", "map", ".", "py_", "\\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_", "#", " ", "Re", "-", "use", " ", "the", " ", "same", " ", "sentinel", " ", "as", " ", "in", " ", "the", " ", "Pyth", "on", " ", "stdlib", " ", "socket", " ", "module", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "socket_", "import_", "\\u", "GLOB", "AL", "\\u", "DEF", "AUL", "T", "\\u", "TIMEOUT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wa", "s", ":", " ", "\\u", "GLOB", "AL", "\\u", "DEF", "AUL", "T", "\\u", "TIME", "OUT", " ", "=", " ", "object", "()", "_", "\\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_", "#", " ", "Back", " ", "up", " ", "our", " ", "definit", "ion", "s", " ", "above", " ", "in", " ", "case", " ", "the", "y", "'", "re", " ", "usef", "ul_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "Order", "ed", "Dict_", "=_", "Order", "ed", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Counter_", "=_", "Counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "\\u", "output_", "=_", "check", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "count_", "=_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "ceil_", "=_", "ceil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "count", "\\u", "elements_", "=_", "\\u", "count", "\\u", "elements_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "recurs", "ive", "\\u", "repr_", "=_", "recurs", "ive", "\\u", "repr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Chain", "Map_", "=_", "Chain", "Map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "create", "\\u", "connection_", "=_", "create", "\\u", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Over", "write", " ", "the", " ", "definit", "ion", "s", " ", "above", " ", "with", " ", "the", " ", "usual", " ", "ones_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "the", " ", "standard", " ", "librar", "y", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "2_", ",_", "7_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "collections_", "import_", "Order", "ed", "Dict_", ",_", "Counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "subprocess_", "import_", "check", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "socket_", "import_", "create", "\\u", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "3_", ",_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "math_", "import_", "ceil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "\\u", "count", "\\u", "elements_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "3_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "repr", "lib_", "import_", "recurs", "ive", "\\u", "repr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "Chain", "Map_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "ceil_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "ceil", "ing", " ", "of", " ", "x", " ", "as", " ", "an", " ", "int", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "the", " ", "smallest", " ", "integral", " ", "value", " ", ">=", " ", "x", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "int_", "(_", "oldc", "eil", "_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recurs", "ive", "\\u", "repr_", "(_", "fill", "value_", "=_", "'...'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Decorat", "or", " ", "to", " ", "make", " ", "a", " ", "repr", " ", "function", " ", "return", " ", "fill", "value", " ", "for", " ", "a", " ", "recurs", "ive", " ", "call", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "decorat", "ing", "\\u", "function_", "(_", "user", "\\u", "function_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repr", "\\u", "running_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "wrapper_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "id_", "(_", "self_", ")_", ",_", "get", "\\u", "ident_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "in_", "repr", "\\u", "running_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fill", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "repr", "\\u", "running_", "._", "add_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "user", "\\u", "function_", "(_", "self_", ")_", "\\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 ", " _", "repr", "\\u", "running_", "._", "discard_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Can", "'", "t", " ", "use", " ", "functo", "ols", ".", "wrap", "s", "()", " ", "here", " ", "bec", "aus", "e", " ", "of", " ", "boots", "trap", " ", "issues_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wrapper_", "._", "\\u\\u", "module\\u\\u_", "=_", "getattr_", "(_", "user", "\\u", "function_", ",_", "'\\u", "\\u", "module", "\\u\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wrapper_", "._", "\\u\\u", "doc\\u\\u_", "=_", "getattr_", "(_", "user", "\\u", "function_", ",_", "'\\u", "\\u", "doc", "\\u\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wrapper_", "._", "\\u\\u", "name\\u\\u_", "=_", "getattr_", "(_", "user", "\\u", "function_", ",_", "'\\u", "\\u", "name", "\\u\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wrapper_", "._", "\\u\\u", "annotations\\u", "\\u_", "=_", "getattr_", "(_", "user", "\\u", "function_", ",_", "'\\u", "\\u", "annotations\\u", "\\u'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "decorat", "ing", "\\u", "function_", "\\u\\u\\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_", "\\u", "Link_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "slots\\u\\u_", "=_", "'", "prev", "'_", ",_", "'", "next", "'_", ",_", "'", "key", "'_", ",_", "'\\u", "\\u", "weak", "ref", "\\u\\u'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Dict", "ionar", "y", " ", "tha", "t", " ", "remember", "s", " ", "insertion", " ", "order", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "An", " ", "inherited", " ", "dict", " ", "maps", " ", "keys", " ", "to", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "inherited", " ", "dict", " ", "provide", "s", " ", "\\u\\u", "getitem", "\\u\\u", ",", " ", "\\u\\u", "len", "\\u\\u", ",", " ", "\\u\\u", "contain", "s", "\\u\\u", ",", " ", "and", " ", "get", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "rema", "inin", "g", " ", "method", "s", " ", "are", " ", "order", "-", "awa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Big", "-", "O", " ", "runn", "ing", " ", "times", " ", "for", " ", "all", " ", "method", "s", " ", "are", " ", "the", " ", "same", " ", "as", " ", "regular", " ", "dictionar", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "internal", " ", "self", ".\\u", "\\u", "map", " ", "dict", " ", "maps", " ", "keys", " ", "to", " ", "link", "s", " ", "in", " ", "a", " ", "dou", "bly", " ", "linked", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "circular", " ", "dou", "bly", " ", "linked", " ", "list", " ", "starts", " ", "and", " ", "ends", " ", "with", " ", "a", " ", "sentinel", " ", "element", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "sentinel", " ", "element", " ", "neve", "r", " ", "gets", " ", "delete", "d", " ", "(", "this", " ", "simpli", "fie", "s", " ", "the", " ", "algo", "rit", "hm", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "sentinel", " ", "is", " ", "in", " ", "self", ".\\u", "\\u", "hard", "root", " ", "with", " ", "a", " ", "weak", "ref", " ", "proxy", " ", "in", " ", "self", ".\\u", "\\u", "root", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "prev", " ", "link", "s", " ", "are", " ", "weak", "ref", " ", "prox", "ies", " ", "(", "to", " ", "prevent", " ", "circular", " ", "reference", "s", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Individual", " ", "link", "s", " ", "are", " ", "kep", "t", " ", "alive", " ", "by", " ", "the", " ", "hard", " ", "reference", " ", "in", " ", "self", ".\\u", "\\u", "map", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tho", "se", " ", "hard", " ", "reference", "s", " ", "disapp", "ear", " ", "whe", "n", " ", "a", " ", "key", " ", "is", " ", "delete", "d", " ", "from", " ", "an", " ", "Order", "ed", "Dict", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "update_", "=_", "\\u\\u", "update_", "=_", "Mut", "able", "Mapping_", "._", "update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "=_", "Mut", "able", "Mapping_", "._", "keys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "Mut", "able", "Mapping_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "=_", "Mut", "able", "Mapping_", "._", "items_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "ne\\u\\u_", "=_", "Mut", "able", "Mapping_", "._", "\\u\\u", "ne\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "marker_", "=_", "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_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Initializ", "e", " ", "an", " ", "order", "ed", " ", "dictionar", "y", ".", " ", " ", "The", " ", "signa", "ture", " ", "is", " ", "the", " ", "same", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "regular", " ", "dictionar", "ies", ",", " ", "but", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "are", " ", "not", " ", "recommende", "d", " ", "bec", "aus", "e", "\\", "10", ";", " ", " ", " ", " ", "thei", "r", " ", "insertion", " ", "order", " ", "is", " ", "arbitra", "ry", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "descrip", "tor", " ", "'\\u", "\\u", "init", "\\u\\u'", " ", "of", " ", "'", "Order", "ed", "Dict", "'", " ", "object", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "need", "s", " ", "an", " ", "argu", "ment", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "args_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'", "expected", " ", "at", " ", "most", " ", "1", " ", "argu", "ment", "s", ",", " ", "got", " ", "%", "d", "'_", "%_", "len_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "hard", "root_", "=_", "\\u", "Link_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "root_", "=_", "root_", "=_", "\\u", "proxy_", "(_", "self_", "._", "\\u\\u", "hard", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "prev_", "=_", "root_", "._", "next_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "map_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u\\u", "update_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setitem\\u\\u_", "(_", "self_", ",_", "key_", ",_", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dict", "\\u", "setitem", "_", "=_", "dict_", "._", "\\u\\u", "setitem\\u\\u_", ",_", "proxy_", "=_", "\\u", "proxy_", ",_", "Link_", "=_", "\\u", "Link_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "od", ".\\u", "\\u", "setitem", "\\u\\u", "(", "i", ",", " ", "y", ")", " ", "<=", "=>", " ", "od", "[", "i", "]=", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sett", "ing", " ", "a", " ", "new", " ", "item", " ", "create", "s", " ", "a", " ", "new", " ", "link", " ", "at", " ", "the", " ", "end", " ", "of", " ", "the", " ", "linked", " ", "list", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "the", " ", "inherited", " ", "dictionar", "y", " ", "is", " ", "update", "d", " ", "with", " ", "the", " ", "new", " ", "key", "/", "value", " ", "pair", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "key_", "not_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "map_", "[_", "key_", "]_", "=_", "link_", "=_", "Link_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "self_", "._", "\\u\\u", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last_", "=_", "root_", "._", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "._", "prev_", ",_", "link_", "._", "next_", ",_", "link_", "._", "key_", "=_", "last_", ",_", "root_", ",_", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last_", "._", "next_", "=_", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "prev_", "=_", "proxy_", "(_", "link_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dict", "\\u", "setitem", "_", "(_", "self_", ",_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "delitem\\u\\u_", "(_", "self_", ",_", "key_", ",_", "dict", "\\u", "deli", "tem_", "=_", "dict_", "._", "\\u\\u", "delitem\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "od", ".\\u", "\\u", "deli", "tem", "\\u\\u", "(", "y", ")", " ", "<=", "=>", " ", "del", " ", "od", "[", "y", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "an", " ", "exist", "ing", " ", "item", " ", "use", "s", " ", "self", ".\\u", "\\u", "map", " ", "to", " ", "find", " ", "the", " ", "link", " ", "whi", "ch", " ", "gets", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", "d", " ", "by", " ", "updat", "ing", " ", "the", " ", "link", "s", " ", "in", " ", "the", " ", "predecessor", " ", "and", " ", "successor", " ", "nodes", "._", "\\u\\u\\uNL\\u\\u\\u_", "dict", "\\u", "deli", "tem_", "(_", "self_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "self_", "._", "\\u\\u", "map_", "._", "pop_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "prev_", "=_", "link_", "._", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "next_", "=_", "link_", "._", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "prev_", "._", "next_", "=_", "link", "\\u", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "next_", "._", "prev_", "=_", "link", "\\u", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\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 ", " _", "'", "od", ".\\u", "\\u", "iter", "\\u\\u()", " ", "<=", "=>", " ", "iter", "(", "od", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Travers", "e", " ", "the", " ", "linked", " ", "list", " ", "in", " ", "order", "._", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "self_", "._", "\\u\\u", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curr_", "=_", "root_", "._", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "curr_", "is_", "not_", "root_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "curr_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curr_", "=_", "curr_", "._", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\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", "reverse", "d\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "od", ".\\u", "\\u", "reverse", "d\\u", "\\u(", ")", " ", "<=", "=>", " ", "reverse", "d", "(", "od", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Travers", "e", " ", "the", " ", "linked", " ", "list", " ", "in", " ", "reverse", " ", "order", "._", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "self_", "._", "\\u\\u", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curr_", "=_", "root_", "._", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "curr_", "is_", "not_", "root_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "curr_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curr_", "=_", "curr_", "._", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\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_", "clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "od", ".", "clear", "()", " ", "->", " ", "Non", "e", ".", " ", " ", "Remove", " ", "all", " ", "items", " ", "from", " ", "od", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "self_", "._", "\\u\\u", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "prev_", "=_", "root_", "._", "next_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "map_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dict_", "._", "clear_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "popi", "tem_", "(_", "self_", ",_", "last_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "od", ".", "popi", "tem", "()", " ", "->", " ", "(", "k", ",", " ", "v", "),", " ", "return", " ", "and", " ", "remove", " ", "a", " ", "(", "key", ",", " ", "value", ")", " ", "pair", ".", "\\", "10", ";", " ", " ", " ", " ", "Pair", "s", " ", "are", " ", "return", "ed", " ", "in", " ", "LIF", "O", " ", "order", " ", "if", " ", "last", " ", "is", " ", "true", " ", "or", " ", "FIFO", " ", "order", " ", "if", " ", "fal", "se", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "'", "dictionar", "y", " ", "is", " ", "empty", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root_", "=_", "self_", "._", "\\u\\u", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link_", "=_", "root_", "._", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "prev_", "=_", "link_", "._", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "prev_", "._", "next_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "prev_", "=_", "link", "\\u", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link_", "=_", "root_", "._", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "next_", "=_", "link_", "._", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "next_", "=_", "link", "\\u", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "next_", "._", "prev_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "key_", "=_", "link_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "self_", "._", "\\u\\u", "map_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "dict_", "._", "pop_", "(_", "self_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "key_", ",_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "move", "\\u", "to", "\\u", "end_", "(_", "self_", ",_", "key_", ",_", "last_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Move", " ", "an", " ", "exist", "ing", " ", "element", " ", "to", " ", "the", " ", "end", " ", "(", "or", " ", "beginn", "ing", " ", "if", " ", "last", "==", "Fal", "se", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", " ", "Key", "Error", " ", "if", " ", "the", " ", "element", " ", "doe", "s", " ", "not", " ", "exist", ".", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "last", "=", "Tru", "e", ",", " ", "acts", " ", "like", " ", "a", " ", "fast", " ", "version", " ", "of", " ", "self", "[", "key", "]=", "self", ".", "pop", "(", "key", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "self_", "._", "\\u\\u", "map_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "prev_", "=_", "link_", "._", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "next_", "=_", "link_", "._", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "prev_", "._", "next_", "=_", "link", "\\u", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "next_", "._", "prev_", "=_", "link", "\\u", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "self_", "._", "\\u\\u", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last_", "=_", "root_", "._", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "._", "prev_", "=_", "last_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "._", "next_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last_", "._", "next_", "=_", "root_", "._", "prev_", "=_", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "first_", "=_", "root_", "._", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "._", "prev_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "._", "next_", "=_", "first_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "next_", "=_", "first_", "._", "prev_", "=_", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\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", "size", "of", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sizeof_", "=_", "sys_", "._", "gets", "ize", "of_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "len_", "(_", "self_", ")_", "+_", "1_", "#", " ", "number", " ", "of", " ", "link", "s", " ", "inclu", "ding", " ", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "sizeof_", "(_", "self_", "._", "\\u\\u", "dict\\u\\u_", ")_", "#", " ", "instance", " ", "dictionary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "+=_", "sizeof_", "(_", "self_", "._", "\\u\\u", "map_", ")_", "*_", "2_", "#", " ", "internal", " ", "dict", " ", "and", " ", "inherited", " ", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "+=_", "sizeof_", "(_", "self_", "._", "\\u\\u", "hard", "root_", ")_", "*_", "n_", "#", " ", "link", " ", "objects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "+=_", "sizeof_", "(_", "self_", "._", "\\u\\u", "root_", ")_", "*_", "n_", "#", " ", "proxy", " ", "objects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "pop_", "(_", "self_", ",_", "key_", ",_", "default_", "=_", "\\u\\u", "marker_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "od", ".", "pop", "(", "k", "[", ",", "d", "])", " ", "->", " ", "v", ",", " ", "remove", " ", "specified", " ", "key", " ", "and", " ", "return", " ", "the", " ", "correspond", "ing", "\\", "10", ";", " ", " ", " ", " ", "value", ".", " ", " ", "If", " ", "key", " ", "is", " ", "not", " ", "found", ",", " ", "d", " ", "is", " ", "return", "ed", " ", "if", " ", "give", "n", ",", " ", "other", "wis", "e", " ", "Key", "Error", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "raise", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "self_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "default_", "is_", "self_", "._", "\\u\\u", "marker_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setdefault_", "(_", "self_", ",_", "key_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "od", ".", "setdefault", "(", "k", "[", ",", "d", "])", " ", "->", " ", "od", ".", "get", "(", "k", ",", "d", "),", " ", "als", "o", " ", "set", " ", "od", "[", "k", "]=", "d", " ", "if", " ", "k", " ", "not", " ", "in", " ", "od", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "[_", "key_", "]_", "=_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "recurs", "ive", "\\u", "repr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "od", ".\\u", "\\u", "repr", "\\u\\u()", " ", "<=", "=>", " ", "repr", "(", "od", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "()'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'%", "s", "(%", "r", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "list_", "(_", "self_", "._", "items_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "reduce", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Return", " ", "state", " ", "informati", "on", " ", "for", " ", "pick", "ling", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inst", "\\u", "dict_", "=_", "vars_", "(_", "self_", ")_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "vars_", "(_", "Order", "ed", "Dict_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inst", "\\u", "dict_", "._", "pop_", "(_", "k_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "(_", ")_", ",_", "inst", "\\u", "dict_", "or_", "None_", ",_", "None_", ",_", "iter_", "(_", "self_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "copy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "od", ".", "copy", "()", " ", "->", " ", "a", " ", "shallow", " ", "copy", " ", "of", " ", "od", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\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_", "fromkeys_", "(_", "cls_", ",_", "iterable_", ",_", "value_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "OD", ".", "from", "keys", "(", "S", "[", ",", " ", "v", "])", " ", "->", " ", "New", " ", "order", "ed", " ", "dictionar", "y", " ", "with", " ", "keys", " ", "from", " ", "S", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "not", " ", "specified", ",", " ", "the", " ", "value", " ", "default", "s", " ", "to", " ", "Non", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "=_", "cls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "iterable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Dict_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "od", ".\\u", "\\u", "eq", "\\u\\u", "(", "y", ")", " ", "<=", "=>", " ", "od", "==", "y", ".", " ", " ", "Compari", "son", " ", "to", " ", "anot", "her", " ", "OD", " ", "is", " ", "order", "-", "sensi", "tiv", "e", "\\", "10", ";", " ", " ", " ", " ", "whi", "le", " ", "compa", "ris", "on", " ", "to", " ", "a", " ", "regular", " ", "mapping", " ", "is", " ", "order", "-", "inse", "nsitive", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "other_", ",_", "Order", "ed", "Dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dict_", "._", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", "and_", "all_", "(_", "map_", "(_", "\\u", "eq_", ",_", "self_", ",_", "other_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dict_", "._", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", "\\u\\u\\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", "count", "\\u", "elements_", "(_", "mapping_", ",_", "iterable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Tal", "ly", " ", "element", "s", " ", "from", " ", "the", " ", "iterable", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mapping", "\\u", "get_", "=_", "mapping_", "._", "get_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", "in_", "iterable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mapping_", "[_", "elem_", "]_", "=_", "mapping", "\\u", "get_", "(_", "elem_", ",_", "0_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Dict", " ", "subclass", " ", "for", " ", "counti", "ng", " ", "hashable", " ", "items", ".", " ", " ", "Some", "times", " ", "call", "ed", " ", "a", " ", "bag", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "multis", "et", ".", " ", " ", "Element", "s", " ", "are", " ", "store", "d", " ", "as", " ", "dictionar", "y", " ", "keys", " ", "and", " ", "thei", "r", " ", "count", "s", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "store", "d", " ", "as", " ", "dictionar", "y", " ", "values", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "abcde", "abc", "dab", "cab", "a", "')", " ", " ", "#", " ", "count", " ", "element", "s", " ", "from", " ", "a", " ", "string", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", ".", "most", "\\u", "common", "(", "3", ")", " ", " ", " ", " ", "#", " ", "three", " ", "most", " ", "common", " ", "element", "s", "\\", "10", ";", " ", " ", " ", " ", "[(", "'", "a", "',", " ", "5", "),", " ", "('", "b", "',", " ", "4", "),", " ", "('", "c", "',", " ", "3", ")]", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "sorte", "d", "(", "c", ")", " ", " ", " ", " ", " ", "#", " ", "list", " ", "all", " ", "unique", " ", "element", "s", "\\", "10", ";", " ", " ", " ", " ", "['", "a", "',", " ", "'", "b", "',", " ", "'", "c", "',", " ", "'", "d", "',", " ", "'", "e", "']", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "''", ".", "join", "(", "sorte", "d", "(", "c", ".", "element", "s", "())", ")", " ", " ", " ", "#", " ", "list", " ", "element", "s", " ", "with", " ", "repetitions", "\\", "10", ";", " ", " ", " ", " ", "'", "aaaaa", "bbb", "bcc", "cdd", "e", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "sum", "(", "c", ".", "values", "())", " ", " ", " ", " ", " ", "#", " ", "total", " ", "of", " ", "all", " ", "count", "s", "\\", "10", ";", " ", " ", " ", " ", "15", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "['", "a", "']", " ", " ", " ", " ", "#", " ", "count", " ", "of", " ", "letter", " ", "'", "a", "'", "\\", "10", ";", " ", " ", " ", " ", "5", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "for", " ", "elem", " ", "in", " ", "'", "sha", "za", "m", "':", " ", " ", " ", "#", " ", "update", " ", "count", "s", " ", "from", " ", "an", " ", "iterable", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "c", "[", "elem", "]", " ", "+=", " ", "1", " ", " ", " ", " ", "#", " ", "by", " ", "addin", "g", " ", "1", " ", "to", " ", "each", " ", "element", "'", "s", " ", "count", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "['", "a", "']", " ", " ", " ", " ", "#", " ", "now", " ", "there", " ", "are", " ", "seven", " ", "'", "a", "'", "\\", "10", ";", " ", " ", " ", " ", "7", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "del", " ", "c", "['", "b", "']", " ", " ", " ", " ", "#", " ", "remove", " ", "all", " ", "'", "b", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "['", "b", "']", " ", " ", " ", " ", "#", " ", "now", " ", "there", " ", "are", " ", "zero", " ", "'", "b", "'", "\\", "10", ";", " ", " ", " ", " ", "0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "d", " ", "=", " ", "Counter", "('", "sims", "ala", "bi", "m", "')", " ", " ", " ", "#", " ", "make", " ", "anot", "her", " ", "counter", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", ".", "update", "(", "d", ")", " ", " ", " ", "#", " ", "add", " ", "in", " ", "the", " ", "second", " ", "counter", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "['", "a", "']", " ", " ", " ", " ", "#", " ", "now", " ", "there", " ", "are", " ", "nine", " ", "'", "a", "'", "\\", "10", ";", " ", " ", " ", " ", "9", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", ".", "clear", "()", " ", " ", " ", " ", " ", "#", " ", "empty", " ", "the", " ", "counter", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "\\", "10", ";", " ", " ", " ", " ", "Counter", "()", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", " ", " ", "If", " ", "a", " ", "count", " ", "is", " ", "set", " ", "to", " ", "zero", " ", "or", " ", "reduce", "d", " ", "to", " ", "zero", ",", " ", "it", " ", "will", " ", "rema", "in", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "counter", " ", "unti", "l", " ", "the", " ", "entry", " ", "is", " ", "delete", "d", " ", "or", " ", "the", " ", "counter", " ", "is", " ", "clear", "ed", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "aaa", "bb", "c", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "['", "b", "']", " ", "-=", " ", "2", " ", " ", " ", "#", " ", "reduce", " ", "the", " ", "count", " ", "of", " ", "'", "b", "'", " ", "by", " ", "two", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", ".", "most", "\\u", "common", "()", " ", " ", " ", " ", " ", "#", " ", "'", "b", "'", " ", "is", " ", "still", " ", "in", ",", " ", "but", " ", "its", " ", "count", " ", "is", " ", "zero", "\\", "10", ";", " ", " ", " ", " ", "[(", "'", "a", "',", " ", "3", "),", " ", "('", "c", "',", " ", "1", "),", " ", "('", "b", "',", " ", "0", ")]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Reference", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "http", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "Multi", "set_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "http", "://", "www", ".", "gnu", ".", "org", "/", "software", "/", "small", "talk", "/", "manu", "al", "-", "base", "/", "html", "\\u", "node", "/", "Bag", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "http", "://", "www", ".", "demo", "2s", ".", "com", "/", "Tu", "tori", "al", "/", "Cp", "p", "/", "038", "0", "\\u\\u", "set", "-", "multis", "et", "/", "Catalog", "038", "0", "\\u\\u", "set", "-", "multis", "et", ".", "ht", "m_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "http", "://", "code", ".", "active", "state", ".", "com", "/", "recip", "es", "/", "259", "174", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Kn", "uth", ",", " ", "TA", "OC", "P", " ", "Vol", ".", " ", "II", " ", "section", " ", "4.6", ".3_", "\\u\\u\\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_", "#", " ", "Override", " ", "dict", " ", "method", "s", " ", "where", " ", "necessar", "y_", "\\u\\u\\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_", "#", " ", "Multi", "set", "-", "style", " ", "mathe", "matical", " ", "operati", "ons", " ", "discuss", "ed", " ", "in", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Kn", "uth", " ", "TA", "OC", "P", " ", "Volume", " ", "II", " ", "section", " ", "4.6", ".3", " ", "exercise", " ", "19_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "and", " ", "at", " ", "http", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "Multi", "set_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", "s", " ", "guaran", "tee", "d", " ", "to", " ", "only", " ", "include", " ", "posit", "ive", " ", "count", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "strip", " ", "negati", "ve", " ", "and", " ", "zero", " ", "count", "s", ",", " ", "add", "-", "in", " ", "an", " ", "empty", " ", "counter", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "c", " ", "+=", " ", "Counter", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Creat", "e", " ", "a", " ", "new", ",", " ", "empty", " ", "Counter", " ", "object", ".", " ", " ", "And", " ", "if", " ", "give", "n", ",", " ", "count", " ", "element", "s", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "an", " ", "input", " ", "iterable", ".", " ", " ", "Or", ",", " ", "initialize", " ", "the", " ", "count", " ", "from", " ", "anot", "her", " ", "mapping", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "element", "s", " ", "to", " ", "thei", "r", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "()", " ", " ", " ", " ", " ", "#", " ", "a", " ", "new", ",", " ", "empty", " ", "counter", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "gall", "aha", "d", "')", " ", " ", " ", " ", " ", "#", " ", "a", " ", "new", " ", "counter", " ", "from", " ", "an", " ", "iterable", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "({", "'", "a", "':", " ", "4", ",", " ", "'", "b", "':", " ", "2", "})", " ", " ", " ", "#", " ", "a", " ", "new", " ", "counter", " ", "from", " ", "a", " ", "mapping", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "(", "a", "=", "4", ",", " ", "b", "=", "2", ")", " ", "#", " ", "a", " ", "new", " ", "counter", " ", "from", " ", "keyw", "ord", " ", "args", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "descrip", "tor", " ", "'\\u", "\\u", "init", "\\u\\u'", " ", "of", " ", "'", "Counter", "'", " ", "object", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "need", "s", " ", "an", " ", "argu", "ment", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "args_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'", "expected", " ", "at", " ", "most", " ", "1", " ", "argu", "ment", "s", ",", " ", "got", " ", "%", "d", "'_", "%_", "len_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Counter_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "missi", "ng", "\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "The", " ", "count", " ", "of", " ", "element", "s", " ", "not", " ", "in", " ", "the", " ", "Counter", " ", "is", " ", "zero", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Needed", " ", "so", " ", "tha", "t", " ", "self", "[", "missi", "ng", "\\u", "item", "]", " ", "doe", "s", " ", "not", " ", "raise", " ", "Key", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "most", "\\u", "common_", "(_", "self_", ",_", "n_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "List", " ", "the", " ", "n", " ", "most", " ", "common", " ", "element", "s", " ", "and", " ", "thei", "r", " ", "count", "s", " ", "from", " ", "the", " ", "most", "\\", "10", ";", " ", " ", " ", " ", "common", " ", "to", " ", "the", " ", "leas", "t", ".", " ", " ", "If", " ", "n", " ", "is", " ", "Non", "e", ",", " ", "then", " ", "list", " ", "all", " ", "element", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "Counter", "('", "abcde", "abc", "dab", "cab", "a", "')", ".", "most", "\\u", "common", "(", "3", ")", "\\", "10", ";", " ", " ", " ", " ", "[(", "'", "a", "',", " ", "5", "),", " ", "('", "b", "',", " ", "4", "),", " ", "('", "c", "',", " ", "3", ")]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Emulat", "e", " ", "Bag", ".", "sorte", "d", "By", "Count", " ", "from", " ", "Small", "talk", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "n_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "sorted_", "(_", "self_", "._", "items_", "(_", ")_", ",_", "key_", "=_", "\\u", "itemgetter_", "(_", "1_", ")_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u", "heapq_", "._", "nla", "rge", "st_", "(_", "n_", ",_", "self_", "._", "items_", "(_", ")_", ",_", "key_", "=_", "\\u", "itemgetter_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "elements_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Iterat", "or", " ", "over", " ", "element", "s", " ", "repeatin", "g", " ", "each", " ", "as", " ", "many", " ", "times", " ", "as", " ", "its", " ", "count", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "ABC", "ABC", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "sorte", "d", "(", "c", ".", "element", "s", "())", "\\", "10", ";", " ", " ", " ", " ", "['", "A", "',", " ", "'", "A", "',", " ", "'", "B", "',", " ", "'", "B", "',", " ", "'", "C", "',", " ", "'", "C", "']", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "Kn", "uth", "'", "s", " ", "example", " ", "for", " ", "prim", "e", " ", "factor", "s", " ", "of", " ", "183", "6", ":", " ", " ", "2", "**", "2", " ", "*", " ", "3", "**", "3", " ", "*", " ", "1", "7", "**", "1", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "prim", "e\\u", "factor", "s", " ", "=", " ", "Counter", "({", "2", ":", " ", "2", ",", " ", "3", ":", " ", "3", ",", " ", "1", "7", ":", " ", "1", "})", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "product", " ", "=", " ", "1", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "for", " ", "factor", " ", "in", " ", "prim", "e\\u", "factor", "s", ".", "element", "s", "():", " ", "#", " ", "loop", " ", "over", " ", "factor", "s", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "product", " ", "*=", " ", "factor", " ", " ", " ", " ", " ", "#", " ", "and", " ", "multipl", "y", " ", "them", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "product", "\\", "10", ";", " ", " ", " ", " ", "183", "6", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ",", " ", "if", " ", "an", " ", "element", "'", "s", " ", "count", " ", "has", " ", "bee", "n", " ", "set", " ", "to", " ", "zero", " ", "or", " ", "is", " ", "a", " ", "negati", "ve", "\\", "10", ";", " ", " ", " ", " ", "number", ",", " ", "element", "s", "()", " ", "will", " ", "ignore", " ", "it", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Emulat", "e", " ", "Bag", ".", "do", " ", "from", " ", "Small", "talk", " ", "and", " ", "Multi", "set", ".", "begin", " ", "from", " ", "C", "++", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\\u", "chain_", "._", "from", "\\u", "iterable_", "(_", "\\u", "star", "map_", "(_", "\\u", "repeat_", ",_", "self_", "._", "items_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\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_", "fromkeys_", "(_", "cls_", ",_", "iterable_", ",_", "v_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "There", " ", "is", " ", "no", " ", "equivalent", " ", "method", " ", "for", " ", "counter", "s", " ", "bec", "aus", "e", " ", "setti", "ng", " ", "v", "=", "1_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "means", " ", "tha", "t", " ", "no", " ", "element", " ", "can", " ", "have", " ", "a", " ", "count", " ", "great", "er", " ", "than", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Counter", ".", "from", "keys", "()", " ", "is", " ", "undefined", ".", " ", " ", "Us", "e", " ", "Counter", "(", "iterable", ")", " ", "inst", "ead", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Lik", "e", " ", "dict", ".", "update", "()", " ", "but", " ", "add", " ", "count", "s", " ", "inst", "ead", " ", "of", " ", "repla", "cing", " ", "them", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sou", "rce", " ", "can", " ", "be", " ", "an", " ", "iterable", ",", " ", "a", " ", "dictionar", "y", ",", " ", "or", " ", "anot", "her", " ", "Counter", " ", "instance", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "whi", "ch", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", ".", "update", "('", "witch", "')", " ", " ", " ", "#", " ", "add", " ", "element", "s", " ", "from", " ", "anot", "her", " ", "iterable", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "d", " ", "=", " ", "Counter", "('", "watch", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", ".", "update", "(", "d", ")", " ", " ", " ", " ", " ", "#", " ", "add", " ", "element", "s", " ", "from", " ", "anot", "her", " ", "counter", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "['", "h", "']", " ", " ", " ", " ", "#", " ", "four", " ", "'", "h", "'", " ", "in", " ", "whi", "ch", ",", " ", "witch", ",", " ", "and", " ", "watch", "\\", "10", ";", " ", " ", " ", " ", "4", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "regular", " ", "dict", ".", "update", "()", " ", "operati", "on", " ", "make", "s", " ", "no", " ", "sense", " ", "here", " ", "bec", "aus", "e", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "replace", " ", "behavior", " ", "results", " ", "in", " ", "the", " ", "some", " ", "of", " ", "original", " ", "unto", "uche", "d", " ", "counts_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bei", "ng", " ", "mixed", "-", "in", " ", "with", " ", "all", " ", "of", " ", "the", " ", "other", " ", "count", "s", " ", "for", " ", "a", " ", "mism", "ash", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "doe", "sn", "'", "t", " ", "have", " ", "a", " ", "straight", "-", "forward", " ", "interpretation", " ", "in", " ", "most", " ", "counti", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "context", "s", ".", " ", " ", "Ins", "tea", "d", ",", " ", "we", " ", "implement", " ", "straight", "-", "addition", ".", " ", " ", "Bot", "h", " ", "the", " ", "inputs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "output", "s", " ", "are", " ", "allow", "ed", " ", "to", " ", "contain", " ", "zero", " ", "and", " ", "negati", "ve", " ", "count", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "descrip", "tor", " ", "'", "update", "'", " ", "of", " ", "'", "Counter", "'", " ", "object", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "need", "s", " ", "an", " ", "argu", "ment", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "args_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'", "expected", " ", "at", " ", "most", " ", "1", " ", "argu", "ment", "s", ",", " ", "got", " ", "%", "d", "'_", "%_", "len_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iterable_", "=_", "args_", "[_", "0_", "]_", "if_", "args_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "iterable_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "iterable_", ",_", "Mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self", "\\u", "get_", "=_", "self_", "._", "get_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "iterable_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "[_", "elem_", "]_", "=_", "count_", "+_", "self", "\\u", "get_", "(_", "elem_", ",_", "0_", ")_", "\\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 ", " ", "_", "super_", "(_", "Counter_", ",_", "self_", ")_", "._", "update_", "(_", "iterable_", ")_", "#", " ", "fast", " ", "path", " ", "whe", "n", " ", "counter", " ", "is", " ", "empty_", "\\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", "count", "\\u", "elements_", "(_", "self_", ",_", "iterable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "kwds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "update_", "(_", "kwds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\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_", "subtract_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Lik", "e", " ", "dict", ".", "update", "()", " ", "but", " ", "subtract", "s", " ", "count", "s", " ", "inst", "ead", " ", "of", " ", "repla", "cing", " ", "them", ".", "\\", "10", ";", " ", " ", " ", " ", "Count", "s", " ", "can", " ", "be", " ", "reduce", "d", " ", "belo", "w", " ", "zero", ".", " ", " ", "Bot", "h", " ", "the", " ", "inputs", " ", "and", " ", "output", "s", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "allow", "ed", " ", "to", " ", "contain", " ", "zero", " ", "and", " ", "negati", "ve", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sou", "rce", " ", "can", " ", "be", " ", "an", " ", "iterable", ",", " ", "a", " ", "dictionar", "y", ",", " ", "or", " ", "anot", "her", " ", "Counter", " ", "instance", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "whi", "ch", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", ".", "subtract", "('", "witch", "')", " ", " ", " ", " ", " ", "#", " ", "subtract", " ", "element", "s", " ", "from", " ", "anot", "her", " ", "iterable", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", ".", "subtract", "(", "Counter", "('", "watch", "'))", " ", " ", " ", " ", "#", " ", "subtract", " ", "element", "s", " ", "from", " ", "anot", "her", " ", "counter", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "['", "h", "']", " ", " ", " ", " ", "#", " ", "2", " ", "in", " ", "whi", "ch", ",", " ", "minu", "s", " ", "1", " ", "in", " ", "witch", ",", " ", "minu", "s", " ", "1", " ", "in", " ", "watch", "\\", "10", ";", " ", " ", " ", " ", "0", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "['", "w", "']", " ", " ", " ", " ", "#", " ", "1", " ", "in", " ", "whi", "ch", ",", " ", "minu", "s", " ", "1", " ", "in", " ", "witch", ",", " ", "minu", "s", " ", "1", " ", "in", " ", "watch", "\\", "10", ";", " ", " ", " ", " ", "-1", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "descrip", "tor", " ", "'", "subtract", "'", " ", "of", " ", "'", "Counter", "'", " ", "object", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "need", "s", " ", "an", " ", "argu", "ment", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "args_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'", "expected", " ", "at", " ", "most", " ", "1", " ", "argu", "ment", "s", ",", " ", "got", " ", "%", "d", "'_", "%_", "len_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iterable_", "=_", "args_", "[_", "0_", "]_", "if_", "args_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "iterable_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self", "\\u", "get_", "=_", "self_", "._", "get_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "iterable_", ",_", "Mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "elem_", ",_", "count_", "in_", "iterable_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "[_", "elem_", "]_", "=_", "self", "\\u", "get_", "(_", "elem_", ",_", "0_", ")_", "-_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "elem_", "in_", "iterable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "[_", "elem_", "]_", "=_", "self", "\\u", "get_", "(_", "elem_", ",_", "0_", ")_", "-_", "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_", "kwds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "subtract_", "(_", "kwds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\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_", "copy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Return", " ", "a", " ", "shallow", " ", "copy", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "reduce", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "(_", "dict_", "(_", "self_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "delitem\\u\\u_", "(_", "self_", ",_", "elem_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Lik", "e", " ", "dict", ".\\u", "\\u", "deli", "tem", "\\u\\u()", " ", "but", " ", "doe", "s", " ", "not", " ", "raise", " ", "Key", "Error", " ", "for", " ", "missi", "ng", " ", "values", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "elem_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Counter_", ",_", "self_", ")_", "._", "\\u\\u", "delitem\\u\\u_", "(_", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\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", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "()'_", "%_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "=_", "',", " ", "'_", "._", "join_", "(_", "map_", "(_", "'%", "r", ":", " ", "%", "r", "'_", "._", "\\u\\u", "mod", "\\u\\u_", ",_", "self_", "._", "most", "\\u", "common_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "({", "%", "s", "})'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "handle", " ", "case", " ", "where", " ", "values", " ", "are", " ", "not", " ", "order", "able_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'{", "0", "}(", "{", "1", "!", "r", "})'_", "._", "format_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "dict_", "(_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "add\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Add", " ", "count", "s", " ", "from", " ", "two", " ", "counter", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "Counter", "('", "abb", "b", "')", " ", "+", " ", "Counter", "('", "bcc", "')", "\\", "10", ";", " ", " ", " ", " ", "Counter", "({", "'", "b", "':", " ", "4", ",", " ", "'", "c", "':", " ", "2", ",", " ", "'", "a", "':", " ", "1", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "other_", ",_", "Counter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Counter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "self_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newco", "unt_", "=_", "count_", "+_", "other_", "[_", "elem_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "newco", "unt_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "elem_", "]_", "=_", "newco", "unt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "other_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "elem_", "not_", "in_", "self_", "and_", "count_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "elem_", "]_", "=_", "count_", "\\u\\u\\uNEWLINE\\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_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sub\\u", "\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Subtract", " ", "count", ",", " ", "but", " ", "keep", " ", "only", " ", "results", " ", "with", " ", "posit", "ive", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "Counter", "('", "abb", "bc", "')", " ", "-", " ", "Counter", "('", "bcc", "d", "')", "\\", "10", ";", " ", " ", " ", " ", "Counter", "({", "'", "b", "':", " ", "2", ",", " ", "'", "a", "':", " ", "1", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "other_", ",_", "Counter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Counter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "self_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newco", "unt_", "=_", "count_", "-_", "other_", "[_", "elem_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "newco", "unt_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "elem_", "]_", "=_", "newco", "unt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "other_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "elem_", "not_", "in_", "self_", "and_", "count_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "elem_", "]_", "=_", "0_", "-_", "count_", "\\u\\u\\uNEWLINE\\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_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "or\\u\\u", "_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Uni", "on", " ", "is", " ", "the", " ", "maxim", "um", " ", "of", " ", "value", " ", "in", " ", "eit", "her", " ", "of", " ", "the", " ", "input", " ", "counter", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "Counter", "('", "abb", "b", "')", " ", "|", " ", "Counter", "('", "bcc", "')", "\\", "10", ";", " ", " ", " ", " ", "Counter", "({", "'", "b", "':", " ", "3", ",", " ", "'", "c", "':", " ", "2", ",", " ", "'", "a", "':", " ", "1", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "other_", ",_", "Counter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Counter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "self_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "\\u", "count_", "=_", "other_", "[_", "elem_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newco", "unt_", "=_", "other", "\\u", "count_", "if_", "count_", "<_", "other", "\\u", "count_", "else_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "newco", "unt_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "elem_", "]_", "=_", "newco", "unt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "other_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "elem_", "not_", "in_", "self_", "and_", "count_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "elem_", "]_", "=_", "count_", "\\u\\u\\uNEWLINE\\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_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "and", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Intersection", " ", "is", " ", "the", " ", "minim", "um", " ", "of", " ", "correspond", "ing", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "Counter", "('", "abb", "b", "')", " ", "&", " ", "Counter", "('", "bcc", "')", "\\", "10", ";", " ", " ", " ", " ", "Counter", "({", "'", "b", "':", " ", "1", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "other_", ",_", "Counter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Counter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "self_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "\\u", "count_", "=_", "other_", "[_", "elem_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newco", "unt_", "=_", "count_", "if_", "count_", "<_", "other", "\\u", "count_", "else_", "other", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "newco", "unt_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "elem_", "]_", "=_", "newco", "unt_", "\\u\\u\\uNEWLINE\\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_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "pos", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Add", "s", " ", "an", " ", "empty", " ", "counter", ",", " ", "effective", "ly", " ", "strip", "ping", " ", "negati", "ve", " ", "and", " ", "zero", " ", "count", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "+_", "Counter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "neg", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Subtract", "s", " ", "from", " ", "an", " ", "empty", " ", "counter", ".", " ", " ", "Strip", "s", " ", "posit", "ive", " ", "and", " ", "zero", " ", "count", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "flip", "s", " ", "the", " ", "sign", " ", "on", " ", "negati", "ve", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Counter_", "(_", ")_", "-_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "keep", "\\u", "positive_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Intern", "al", " ", "method", " ", "to", " ", "strip", " ", "element", "s", " ", "with", " ", "a", " ", "negati", "ve", " ", "or", " ", "zero", " ", "count", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nonp", "osi", "tive_", "=_", "[_", "elem_", "for_", "elem_", ",_", "count_", "in_", "self_", "._", "items_", "(_", ")_", "if_", "not_", "count_", ">_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", "in_", "nonp", "osi", "tive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "[_", "elem_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iad", "d\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Inp", "lace", " ", "add", " ", "from", " ", "anot", "her", " ", "counter", ",", " ", "keep", "ing", " ", "only", " ", "posit", "ive", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "abb", "b", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "+=", " ", "Counter", "('", "bcc", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "\\", "10", ";", " ", " ", " ", " ", "Counter", "({", "'", "b", "':", " ", "4", ",", " ", "'", "c", "':", " ", "2", ",", " ", "'", "a", "':", " ", "1", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "other_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "elem_", "]_", "+=_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "keep", "\\u", "positive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "isu", "b", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Inp", "lace", " ", "subtract", " ", "counter", ",", " ", "but", " ", "keep", " ", "only", " ", "results", " ", "with", " ", "posit", "ive", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "abb", "bc", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "-=", " ", "Counter", "('", "bcc", "d", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "\\", "10", ";", " ", " ", " ", " ", "Counter", "({", "'", "b", "':", " ", "2", ",", " ", "'", "a", "':", " ", "1", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "other_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "elem_", "]_", "-=_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "keep", "\\u", "positive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ior", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Inp", "lace", " ", "uni", "on", " ", "is", " ", "the", " ", "maxim", "um", " ", "of", " ", "value", " ", "from", " ", "eit", "her", " ", "counter", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "abb", "b", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "|", "=", " ", "Counter", "('", "bcc", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "\\", "10", ";", " ", " ", " ", " ", "Counter", "({", "'", "b", "':", " ", "3", ",", " ", "'", "c", "':", " ", "2", ",", " ", "'", "a", "':", " ", "1", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "other", "\\u", "count_", "in_", "other_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "self_", "[_", "elem_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "other", "\\u", "count_", ">_", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "elem_", "]_", "=_", "other", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "keep", "\\u", "positive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Counter_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ian", "d\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Inp", "lace", " ", "intersect", "ion", " ", "is", " ", "the", " ", "minim", "um", " ", "of", " ", "correspond", "ing", " ", "count", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "=", " ", "Counter", "('", "abb", "b", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", " ", "&", "=", " ", "Counter", "('", "bcc", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "c", "\\", "10", ";", " ", " ", " ", " ", "Counter", "({", "'", "b", "':", " ", "1", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", ",_", "count_", "in_", "self_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "\\u", "count_", "=_", "other_", "[_", "elem_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "other", "\\u", "count_", "<_", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "elem_", "]_", "=_", "other", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "keep", "\\u", "positive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "output_", "(_", "*_", "popen", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "Pyth", "on", " ", "2.6", " ", "compatibility", ":", " ", "see", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "stack", "overflow", ".", "com", "/", "question", "s", "/", "481", "497", "0", "/", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "stdout", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "stdout", " ", "argu", "ment", " ", "not", " ", "allow", "ed", ",", " ", "it", " ", "will", " ", "be", " ", "overrid", "den", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "process_", "=_", "subprocess_", "._", "Popen_", "(_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "*_", "popen", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", ",_", "unu", "sed", "\\u", "err_", "=_", "process_", "._", "communicate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retcode_", "=_", "process_", "._", "poll_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "retcode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "kwargs_", "._", "get_", "(_", "\"", "args", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cmd_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "popen", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "subprocess_", "._", "Call", "ed", "Process", "Error_", "(_", "retcode_", ",_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "output_", "\\u\\u\\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_", "count_", "(_", "start_", "=_", "0_", ",_", "step_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "``", "iter", "tool", "s", ".", "count", "``", " ", "in", " ", "Py", " ", "2.6", " ", "doe", "sn", "'", "t", " ", "accept", " ", "a", " ", "step", "\\", "10", ";", " ", " ", " ", " ", "parameter", ".", " ", "Thi", "s", " ", "is", " ", "an", " ", "enhance", "d", " ", "version", " ", "of", " ", "``", "iter", "tool", "s", ".", "count", "``", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "Py", "2.6", " ", "equivalent", " ", "to", " ", "``", "iter", "tool", "s", ".", "count", "``", " ", "in", " ", "Pyth", "on", " ", "2.7", "+.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "+=_", "step_", "\\u\\u\\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_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "A", " ", "Chain", "Map", " ", "group", "s", " ", "multiple", " ", "dict", "s", " ", "(", "or", " ", "other", " ", "mapping", "s", ")", " ", "tog", "ether", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "create", " ", "a", " ", "single", ",", " ", "update", "able", " ", "view", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "underl", "ying", " ", "mapping", "s", " ", "are", " ", "store", "d", " ", "in", " ", "a", " ", "list", ".", " ", " ", "Tha", "t", " ", "list", " ", "is", " ", "public", " ", "and", " ", "can", "\\", "10", ";", " ", " ", " ", " ", "accesse", "d", " ", "or", " ", "update", "d", " ", "usi", "ng", " ", "the", " ", "*", "maps", "*", " ", "attribute", ".", " ", " ", "There", " ", "is", " ", "no", " ", "other", " ", "state", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Look", "ups", " ", "search", " ", "the", " ", "underl", "ying", " ", "mapping", "s", " ", "success", "ively", " ", "unti", "l", " ", "a", " ", "key", " ", "is", " ", "found", ".", "\\", "10", ";", " ", " ", " ", " ", "In", " ", "contrast", ",", " ", "writes", ",", " ", "update", "s", ",", " ", "and", " ", "deletion", "s", " ", "only", " ", "operate", " ", "on", " ", "the", " ", "first", "\\", "10", ";", " ", " ", " ", " ", "mapping", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Py", "2", " ", "compatibility", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "nonzero\\u", "\\u_", "=_", "\\u\\u", "bool\\u", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "copy", "\\u\\u_", "=_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "maps_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Initializ", "e", " ", "a", " ", "Chain", "Map", " ", "by", " ", "setti", "ng", " ", "*", "maps", "*", " ", "to", " ", "the", " ", "give", "n", " ", "mapping", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "no", " ", "mapping", "s", " ", "are", " ", "provided", ",", " ", "a", " ", "single", " ", "empty", " ", "dictionar", "y", " ", "is", " ", "used", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "maps_", "=_", "list_", "(_", "maps_", ")_", "or_", "[_", "{_", "}_", "]_", "#", " ", "alw", "ay", "s", " ", "at", " ", "leas", "t", " ", "one", " ", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "missi", "ng", "\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "mapping_", "in_", "self_", "._", "maps_", ":_", "\\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_", "mapping_", "[_", "key_", "]_", "#", " ", "can", "'", "t", " ", "use", " ", "'", "key", " ", "in", " ", "mapping", "'", " ", "with", " ", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "missi", "ng", "\\u\\u_", "(_", "key_", ")_", "#", " ", "support", " ", "subclasses", " ", "tha", "t", " ", "defin", "e", " ", "\\u\\u", "missi", "ng", "\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "key_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "[_", "key_", "]_", "if_", "key_", "in_", "self_", "else_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "len\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "set_", "(_", ")_", "._", "union_", "(_", "*_", "self_", "._", "maps_", ")_", ")_", "#", " ", "reus", "es", " ", "store", "d", " ", "hash", " ", "values", " ", "if", " ", "possible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "iter_", "(_", "set_", "(_", ")_", "._", "union_", "(_", "*_", "self_", "._", "maps_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "contains\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "any_", "(_", "key_", "in_", "m_", "for_", "m_", "in_", "self_", "._", "maps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "bool\\u", "\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "any_", "(_", "self_", "._", "maps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "recurs", "ive", "\\u", "repr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'{", "0.", "\\u\\u", "class", "\\u\\u", ".\\u", "\\u", "name", "\\u\\u}", "({", "1", "})'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "',", " ", "'_", "._", "join_", "(_", "map_", "(_", "repr_", ",_", "self_", "._", "maps_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\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_", "fromkeys_", "(_", "cls_", ",_", "iterable_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Creat", "e", " ", "a", " ", "Chain", "Map", " ", "with", " ", "a", " ", "single", " ", "dict", " ", "created", " ", "from", " ", "the", " ", "iterable", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", "dict_", "._", "fromkeys_", "(_", "iterable_", ",_", "*_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "copy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "New", " ", "Chain", "Map", " ", "or", " ", "subclass", " ", "with", " ", "a", " ", "new", " ", "copy", " ", "of", " ", "maps", "[", "0", "]", " ", "and", " ", "refs", " ", "to", " ", "maps", "[", "1", ":]", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "self_", "._", "maps_", "[_", "0_", "]_", "._", "copy_", "(_", ")_", ",_", "*_", "self_", "._", "maps_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "new", "\\u", "child_", "(_", "self_", ",_", "m_", "=_", "None_", ")_", ":_", "#", " ", "like", " ", "Dj", "ang", "o", "'", "s", " ", "Context", ".", "push", "()", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "New", " ", "Chain", "Map", " ", "with", " ", "a", " ", "new", " ", "map", " ", "followe", "d", " ", "by", " ", "all", " ", "previ", "ous", " ", "maps", ".", " ", "If", " ", "no", "\\", "10", ";", " ", " ", " ", " ", "map", " ", "is", " ", "provided", ",", " ", "an", " ", "empty", " ", "dict", " ", "is", " ", "used", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "m_", ",_", "*_", "self_", "._", "maps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\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_", "parents_", "(_", "self_", ")_", ":_", "#", " ", "like", " ", "Dj", "ang", "o", "'", "s", " ", "Context", ".", "pop", "()", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "New", " ", "Chain", "Map", " ", "from", " ", "maps", "[", "1", ":]", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "*_", "self_", "._", "maps_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setitem\\u\\u_", "(_", "self_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "maps_", "[_", "0_", "]_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "delitem\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "maps_", "[_", "0_", "]_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "'", "Key", " ", "not", " ", "found", " ", "in", " ", "the", " ", "first", " ", "mapping", ":", " ", "{", "!", "r", "}'_", "._", "format_", "(_", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\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_", "popi", "tem_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Remove", " ", "and", " ", "return", " ", "an", " ", "item", " ", "pair", " ", "from", " ", "maps", "[", "0", "].", " ", "Rai", "se", " ", "Key", "Error", " ", "is", " ", "maps", "[", "0", "]", " ", "is", " ", "empty", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "maps_", "[_", "0_", "]_", "._", "popi", "tem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "'", "No", " ", "keys", " ", "found", " ", "in", " ", "the", " ", "first", " ", "mapping", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\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_", "pop_", "(_", "self_", ",_", "key_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Remove", " ", "*", "key", "*", " ", "from", " ", "maps", "[", "0", "]", " ", "and", " ", "return", " ", "its", " ", "value", ".", " ", "Rai", "se", " ", "Key", "Error", " ", "if", " ", "*", "key", "*", " ", "not", " ", "in", " ", "maps", "[", "0", "].", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "maps_", "[_", "0_", "]_", "._", "pop_", "(_", "key_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "'", "Key", " ", "not", " ", "found", " ", "in", " ", "the", " ", "first", " ", "mapping", ":", " ", "{", "!", "r", "}'_", "._", "format_", "(_", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chain", "Map_", "(_", "Mut", "able", "Mapping_", ")_", ":_", "\\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_", "clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Clear", " ", "maps", "[", "0", "],", " ", "leaving", " ", "maps", "[", "1", ":]", " ", "inta", "ct", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "maps_", "[_", "0_", "]_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create", "\\u", "connection_", "(_", "address_", ",_", "timeout_", "=_", "\\u", "GLOB", "AL", "\\u", "DEF", "AUL", "T", "\\u", "TIMEOUT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "address_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Back", "port", " ", "of", " ", "3", "-", "argu", "ment", " ", "create", "\\u", "connecti", "on", "()", " ", "for", " ", "Py", "2.6", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Connect", " ", "to", " ", "*", "address", "*", " ", "and", " ", "return", " ", "the", " ", "socket", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Conve", "nie", "nce", " ", "function", ".", " ", " ", "Connect", " ", "to", " ", "*", "address", "*", " ", "(", "a", " ", "2", "-", "tuple", " ", "``", "(", "host", ",", "\\", "10", ";", " ", " ", " ", " ", "port", ")`", "`)", " ", "and", " ", "return", " ", "the", " ", "socket", " ", "object", ".", " ", " ", "Passi", "ng", " ", "the", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "*", "timeo", "ut", "*", " ", "parameter", " ", "will", " ", "set", " ", "the", " ", "timeo", "ut", " ", "on", " ", "the", " ", "socket", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", "bef", "ore", " ", "atte", "mpt", "ing", " ", "to", " ", "connect", ".", " ", " ", "If", " ", "no", " ", "*", "timeo", "ut", "*", " ", "is", " ", "supplie", "d", ",", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "global", " ", "default", " ", "timeo", "ut", " ", "setti", "ng", " ", "return", "ed", " ", "by", " ", ":", "func", ":`", "getde", "fault", "timeo", "ut", "`", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "used", ".", " ", " ", "If", " ", "*", "source", "\\u", "address", "*", " ", "is", " ", "set", " ", "it", " ", "must", " ", "be", " ", "a", " ", "tuple", " ", "of", " ", "(", "host", ",", " ", "port", ")", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "the", " ", "socket", " ", "to", " ", "bind", " ", "as", " ", "a", " ", "source", " ", "address", " ", "bef", "ore", " ", "mak", "ing", " ", "the", " ", "connecti", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "host", " ", "of", " ", "''", " ", "or", " ", "port", " ", "0", " ", "tell", "s", " ", "the", " ", "OS", " ", "to", " ", "use", " ", "the", " ", "default", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "host_", ",_", "port_", "=_", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "res_", "in_", "getadd", "rin", "fo_", "(_", "host_", ",_", "port_", ",_", "0_", ",_", "SOCK", "\\u", "STREAM_", ")_", ":_", "\\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_", "sock_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sock_", "=_", "socket_", "(_", "af_", ",_", "sock", "type_", ",_", "proto_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timeout_", "is_", "not_", "\\u", "GLOB", "AL", "\\u", "DEF", "AUL", "T", "\\u", "TIMEOUT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sock_", "._", "settimeout_", "(_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "source", "\\u", "address_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sock_", "._", "bind_", "(_", "source", "\\u", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sock_", "._", "connect_", "(_", "sa_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "error_", "as_", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err_", "=_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sock_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sock_", "._", "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_", "err_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "err_", "\\u\\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_", "error_", "(_", "\"", "getadd", "rin", "fo", " ", "return", "s", " ", "an", " ", "empty", " ", "list", "\"_", ")_", "\\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,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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 ]
Testing equality to None
pybrain/pybrain/pybrain/rl/environments/twoplayergames/pente.py
[ { "content": " def _setStone(self, c, pos, tokill=None):\n \"\"\" set stone, and potentially kill stones. \"\"\"\n if tokill == None:\n tokill = self._killsWhich(c, pos)\n GomokuGame._setStone(self, c, pos)\n for p in tokill:\n self.b[p] = self.EMPTY\n self.pairsTaken[c] += len(tokill) // 2", "metadata": "root.PenteGame._setStone", "header": "['class', 'PenteGame', '(', 'GomokuGame', ')', ':', '___EOS___']", "index": 73 } ]
[ { "span": "tokill == None:", "start_line": 75, "start_column": 11, "end_line": 75, "end_column": 25 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Pen", "te", "Game_", "(_", "Go", "mo", "ku", "Game_", ")_", ":_", "\\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", "set", "Stone", "_", "(_", "self_", ",_", "c_", ",_", "pos_", ",_", "tok", "ill", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "set", " ", "stone", ",", " ", "and", " ", "potenti", "ally", " ", "kill", " ", "stone", "s", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tok", "ill", "_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tok", "ill", "_", "=_", "self_", "._", "\\u", "kills", "Whi", "ch_", "(_", "c_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Go", "mo", "ku", "Game_", "._", "\\u", "set", "Stone", "_", "(_", "self_", ",_", "c_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "tok", "ill", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "b_", "[_", "p_", "]_", "=_", "self_", "._", "EMPTY_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "pair", "s", "Taken", "_", "[_", "c_", "]_", "+=_", "len_", "(_", "tok", "ill", "_", ")_", "//_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
nakamuray/blikit/blikit-manage.py
[ { "content": "#!/usr/bin/python\nimport os\nimport sys\n\nimport blikit\n\nfrom blikit.application import Blikit, is_git_repo\nfrom werkzeug import script\nfrom werkzeug.contrib import profiler\n\nif not is_git_repo('.'):\n print >> sys.stderr, 'not a git repository'\n sys.exit(0)\n\n\naction_runserver = script.make_runserver(make_app)\n\naction_develop = script.make_runserver(make_app,\n use_reloader=True,\n use_debugger=True)\n\naction_profile = profiler.make_action(make_app,\n stream=open('/tmp/profiler.log', 'w'))\n\nscript.run()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def make_app():\n return Blikit('.')", "metadata": "root.make_app", "header": "['module', '___EOS___']", "index": 14 } ]
[ { "span": "import os", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 9 }, { "span": "import blikit", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\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_", "import_", "bli", "kit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bli", "kit_", "._", "application_", "import_", "Bli", "kit_", ",_", "is", "\\u", "git", "\\u", "repo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "werkzeug_", "import_", "script_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "werkzeug_", "._", "contrib_", "import_", "profiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "is", "\\u", "git", "\\u", "repo_", "(_", "'.'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "not", " ", "a", " ", "git", " ", "repos", "itor", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "action", "\\u", "runs", "erver_", "=_", "script_", "._", "make", "\\u", "runs", "erver_", "(_", "make", "\\u", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "action", "\\u", "develop", "_", "=_", "script_", "._", "make", "\\u", "runs", "erver_", "(_", "make", "\\u", "app_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "reloade", "r_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "debugger_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "action", "\\u", "profile_", "=_", "profiler_", "._", "make", "\\u", "action_", "(_", "make", "\\u", "app_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "=_", "open_", "(_", "'/", "tmp", "/", "profiler", ".", "log", "'_", ",_", "'", "w", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "script_", "._", "run_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "app_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Bli", "kit_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
probcomp/crosscat/src/tests/synthetic_data_generator.py
[ { "content": "def generate_separated_model_parameters(cctype, C, num_clusters, get_next_seed, distargs=None):\n\t\"\"\" Generates a list of separated component model parameters\n\t\"\"\"\n\tif cctype == 'continuous':\n\t\t# C=1 implies 3 sigma, C=0, implies total overlap, C=.5 implies 1 sigma\n\t\tA = 1.7071\n\t\tB = .7929\n\t # outputs distance in standard deviations that the two clusters should be apart\n\t\td_in_simga = lambda c : A*(c**1.5) + B*c\n\t\trho_to_sigma = lambda rho : (1.0/rho)**.5\n\t\t\n\t\t# generate the 'seed' component model randomly\n\t\tN = 100 # imaginary data\n\t\tmodel = ccmext.p_ContinuousComponentModel.from_parameters(N, gen_seed=get_next_seed())\n\t\tparams = model.sample_parameters_given_hyper(gen_seed=get_next_seed())\n\t\t# track the means and standard deviations\n\n\t\tmodel_params = [params]\n\t\t\n\t\tfor i in range(0,num_clusters-1):\n\t\t\tparams = model.sample_parameters_given_hyper(gen_seed=get_next_seed())\n\t\t\tlast_mean = model_params[i]['mu']\n\t\t\tstd1 = rho_to_sigma(model_params[i]['rho'])\n\t\t\tstd2 = rho_to_sigma(params['rho'])\n\t\t\tsumstd = std1+std2\n\t\t\tpush = d_in_simga(C)*sumstd\n\t\t\tparams['mu'] = model_params[i]['mu'] + push\n\t\t\tmodel_params.append(params)\n\n\t\tassert len(model_params) == num_clusters\n\t\trandom.shuffle(model_params)\n\t\tassert len(model_params) == num_clusters\n\t\treturn model_params\n\n\telif cctype == 'multinomial':\n\t\t\n\t\t# check the distargs dict\t\n\t\tif not isinstance(distargs, dict):\n\t\t\traise TypeError(\"for cctype 'multinomial' distargs must be a dict\")\n\n\t\ttry:\n\t\t\tK = distargs['K']\n\t\texcept KeyError:\n\t\t\traise KeyError(\"for cctype 'multinomial' distargs should have key 'K',\\\n\t\t\t the number of categories\")\n\n\t\t# generate an inital set of parameters\n\t\t# weights = numpy.random.rand(K)\n\t\t# weights = weights/numpy.sum(weights)\n\t\tweights = numpy.array([1.0/float(K)]*K)\n\t\tweights = weights.tolist()\n\n\t\tmodel_params = [dict(weights=weights)]\n\t\t\n\t\tfor i in range(0,num_clusters-1):\n\t\t\tweights = generate_separated_multinomial_weights(weights,C)\n\t\t\tmodel_params.append(dict(weights=weights))\n\n\t\tassert len(model_params) == num_clusters\n\t\trandom.shuffle(model_params)\n\t\tassert len(model_params) == num_clusters\n\t\treturn model_params\n\telif cctype == 'cyclic':\n\n\t\tsep = (2.0*math.pi/num_clusters)\n\n\t\tmus = [c*sep for c in range(num_clusters)]\n\t\tstd = sep/(5.0*C**.75)\n\t\tk = 1/(std*std)\n\n\t\tmodel_params = []\n\t\tfor c in range(num_clusters):\n\t\t\tmodel_params.append(dict(mu=mus[c], kappa=k))\n\n\t\treturn model_params\n\telse:\n\t\traise ValueError(\"Invalid cctype %s.\" % cctype )", "metadata": "root.generate_separated_model_parameters", "header": "['module', '___EOS___']", "index": 128 }, { "content": "def gen_data(cctypes, n_rows, cols_to_views, cluster_weights, separation, seed=0, distargs=None, return_structure=False):\n\t\"\"\"\tGenerates a synthetic data.\n\t\tInputs:\n\t\t\t- cctypes: List of strings. Each entry, i, is the cctype of the \n\t\t\tcolumn i. ex: cctypes = ['continuous','continuous', 'multinomial']\n\t\t\t- n_rows: integer. the number of rows\n\t\t\t- cols_to_views: List of integers. Each entry, i, is the view, v, \n\t\t\tto which columns i is assigned. v \\in [0,...,n_cols-1].\n\t\t\tex: cols_to_views = [0, 0, 1]\n\t\t\t- cluster_weights: List of lists of floats. A num_views length list\n\t\t\tof list. Each sublist, W, is a list of cluster weights for the \n\t\t\tview, thus W should always sum to 1.\n\t\t\tex (two views, first view has 2 clusters, second view has 3 \n\t\t\tclusters):\n\t\t\tcluster_weights = [[.3, .7], [.25, .5, .25]]\n\t\t\t- separation: list of floats. Each entry, i, is the separation, C,\n\t\t\tof the clusters in view i. C \\in [0,1] where 0 is no separation and\n\t\t\t1 is well-separated.\n\t\t\tex (2 views): separation = [ .5, .7]\n\t\t\t- seed: optional\n\t\t\t- distargs: optional (only if continuous). distargs is n_columns\n\t\t\tlength list where each entry is either None or a dict appropriate \n\t\t\tfor the cctype in that column. For a normal feature, the entry \n\t\t\tshould be None, for a multinomial feature, the entry should be a \n\t\t\tdict with the entry K (the number of categories). \n\t\t\t- return_structure: (bool, optional). Returns also a dict withe the\n\t\t\tdata generation structure included. A dict with keys:\n\t\t\t\t- component_params: a n_cols length list of lists. Where each \n\t\t\t\tlist is a set of component model parameters for each cluster in\n\t\t\t\tthe view to which that column belongs\n\t\t\t\t- cols_to_views: a list assigning each column to a view\n\t\t\t\t- rows_to_clusters: a n_views length list of list. Each entry,\n\t\t\t\trows_to_clusters[v][r] is the cluster to which all rows in \n\t\t\t\tcolumns belonging to view v are assigned\n\t\tReturns:\n\t\t\tT, M_c\n\t\tExample:\n\t\t\t>>> cctypes = ['continuous','continuous','multinomial','continuous','multinomial']\n\t\t\t>>> disargs = [None, None, dict(K=5), None, dict(K=2)]\n\t\t\t>>> n_rows = 10\n\t\t\t>>> cols_to_views = [0, 0, 1, 1, 2]\n\t\t\t>>> cluster_weights = [[.3, .7],[.5, .5],[.2, .3, .5]]\n\t\t\t>>> separation = [.9, .6, .9]\n\t\t\t>>> T, M_c = gen_data(cctypes, n_rows, cols_to_views, cluster_weights,\n\t\t\t\tseparation, seed=0, distargs=distargs)\n\t\"\"\"\n\n\t# check Inputs\n\tif not isinstance(n_rows, int):\n\t\traise TypeError(\"n_rows should be an integer\")\n\n\tif not isinstance(cctypes, list):\n\t\traise TypeError(\"cctypes should be a list\")\n\n\tn_cols_cctypes = len(cctypes)\n\tfor cctype in cctypes:\n\t\tif not isinstance(cctype, str):\n\t\t\traise TypeError(\"cctypes should be a list of strings\")\n\n\t\t# NOTE: will have to update when new component models are added\n\t\tif cctype not in ['continuous', 'multinomial', 'cyclic']:\n\t\t\traise ValueError(\"invalid cctypein cctypes: %s.\" % cctype)\n\n\tif not isinstance(cols_to_views, list):\n\t\traise TypeError(\"cols_to_views should be a list\")\n\n\tif len(cols_to_views) != n_cols_cctypes:\n\t\traise ValueError(\"number of columns in cctypes does not match number\\\n\t\t of columns in cols_to_views\")\n\n\tif min(cols_to_views) != 0:\n\t\traise ValueError(\"min value of cols_to_views should be 0\")\n\n\tn_views_cols_to_views = max(cols_to_views) + 1\n\n\tset_ctv = set(cols_to_views)\n\tif len(set_ctv) != n_views_cols_to_views:\n\t\traise ValueError(\"View indices skipped in cols_to_views\")\n\n\t# check cluster weights\n\tif not isinstance(cluster_weights, list):\n\t\traise TypeError(\"cluster_weights should be a list\")\n\n\tif n_views_cols_to_views != len(cluster_weights):\n\t\traise ValueError(\"The number of views in cols_to_views and \\\n\t\t\tcluster_weights do not agree.\")\n\n\t# check each set of weights\n\tfor W in cluster_weights:\n\t\tif not isinstance(W, list):\n\t\t\traise TypeError(\"cluster_weights should be a list of lists\")\n\t\tif math.fabs(sum(W)-1.0) > .0000001:\n\t\t\traise ValueError(\"each vector of weights should sum to 1\")\n\n\tif not isinstance(separation, list):\n\t\traise TypeError(\"separation should be a list\")\n\n\tif len(separation) != n_views_cols_to_views:\n\t\traise ValueError(\"number of view in separation and cols_to_views do not agree\")\n\n\tfor c in separation:\n\t\tif not isinstance(c, float) or c > 1.0 or c < 0.0:\n\t\t\traise ValueError(\"each value in separation should be a float from 0 to 1\")\n\n\tnum_views = len(separation)\n\tn_cols = len(cols_to_views)\n\n\t# check the cctypes vs the distargs\n\tif distargs is None:\n\t\tdistargs = [None for i in range(n_cols)]\n\n\tif not isinstance(distargs, list):\n\t\traise TypeError(\"distargs should be a list\")\n\n\tif len(distargs) != n_cols:\n\t\traise ValueError(\"distargs should have an entry for each column\")\n\n\tfor i in range(n_cols):\n\t\tif cctypes[i] == 'continuous' or cctypes[i] == 'cyclic':\n\t\t\tif distargs[i] is not None:\n\t\t\t\traise ValueError(\"distargs entry for 'continuous' cctype should be None\")\n\t\telif cctypes[i] == 'multinomial':\n\t\t\tif not isinstance(distargs[i], dict):\n\t\t\t\traise TypeError(\"ditargs for cctype 'multinomial' should be a dict\")\n\t\t\tif len(distargs[i].keys()) != 1:\n\t\t\t\traise KeyError(\"distargs for cctype 'multinomial' should have one key, 'K'\")\n\t\t\tif 'K' not in distargs[i].keys():\n\t\t\t\traise KeyError(\"distargs for cctype 'multinomial' should have the key 'K'\")\n\t\telse:\n\t\t\traise ValueError(\"invalid cctypein cctypes: %s.\" % cctypes[i])\n\n\trandom.seed(seed)\n\tnumpy.random.seed(seed)\n\n\t# Generate the rows to categories partitions (mutlinomial)\n\trows_to_clusters = []\n\tfor W in cluster_weights:\n\n\t\tcW = list(W)\n\t\tfor i in range(1, len(cW)):\n\t\t\tcW[i] += cW[i-1]\n\n\t\tK = len(cW)\n\n\t\trows_to_clusters_view = list(range(K))\n\t\tfor r in range(K,n_rows):\n\t\t\trows_to_clusters_view.append(p_draw(cW))\n\n\t\trandom.shuffle(rows_to_clusters_view)\n\t\tassert len(rows_to_clusters_view) == n_rows\n\n\t\trows_to_clusters.append(rows_to_clusters_view)\n\n\n\tget_next_seed = lambda : random.randrange(2147483647)\n\n\t# start generating the data\n\tdata_table = numpy.zeros((n_rows, n_cols))\n\tcomponent_params = []\n\tfor col in range(n_cols):\n\t\n\t\tview = cols_to_views[col]\n\n\t\t# get the number of cluster in view\n\t\tnum_clusters = len(cluster_weights[view])\n\n\t\tcctype = cctypes[col]\n\n\t\tC = separation[view]\n\n\t\t# generate a set of C-separated component model parameters \n\t\tcomponent_parameters = generate_separated_model_parameters(cctype, C,\n\t\t\tnum_clusters, get_next_seed, distargs=distargs[col])\n\n\t\tcomponent_params.append(component_parameters)\n\n\t\t# get the data generation function\n\t\tgen = get_data_generator[cctype]\n\t\tfor row in range(n_rows):\n\t\t\t# get the cluster this \n\t\t\tcluster = rows_to_clusters[view][row]\n\t\t\tparams = component_parameters[cluster]\n\t\t\tx = gen(params, 1, gen_seed=get_next_seed())[0]\n\t\t\tdata_table[row,col] = x\n\n\n\tT = data_table.tolist()\n\tM_c = du.gen_M_c_from_T(T, cctypes=cctypes)\n\n\tif return_structure:\n\t\tstructure = dict()\n\t\tstructure['component_params'] = component_params\n\t\tstructure['cols_to_views'] = cols_to_views\n\t\tstructure['rows_to_clusters'] = rows_to_clusters\n\t\tstructure['cluster_weights'] = cluster_weights\n\t\treturn T, M_c, structure\n\telse:\n\t\treturn T, M_c", "metadata": "root.gen_data", "header": "['module', '___EOS___']", "index": 207 } ]
[ { "span": "last_mean ", "start_line": 149, "start_column": 3, "end_line": 149, "end_column": 12 }, { "span": "num_views ", "start_line": 311, "start_column": 1, "end_line": 311, "end_column": 10 } ]
[]
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_", "generat", "e\\u", "separate", "d\\u", "model", "\\u", "parameters_", "(_", "cct", "ype_", ",_", "C_", ",_", "num", "\\u", "clusters_", ",_", "get", "\\u", "next", "\\u", "seed_", ",_", "dist", "args_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", " ", "Generate", "s", " ", "a", " ", "list", " ", "of", " ", "separate", "d", " ", "component", " ", "model", " ", "parameter", "s", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cct", "ype_", "==_", "'", "continuous", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "C", "=", "1", " ", "implies", " ", "3", " ", "sigma", ",", " ", "C", "=", "0", ",", " ", "implies", " ", "total", " ", "overl", "ap", ",", " ", "C", "=.", "5", " ", "implies", " ", "1", " ", "sigma_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "A_", "=_", "1.7", "071", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "B_", "=_", ".7", "929", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "output", "s", " ", "distance", " ", "in", " ", "standard", " ", "deviation", "s", " ", "tha", "t", " ", "the", " ", "two", " ", "cluster", "s", " ", "shou", "ld", " ", "be", " ", "apart", "_", "\\u\\u\\uNL\\u\\u\\u_", "d\\u", "in", "\\u", "sim", "ga_", "=_", "lambda_", "c_", ":_", "A_", "*_", "(_", "c_", "**_", "1.5_", ")_", "+_", "B_", "*_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rho", "\\u", "to", "\\u", "sigma_", "=_", "lambda_", "rho_", ":_", "(_", "1.0_", "/_", "rho_", ")_", "**_", ".5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "e", " ", "the", " ", "'", "seed", "'", " ", "component", " ", "model", " ", "random", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "N_", "=_", "100_", "#", " ", "imagin", "ary", " ", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "cc", "me", "xt_", "._", "p", "\\u", "Continu", "ous", "Compo", "nent", "Model_", "._", "from", "\\u", "parameters_", "(_", "N_", ",_", "gen", "\\u", "seed_", "=_", "get", "\\u", "next", "\\u", "seed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "model_", "._", "sample", "\\u", "parameter", "s", "\\u", "give", "n", "\\u", "hyper", "_", "(_", "gen", "\\u", "seed_", "=_", "get", "\\u", "next", "\\u", "seed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "track", " ", "the", " ", "means", " ", "and", " ", "standard", " ", "deviation", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "params_", "=_", "[_", "params_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "num", "\\u", "clusters_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "params_", "=_", "model_", "._", "sample", "\\u", "parameter", "s", "\\u", "give", "n", "\\u", "hyper", "_", "(_", "gen", "\\u", "seed_", "=_", "get", "\\u", "next", "\\u", "seed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "mean_", "=_", "model", "\\u", "params_", "[_", "i_", "]_", "[_", "'", "mu", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "1_", "=_", "rho", "\\u", "to", "\\u", "sigma_", "(_", "model", "\\u", "params_", "[_", "i_", "]_", "[_", "'", "rho", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "2_", "=_", "rho", "\\u", "to", "\\u", "sigma_", "(_", "params_", "[_", "'", "rho", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sums", "td_", "=_", "std", "1_", "+_", "std", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "push_", "=_", "d\\u", "in", "\\u", "sim", "ga_", "(_", "C_", ")_", "*_", "sums", "td_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "[_", "'", "mu", "'_", "]_", "=_", "model", "\\u", "params_", "[_", "i_", "]_", "[_", "'", "mu", "'_", "]_", "+_", "push_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "\\u", "params_", "._", "append_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "model", "\\u", "params_", ")_", "==_", "num", "\\u", "clusters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random_", "._", "shuffle_", "(_", "model", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "model", "\\u", "params_", ")_", "==_", "num", "\\u", "clusters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "model", "\\u", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cct", "ype_", "==_", "'", "multin", "omial", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "the", " ", "dist", "args", " ", "dict", "\t_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "isinstance_", "(_", "dist", "args_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Type", "Error_", "(_", "\"", "for", " ", "cct", "ype", " ", "'", "multin", "omial", "'", " ", "dist", "args", " ", "must", " ", "be", " ", "a", " ", "dict", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "K_", "=_", "dist", "args_", "[_", "'", "K", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Key", "Error_", "(_", "\"", "for", " ", "cct", "ype", " ", "'", "multin", "omial", "'", " ", "dist", "args", " ", "shou", "ld", " ", "have", " ", "key", " ", "'", "K", "',", "\\\\", "\\", "10", ";", "\t\t\t", " ", "the", " ", "number", " ", "of", " ", "categor", "ies", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "e", " ", "an", " ", "init", "al", " ", "set", " ", "of", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "weight", "s", " ", "=", " ", "nump", "y", ".", "random", ".", "rand", "(", "K", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "weight", "s", " ", "=", " ", "weight", "s", "/", "nump", "y", ".", "sum", "(", "weight", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "weights_", "=_", "numpy_", "._", "array_", "(_", "[_", "1.0_", "/_", "float_", "(_", "K_", ")_", "]_", "*_", "K_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "weights_", "=_", "weights_", "._", "tolist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "params_", "=_", "[_", "dict_", "(_", "weights_", "=_", "weights_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "num", "\\u", "clusters_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "weights_", "=_", "generat", "e\\u", "separate", "d\\u", "multin", "omial", "\\u", "weights_", "(_", "weights_", ",_", "C_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "\\u", "params_", "._", "append_", "(_", "dict_", "(_", "weights_", "=_", "weights_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "model", "\\u", "params_", ")_", "==_", "num", "\\u", "clusters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random_", "._", "shuffle_", "(_", "model", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "model", "\\u", "params_", ")_", "==_", "num", "\\u", "clusters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "model", "\\u", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cct", "ype_", "==_", "'", "cyclic", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sep_", "=_", "(_", "2.0_", "*_", "math_", "._", "pi_", "/_", "num", "\\u", "clusters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mus", "_", "=_", "[_", "c_", "*_", "sep_", "for_", "c_", "in_", "range_", "(_", "num", "\\u", "clusters_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std_", "=_", "sep_", "/_", "(_", "5.0_", "*_", "C_", "**_", ".75", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "1_", "/_", "(_", "std_", "*_", "std_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "range_", "(_", "num", "\\u", "clusters_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "model", "\\u", "params_", "._", "append_", "(_", "dict_", "(_", "mu_", "=_", "mus", "_", "[_", "c_", "]_", ",_", "kappa_", "=_", "k_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "model", "\\u", "params_", "\\u\\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_", "raise_", "Value", "Error_", "(_", "\"", "Inva", "lid", " ", "cct", "ype", " ", "%", "s", ".\"_", "%_", "cct", "ype_", ")_", "\\u\\u\\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_", "gen", "\\u", "data_", "(_", "cct", "ypes_", ",_", "n", "\\u", "rows_", ",_", "cols", "\\u", "to", "\\u", "views_", ",_", "cluster", "\\u", "weights_", ",_", "separation", "_", ",_", "seed_", "=_", "0_", ",_", "dist", "args_", "=_", "None_", ",_", "return", "\\u", "structure_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "\t", "Generate", "s", " ", "a", " ", "synthetic", " ", "data", ".", "\\", "10", ";", "\t", "\t", "Inp", "uts", ":", "\\", "10", ";", "\t\t\t", "-", " ", "cct", "ype", "s", ":", " ", "List", " ", "of", " ", "string", "s", ".", " ", "Ea", "ch", " ", "entry", ",", " ", "i", ",", " ", "is", " ", "the", " ", "cct", "ype", " ", "of", " ", "the", " ", "\\", "10", ";", "\t\t\t", "column", " ", "i", ".", " ", "ex", ":", " ", "cct", "ype", "s", " ", "=", " ", "['", "continuous", "','", "continuous", "',", " ", "'", "multin", "omial", "']", "\\", "10", ";", "\t\t\t", "-", " ", "n", "\\u", "rows", ":", " ", "integ", "er", ".", " ", "the", " ", "number", " ", "of", " ", "rows", "\\", "10", ";", "\t\t\t", "-", " ", "cols", "\\u", "to", "\\u", "views", ":", " ", "List", " ", "of", " ", "integ", "ers", ".", " ", "Ea", "ch", " ", "entry", ",", " ", "i", ",", " ", "is", " ", "the", " ", "view", ",", " ", "v", ",", " ", "\\", "10", ";", "\t\t\t", "to", " ", "whi", "ch", " ", "column", "s", " ", "i", " ", "is", " ", "assign", "ed", ".", " ", "v", " ", "\\\\", "in", " ", "[", "0", ",...", ",", "n", "\\u", "cols", "-1", "].", "\\", "10", ";", "\t\t\t", "ex", ":", " ", "cols", "\\u", "to", "\\u", "views", " ", "=", " ", "[", "0", ",", " ", "0", ",", " ", "1", "]", "\\", "10", ";", "\t\t\t", "-", " ", "cluster", "\\u", "weight", "s", ":", " ", "List", " ", "of", " ", "lists", " ", "of", " ", "float", "s", ".", " ", "A", " ", "num", "\\u", "views", " ", "length", " ", "list", "\\", "10", ";", "\t\t\t", "of", " ", "list", ".", " ", "Ea", "ch", " ", "subli", "st", ",", " ", "W", ",", " ", "is", " ", "a", " ", "list", " ", "of", " ", "cluster", " ", "weight", "s", " ", "for", " ", "the", " ", "\\", "10", ";", "\t\t\t", "view", ",", " ", "thu", "s", " ", "W", " ", "shou", "ld", " ", "alw", "ay", "s", " ", "sum", " ", "to", " ", "1", ".", "\\", "10", ";", "\t\t\t", "ex", " ", "(", "two", " ", "views", ",", " ", "first", " ", "view", " ", "has", " ", "2", " ", "cluster", "s", ",", " ", "second", " ", "view", " ", "has", " ", "3", " ", "\\", "10", ";", "\t\t\t", "cluster", "s", "):", "\\", "10", ";", "\t\t\t", "cluster", "\\u", "weight", "s", " ", "=", " ", "[[", ".3", ",", " ", ".7", "],", " ", "[.", "25", ",", " ", ".5", ",", " ", ".2", "5", "]]", "\\", "10", ";", "\t\t\t", "-", " ", "separation", ":", " ", "list", " ", "of", " ", "float", "s", ".", " ", "Ea", "ch", " ", "entry", ",", " ", "i", ",", " ", "is", " ", "the", " ", "separation", ",", " ", "C", ",", "\\", "10", ";", "\t\t\t", "of", " ", "the", " ", "cluster", "s", " ", "in", " ", "view", " ", "i", ".", " ", "C", " ", "\\\\", "in", " ", "[", "0", ",", "1", "]", " ", "where", " ", "0", " ", "is", " ", "no", " ", "separation", " ", "and", "\\", "10", ";", "\t\t\t", "1", " ", "is", " ", "well", "-", "separate", "d", ".", "\\", "10", ";", "\t\t\t", "ex", " ", "(", "2", " ", "views", "):", " ", "separation", " ", "=", " ", "[", " ", ".5", ",", " ", ".7", "]", "\\", "10", ";", "\t\t\t", "-", " ", "seed", ":", " ", "option", "al", "\\", "10", ";", "\t\t\t", "-", " ", "dist", "args", ":", " ", "option", "al", " ", "(", "only", " ", "if", " ", "continuous", ").", " ", "dist", "args", " ", "is", " ", "n", "\\u", "column", "s", "\\", "10", ";", "\t\t\t", "length", " ", "list", " ", "where", " ", "each", " ", "entry", " ", "is", " ", "eit", "her", " ", "Non", "e", " ", "or", " ", "a", " ", "dict", " ", "appropr", "iate", " ", "\\", "10", ";", "\t\t\t", "for", " ", "the", " ", "cct", "ype", " ", "in", " ", "tha", "t", " ", "column", ".", " ", "For", " ", "a", " ", "normal", " ", "feature", ",", " ", "the", " ", "entry", " ", "\\", "10", ";", "\t\t\t", "shou", "ld", " ", "be", " ", "Non", "e", ",", " ", "for", " ", "a", " ", "multin", "omial", " ", "feature", ",", " ", "the", " ", "entry", " ", "shou", "ld", " ", "be", " ", "a", " ", "\\", "10", ";", "\t\t\t", "dict", " ", "with", " ", "the", " ", "entry", " ", "K", " ", "(", "the", " ", "number", " ", "of", " ", "categor", "ies", ").", " ", "\\", "10", ";", "\t\t\t", "-", " ", "return", "\\u", "structure", ":", " ", "(", "bool", ",", " ", "option", "al", ").", " ", "Return", "s", " ", "als", "o", " ", "a", " ", "dict", " ", "with", "e", " ", "the", "\\", "10", ";", "\t\t\t", "data", " ", "generat", "ion", " ", "structure", " ", "include", "d", ".", " ", "A", " ", "dict", " ", "with", " ", "keys", ":", "\\", "10", ";", "\t\t\t", "\t", "-", " ", "component", "\\u", "params", ":", " ", " ", "a", " ", "n", "\\u", "cols", " ", "length", " ", "list", " ", "of", " ", "lists", ".", " ", "Whe", "re", " ", "each", " ", "\\", "10", ";", "\t\t\t", "\t", "list", " ", "is", " ", "a", " ", "set", " ", "of", " ", "component", " ", "model", " ", "parameter", "s", " ", "for", " ", "each", " ", "cluster", " ", "in", "\\", "10", ";", "\t\t\t", "\t", "the", " ", "view", " ", "to", " ", "whi", "ch", " ", "tha", "t", " ", "column", " ", "belo", "ngs", "\\", "10", ";", "\t\t\t", "\t", "-", " ", "cols", "\\u", "to", "\\u", "views", ":", " ", "a", " ", "list", " ", "assign", "ing", " ", "each", " ", "column", " ", "to", " ", "a", " ", "view", "\\", "10", ";", "\t\t\t", "\t", "-", " ", "rows", "\\u", "to", "\\u", "cluster", "s", ":", " ", "a", " ", "n", "\\u", "views", " ", "length", " ", "list", " ", "of", " ", "list", ".", " ", "Ea", "ch", " ", "entry", ",", "\\", "10", ";", "\t\t\t", "\t", "rows", "\\u", "to", "\\u", "cluster", "s", "[", "v", "][", "r", "]", " ", "is", " ", "the", " ", "cluster", " ", "to", " ", "whi", "ch", " ", "all", " ", "rows", " ", "in", " ", "\\", "10", ";", "\t\t\t", "\t", "column", "s", " ", "belonging", " ", "to", " ", "view", " ", "v", " ", "are", " ", "assign", "ed", "\\", "10", ";", "\t", "\t", "Return", "s", ":", "\\", "10", ";", "\t\t\t", "T", ",", " ", "M", "\\u", "c", "\\", "10", ";", "\t", "\t", "Exam", "ple", ":", "\\", "10", ";", "\t\t\t", ">>>", " ", "cct", "ype", "s", " ", "=", " ", "['", "continuous", "','", "continuous", "','", "multin", "omial", "','", "continuous", "','", "multin", "omial", "']", "\\", "10", ";", "\t\t\t", ">>>", " ", "disa", "rg", "s", " ", "=", " ", "[", "Non", "e", ",", " ", "Non", "e", ",", " ", "dict", "(", "K", "=", "5", "),", " ", "Non", "e", ",", " ", "dict", "(", "K", "=", "2", ")]", "\\", "10", ";", "\t\t\t", ">>>", " ", "n", "\\u", "rows", " ", "=", " ", "10", "\\", "10", ";", "\t\t\t", ">>>", " ", "cols", "\\u", "to", "\\u", "views", " ", "=", " ", "[", "0", ",", " ", "0", ",", " ", "1", ",", " ", "1", ",", " ", "2", "]", "\\", "10", ";", "\t\t\t", ">>>", " ", "cluster", "\\u", "weight", "s", " ", "=", " ", "[[", ".3", ",", " ", ".7", "],[", ".5", ",", " ", ".5", "],[", ".2", ",", " ", ".3", ",", " ", ".5", "]]", "\\", "10", ";", "\t\t\t", ">>>", " ", "separation", " ", "=", " ", "[.", "9", ",", " ", ".6", ",", " ", ".9", "]", "\\", "10", ";", "\t\t\t", ">>>", " ", "T", ",", " ", "M", "\\u", "c", " ", "=", " ", "gen", "\\u", "data", "(", "cct", "ype", "s", ",", " ", "n", "\\u", "rows", ",", " ", "cols", "\\u", "to", "\\u", "views", ",", " ", "cluster", "\\u", "weight", "s", ",", "\\", "10", ";", "\t\t\t", "\t", "separation", ",", " ", "seed", "=", "0", ",", " ", "dist", "args", "=", "dist", "args", ")", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "Inputs_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "n", "\\u", "rows_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Type", "Error_", "(_", "\"", "n", "\\u", "rows", " ", "shou", "ld", " ", "be", " ", "an", " ", "integ", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "cct", "ypes_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Type", "Error_", "(_", "\"", "cct", "ype", "s", " ", "shou", "ld", " ", "be", " ", "a", " ", "list", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n", "\\u", "cols", "\\u", "cct", "ypes_", "=_", "len_", "(_", "cct", "ypes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cct", "ype_", "in_", "cct", "ypes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "isinstance_", "(_", "cct", "ype_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Type", "Error_", "(_", "\"", "cct", "ype", "s", " ", "shou", "ld", " ", "be", " ", "a", " ", "list", " ", "of", " ", "string", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "will", " ", "have", " ", "to", " ", "update", " ", "whe", "n", " ", "new", " ", "component", " ", "model", "s", " ", "are", " ", "added_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cct", "ype_", "not_", "in_", "[_", "'", "continuous", "'_", ",_", "'", "multin", "omial", "'_", ",_", "'", "cyclic", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Value", "Error_", "(_", "\"", "invalid", " ", "cct", "ype", "in", " ", "cct", "ype", "s", ":", " ", "%", "s", ".\"_", "%_", "cct", "ype_", ")_", "\\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_", "isinstance_", "(_", "cols", "\\u", "to", "\\u", "views_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Type", "Error_", "(_", "\"", "cols", "\\u", "to", "\\u", "views", " ", "shou", "ld", " ", "be", " ", "a", " ", "list", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "cols", "\\u", "to", "\\u", "views_", ")_", "!=_", "n", "\\u", "cols", "\\u", "cct", "ypes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Value", "Error_", "(_", "\"", "number", " ", "of", " ", "column", "s", " ", "in", " ", "cct", "ype", "s", " ", "doe", "s", " ", "not", " ", "match", " ", "number", "\\\\", "\\", "10", ";", "\t", "\t", " ", "of", " ", "column", "s", " ", "in", " ", "cols", "\\u", "to", "\\u", "views", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "min_", "(_", "cols", "\\u", "to", "\\u", "views_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Value", "Error_", "(_", "\"", "min", " ", "value", " ", "of", " ", "cols", "\\u", "to", "\\u", "views", " ", "shou", "ld", " ", "be", " ", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n", "\\u", "views", "\\u", "cols", "\\u", "to", "\\u", "views_", "=_", "max_", "(_", "cols", "\\u", "to", "\\u", "views_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "set\\u", "ct", "v_", "=_", "set_", "(_", "cols", "\\u", "to", "\\u", "views_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "set\\u", "ct", "v_", ")_", "!=_", "n", "\\u", "views", "\\u", "cols", "\\u", "to", "\\u", "views_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Value", "Error_", "(_", "\"", "View", " ", "indice", "s", " ", "skip", "ped", " ", "in", " ", "cols", "\\u", "to", "\\u", "views", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "cluster", " ", "weights_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "cluster", "\\u", "weights_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Type", "Error_", "(_", "\"", "cluster", "\\u", "weight", "s", " ", "shou", "ld", " ", "be", " ", "a", " ", "list", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "n", "\\u", "views", "\\u", "cols", "\\u", "to", "\\u", "views_", "!=_", "len_", "(_", "cluster", "\\u", "weights_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Value", "Error_", "(_", "\"", "The", " ", "number", " ", "of", " ", "views", " ", "in", " ", "cols", "\\u", "to", "\\u", "views", " ", "and", " ", "\\\\", "\\", "10", ";", "\t\t\t", "cluster", "\\u", "weight", "s", " ", "do", " ", "not", " ", "agree", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "each", " ", "set", " ", "of", " ", "weights_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "W_", "in_", "cluster", "\\u", "weights_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "isinstance_", "(_", "W_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Type", "Error_", "(_", "\"", "cluster", "\\u", "weight", "s", " ", "shou", "ld", " ", "be", " ", "a", " ", "list", " ", "of", " ", "lists", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "math_", "._", "fabs_", "(_", "sum_", "(_", "W_", ")_", "-_", "1.0_", ")_", ">_", ".0000", "001_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Value", "Error_", "(_", "\"", "each", " ", "vector", " ", "of", " ", "weight", "s", " ", "shou", "ld", " ", "sum", " ", "to", " ", "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_", "not_", "isinstance_", "(_", "separation", "_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Type", "Error_", "(_", "\"", "separation", " ", "shou", "ld", " ", "be", " ", "a", " ", "list", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "separation", "_", ")_", "!=_", "n", "\\u", "views", "\\u", "cols", "\\u", "to", "\\u", "views_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Value", "Error_", "(_", "\"", "number", " ", "of", " ", "view", " ", "in", " ", "separation", " ", "and", " ", "cols", "\\u", "to", "\\u", "views", " ", "do", " ", "not", " ", "agree", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "c_", "in_", "separation", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "isinstance_", "(_", "c_", ",_", "float_", ")_", "or_", "c_", ">_", "1.0_", "or_", "c_", "<_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Value", "Error_", "(_", "\"", "each", " ", "value", " ", "in", " ", "separation", " ", "shou", "ld", " ", "be", " ", "a", " ", "float", " ", "from", " ", "0", " ", "to", " ", "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_", "num", "\\u", "views_", "=_", "len_", "(_", "separation", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "cols_", "=_", "len_", "(_", "cols", "\\u", "to", "\\u", "views_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "the", " ", "cct", "ype", "s", " ", "vs", " ", "the", " ", "dist", "args_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dist", "args_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "dist", "args_", "=_", "[_", "None_", "for_", "i_", "in_", "range_", "(_", "n", "\\u", "cols_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "dist", "args_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Type", "Error_", "(_", "\"", "dist", "args", " ", "shou", "ld", " ", "be", " ", "a", " ", "list", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "dist", "args_", ")_", "!=_", "n", "\\u", "cols_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Value", "Error_", "(_", "\"", "dist", "args", " ", "shou", "ld", " ", "have", " ", "an", " ", "entry", " ", "for", " ", "each", " ", "column", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "n", "\\u", "cols_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "cct", "ypes_", "[_", "i_", "]_", "==_", "'", "continuous", "'_", "or_", "cct", "ypes_", "[_", "i_", "]_", "==_", "'", "cyclic", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "dist", "args_", "[_", "i_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Value", "Error_", "(_", "\"", "dist", "args", " ", "entry", " ", "for", " ", "'", "continuous", "'", " ", "cct", "ype", " ", "shou", "ld", " ", "be", " ", "Non", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cct", "ypes_", "[_", "i_", "]_", "==_", "'", "multin", "omial", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "not_", "isinstance_", "(_", "dist", "args_", "[_", "i_", "]_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Type", "Error_", "(_", "\"", "dit", "args", " ", "for", " ", "cct", "ype", " ", "'", "multin", "omial", "'", " ", "shou", "ld", " ", "be", " ", "a", " ", "dict", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "dist", "args_", "[_", "i_", "]_", "._", "keys_", "(_", ")_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Key", "Error_", "(_", "\"", "dist", "args", " ", "for", " ", "cct", "ype", " ", "'", "multin", "omial", "'", " ", "shou", "ld", " ", "have", " ", "one", " ", "key", ",", " ", "'", "K", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "K", "'_", "not_", "in_", "dist", "args_", "[_", "i_", "]_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Key", "Error_", "(_", "\"", "dist", "args", " ", "for", " ", "cct", "ype", " ", "'", "multin", "omial", "'", " ", "shou", "ld", " ", "have", " ", "the", " ", "key", " ", "'", "K", "'\"_", ")_", "\\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\t", "\t\t_", "raise_", "Value", "Error_", "(_", "\"", "invalid", " ", "cct", "ype", "in", " ", "cct", "ype", "s", ":", " ", "%", "s", ".\"_", "%_", "cct", "ypes_", "[_", "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_", "random_", "._", "seed_", "(_", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numpy_", "._", "random_", "._", "seed_", "(_", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generate", " ", "the", " ", "rows", " ", "to", " ", "categor", "ies", " ", "partit", "ion", "s", " ", "(", "mut", "lino", "mia", "l", ")_", "\\u\\u\\uNL\\u\\u\\u_", "rows", "\\u", "to", "\\u", "clusters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "W_", "in_", "cluster", "\\u", "weights_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "c", "W_", "=_", "list_", "(_", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "len_", "(_", "c", "W_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "c", "W_", "[_", "i_", "]_", "+=_", "c", "W_", "[_", "i_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "K_", "=_", "len_", "(_", "c", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rows", "\\u", "to", "\\u", "cluster", "s", "\\u", "view_", "=_", "list_", "(_", "range_", "(_", "K_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "range_", "(_", "K_", ",_", "n", "\\u", "rows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "rows", "\\u", "to", "\\u", "cluster", "s", "\\u", "view_", "._", "append_", "(_", "p", "\\u", "draw_", "(_", "c", "W_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "random_", "._", "shuffle_", "(_", "rows", "\\u", "to", "\\u", "cluster", "s", "\\u", "view_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "rows", "\\u", "to", "\\u", "cluster", "s", "\\u", "view_", ")_", "==_", "n", "\\u", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rows", "\\u", "to", "\\u", "clusters_", "._", "append_", "(_", "rows", "\\u", "to", "\\u", "cluster", "s", "\\u", "view_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "get", "\\u", "next", "\\u", "seed_", "=_", "lambda_", ":_", "random_", "._", "randrange_", "(_", "2147483647", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "generat", "ing", " ", "the", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "table_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "n", "\\u", "rows_", ",_", "n", "\\u", "cols_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "component", "\\u", "params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "range_", "(_", "n", "\\u", "cols_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "view_", "=_", "cols", "\\u", "to", "\\u", "views_", "[_", "col_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "number", " ", "of", " ", "cluster", " ", "in", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "clusters_", "=_", "len_", "(_", "cluster", "\\u", "weights_", "[_", "view_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cct", "ype_", "=_", "cct", "ypes_", "[_", "col_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "C_", "=_", "separation", "_", "[_", "view_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "e", " ", "a", " ", "set", " ", "of", " ", "C", "-", "separate", "d", " ", "component", " ", "model", " ", "parameter", "s", " _", "\\u\\u\\uNL\\u\\u\\u_", "component", "\\u", "parameters_", "=_", "generat", "e\\u", "separate", "d\\u", "model", "\\u", "parameters_", "(_", "cct", "ype_", ",_", "C_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "clusters_", ",_", "get", "\\u", "next", "\\u", "seed_", ",_", "dist", "args_", "=_", "dist", "args_", "[_", "col_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "component", "\\u", "params_", "._", "append_", "(_", "component", "\\u", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "data", " ", "generat", "ion", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "gen_", "=_", "get", "\\u", "data\\u", "generator_", "[_", "cct", "ype_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "range_", "(_", "n", "\\u", "rows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "cluster", " ", "this", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "cluster_", "=_", "rows", "\\u", "to", "\\u", "clusters_", "[_", "view_", "]_", "[_", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "component", "\\u", "parameters_", "[_", "cluster_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "gen_", "(_", "params_", ",_", "1_", ",_", "gen", "\\u", "seed_", "=_", "get", "\\u", "next", "\\u", "seed_", "(_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "table_", "[_", "row_", ",_", "col_", "]_", "=_", "x_", "\\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_", "T_", "=_", "data\\u", "table_", "._", "tolist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "M", "\\u", "c_", "=_", "du_", "._", "gen", "\\u", "M", "\\u", "c\\u", "from", "\\u", "T_", "(_", "T_", ",_", "cct", "ypes_", "=_", "cct", "ypes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "return", "\\u", "structure_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "structure_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "structure_", "[_", "'", "component", "\\u", "params", "'_", "]_", "=_", "component", "\\u", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "structure_", "[_", "'", "cols", "\\u", "to", "\\u", "views", "'_", "]_", "=_", "cols", "\\u", "to", "\\u", "views_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "structure_", "[_", "'", "rows", "\\u", "to", "\\u", "cluster", "s", "'_", "]_", "=_", "rows", "\\u", "to", "\\u", "clusters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "structure_", "[_", "'", "cluster", "\\u", "weight", "s", "'_", "]_", "=_", "cluster", "\\u", "weights_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "T_", ",_", "M", "\\u", "c_", ",_", "structure_", "\\u\\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_", "return_", "T_", ",_", "M", "\\u", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 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__init__(self, name):\n\t\t\tself.name = name\n\n\t\tdef __eq__(self, value):\n\t\t\treturn self.is_equal(value)\n\n\t\tdef is_equal(self, value):\n\t\t\treturn Search.Node(self.name, {\"is\": value})\n\n\tclass EqualityNodeBuilder(IsNodeBuilder):\n\t\tdef __ne__(self, value):\n\t\t\treturn self.is_not_equal(value)\n\n\t\tdef is_not_equal(self, value):\n\t\t\treturn Search.Node(self.name, {\"is_not\": value})\n\n\tclass KeyValueNodeBuilder(object):\n\t\tdef __init__(self, name):\n\t\t\tself.name = name\n\n\t\tdef __eq__(self, value):\n\t\t\treturn self.is_equal(value)\n\n\t\tdef is_equal(self, value):\n\t\t\treturn Search.Node(self.name, value)\n\n\t\tdef __ne__(self, value):\n\t\t\treturn self.is_not_equal(value)\n\n\t\tdef is_not_equal(self, value):\n\t\t\treturn Search.Node(self.name, not value)\n\n\tclass PartialMatchNodeBuilder(EqualityNodeBuilder):\n\t\tdef starts_with(self, value):\n\t\t\treturn Search.Node(self.name, {\"starts_with\": value})\n\n\t\tdef ends_with(self, value):\n\t\t\treturn Search.Node(self.name, {\"ends_with\": value})\n\n\tclass TextNodeBuilder(PartialMatchNodeBuilder):\n\t\tdef contains(self, value):\n\t\t\treturn Search.Node(self.name, {\"contains\": value})\n\n\tclass Node(object):\n\t\tdef __init__(self, name, dict):\n\t\t\tself.name = name\n\t\t\tself.dict = dict\n\n\t\tdef to_param(self):\n\t\t\treturn self.dict\n\n\tclass MultipleValueNodeBuilder(object):\n\t\tdef __init__(self, name, whitelist = []):\n\t\t\tself.name = name\n\t\t\tself.whitelist = whitelist\n\n\t\tdef in_list(self, *values):\n\t\t\tif isinstance(values[0], list):\n\t\t\t\tvalues = values[0]\n\n\t\t\tinvalid_args = set(values) - set(self.whitelist)\n\t\t\tif len(self.whitelist) > 0 and len(invalid_args) > 0:\n\t\t\t\terror_string = \"Invalid argument(s) for %s: %s\" % (self.name, \", \".join(invalid_args))\n\t\t\t\traise AttributeError(error_string)\n\t\t\treturn Search.Node(self.name, list(values))\n\n\t\tdef __eq__(self, value):\n\t\t\treturn self.in_list([value])\n\n\tclass MultipleValueOrTextNodeBuilder(TextNodeBuilder, MultipleValueNodeBuilder):\n\t\tdef __init__(self, name, whitelist = []):\n\t\t\tSearch.MultipleValueNodeBuilder.__init__(self, name, whitelist)\n\n\tclass RangeNodeBuilder(object):\n\t\tdef __init__(self, name):\n\t\t\tself.name = name\n\n\t\tdef __eq__(self, value):\n\t\t\treturn self.is_equal(value)\n\n\t\tdef is_equal(self, value):\n\t\t\treturn Search.EqualityNodeBuilder(self.name) == value\n\n\t\tdef __ge__(self, min):\n\t\t\treturn self.greater_than_or_equal_to(min)\n\n\t\tdef greater_than_or_equal_to(self, min):\n\t\t\treturn Search.Node(self.name, {\"min\": min})\n\n\t\tdef __le__(self, max):\n\t\t\treturn self.less_than_or_equal_to(max)\n\n\t\tdef less_than_or_equal_to(self, max):\n\t\t\treturn Search.Node(self.name, {\"max\": max})\n\n\t\tdef between(self, min, max):\n\t\t\treturn Search.Node(self.name, {\"min\": min, \"max\": max})", "metadata": "root.Search", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "class RangeNodeBuilder(object):", "start_line": 75, "start_column": 1, "end_line": 75, "end_column": 32 } ]
[ { "span": "def __ge__(self, min):", "start_line": 85, "start_column": 2, "end_line": 85, "end_column": 24 }, { "span": "def __le__(self, max):", "start_line": 91, "start_column": 2, "end_line": 91, "end_column": 24 } ]
1
false
[ "[CLS]_", "Incomp", "lete", "_", "ordering_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "class_", "Search_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "class_", "Is", "Node", "Builder_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "is", "\\u", "equal_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "equal_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "{_", "\"", "is", "\"_", ":_", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Equali", "ty", "Node", "Builder_", "(_", "Is", "Node", "Builder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "is", "\\u", "not", "\\u", "equal_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "not", "\\u", "equal_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "{_", "\"", "is", "\\u", "not", "\"_", ":_", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Key", "Value", "Node", "Builder_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "is", "\\u", "equal_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "equal_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "is", "\\u", "not", "\\u", "equal_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "not", "\\u", "equal_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "not_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Parti", "al", "Match", "Node", "Builder_", "(_", "Equali", "ty", "Node", "Builder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "starts", "\\u", "with_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "{_", "\"", "starts", "\\u", "with", "\"_", ":_", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ends", "\\u", "with_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "{_", "\"", "ends", "\\u", "with", "\"_", ":_", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Text", "Node", "Builder_", "(_", "Parti", "al", "Match", "Node", "Builder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "contains_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "{_", "\"", "contain", "s", "\"_", ":_", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Node_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dict_", "=_", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "param_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Multipl", "e", "Value", "Node", "Builder_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "whitelist_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "whitelist_", "=_", "whitelist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "in", "\\u", "list_", "(_", "self_", ",_", "*_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "isinstance_", "(_", "values_", "[_", "0_", "]_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "values_", "=_", "values_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "invalid", "\\u", "args_", "=_", "set_", "(_", "values_", ")_", "-_", "set_", "(_", "self_", "._", "whitelist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "whitelist_", ")_", ">_", "0_", "and_", "len_", "(_", "invalid", "\\u", "args_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "error", "\\u", "string_", "=_", "\"", "Inva", "lid", " ", "argu", "ment", "(", "s", ")", " ", "for", " ", "%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "name_", ",_", "\",", " ", "\"_", "._", "join_", "(_", "invalid", "\\u", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Attribute", "Error_", "(_", "error", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "list_", "(_", "values_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "in", "\\u", "list_", "(_", "[_", "value_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Multipl", "e", "Value", "Or", "Text", "Node", "Builder_", "(_", "Text", "Node", "Builder_", ",_", "Multipl", "e", "Value", "Node", "Builder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "whitelist_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "Search_", "._", "Multipl", "e", "Value", "Node", "Builder_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "whitelist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Range", "Node", "Builder_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "is", "\\u", "equal_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "equal_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Equali", "ty", "Node", "Builder_", "(_", "self_", "._", "name_", ")_", "==_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ge", "\\u\\u_", "(_", "self_", ",_", "min_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "great", "er", "\\u", "than", "\\u", "or", "\\u", "equal", "\\u", "to_", "(_", "min_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "great", "er", "\\u", "than", "\\u", "or", "\\u", "equal", "\\u", "to_", "(_", "self_", ",_", "min_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "{_", "\"", "min", "\"_", ":_", "min_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "le", "\\u\\u_", "(_", "self_", ",_", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "less", "\\u", "than", "\\u", "or", "\\u", "equal", "\\u", "to_", "(_", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "less", "\\u", "than", "\\u", "or", "\\u", "equal", "\\u", "to_", "(_", "self_", ",_", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "{_", "\"", "max", "\"_", ":_", "max_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "between_", "(_", "self_", ",_", "min_", ",_", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Search_", "._", "Node_", "(_", "self_", "._", "name_", ",_", "{_", "\"", "min", "\"_", ":_", "min_", ",_", "\"", "max", "\"_", ":_", "max_", "}_", ")_" ]
[ 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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/challenge.py
[ { "content": "from hacksport.problem import Challenge, ProtectedFile, ExecutableFile,Remote\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Problem(Remote):\n program_name = \"rop_fun\"\n files = [ProtectedFile(\"flag.txt\")]", "metadata": "root.Problem", "header": "['module', '___EOS___']", "index": 2 }, { "content": " def initialize(self) :\n self.flag = \"s0_much_r0p_4hhhhhh\"", "metadata": "root.Problem.initialize", "header": "['class', 'Problem', '(', 'Remote', ')', ':', '___EOS___']", "index": 5 } ]
[ { "span": "from hacksport.problem import Challenge, ProtectedFile, ExecutableFile,Remote", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 77 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "hack", "sport_", "._", "problem_", "import_", "Chall", "enge", "_", ",_", "Protect", "ed", "File_", ",_", "Executable", "File_", ",_", "Remote_", "\\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_", "Problem_", "(_", "Remote_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "program", "\\u", "name_", "=_", "\"", "rop", "\\u", "fun", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "files_", "=_", "[_", "Protect", "ed", "File_", "(_", "\"", "flag", ".", "txt", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Problem_", "(_", "Remote_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "initialize_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flag_", "=_", "\"", "s0", "\\u", "muc", "h", "\\u", "r", "0", "p", "\\u", "4", "hh", "hh", "hh", "\"_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
aldebaran/qibuild/python/qibuild/test/test_perf.py
[ { "content": "## Copyright (c) 2012-2016 Aldebaran Robotics. All rights reserved.\n## Use of this source code is governed by a BSD-style license that can be\n## found in the COPYING file.\n\nimport os\n\nimport qisys.sh\nimport qibuild.test\nimport qibuild.find\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test_perf(qibuild_action):\n proj = qibuild_action.add_test_project(\"perf\")\n qibuild_action(\"configure\", \"perf\", \"-DQI_WITH_PERF_TESTS=ON\")\n qibuild_action(\"make\", \"perf\")\n proj.run_tests(perf=True)\n for name in [\"perf_spam\", \"perf_eggs\"]:\n expected_path = os.path.join(proj.sdk_directory,\n \"perf-results\", name + \".xml\")\n assert os.path.exists(expected_path)\n for name in [\"perf_timeout\", \"perf_segv\"]:\n expected_path = os.path.join(proj.sdk_directory,\n \"perf-results\", name + \".xml\")\n assert not os.path.exists(expected_path)", "metadata": "root.test_perf", "header": "['module', '___EOS___']", "index": 11 } ]
[ { "span": "import qisys.sh", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 15 }, { "span": "import qibuild.test", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 19 }, { "span": "import qibuild.find", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 19 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "##", " ", "Copy", "right", " ", "(", "c", ")", " ", "2012", "-", "2016", " ", "Al", "deb", "aran", " ", "Robot", "ics", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Us", "e", " ", "of", " ", "this", " ", "source", " ", "code", " ", "is", " ", "govern", "ed", " ", "by", " ", "a", " ", "BS", "D", "-", "style", " ", "license", " ", "tha", "t", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "found", " ", "in", " ", "the", " ", "COPY", "ING", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "qi", "sys_", "._", "sh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "qi", "build_", "._", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "qi", "build_", "._", "find_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "perf_", "(_", "qi", "build", "\\u", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proj_", "=_", "qi", "build", "\\u", "action_", "._", "add", "\\u", "test\\u", "project_", "(_", "\"", "perf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qi", "build", "\\u", "action_", "(_", "\"", "configur", "e", "\"_", ",_", "\"", "perf", "\"_", ",_", "\"-", "DQ", "I", "\\u", "WITH", "\\u", "PERF", "\\u", "TESTS", "=", "ON", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qi", "build", "\\u", "action_", "(_", "\"", "make", "\"_", ",_", "\"", "perf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proj_", "._", "run", "\\u", "tests_", "(_", "perf_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "[_", "\"", "perf", "\\u", "spam", "\"_", ",_", "\"", "perf", "\\u", "egg", "s", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "proj_", "._", "sd", "k", "\\u", "directory_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "perf", "-", "results", "\"_", ",_", "name_", "+_", "\".", "xml", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "exists_", "(_", "expected", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "name_", "in_", "[_", "\"", "perf", "\\u", "timeo", "ut", "\"_", ",_", "\"", "perf", "\\u", "seg", "v", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "proj_", "._", "sd", "k", "\\u", "directory_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "perf", "-", "results", "\"_", ",_", "name_", "+_", "\".", "xml", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "expected", "\\u", "path_", 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f.py
[ { "content": "# -*- coding: utf-8 -*-\n#\n# TempoDB Python API documentation build configuration file, created by\n# sphinx-quickstart on Wed Dec 18 15:48:58 2013.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n 'sphinx.ext.autodoc',\n 'sphinx.ext.todo',\n 'sphinx.ext.coverage',\n 'sphinx.ext.pngmath',\n 'sphinx.ext.mathjax',\n 'sphinx.ext.viewcode',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'TempoDB Python API'\ncopyright = u'2014, TempoDB Inc.'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '1.0b'\n# The full version, including alpha/beta/rc tags.\nrelease = '1.0b'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = []\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\nhtml_theme = 'default'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'TempoDBPythonAPIdoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n ('index', 'TempoDBPythonAPI.tex', u'TempoDB Python API Documentation',\n u'Aaron Brenzel', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n ('index', 'tempodbpythonapi', u'TempoDB Python API Documentation',\n [u'Aaron Brenzel'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n ('index', 'TempoDBPythonAPI', u'TempoDB Python API Documentation',\n u'Aaron Brenzel', 'TempoDBPythonAPI', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sys", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 10 }, { "span": "import os", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 9 } ]
[]
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_", "#", " ", "Temp", "o", "DB", " ", "Pyth", "on", " ", "API", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "We", "d", " ", "De", "c", " ", "1", "8", " ", "15", ":", "4", "8", ":", "5", "8", " ", "2013", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "execfile", "()", "d", " ", "with", " ", "the", " ", "current", " ", "director", "y", " ", "set", " ", "to", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", "ing", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "not", " ", "all", " ", "possib", "le", " ", "configura", "tion", " ", "values", " ", "are", " ", "presen", "t", " ", "in", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autogen", "erate", "d", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "configura", "tion", " ", "values", " ", "have", " ", "a", " ", "default", ";", " ", "values", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serve", " ", "to", " ", "show", " ", "the", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "insert", "(", "0", ",", " ", "os", ".", "path", ".", "abs", "path", "('.", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "documentation", " ", "need", "s", " ", "a", " ", "minima", "l", " ", "Sph", "inx", " ", "version", ",", " ", "state", " ", "it", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "need", "s", "\\u", "sphinx", " ", "=", " ", "'", "1.0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extensi", "ons", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "autod", "oc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "todo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "covera", "ge", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "png", "math", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "math", "jax", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "view", "code", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "'.", "rst", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "encoding", " ", "of", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "source", "\\u", "encoding", " ", "=", " ", "'", "utf", "-", "8", "-", "sig", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "master", " ", "toc", "tree", " ", "document", "._", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "doc_", "=_", "'", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "project", "._", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "u", "'", "Temp", "o", "DB", " ", "Pyth", "on", " ", "API", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "u", "'", "2014", ",", " ", "Temp", "o", "DB", " ", "Inc", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "version", " ", "info", " ", "for", " ", "the", " ", "project", " ", "you", "'", "re", " ", "document", "ing", ",", " ", "acts", " ", "as", " ", "replace", "ment", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "|", "version", "|", " ", "and", " ", "|", "release", "|", ",", " ", "als", "o", " ", "used", " ", "in", " ", "vari", "ous", " ", "other", " ", "place", "s", " ", "through", "out", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "short", " ", "X", ".", "Y", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "1.0", "b", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "release_", "=_", "'", "1.0", "b", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "language", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "pattern", "s", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "match", " ", "files", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "ies", " ", "to", " ", "ignore", " ", "whe", "n", " ", "look", "ing", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "patterns_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "re", "ST", " ", "default", " ", "role", " ", "(", "used", " ", "for", " ", "this", " ", "markup", ":", " ", "`", "text", "`)", " ", "to", " ", "use", " ", "for", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "\\u", "role", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "'(", ")'", " ", "will", " ", "be", " ", "append", "ed", " ", "to", " ", ":", "func", ":", " ", "etc", ".", " ", "cross", "-", "reference", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "function", "\\u", "parenthes", "es", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "current", " ", "module", " ", "name", " ", "will", " ", "be", " ", "prepend", "ed", " ", "to", " ", "all", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unit", " ", "titles", " ", "(", "suc", "h", " ", "as", " ", "..", " ", "function", "::", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "module", "\\u", "names", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "section", "author", " ", "and", " ", "module", "author", " ", "directive", "s", " ", "will", " ", "be", " ", "shown", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ".", " ", "The", "y", " ", "are", " ", "ignore", "d", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "\\u", "author", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "Pyg", "ment", "s", " ", "(", "synta", "x", " ", "highlight", "ing", ")", " ", "style", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "pyg", "ment", "s", "\\u", "style_", "=_", "'", "sphinx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "ignore", "d", " ", "prefix", "es", " ", "for", " ", "module", " ", "index", " ", "sorting", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "modi", "nde", "x", "\\u", "common", "\\u", "prefix", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "keep", " ", "warn", "ings", " ", "as", " ", "\"", "system", " ", "message", "\"", " ", "paragraph", "s", " ", "in", " ", "the", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "keep", "\\u", "warn", "ings", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "See", " ", "the", " ", "documentation", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "list", " ", "of", " ", "bui", "lti", "n", " ", "themes", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Them", "e", " ", "options", " ", "are", " ", "them", "e-", "specific", " ", "and", " ", "customize", " ", "the", " ", "look", " ", "and", " ", "feel", " ", "of", " ", "a", " ", "theme_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "ther", ".", " ", " ", "For", " ", "a", " ", "list", " ", "of", " ", "options", " ", "avail", "able", " ", "for", " ", "each", " ", "them", "e", ",", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "options", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "themes", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "for", " ", "this", " ", "set", " ", "of", " ", "Sph", "inx", " ", "document", "s", ".", " ", " ", "If", " ", "Non", "e", ",", " ", "it", " ", "default", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"<", "project", ">", " ", "v", "<", "release", ">", " ", "documentation", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "shorter", " ", "title", " ", "for", " ", "the", " ", "navigation", " ", "bar", ".", " ", " ", "Default", " ", "is", " ", "the", " ", "same", " ", "as", " ", "html", "\\u", "title", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "short", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "sidebar", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "within", " ", "the", " ", "static", " ", "path", ")", " ", "to", " ", "use", " ", "as", " ", "fav", "icon", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", ".", " ", " ", "Thi", "s", " ", "file", " ", "shou", "ld", " ", "be", " ", "a", " ", "Window", "s", " ", "icon", " ", "file", " ", "(.", "ico", ")", " ", "bei", "ng", " ", "16", "x1", "6", " ", "or", " ", "32", "x3", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pixel", "s", " ", "large", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "fav", "icon", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "static", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "style", " ", "sheet", "s", ")", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "y", " ", "are", " ", "copie", "d", " ", "after", " ", "the", " ", "bui", "lti", "n", " ", "static", " ", "files", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "a", " ", "file", " ", "named", " ", "\"", "default", ".", "css", "\"", " ", "will", " ", "overwrit", "e", " ", "the", " ", "bui", "lti", "n", " ", "\"", "default", ".", "css", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "static", "\\u", "path_", "=_", "[_", "'\\u", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "extra", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "robots", ".", "txt", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "hta", "ccess", ")", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "se", " ", "files", " ", "are", " ", "copied_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "direct", "ly", " ", "to", " ", "the", " ", "root", " ", "of", " ", "the", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "extra", "\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "smart", "ypa", "nts", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "index", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "index", " ", "is", " ", "split", " ", "int", "o", " ", "individual", " ", "page", "s", " ", "for", " ", "each", " ", "letter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "split", "\\u", "index", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "link", "s", " ", "to", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "the", " ", "page", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "source", "link", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"", "Creat", "ed", " ", "usi", "ng", " ", "Sph", "inx", "\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "sphinx", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"(", "C", ")", " ", "Copy", "right", " ", "...\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "copyr", "ight", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "Temp", "o", "DB", "Pyth", "on", "API", "doc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "elements_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "pape", "r", "'", " ", "or", " ", "'", "a4", "pape", "r", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "papers", "ize", "':", " ", "'", "letter", "pape", "r", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "font", " ", "size", " ", "('", "10", "pt", "',", " ", "'", "11", "pt", "'", " ", "or", " ", "'", "1", "2p", "t", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "points", "ize", "':", " ", "'", "10", "pt", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "stu", "ff", " ", "for", " ", "the", " ", "La", "Te", "X", " ", "preamble", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "preamble", "':", " ", "''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", ",", " ", "manu", "al", ",", " ", "or", " ", "own", " ", "class", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "Temp", "o", "DB", "Pyth", "on", "API", ".", "tex", "'_", ",_", "u", "'", "Temp", "o", "DB", " ", "Pyth", "on", " ", "API", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Aa", "ron", " ", "Bre", "nze", "l", "'_", ",_", "'", "manu", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "title", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "\"", "manu", "al", "\"", " ", "document", "s", ",", " ", "if", " ", "this", " ", "is", " ", "true", ",", " ", "then", " ", "toplevel", " ", "heading", "s", " ", "are", " ", "part", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "chapters", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "part", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "page", " ", "reference", "s", " ", "after", " ", "internal", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "pager", "ef", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "manu", "al", " ", "page", " ", "output", " ", "--------------", "--------------", "-----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "One", " ", "entry", " ", "per", " ", "manu", "al", " ", "page", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "name", ",", " ", "description", ",", " ", "author", "s", ",", " ", "manu", "al", " ", "section", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "man", "\\u", "pages_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "tempo", "dbp", "yth", "ona", "pi", "'_", ",_", "u", "'", "Temp", "o", "DB", " ", "Pyth", "on", " ", "API", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "u", "'", "Aa", "ron", " ", "Bre", "nze", "l", "'_", "]_", ",_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "man", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "Tex", "info", " ", "output", " ", "--------------", "--------------", "--------------", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "Tex", "info", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "dir", " ", "menu", " ", "entry", ",", " ", "description", ",", " ", "category", ")_", "\\u\\u\\uNL\\u\\u\\u_", "tex", "info", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "Temp", "o", "DB", "Pyth", "on", "API", "'_", ",_", "u", "'", "Temp", "o", "DB", " ", "Pyth", "on", " ", "API", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Aa", "ron", " ", "Bre", "nze", "l", "'_", ",_", "'", "Temp", "o", "DB", "Pyth", "on", "API", "'_", ",_", "'", "One", " ", "line", " ", "description", " ", "of", " ", "project", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mis", "cell", "ane", "ous", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "w", " ", "to", " ", "display", " ", "URL", " ", "addresse", "s", ":", " ", "'", "footnote", "',", " ", "'", "no", "',", " ", "or", " ", "'", "inline", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "show", "\\u", "urls", " ", "=", " ", "'", "footnote", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "do", " ", "not", " ", "generat", "e", " ", "a", " ", "@", "deta", "il", "menu", " ", "in", " ", "the", " ", "\"", "Top", "\"", " ", "node", "'", "s", " ", "menu", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "no", "\\u", "deta", "il", "menu", " ", "=", " ", "False_", "\\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, 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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 ]
Unused local variable
pydata/pandas/pandas/util/testing.py
[ { "content": "def add_nans(panel):\n I, J, N = panel.shape\n for i, item in enumerate(panel.items):\n dm = panel[item]\n for j, col in enumerate(dm.columns):\n dm[col][:i + j] = np.NaN\n return panel", "metadata": "root.add_nans", "header": "['module', '___EOS___']", "index": 1745 } ]
[ { "span": "I,", "start_line": 1746, "start_column": 4, "end_line": 1746, "end_column": 5 }, { "span": "J,", "start_line": 1746, "start_column": 7, "end_line": 1746, "end_column": 8 }, { "span": "N ", "start_line": 1746, "start_column": 10, "end_line": 1746, "end_column": 11 } ]
[]
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_", "add", "\\u", "nans", "_", "(_", "panel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "I_", ",_", "J_", ",_", "N_", "=_", "panel_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "item_", "in_", "enumerate_", "(_", "panel_", "._", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dm_", "=_", "panel_", "[_", "item_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", ",_", "col_", "in_", "enumerate_", "(_", "dm_", "._", "columns_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dm_", "[_", "col_", "]_", "[_", ":_", "i_", "+_", "j_", "]_", "=_", "np_", "._", "Na", "N_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "panel_", "\\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, 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 ]
Testing equality to None
seomoz/shovel/shovel/tasks.py
[ { "content": " def read(self, path, base=None):\n '''Import some tasks'''\n if base == None:\n base = os.getcwd()\n absolute = os.path.abspath(path)\n if os.path.isfile(absolute):\n # Load that particular file\n logger.info('Loading %s' % absolute)\n self.extend(Task.load(path, base))\n elif os.path.isdir(absolute):\n # Walk this directory looking for tasks\n tasks = []\n for root, _, files in os.walk(absolute):\n files = [f for f in files if f.endswith('.py')]\n for child in files:\n absolute = os.path.join(root, child)\n logger.info('Loading %s' % absolute)\n tasks.extend(Task.load(absolute, base))\n self.extend(tasks)", "metadata": "root.Shovel.read", "header": "['class', 'Shovel', '(', 'object', ')', ':', '___EOS___']", "index": 80 } ]
[ { "span": "base == None:", "start_line": 82, "start_column": 11, "end_line": 82, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Sho", "vel_", "(_", "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_", "read_", "(_", "self_", ",_", "path_", ",_", "base_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Import", " ", "some", " ", "task", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "base_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "absolute_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "absolute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Load", " ", "tha", "t", " ", "partic", "ular", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "'", "Load", "ing", " ", "%", "s", "'_", "%_", "absolute_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "extend_", "(_", "Task_", "._", "load_", "(_", "path_", ",_", "base_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "path_", "._", "isdir_", "(_", "absolute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Walk", " ", "this", " ", "director", "y", " ", "look", "ing", " ", "for", " ", "tasks_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tasks_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "root_", ",_", "\\u_", ",_", "files_", "in_", "os_", "._", "walk_", "(_", "absolute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files_", "=_", "[_", "f_", "for_", "f_", "in_", "files_", "if_", "f_", "._", "endswith_", "(_", "'.", "py", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "child_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "absolute_", "=_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "child_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "info_", "(_", "'", "Load", "ing", " ", "%", "s", "'_", "%_", "absolute_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tasks_", "._", "extend_", "(_", "Task_", "._", "load_", "(_", "absolute_", ",_", "base_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "extend_", "(_", "tasks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
tuturto/pyherc/src/herculeum/ui/gui/map.py
[ { "content": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2010-2015 Tuukka Turto\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n# \n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n\"\"\"\nModule for main map related functionality\n\"\"\"\nfrom random import Random\n\nfrom herculeum.ui.controllers import MoveController\nfrom herculeum.ui.gui.animations import AnimationFactory\nfrom herculeum.ui.gui.eventdisplay import EventMessageWidget\nfrom herculeum.ui.gui.widgets import (EffectsWidget, HitPointsWidget,\n SpellSelectorWidget, TimerAdapter)\nfrom herculeum.ui.gui.layers import (zorder_floor, zorder_wall, zorder_ornament,\n zorder_item, zorder_character,\n zorder_counter, zorder_trap)\nfrom pyherc.data.model import DIED_IN_DUNGEON\nfrom pyherc.events import e_event_type\nfrom pyherc.ports import (is_move_legal, move, attack, is_dig_legal, dig,\n wait, pick_up, cast)\nfrom PyQt4.QtCore import (pyqtProperty, pyqtSignal, QAbstractAnimation,\n QEasingCurve, QEvent, QObject, QPropertyAnimation,\n QSequentialAnimationGroup, QSize, Qt, QTimer)\nfrom PyQt4.QtGui import (QColor, QFont, QGraphicsPixmapItem, QGraphicsScene,\n QGraphicsSimpleTextItem, QGraphicsView, QHBoxLayout,\n QTransform, QVBoxLayout, QWidget)\nfrom pyherc.data import get_characters, get_items, get_tiles\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PlayMapWindow(QWidget):\n \"\"\"\n Window for displaying playing world\n\n .. versionadded:: 0.5\n \"\"\"\n\n MenuRequested = pyqtSignal(name='MenuRequested')\n EndScreenRequested = pyqtSignal(name='EndScreenRequested')\n\n\n\n\n\n", "metadata": "root.PlayMapWindow", "header": "['module', '___EOS___']", "index": 48 }, { "content": " def __init__(self, parent, model, surface_manager, action_factory, rng,\n rules_engine, configuration):\n \"\"\"\n Default constructor\n \"\"\"\n super().__init__(parent)\n\n self.model = model\n self.surface_manager = surface_manager\n self.action_factory = action_factory\n self.rng = rng\n self.current_level = None\n self.configuration = configuration\n\n self.hit_points_widget = None\n self.message_widget = None\n self.map_widget = None\n self.effects_widget = None\n self.spell_selector = None\n\n self.__set_layout(model, surface_manager, action_factory, rng,\n rules_engine, configuration)", "metadata": "root.PlayMapWindow.__init__", "header": "['class', 'PlayMapWindow', '(', 'QWidget', ')', ':', '___EOS___']", "index": 54 }, { "content": " def __set_layout(self, model, surface_manager, action_factory, rng,\n rules_engine, configuration):\n \"\"\"\n Set layout of this window\n \"\"\"\n layout = QVBoxLayout()\n status_layout = QHBoxLayout()\n\n self.hit_points_widget = HitPointsWidget(parent = self,\n surface_manager = surface_manager)\n self.effects_widget = EffectsWidget(parent = self,\n surface_manager = surface_manager)\n\n self.spell_selector = SpellSelectorWidget(parent = self,\n surface_manager = surface_manager)\n\n self.map_widget = PlayMapWidget(parent = self,\n model = model,\n surface_manager = surface_manager,\n action_factory = action_factory,\n rng = rng,\n rules_engine = rules_engine,\n configuration = configuration)\n self.map_widget.MenuRequested.connect(self.on_menu_requested)\n self.map_widget.EndScreenRequested.connect(self.on_end_screen_requested)\n self.map_widget.NextSpellRequested.connect(self.on_next_spell)\n self.map_widget.PreviousSpellRequested.connect(self.on_previous_spell)\n\n self.message_widget = EventMessageWidget(parent = self)\n self.message_widget.setMaximumHeight(100)\n\n status_layout.addWidget(self.hit_points_widget)\n status_layout.addWidget(self.spell_selector)\n status_layout.addWidget(self.effects_widget)\n status_layout.addStretch()\n\n layout.addLayout(status_layout)\n layout.addWidget(self.map_widget)\n layout.addWidget(self.message_widget)\n self.setLayout(layout)\n self.resize(QSize(640, 480))", "metadata": "root.PlayMapWindow.__set_layout", "header": "['class', 'PlayMapWindow', '(', 'QWidget', ')', ':', '___EOS___']", "index": 80 }, { "content": " def construct_scene(self):\n \"\"\"\n Create scene to display\n \"\"\"\n self.map_widget.construct_scene()\n self.model.player.register_event_listener(self.message_widget)\n self.message_widget.set_point_of_view(self.model.player)\n self.model.player.register_for_updates(self.effects_widget)", "metadata": "root.PlayMapWindow.construct_scene", "header": "['class', 'PlayMapWindow', '(', 'QWidget', ')', ':', '___EOS___']", "index": 122 }, { "content": " def on_menu_requested(self):\n \"\"\"\n Handle requesting menu window\n \"\"\"\n self.MenuRequested.emit()", "metadata": "root.PlayMapWindow.on_menu_requested", "header": "['class', 'PlayMapWindow', '(', 'QWidget', ')', ':', '___EOS___']", "index": 131 }, { "content": " def on_end_screen_requested(self):\n \"\"\"\n Handle requesting end screen\n\n .. versionadded:: 0.8\n \"\"\"\n self.EndScreenRequested.emit()", "metadata": "root.PlayMapWindow.on_end_screen_requested", "header": "['class', 'PlayMapWindow', '(', 'QWidget', ')', ':', '___EOS___']", "index": 137 }, { "content": " def on_next_spell(self):\n \"\"\"\n Handle selecting next spell\n\n .. versionadded:: 0.10\n \"\"\"\n self.spell_selector.next_spell()", "metadata": "root.PlayMapWindow.on_next_spell", "header": "['class', 'PlayMapWindow', '(', 'QWidget', ')', ':', '___EOS___']", "index": 145 }, { "content": " def on_previous_spell(self):\n \"\"\"\n Handle selecting previous spell\n\n .. versionadded:: 0.10\n \"\"\"\n self.spell_selector.previous_spell()", "metadata": "root.PlayMapWindow.on_previous_spell", "header": "['class', 'PlayMapWindow', '(', 'QWidget', ')', ':', '___EOS___']", "index": 153 }, { "content": "class PlayMapWidget(QWidget):\n \"\"\"\n Widget for displaying playing world\n\n .. versionadded:: 0.5\n \"\"\"\n\n MenuRequested = pyqtSignal(name='MenuRequested')\n EndScreenRequested = pyqtSignal(name='EndScreenRequested')\n NextSpellRequested = pyqtSignal(name='NextSpellRequested')\n PreviousSpellRequested = pyqtSignal(name='PreviousSpellRequested')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.PlayMapWidget", "header": "['module', '___EOS___']", "index": 161 }, { "content": " def __init__(self, parent, model, surface_manager, action_factory, rng,\n rules_engine, configuration):\n \"\"\"\n Default constructor\n \"\"\"\n super().__init__(parent)\n\n self.model = model\n self.scene = None\n self.surface_manager = surface_manager\n self.action_factory = action_factory\n self.rng = rng\n self.rules_engine = rules_engine\n self.configuration = configuration\n\n self.current_level = None\n self.view = None\n self.animation_adapters = []\n self.animation_timers = []\n\n for adapter in range(10):\n self.animation_adapters.append(TimerAdapter())\n self.animation_timers.append(QTimer(self))\n self.animation_timers[adapter].timeout.connect(self.animation_adapters[adapter].trigger_animations)\n self.animation_timers[adapter].start(450 + adapter * 10)\n\n self.animations = []\n self.move_controller = MoveController(action_factory = action_factory,\n rng = rng)\n\n self.__set_layout()\n self.keymap, self.move_key_map = self._construct_keymaps(\n configuration.controls)\n\n self.animation_factory = AnimationFactory()", "metadata": "root.PlayMapWidget.__init__", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 167 }, { "content": " def _construct_keymaps(self, config):\n \"\"\"\n Construct keymaps for handling input\n \"\"\"\n keymap = {}\n move_keymap = {}\n for key in config.move_left:\n keymap[key] = self._move\n move_keymap[key] = 7\n for key in config.move_up:\n keymap[key] = self._move\n move_keymap[key] = 1\n for key in config.move_right:\n keymap[key] = self._move\n move_keymap[key] = 3\n for key in config.move_down:\n keymap[key] = self._move\n move_keymap[key] = 5\n for key in config.start:\n keymap[key] = self._menu\n for key in config.action_a:\n keymap[key] = self._action_a\n for key in config.back:\n keymap[key] = self._back\n for key in config.left_shoulder:\n keymap[key] = self._shoulder_left\n for key in config.right_shoulder:\n keymap[key] = self._shoulder_right\n for key in config.mode_1:\n keymap[key] = self._zoom_out\n for key in config.mode_2:\n keymap[key] = self._zoom_in\n\n return keymap, move_keymap", "metadata": "root.PlayMapWidget._construct_keymaps", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 209 }, { "content": " def __set_layout(self):\n \"\"\"\n Set layout of this widget\n \"\"\"\n self.scene = QGraphicsScene()\n\n layout = QHBoxLayout()\n\n self.view = QGraphicsView(self.scene)\n self.view.setFocusPolicy(Qt.StrongFocus)\n self.view.installEventFilter(self)\n self.view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n self.view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n\n layout.addWidget(self.view)\n\n self.setLayout(layout)", "metadata": "root.PlayMapWidget.__set_layout", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 244 }, { "content": " def construct_scene(self):\n \"\"\"\n Construct scene to display\n \"\"\"\n self.__construct_scene(self.model, self.scene)\n\n self.model.player.register_for_updates(self)\n self.model.register_event_listener(self)\n self.__center_view_on_character(self.model.player)", "metadata": "root.PlayMapWidget.construct_scene", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 262 }, { "content": " def __center_view_on_character(self, entity):\n \"\"\"\n Center view on given entity\n \"\"\"\n location = entity.location\n width = 32\n height = 32\n\n self.view.setSceneRect((location[0] * 32) - width // 2,\n (location[1] * 32) - height // 2,\n width,\n height)", "metadata": "root.PlayMapWidget.__center_view_on_character", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 272 }, { "content": " def __construct_scene(self, model, scene):\n \"\"\"\n Constructs scene to display\n \"\"\"\n for anim in [x for x in self.animations]:\n anim.stop()\n anim.clear()\n\n for adapter in self.animation_adapters:\n adapter.glyphs.clear()\n\n self.animations = []\n\n scene.clear()\n\n self.current_level = model.player.level\n\n for location, tile in get_tiles(self.current_level):\n if tile['\\ufdd0:floor']:\n new_glyph = MapGlyph(self.surface_manager.get_icon(tile['\\ufdd0:floor']),\n None,\n self.animation_adapters[0])\n new_glyph.setZValue(zorder_floor)\n new_glyph.setPos(location[0] * 32, location[1] * 32)\n scene.addItem(new_glyph)\n if tile['\\ufdd0:wall']:\n new_glyph = MapGlyph(self.surface_manager.get_icon(tile['\\ufdd0:wall']),\n None)\n new_glyph.setZValue(zorder_wall)\n new_glyph.setPos(location[0] * 32, location[1] * 32)\n scene.addItem(new_glyph)\n\n for tile_id in tile['\\ufdd0:ornamentation']:\n new_glyph = MapGlyph(self.surface_manager.get_icon(tile_id),\n None,\n self.rng.choice(self.animation_adapters))\n new_glyph.setZValue(zorder_ornament)\n new_glyph.setPos(location[0] * 32, location[1] * 32)\n scene.addItem(new_glyph)\n for item in tile['\\ufdd0:items']:\n self.add_glyph(item, scene, zorder_item)\n for trap in tile['\\ufdd0:traps']:\n self.add_glyph(trap, scene, zorder_trap)\n\n for creature in get_characters(self.current_level):\n self.add_glyph(creature,\n scene,\n zorder_character)", "metadata": "root.PlayMapWidget.__construct_scene", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 285 }, { "content": " def add_glyph(self, entity, scene, z_order):\n \"\"\"\n Add graphical representation of an entity\n\n :param entity: entity to display\n :param scene: scene where glyph will be added\n :type scene: QGraphicsScene\n :param z_order: z-order of entity being displayed\n :type z_order: int\n \"\"\"\n new_glyph = MapGlyph(self.surface_manager.get_icon(entity.icon),\n entity, self.rng.choice(self.animation_adapters))\n new_glyph.setZValue(z_order)\n new_glyph.setPos(entity.location[0] * 32,\n entity.location[1] * 32)\n scene.addItem(new_glyph)", "metadata": "root.PlayMapWidget.add_glyph", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 334 }, { "content": " def remove_glyph(self, entity):\n \"\"\"\n Remove graphical representation of an entity\n \"\"\"\n glyphs = [x for x in self.view.items()\n if (hasattr(x, 'entity'))\n and (x.entity == entity)]\n\n for glyph in glyphs:\n self.view.scene().removeItem(glyph)", "metadata": "root.PlayMapWidget.remove_glyph", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 351 }, { "content": " def receive_event(self, event):\n \"\"\"\n Receive event from model\n \"\"\"\n\n anim = self.animation_factory.create_animation(event)\n anim.trigger(self)", "metadata": "root.PlayMapWidget.receive_event", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 362 }, { "content": " def remove_finished_animation(self):\n \"\"\"\n Remove finished animation\n \"\"\"\n finished_animations = [x for x in self.animations\n if x.state() == QAbstractAnimation.Stopped]\n counters = [x.animationAt(0).targetObject().object_to_animate\n for x in finished_animations] #TODO: works only if single thing is animated\n\n for item in finished_animations:\n item.clear()\n self.animations.remove(item)", "metadata": "root.PlayMapWidget.remove_finished_animation", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 370 }, { "content": " def receive_update(self, event):\n \"\"\"\n Receive update from entity\n \"\"\"\n if e_event_type(event) == 'move':\n if self.model.player.level != self.current_level:\n self.__construct_scene(self.model, self.scene)\n self.__center_view_on_character(self.model.player)", "metadata": "root.PlayMapWidget.receive_update", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 383 }, { "content": " def eventFilter(self, qobject, event): #pylint: disable-msg=C0103\n \"\"\"\n Filter events\n\n .. Note:: This is done in order to process cursor keys\n \"\"\"\n result = False\n\n if event.type() == QEvent.KeyPress:\n self.keyPressEvent(event)\n result = True\n else:\n result = super().eventFilter(qobject, event)\n\n return result", "metadata": "root.PlayMapWidget.eventFilter", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 392 }, { "content": " def keyPressEvent(self, event): #pylint: disable-msg=C0103\n \"\"\"\n Handle key events\n \"\"\"\n if self.model.player is None:\n return\n\n key_code = event.key()\n\n player = self.model.player\n next_creature = self.model.get_next_creature(self.rules_engine)\n\n if next_creature == player:\n\n if key_code in self.keymap:\n self.keymap[key_code](key_code, event.modifiers())\n\n next_creature = self.model.get_next_creature(self.rules_engine)\n\n if next_creature is None:\n self.model.end_condition = DIED_IN_DUNGEON\n\n while (next_creature != player\n and next_creature is not None\n and self.model.end_condition == 0):\n next_creature.act()\n next_creature = self.model.get_next_creature(self.rules_engine)\n\n if next_creature is None:\n self.model.end_condition = DIED_IN_DUNGEON\n\n if self.model.end_condition != 0:\n self.EndScreenRequested.emit()", "metadata": "root.PlayMapWidget.keyPressEvent", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 408 }, { "content": " def _move(self, key, modifiers):\n \"\"\"\n Process movement key\n\n :param key: key triggering the processing\n :type key: int\n \"\"\"\n player = self.model.player\n direction = self.move_key_map[key]\n\n if modifiers & Qt.ControlModifier:\n if direction != 9:\n attack(player,\n direction,\n self.rng)\n elif modifiers & Qt.AltModifier:\n if direction != 9:\n cast(player,\n direction,\n 'fireball')\n\n else:\n self.move_controller.move_or_attack(player, direction)", "metadata": "root.PlayMapWidget._move", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 442 }, { "content": " def _menu(self, key, modifiers):\n \"\"\"\n Process menu key\n\n :param key: key triggering the processing\n :type key: int\n \"\"\"\n self.MenuRequested.emit()", "metadata": "root.PlayMapWidget._menu", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 466 }, { "content": " def _back(self, key, modifiers):\n \"\"\"\n Process back key\n\n :param key: key triggering the processing\n :type key: int\n \"\"\"\n wait(self.model.player)", "metadata": "root.PlayMapWidget._back", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 475 }, { "content": " def _zoom_in(self, key, modifiers):\n \"\"\"\n Zoom map in\n \"\"\"\n self.view.scale(1.1, 1.1)", "metadata": "root.PlayMapWidget._zoom_in", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 484 }, { "content": " def _zoom_out(self, key, modifiers):\n \"\"\"\n Zoom map out\n \"\"\"\n self.view.scale(0.9, 0.9)", "metadata": "root.PlayMapWidget._zoom_out", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 490 }, { "content": " def _shoulder_right(self, key, modifiers):\n \"\"\"\n Process right shoulder button\n\n :param key: key triggering the processing\n :type key: int\n\n .. versionadded:: 0.10\n \"\"\"\n self.NextSpellRequested.emit()", "metadata": "root.PlayMapWidget._shoulder_right", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 496 }, { "content": " def _shoulder_left(self, key, modifiers):\n \"\"\"\n Process left shoulder button\n\n :param key: key triggering the processing\n :type key: int\n\n .. versionadded:: 0.10\n \"\"\"\n self.PreviousSpellRequested.emit()", "metadata": "root.PlayMapWidget._shoulder_left", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 507 }, { "content": " def _action_a(self, key, modifiers):\n \"\"\"\n Process action a key\n\n :param key: key triggering the processing\n :type key: int\n \"\"\"\n player = self.model.player\n level = player.level\n items = list(get_items(level, player.location))\n\n if items is not None and len(items) > 0:\n pick_up(player,\n items[0])\n\n elif is_move_legal(player, 9):\n move(player, 9)\n\n elif is_dig_legal(player):\n dig(player)", "metadata": "root.PlayMapWidget._action_a", "header": "['class', 'PlayMapWidget', '(', 'QWidget', ')', ':', '___EOS___']", "index": 518 }, { "content": "class DamageCounter(QGraphicsSimpleTextItem):\n \"\"\"\n Counter for showing damage\n\n .. versionadded:: 0.6\n \"\"\"", "metadata": "root.DamageCounter", "header": "['module', '___EOS___']", "index": 539 }, { "content": " def __init__(self, damage, colour, parent):\n \"\"\"\n Default constructor\n \"\"\"\n super().__init__()\n\n font = QFont('Helvetica',\n 12,\n QFont.Bold,\n False)\n\n self.setText(str(damage))\n self.setBrush(QColor(colour))\n self.setFont(font)\n\n self.adapter = DamageCounterAdapter(self, self)", "metadata": "root.DamageCounter.__init__", "header": "['class', 'DamageCounter', '(', 'QGraphicsSimpleTextItem', ')', ':', '___EOS___']", "index": 545 }, { "content": "class DamageCounterAdapter(QObject):\n \"\"\"\n Adapter for damage counter\n\n .. versionadded:: 0.6\n \"\"\"\n\n\n\n\n\n y_location = pyqtProperty(int, __get_y_location, __set_y_location)\n opacity = pyqtProperty(float, __get_opacity, __set_opacity)", "metadata": "root.DamageCounterAdapter", "header": "['module', '___EOS___']", "index": 562 }, { "content": " def __init__(self, parent, object_to_animate):\n \"\"\"\n Default constructor\n \"\"\"\n super().__init__()\n self.object_to_animate = object_to_animate", "metadata": "root.DamageCounterAdapter.__init__", "header": "['class', 'DamageCounterAdapter', '(', 'QObject', ')', ':', '___EOS___']", "index": 568 }, { "content": " def __get_y_location(self):\n return self.object_to_animate.y()", "metadata": "root.DamageCounterAdapter.__get_y_location", "header": "['class', 'DamageCounterAdapter', '(', 'QObject', ')', ':', '___EOS___']", "index": 575 }, { "content": " def __set_y_location(self, y):\n self.object_to_animate.setY(y)", "metadata": "root.DamageCounterAdapter.__set_y_location", "header": "['class', 'DamageCounterAdapter', '(', 'QObject', ')', ':', '___EOS___']", "index": 578 }, { "content": " def __get_opacity(self):\n return self.object_to_animate.opacity()", "metadata": "root.DamageCounterAdapter.__get_opacity", "header": "['class', 'DamageCounterAdapter', '(', 'QObject', ')', ':', '___EOS___']", "index": 581 }, { "content": " def __set_opacity(self, opacity):\n self.object_to_animate.setOpacity(opacity)", "metadata": "root.DamageCounterAdapter.__set_opacity", "header": "['class', 'DamageCounterAdapter', '(', 'QObject', ')', ':', '___EOS___']", "index": 584 }, { "content": "class MapGlyph(QGraphicsPixmapItem):\n \"\"\"\n Widget to represent a glyph on map\n\n .. versionadded:: 0.5\n \"\"\"\n", "metadata": "root.MapGlyph", "header": "['module', '___EOS___']", "index": 590 }, { "content": " def __init__(self, pixmap, entity, timer = None):\n \"\"\"\n Default constructor\n \"\"\"\n self.tiles = []\n\n if hasattr(pixmap, 'alphaChannel'):\n super().__init__(pixmap, None)\n else:\n assert len(pixmap) > 0\n super().__init__(pixmap[0], None)\n if timer:\n timer.register(self)\n self.tiles = pixmap\n\n self.entity = entity\n\n self.flipped = False\n self.offset = 0", "metadata": "root.MapGlyph.__init__", "header": "['class', 'MapGlyph', '(', 'QGraphicsPixmapItem', ')', ':', '___EOS___']", "index": 596 }, { "content": " def animate(self, frame):\n \"\"\"\n Move animation to given frame\n\n .. versionadded:: 0.10\n \"\"\"\n self.setPixmap(self.tiles[frame])", "metadata": "root.MapGlyph.animate", "header": "['class', 'MapGlyph', '(', 'QGraphicsPixmapItem', ')', ':', '___EOS___']", "index": 616 } ]
[ { "span": "from random import Random", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 25 }, { "span": "from herculeum.ui.gui.layers import (zorder_floor, zorder_wall, zorder_ornament,\n zorder_item, zorder_character,\n zorder_counter, zorder_trap)", "start_line": 32, "start_column": 0, "end_line": 34, "end_column": 65 }, { "span": "from PyQt4.QtCore import (pyqtProperty, pyqtSignal, QAbstractAnimation,\n QEasingCurve, QEvent, QObject, QPropertyAnimation,\n QSequentialAnimationGroup, QSize, Qt, QTimer)", "start_line": 39, "start_column": 0, "end_line": 41, "end_column": 71 }, { "span": "from PyQt4.QtGui import (QColor, QFont, QGraphicsPixmapItem, QGraphicsScene,\n QGraphicsSimpleTextItem, QGraphicsView, QHBoxLayout,\n QTransform, QVBoxLayout, QWidget)", "start_line": 42, "start_column": 0, "end_line": 44, "end_column": 58 } ]
[]
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_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2010", "-", "201", "5", " ", "Tu", "uk", "ka", " ", "Tur", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Modul", "e", " ", "for", " ", "main", " ", "map", " ", "relate", "d", " ", "functional", "it", "y", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "random_", "import_", "Random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "her", "cul", "eum", "_", "._", "ui_", "._", "controllers_", "import_", "Move", "Controller_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "her", "cul", "eum", "_", "._", "ui_", "._", "gui_", "._", "animati", "ons_", "import_", "Animat", "ion", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "her", "cul", "eum", "_", "._", "ui_", "._", "gui_", "._", "event", "display_", "import_", "Event", "Messag", "e", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "her", "cul", "eum", "_", "._", "ui_", "._", "gui_", "._", "widgets_", "import_", "(_", "Effe", "ct", "s", "Widget_", ",_", "Hit", "Point", "s", "Widget_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Spell", "Select", "or", "Widget_", ",_", "Time", "r", "Adapter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "her", "cul", "eum", "_", "._", "ui_", "._", "gui_", "._", "layers_", "import_", "(_", "zor", "der", "\\u", "floor_", ",_", "zor", "der", "\\u", "wall_", ",_", "zor", "der", "\\u", "orna", "ment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "zor", "der", "\\u", "item_", ",_", "zor", "der", "\\u", "character_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "zor", "der", "\\u", "counter_", ",_", "zor", "der", "\\u", "trap_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyh", "erc_", "._", "data_", "._", "model_", "import_", "DI", "ED", "\\u", "IN", "\\u", "DU", "NGE", "ON_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyh", "erc_", "._", "events_", "import_", "e\\u", "event", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyh", "erc_", "._", "ports_", "import_", "(_", "is", "\\u", "move", "\\u", "lega", "l_", ",_", "move_", ",_", "attack_", ",_", "is", "\\u", "dig", "\\u", "lega", "l_", ",_", "dig", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wait_", ",_", "pick", "\\u", "up_", ",_", "cast_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Py", "Qt4_", "._", "Qt", "Core_", "import_", "(_", "pyqt", "Property_", ",_", "pyqt", "Signal_", ",_", "QA", "bst", "ract", "Animation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "QE", "asin", "g", "Curve_", ",_", "QE", "vent_", ",_", "QO", "bject_", ",_", "QP", "rope", "rty", "Animation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "QS", "eque", "nti", "al", "Animat", "ion", "Group_", ",_", "QS", "ize_", ",_", "Qt_", ",_", "QT", "ime", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Py", "Qt4_", "._", "Qt", "Gui_", "import_", "(_", "QC", "olor_", ",_", "QF", "ont", "_", ",_", "QG", "raph", "ics", "Pix", "map", "Item_", ",_", "QG", "raph", "ics", "Scene_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "QG", "raph", "ics", "Simple", "Text", "Item_", ",_", "QG", "raph", "ics", "View_", ",_", "Q", "HB", "ox", "Layout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "QT", "ransf", "orm_", ",_", "QV", "Box", "Layout_", ",_", "QW", "idge", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyh", "erc_", "._", "data_", "import_", "get", "\\u", "characters_", ",_", "get", "\\u", "items_", ",_", "get", "\\u", "tiles_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Play", "Map", "Window_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Window", " ", "for", " ", "display", "ing", " ", "play", "ing", " ", "world", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.", "5", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Menu", "Requeste", "d_", "=_", "pyqt", "Signal_", "(_", "name_", "=_", "'", "Menu", "Requeste", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "End", "Scr", "een", "Requeste", "d_", "=_", "pyqt", "Signal_", "(_", "name_", "=_", "'", "End", "Scr", "een", "Requeste", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Play", "Map", "Window_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", ",_", "model_", ",_", "surf", "ace", "\\u", "manager_", ",_", "action", "\\u", "factory_", ",_", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rule", "s", "\\u", "engine_", ",_", "configuration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "construct", "or", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "model_", "=_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "surf", "ace", "\\u", "manager_", "=_", "surf", "ace", "\\u", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "action", "\\u", "factory_", "=_", "action", "\\u", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rng_", "=_", "rng_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "current", "\\u", "level_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "configuration_", "=_", "configuration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "hit", "\\u", "points", "\\u", "widget_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "message", "\\u", "widget_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map", "\\u", "widget_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "effect", "s", "\\u", "widget_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "spell", "\\u", "selector_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "set\\u", "layout_", "(_", "model_", ",_", "surf", "ace", "\\u", "manager_", ",_", "action", "\\u", "factory_", ",_", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rule", "s", "\\u", "engine_", ",_", "configuration_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Window_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "set\\u", "layout_", "(_", "self_", ",_", "model_", ",_", "surf", "ace", "\\u", "manager_", ",_", "action", "\\u", "factory_", ",_", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rule", "s", "\\u", "engine_", ",_", "configuration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "layout", " ", "of", " ", "this", " ", "window", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layout_", "=_", "QV", "Box", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status", "\\u", "layout_", "=_", "Q", "HB", "ox", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "hit", "\\u", "points", "\\u", "widget_", "=_", "Hit", "Point", "s", "Widget_", "(_", "parent_", "=_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "surf", "ace", "\\u", "manager_", "=_", "surf", "ace", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "effect", "s", "\\u", "widget_", "=_", "Effe", "ct", "s", "Widget_", "(_", "parent_", "=_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "surf", "ace", "\\u", "manager_", "=_", "surf", "ace", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "spell", "\\u", "selector_", "=_", "Spell", "Select", "or", "Widget_", "(_", "parent_", "=_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "surf", "ace", "\\u", "manager_", "=_", "surf", "ace", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "map", "\\u", "widget_", "=_", "Play", "Map", "Widget_", "(_", "parent_", "=_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "surf", "ace", "\\u", "manager_", "=_", "surf", "ace", "\\u", "manager_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action", "\\u", "factory_", "=_", "action", "\\u", "factory_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rule", "s", "\\u", "engine_", "=_", "rule", "s", "\\u", "engine_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "configuration_", "=_", "configuration_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map", "\\u", "widget_", "._", "Menu", "Requeste", "d_", "._", "connect_", "(_", "self_", "._", "on", "\\u", "menu", "\\u", "requested_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map", "\\u", "widget_", "._", "End", "Scr", "een", "Requeste", "d_", "._", "connect_", "(_", "self_", "._", "on", "\\u", "end", "\\u", "screen", "\\u", "requested_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map", "\\u", "widget_", "._", "Ne", "xt", "Spell", "Requeste", "d_", "._", "connect_", "(_", "self_", "._", "on", "\\u", "next", "\\u", "spell_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map", "\\u", "widget_", "._", "Prev", "ious", "Spell", "Requeste", "d_", "._", "connect_", "(_", "self_", "._", "on", "\\u", "previ", "ous", "\\u", "spell_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "message", "\\u", "widget_", "=_", "Event", "Messag", "e", "Widget_", "(_", "parent_", "=_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "message", "\\u", "widget_", "._", "set", "Maxim", "um", "Height_", "(_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "status", "\\u", "layout_", "._", "add", "Widget_", "(_", "self_", "._", "hit", "\\u", "points", "\\u", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status", "\\u", "layout_", "._", "add", "Widget_", "(_", "self_", "._", "spell", "\\u", "selector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status", "\\u", "layout_", "._", "add", "Widget_", "(_", "self_", "._", "effect", "s", "\\u", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status", "\\u", "layout_", "._", "add", "Stretch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "layout_", "._", "add", "Layout_", "(_", "status", "\\u", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layout_", "._", "add", "Widget_", "(_", "self_", "._", "map", "\\u", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layout_", "._", "add", "Widget_", "(_", "self_", "._", "message", "\\u", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Layout_", "(_", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resize_", "(_", "QS", "ize_", "(_", "640_", ",_", "480_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Window_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "construct", "\\u", "scene_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "scen", "e", " ", "to", " ", "display", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map", "\\u", "widget_", "._", "construct", "\\u", "scene_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "._", "player_", "._", "register", "\\u", "event", "\\u", "listener_", "(_", "self_", "._", "message", "\\u", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "message", "\\u", "widget_", "._", "set\\u", "point", "\\u", "of", "\\u", "view_", "(_", "self_", "._", "model_", "._", "player_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "._", "player_", "._", "register", "\\u", "for", "\\u", "updates_", "(_", "self_", "._", "effect", "s", "\\u", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Window_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "menu", "\\u", "requested_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "request", "ing", " ", "menu", " ", "window", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Menu", "Requeste", "d_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Window_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "end", "\\u", "screen", "\\u", "requested_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "request", "ing", " ", "end", " ", "screen", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.", "8", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "End", "Scr", "een", "Requeste", "d_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Window_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "next", "\\u", "spell_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "selecti", "ng", " ", "next", " ", "spell", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.10", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "spell", "\\u", "selector_", "._", "next", "\\u", "spell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Window_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "previ", "ous", "\\u", "spell_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "selecti", "ng", " ", "previ", "ous", " ", "spell", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.10", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "spell", "\\u", "selector_", "._", "previ", "ous", "\\u", "spell_", "(_", ")_", "\\u\\u\\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_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wid", "get", " ", "for", " ", "display", "ing", " ", "play", "ing", " ", "world", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.", "5", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Menu", "Requeste", "d_", "=_", "pyqt", "Signal_", "(_", "name_", "=_", "'", "Menu", "Requeste", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "End", "Scr", "een", "Requeste", "d_", "=_", "pyqt", "Signal_", "(_", "name_", "=_", "'", "End", "Scr", "een", "Requeste", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ne", "xt", "Spell", "Requeste", "d_", "=_", "pyqt", "Signal_", "(_", "name_", "=_", "'", "Ne", "xt", "Spell", "Requeste", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Prev", "ious", "Spell", "Requeste", "d_", "=_", "pyqt", "Signal_", "(_", "name_", "=_", "'", "Prev", "ious", "Spell", "Requeste", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", ",_", "model_", ",_", "surf", "ace", "\\u", "manager_", ",_", "action", "\\u", "factory_", ",_", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rule", "s", "\\u", "engine_", ",_", "configuration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "construct", "or", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "model_", "=_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scene_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "surf", "ace", "\\u", "manager_", "=_", "surf", "ace", "\\u", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "action", "\\u", "factory_", "=_", "action", "\\u", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rng_", "=_", "rng_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rule", "s", "\\u", "engine_", "=_", "rule", "s", "\\u", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "configuration_", "=_", "configuration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "current", "\\u", "level_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "animati", "on", "\\u", "adapters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "animati", "on", "\\u", "timers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "adapter_", "in_", "range_", "(_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "animati", "on", "\\u", "adapters_", "._", "append_", "(_", "Time", "r", "Adapter_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "animati", "on", "\\u", "timers_", "._", "append_", "(_", "QT", "ime", "r_", "(_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "animati", "on", "\\u", "timers_", "[_", "adapter_", "]_", "._", "timeout_", "._", "connect_", "(_", "self_", "._", "animati", "on", "\\u", "adapters_", "[_", "adapter_", "]_", "._", "trigger", "\\u", "animati", "ons_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "animati", "on", "\\u", "timers_", "[_", "adapter_", "]_", "._", "start_", "(_", "450_", "+_", "adapter_", "*_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "animati", "ons_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "move", "\\u", "controller_", "=_", "Move", "Controller_", "(_", "action", "\\u", "factory_", "=_", "action", "\\u", "factory_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "set\\u", "layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keymap_", ",_", "self_", "._", "move", "\\u", "key", "\\u", "map_", "=_", "self_", "._", "\\u", "construct", "\\u", "keymap", "s_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "configuration_", "._", "controls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "animati", "on", "\\u", "factory_", "=_", "Animat", "ion", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "construct", "\\u", "keymap", "s_", "(_", "self_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Construct", " ", "keymap", "s", " ", "for", " ", "handling", " ", "input", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keymap_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "move", "\\u", "keymap_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "move", "\\u", "left_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "move_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "move", "\\u", "keymap_", "[_", "key_", "]_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "move", "\\u", "up_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "move_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "move", "\\u", "keymap_", "[_", "key_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "move", "\\u", "right_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "move_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "move", "\\u", "keymap_", "[_", "key_", "]_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "move", "\\u", "down_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "move_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "move", "\\u", "keymap_", "[_", "key_", "]_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "start_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "action", "\\u", "a_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "action", "\\u", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "back_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "back_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "left", "\\u", "shoulder", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "shoulder", "\\u", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "right", "\\u", "shoulder", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "shoulder", "\\u", "right_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "mode", "\\u", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "zoom", "\\u", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "config_", "._", "mode", "\\u", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keymap_", "[_", "key_", "]_", "=_", "self_", "._", "\\u", "zoom", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "keymap_", ",_", "move", "\\u", "keymap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "set\\u", "layout_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "layout", " ", "of", " ", "this", " ", "widget", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scene_", "=_", "QG", "raph", "ics", "Scene_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "layout_", "=_", "Q", "HB", "ox", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "=_", "QG", "raph", "ics", "View_", "(_", "self_", "._", "scene_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set", "Foc", "us", "Policy_", "(_", "Qt_", "._", "Strong", "Focus_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "install", "Event", "Filter_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set", "Horiz", "onta", "l", "Scroll", "Bar", "Policy_", "(_", "Qt_", "._", "Scroll", "Bar", "Al", "way", "s", "Off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set", "Vertica", "l", "Scroll", "Bar", "Policy_", "(_", "Qt_", "._", "Scroll", "Bar", "Al", "way", "s", "Off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "layout_", "._", "add", "Widget_", "(_", "self_", "._", "view_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set", "Layout_", "(_", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "construct", "\\u", "scene_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Construct", " ", "scen", "e", " ", "to", " ", "display", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "construct", "\\u", "scene_", "(_", "self_", "._", "model_", ",_", "self_", "._", "scene_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "model_", "._", "player_", "._", "register", "\\u", "for", "\\u", "updates_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "._", "register", "\\u", "event", "\\u", "listener_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "center", "\\u", "view", "\\u", "on", "\\u", "character_", "(_", "self_", "._", "model_", "._", "player_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "center", "\\u", "view", "\\u", "on", "\\u", "character_", "(_", "self_", ",_", "entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Center", " ", "view", " ", "on", " ", "give", "n", " ", "entity", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "location_", "=_", "entity_", "._", "location_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "height_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "set", "Scen", "e", "Rect_", "(_", "(_", "location_", "[_", "0_", "]_", "*_", "32_", ")_", "-_", "width_", "//_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "location_", "[_", "1_", "]_", "*_", "32_", ")_", "-_", "height_", "//_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "construct", "\\u", "scene_", "(_", "self_", ",_", "model_", ",_", "scene_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Construct", "s", " ", "scen", "e", " ", "to", " ", "display", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "anim_", "in_", "[_", "x_", "for_", "x_", "in_", "self_", "._", "animati", "ons_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "anim_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "anim_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "adapter_", "in_", "self_", "._", "animati", "on", "\\u", "adapters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "adapter_", "._", "glyphs_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "animati", "ons_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "scene_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "current", "\\u", "level_", "=_", "model_", "._", "player_", "._", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "location_", ",_", "tile_", "in_", "get", "\\u", "tiles_", "(_", "self_", "._", "current", "\\u", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "tile_", "[_", "'\\\\", "uf", "dd", "0", ":", "floor", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "glyph_", "=_", "Map", "Glyph_", "(_", "self_", "._", "surf", "ace", "\\u", "manager_", "._", "get", "\\u", "icon_", "(_", "tile_", "[_", "'\\\\", "uf", "dd", "0", ":", "floor", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "animati", "on", "\\u", "adapters_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "._", "set", "Z", "Value_", "(_", "zor", "der", "\\u", "floor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "._", "set", "Pos_", "(_", "location_", "[_", "0_", "]_", "*_", "32_", ",_", "location_", "[_", "1_", "]_", "*_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scene_", "._", "add", "Item_", "(_", "new", "\\u", "glyph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tile_", "[_", "'\\\\", "uf", "dd", "0", ":", "wall", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "glyph_", "=_", "Map", "Glyph_", "(_", "self_", "._", "surf", "ace", "\\u", "manager_", "._", "get", "\\u", "icon_", "(_", "tile_", "[_", "'\\\\", "uf", "dd", "0", ":", "wall", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "._", "set", "Z", "Value_", "(_", "zor", "der", "\\u", "wall_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "._", "set", "Pos_", "(_", "location_", "[_", "0_", "]_", "*_", "32_", ",_", "location_", "[_", "1_", "]_", "*_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scene_", "._", "add", "Item_", "(_", "new", "\\u", "glyph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "tile", "\\u", "id_", "in_", "tile_", "[_", "'\\\\", "uf", "dd", "0", ":", "orna", "menta", "tion", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "glyph_", "=_", "Map", "Glyph_", "(_", "self_", "._", "surf", "ace", "\\u", "manager_", "._", "get", "\\u", "icon_", "(_", "tile", "\\u", "id_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rng_", "._", "choice_", "(_", "self_", "._", "animati", "on", "\\u", "adapters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "._", "set", "Z", "Value_", "(_", "zor", "der", "\\u", "orna", "ment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "._", "set", "Pos_", "(_", "location_", "[_", "0_", "]_", "*_", "32_", ",_", "location_", "[_", "1_", "]_", "*_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scene_", "._", "add", "Item_", "(_", "new", "\\u", "glyph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "item_", "in_", "tile_", "[_", "'\\\\", "uf", "dd", "0", ":", "items", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "glyph_", "(_", "item_", ",_", "scene_", ",_", "zor", "der", "\\u", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "trap_", "in_", "tile_", "[_", "'\\\\", "uf", "dd", "0", ":", "trap", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "glyph_", "(_", "trap_", ",_", "scene_", ",_", "zor", "der", "\\u", "trap_", ")_", "\\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_", "creature", "_", "in_", "get", "\\u", "characters_", "(_", "self_", "._", "current", "\\u", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "glyph_", "(_", "creature", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scene_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "zor", "der", "\\u", "character_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "glyph_", "(_", "self_", ",_", "entity_", ",_", "scene_", ",_", "z", "\\u", "order_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "graphical", " ", "represent", "ation", " ", "of", " ", "an", " ", "entity", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "entity", ":", " ", "entity", " ", "to", " ", "display", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "scen", "e", ":", " ", "scen", "e", " ", "where", " ", "glyph", " ", "will", " ", "be", " ", "adde", "d", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "scen", "e", ":", " ", "QG", "raph", "ics", "Scen", "e", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "z", "\\u", "order", ":", " ", "z", "-", "order", " ", "of", " ", "entity", " ", "bei", "ng", " ", "displaye", "d", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "z", "\\u", "order", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "=_", "Map", "Glyph_", "(_", "self_", "._", "surf", "ace", "\\u", "manager_", "._", "get", "\\u", "icon_", "(_", "entity_", "._", "icon_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entity_", ",_", "self_", "._", "rng_", "._", "choice_", "(_", "self_", "._", "animati", "on", "\\u", "adapters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "._", "set", "Z", "Value_", "(_", "z", "\\u", "order_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "glyph_", "._", "set", "Pos_", "(_", "entity_", "._", "location_", "[_", "0_", "]_", "*_", "32_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entity_", "._", "location_", "[_", "1_", "]_", "*_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scene_", "._", "add", "Item_", "(_", "new", "\\u", "glyph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "\\u", "glyph_", "(_", "self_", ",_", "entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", " ", "graphical", " ", "represent", "ation", " ", "of", " ", "an", " ", "entity", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "glyphs_", "=_", "[_", "x_", "for_", "x_", "in_", "self_", "._", "view_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "hasattr_", "(_", "x_", ",_", "'", "entity", "'_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "(_", "x_", "._", "entity_", "==_", "entity_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "glyph_", "in_", "glyphs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "scene_", "(_", ")_", "._", "remove", "Item_", "(_", "glyph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\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_", "receive", "\\u", "event_", "(_", "self_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Receive", " ", "event", " ", "from", " ", "model", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "anim_", "=_", "self_", "._", "animati", "on", "\\u", "factory_", "._", "create", "\\u", "animation_", "(_", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "anim_", "._", "trigger_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "\\u", "finish", "ed", "\\u", "animation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", " ", "finish", "ed", " ", "animati", "on", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finish", "ed", "\\u", "animati", "ons_", "=_", "[_", "x_", "for_", "x_", "in_", "self_", "._", "animati", "ons_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "x_", "._", "state_", "(_", ")_", "==_", "QA", "bst", "ract", "Animation_", "._", "Stopp", "ed_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counters_", "=_", "[_", "x_", "._", "animati", "on", "At_", "(_", "0_", ")_", "._", "target", "Object_", "(_", ")_", "._", "object\\u", "to", "\\u", "animate", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "finish", "ed", "\\u", "animati", "ons_", "]_", "#", "TOD", "O", ":", " ", "works", " ", "only", " ", "if", " ", "single", " ", "thing", " ", "is", " ", "animate", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "finish", "ed", "\\u", "animati", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "animati", "ons_", "._", "remove_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\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_", "receive", "\\u", "update_", "(_", "self_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Receive", " ", "update", " ", "from", " ", "entity", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "e\\u", "event", "\\u", "type_", "(_", "event_", ")_", "==_", "'", "move", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "model_", "._", "player_", "._", "level_", "!=_", "self_", "._", "current", "\\u", "level_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "construct", "\\u", "scene_", "(_", "self_", "._", "model_", ",_", "self_", "._", "scene_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "center", "\\u", "view", "\\u", "on", "\\u", "character_", "(_", "self_", "._", "model_", "._", "player_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\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_", "event", "Filter_", "(_", "self_", ",_", "qo", "bject_", ",_", "event_", ")_", ":_", "#", "pylint", ":", " ", "disable", "-", "msg", "=", "C0", "103_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Filter", " ", "events", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "Not", "e", "::", " ", "Thi", "s", " ", "is", " ", "don", "e", " ", "in", " ", "order", " ", "to", " ", "process", " ", "cursor", " ", "keys", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "event_", "._", "type_", "(_", ")_", "==_", "QE", "vent_", "._", "Key", "Press_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "key", "Press", "Event_", "(_", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "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 ", " _", "result_", "=_", "super_", "(_", ")_", "._", "event", "Filter_", "(_", "qo", "bject_", ",_", "event_", ")_", "\\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_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "key", "Press", "Event_", "(_", "self_", ",_", "event_", ")_", ":_", "#", "pylint", ":", " ", "disable", "-", "msg", "=", "C0", "103_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "key", " ", "events", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "model_", "._", "player_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "key", "\\u", "code_", "=_", "event_", "._", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "player_", "=_", "self_", "._", "model_", "._", "player_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "creature", "_", "=_", "self_", "._", "model_", "._", "get", "\\u", "next", "\\u", "creature", "_", "(_", "self_", "._", "rule", "s", "\\u", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "next", "\\u", "creature", "_", "==_", "player_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key", "\\u", "code_", "in_", "self_", "._", "keymap_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "keymap_", "[_", "key", "\\u", "code_", "]_", "(_", "key", "\\u", "code_", ",_", "event_", "._", "modifiers_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "next", "\\u", "creature", "_", "=_", "self_", "._", "model_", "._", "get", "\\u", "next", "\\u", "creature", "_", "(_", "self_", "._", "rule", "s", "\\u", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "next", "\\u", "creature", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model_", "._", "end", "\\u", "condition_", "=_", "DI", "ED", "\\u", "IN", "\\u", "DU", "NGE", "ON_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "(_", "next", "\\u", "creature", "_", "!=_", "player_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "next", "\\u", "creature", "_", "is_", "not_", "None_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "self_", "._", "model_", "._", "end", "\\u", "condition_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "creature", "_", "._", "act_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "creature", "_", "=_", "self_", "._", "model_", "._", "get", "\\u", "next", "\\u", "creature", "_", "(_", "self_", "._", "rule", "s", "\\u", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "next", "\\u", "creature", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model_", "._", "end", "\\u", "condition_", "=_", "DI", "ED", "\\u", "IN", "\\u", "DU", "NGE", "ON_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "model_", "._", "end", "\\u", "condition_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "End", "Scr", "een", "Requeste", "d_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\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", "move_", "(_", "self_", ",_", "key_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Process", " ", "movement", " ", "key", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "key", " ", "trigger", "ing", " ", "the", " ", "process", "ing", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "key", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player_", "=_", "self_", "._", "model_", "._", "player_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "direction_", "=_", "self_", "._", "move", "\\u", "key", "\\u", "map_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "modifiers_", "&_", "Qt_", "._", "Control", "Modifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "direction_", "!=_", "9_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attack_", "(_", "player_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "direction_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "modifiers_", "&_", "Qt_", "._", "Alt", "Modifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "direction_", "!=_", "9_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cast_", "(_", "player_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "direction_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fireba", "ll", "'_", ")_", "\\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 ", " _", "self_", "._", "move", "\\u", "controller_", "._", "move", "\\u", "or", "\\u", "attack_", "(_", "player_", ",_", "direction_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\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", "menu_", "(_", "self_", ",_", "key_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Process", " ", "menu", " ", "key", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "key", " ", "trigger", "ing", " ", "the", " ", "process", "ing", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "key", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Menu", "Requeste", "d_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "back_", "(_", "self_", ",_", "key_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Process", " ", "back", " ", "key", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "key", " ", "trigger", "ing", " ", "the", " ", "process", "ing", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "key", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wait_", "(_", "self_", "._", "model_", "._", "player_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "zoom", "\\u", "in_", "(_", "self_", ",_", "key_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Zoom", " ", "map", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "scale_", "(_", "1.1_", ",_", "1.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "zoom", "\\u", "out_", "(_", "self_", ",_", "key_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Zoom", " ", "map", " ", "out", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "scale_", "(_", "0.9_", ",_", "0.9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "shoulder", "\\u", "right_", "(_", "self_", ",_", "key_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Process", " ", "right", " ", "shoulder", " ", "button", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "key", " ", "trigger", "ing", " ", "the", " ", "process", "ing", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "key", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.10", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Ne", "xt", "Spell", "Requeste", "d_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "shoulder", "\\u", "left_", "(_", "self_", ",_", "key_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Process", " ", "left", " ", "shoulder", " ", "button", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "key", " ", "trigger", "ing", " ", "the", " ", "process", "ing", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "key", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.10", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Prev", "ious", "Spell", "Requeste", "d_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Play", "Map", "Widget_", "(_", "QW", "idge", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "action", "\\u", "a_", "(_", "self_", ",_", "key_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Process", " ", "action", " ", "a", " ", "key", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "key", " ", "trigger", "ing", " ", "the", " ", "process", "ing", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "key", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player_", "=_", "self_", "._", "model_", "._", "player_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "level_", "=_", "player_", "._", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "=_", "list_", "(_", "get", "\\u", "items_", "(_", "level_", ",_", "player_", "._", "location_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "items_", "is_", "not_", "None_", "and_", "len_", "(_", "items_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pick", "\\u", "up_", "(_", "player_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "move", "\\u", "lega", "l_", "(_", "player_", ",_", "9_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "move_", "(_", "player_", ",_", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "dig", "\\u", "lega", "l_", "(_", "player_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dig", "_", "(_", "player_", ")_", "\\u\\u\\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_", "Dam", "age", "Counter_", "(_", "QG", "raph", "ics", "Simple", "Text", "Item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Counter", " ", "for", " ", "showin", "g", " ", "damage", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.", "6", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dam", "age", "Counter_", "(_", "QG", "raph", "ics", "Simple", "Text", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "damage_", ",_", "colour_", ",_", "parent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "construct", "or", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "font_", "=_", "QF", "ont", "_", "(_", "'", "Hel", "vet", "ica", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "12_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "QF", "ont", "_", "._", "Bold_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set", "Text_", "(_", "str_", "(_", "damage_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Brush_", "(_", "QC", "olor_", "(_", "colour_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Font_", "(_", "font_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "adapter_", "=_", "Dam", "age", "Counter", "Adapter_", "(_", "self_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Dam", "age", "Counter", "Adapter_", "(_", "QO", "bject_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Adapt", "er", " ", "for", " ", "damage", " ", "counter", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.", "6", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "y", "\\u", "location_", "=_", "pyqt", "Property_", "(_", "int_", ",_", "\\u\\u", "get", "\\u", "y", "\\u", "location_", ",_", "\\u\\u", "set\\u", "y", "\\u", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opacity_", "=_", "pyqt", "Property_", "(_", "float_", ",_", "\\u\\u", "get", "\\u", "opacity_", ",_", "\\u\\u", "set\\u", "opacity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dam", "age", "Counter", "Adapter_", "(_", "QO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", ",_", "object\\u", "to", "\\u", "animate", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "construct", "or", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "object\\u", "to", "\\u", "animate", "_", "=_", "object\\u", "to", "\\u", "animate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dam", "age", "Counter", "Adapter_", "(_", "QO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "y", "\\u", "location_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "object\\u", "to", "\\u", "animate", "_", "._", "y_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dam", "age", "Counter", "Adapter_", "(_", "QO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "set\\u", "y", "\\u", "location_", "(_", "self_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "object\\u", "to", "\\u", "animate", "_", "._", "set", "Y_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dam", "age", "Counter", "Adapter_", "(_", "QO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "opacity_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "object\\u", "to", "\\u", "animate", "_", "._", "opacity_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dam", "age", "Counter", "Adapter_", "(_", "QO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "set\\u", "opacity_", "(_", "self_", ",_", "opacity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "object\\u", "to", "\\u", "animate", "_", "._", "set", "Opa", "city_", "(_", "opacity_", ")_", "\\u\\u\\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_", "Map", "Glyph_", "(_", "QG", "raph", "ics", "Pix", "map", "Item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wid", "get", " ", "to", " ", "represent", " ", "a", " ", "glyph", " ", "on", " ", "map", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.", "5", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Map", "Glyph_", "(_", "QG", "raph", "ics", "Pix", "map", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "pixmap_", ",_", "entity_", ",_", "timer_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "construct", "or", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tiles_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "pixmap_", ",_", "'", "alpha", "Chan", "nel", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "pixmap_", ",_", "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 ", " _", "assert_", "len_", "(_", "pixmap_", ")_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "pixmap_", "[_", "0_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timer_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timer_", "._", "register_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "tiles_", "=_", "pixmap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "entity_", "=_", "entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "flipped", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Map", "Glyph_", "(_", "QG", "raph", "ics", "Pix", "map", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "animate", "_", "(_", "self_", ",_", "frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Move", " ", "animati", "on", " ", "to", " ", "give", "n", " ", "frame", "\\", "10", ";", "\\", "10", ";", " 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
WGBH/django-versatileimagefield/versatileimagefield/widgets.py
[ { "content": " def render(self, name, value, attrs=None):\n substitutions = {\n 'initial_text': force_text(self.initial_text),\n 'input_text': self.input_text,\n 'clear_template': '',\n 'clear_checkbox_label': self.clear_checkbox_label,\n 'ppoi_label': self.ppoi_label\n }\n template = '%(input)s'\n substitutions['input'] = super(ClearableFileInput, self).render(\n name,\n value,\n attrs\n )\n if value and hasattr(value, \"url\"):\n substitutions['initial'] = format_html('<a href=\"{0}\">{1}</a>',\n value.url,\n force_text(value))\n substitutions['initial_url'] = value.url\n template = self.template_with_initial_and_imagepreview\n point_stage_id = self.get_point_stage_id(name)\n ppoi_id = self.get_ppoi_id(name)\n substitutions['point_stage_id'] = point_stage_id\n substitutions['ppoi_id'] = ppoi_id\n substitutions['image_preview_id'] = self.image_preview_id(name)\n image_preview = self.image_preview(\n name,\n value\n )\n substitutions['image_preview'] = image_preview\n\n if value.field.blank:\n checkbox_name = self.clear_checkbox_name(name)\n checkbox_id = self.clear_checkbox_id(checkbox_name)\n substitutions['clear_checkbox_name'] = conditional_escape(\n checkbox_name\n )\n substitutions['clear_checkbox_id'] = conditional_escape(\n checkbox_id\n )\n substitutions['clear'] = CheckboxInput().render(\n checkbox_name,\n False,\n attrs={'id': checkbox_id}\n )\n substitutions['clear_template'] = self.template_with_clear % \\\n substitutions\n return mark_safe(template % substitutions)", "metadata": "root.ClearableFileInputWithImagePreview.render", "header": "['class', 'ClearableFileInputWithImagePreview', '(', 'ClearableFileInput', ')', ':', '___EOS___']", "index": 92 } ]
[ { "span": "super(ClearableFileInput, self).", "start_line": 101, "start_column": 33, "end_line": 101, "end_column": 64 } ]
[]
1
true
[ "[CLS]_", "First_", "argument_", "to_", "super_", "(_", ")_", "is_", "not_", "encl", "osin", "g_", "class_", "[SEP]_", "class_", "Clear", "able", "File", "Inp", "ut", "With", "Image", "Preview", "_", "(_", "Clear", "able", "File", "Input_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "self_", ",_", "name_", ",_", "value_", ",_", "attrs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "substitutions_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "initial", "\\u", "text", "'_", ":_", "force", "\\u", "text_", "(_", "self_", "._", "initial", "\\u", "text_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "input", "\\u", "text", "'_", ":_", "self_", "._", "input", "\\u", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "clear", "\\u", "template", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "clear", "\\u", "checkb", "ox", "\\u", "label", "'_", ":_", "self_", "._", "clear", "\\u", "checkb", "ox", "\\u", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ppo", "i", "\\u", "label", "'_", ":_", "self_", "._", "ppo", "i", "\\u", "label_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "'%", "(", "input", ")", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "input", "'_", "]_", "=_", "super_", "(_", "Clear", "able", "File", "Input_", ",_", "self_", ")_", "._", "render_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "attrs_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "and_", "hasattr_", "(_", "value_", ",_", "\"", "url", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "substitutions_", "[_", "'", "initial", "'_", "]_", "=_", "format\\u", "html_", "(_", "'<", "a", " ", "href", "=\"", "{", "0", "}\">", "{", "1", "}", "</", "a", ">'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "value_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force", "\\u", "text_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "initial", "\\u", "url", "'_", "]_", "=_", "value_", "._", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "self_", "._", "template", "\\u", "with", "\\u", "initial", "\\u", "and", "\\u", "image", "preview_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point", "\\u", "stage", "\\u", "id_", "=_", "self_", "._", "get", "\\u", "point", "\\u", "stage", "\\u", "id_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ppo", "i", "\\u", "id_", "=_", "self_", "._", "get", "\\u", "ppo", "i", "\\u", "id_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "point", "\\u", "stage", "\\u", "id", "'_", "]_", "=_", "point", "\\u", "stage", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "ppo", "i", "\\u", "id", "'_", "]_", "=_", "ppo", "i", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "image", "\\u", "previe", "w", "\\u", "id", "'_", "]_", "=_", "self_", "._", "image", "\\u", "previe", "w", "\\u", "id_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "preview_", "=_", "self_", "._", "image", "\\u", "preview_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "value_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "image", "\\u", "previe", "w", "'_", "]_", "=_", "image", "\\u", "preview_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "value_", "._", "field_", "._", "blank_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "checkb", "ox", "\\u", "name_", "=_", "self_", "._", "clear", "\\u", "checkb", "ox", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checkb", "ox", "\\u", "id_", "=_", "self_", "._", "clear", "\\u", "checkb", "ox", "\\u", "id_", "(_", "checkb", "ox", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "clear", "\\u", "checkb", "ox", "\\u", "name", "'_", "]_", "=_", "conditional", "\\u", "escape_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "checkb", "ox", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "clear", "\\u", "checkb", "ox", "\\u", "id", "'_", "]_", "=_", "conditional", "\\u", "escape_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "checkb", "ox", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "clear", "'_", "]_", "=_", "Checkb", "ox", "Input_", "(_", ")_", "._", "render_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "checkb", "ox", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "attrs_", "=_", "{_", "'", "id", "'_", ":_", "checkb", "ox", "\\u", "id_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "substitutions_", "[_", "'", "clear", "\\u", "template", "'_", "]_", "=_", "self_", "._", "template", "\\u", "with", "\\u", "clear_", "%_", "substitutions_", "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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
hydroshare/hydroshare2/ga_interactive/urls.py
[ { "content": "from django.conf.urls import patterns, include, url\nfrom ga_interactive.views import notebook_for_user\n\nurlpatterns = patterns('',\n url(r'^notebook/(?P<path>.*)$', notebook_for_user),\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.conf.urls import patterns, include, url", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "conf_", "._", "urls_", "import_", "patterns_", ",_", "include_", ",_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ga", "\\u", "interactive_", "._", "views_", "import_", "notebook", "\\u", "for", "\\u", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "urlpatterns_", "=_", "patterns_", "(_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "notebook", "/(", "?", "P", "<", "path", ">.*)", "$'_", ",_", "notebook", "\\u", "for", "\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
PyHDI/veriloggen/veriloggen/verilog/from_verilog.py
[ { "content": "def to_module_dict(*filelist, **opt):\n ast = to_ast(*filelist, **opt)\n \n module_visitor = ModuleVisitor()\n module_visitor.visit(ast)\n module_names = module_visitor.get_modulenames()\n moduleinfotable = module_visitor.get_moduleinfotable()\n moduleinfo = moduleinfotable.getDefinitions()\n module_dict = collections.OrderedDict([ (n, d.definition) for n, d in moduleinfo.items() ])\n\n return module_dict", "metadata": "root.to_module_dict", "header": "['module', '___EOS___']", "index": 51 }, { "content": " def _visit_GenerateFor(self, item):\n pre = self.visit(item.pre)\n cond = self.visit(item.cond)\n post = self.visit(item.post)\n scope = (item.statement.scope\n if isinstance(item.statement, vast.Block)\n else None)\n _for = module.GenerateFor(self.m, pre, cond, post, scope)\n ret = _for\n self.add_object(_for)\n self.push_module(_for)\n statement = self.visit(item.statement)\n self.pop_module()\n return ret", "metadata": "root.VerilogReadVisitor._visit_GenerateFor", "header": "['class', 'VerilogReadVisitor', '(', 'object', ')', ':', '___EOS___']", "index": 771 }, { "content": " def _visit_GenerateIf(self, item):\n cond = self.visit(item.cond)\n true_scope = (item.true_statement.scope\n if isinstance(item.true_statement, vast.Block)\n else None)\n false_scope = (item.false_statement.scope\n if isinstance(item.false_statement, vast.Block)\n else None)\n _if_true = module.GenerateIf(self.m, cond, true_scope)\n ret = _if_true\n self.add_object(_if_true)\n self.push_module(_if_true)\n statement = self.visit(item.true_statement)\n self.pop_module()\n _if_false = _if_true.Else(false_scope)\n self.push_module(_if_false)\n statement = (self.visit(item.false_statement)\n if item.false_statement is not None else None)\n self.pop_module()\n return ret", "metadata": "root.VerilogReadVisitor._visit_GenerateIf", "header": "['class', 'VerilogReadVisitor', '(', 'object', ')', ':', '___EOS___']", "index": 786 } ]
[ { "span": "module_names ", "start_line": 56, "start_column": 4, "end_line": 56, "end_column": 16 }, { "span": "statement ", "start_line": 782, "start_column": 8, "end_line": 782, "end_column": 17 }, { "span": "statement ", "start_line": 802, "start_column": 8, "end_line": 802, "end_column": 17 } ]
[]
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_", "to", "\\u", "module", "\\u", "dict_", "(_", "*_", "filelist_", ",_", "**_", "opt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ast_", "=_", "to", "\\u", "ast_", "(_", "*_", "filelist_", ",_", "**_", "opt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "visitor_", "=_", "Modul", "e", "Visitor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "visitor_", "._", "visit_", "(_", "ast_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "names_", "=_", "module", "\\u", "visitor_", "._", "get", "\\u", "modulename", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "info", "table_", "=_", "module", "\\u", "visitor_", "._", "get", "\\u", "module", "info", "table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "info_", "=_", "module", "info", "table_", "._", "get", "Definit", "ions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "dict_", "=_", "collections_", "._", "Order", "ed", "Dict_", "(_", "[_", "(_", "n_", ",_", "d_", "._", "definition_", ")_", "for_", "n_", ",_", "d_", "in_", "module", "info_", "._", "items_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "module", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Read", "Visitor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "visit", "\\u", "Generate", "For_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pre_", "=_", "self_", "._", "visit_", "(_", "item_", "._", "pre_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cond_", "=_", "self_", "._", "visit_", "(_", "item_", "._", "cond_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "self_", "._", "visit_", "(_", "item_", "._", "post_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scope_", "=_", "(_", "item_", "._", "statement_", "._", "scope_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", "._", "statement_", ",_", "vas", "t_", "._", "Block_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "for_", "=_", "module_", "._", "Generate", "For_", "(_", "self_", "._", "m_", ",_", "pre_", ",_", "cond_", ",_", "post_", ",_", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "\\u", "for_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "object_", "(_", "\\u", "for_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "push", "\\u", "module_", "(_", "\\u", "for_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "self_", "._", "visit_", "(_", "item_", "._", "statement_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pop", "\\u", "module_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Read", "Visitor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "visit", "\\u", "Generate", "If_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cond_", "=_", "self_", "._", "visit_", "(_", "item_", "._", "cond_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "true", "\\u", "scope_", "=_", "(_", "item_", "._", "true", "\\u", "statement_", "._", "scope_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", "._", "true", "\\u", "statement_", ",_", "vas", "t_", "._", "Block_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fal", "se", "\\u", "scope_", "=_", "(_", "item_", "._", "fal", "se", "\\u", "statement_", "._", "scope_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", "._", "fal", "se", "\\u", "statement_", ",_", "vas", "t_", "._", "Block_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "if", "\\u", "true_", "=_", "module_", "._", "Generate", "If_", "(_", "self_", "._", "m_", ",_", "cond_", ",_", "true", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "\\u", "if", "\\u", "true_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "object_", "(_", "\\u", "if", "\\u", "true_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "push", "\\u", "module_", "(_", "\\u", "if", "\\u", "true_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "self_", "._", "visit_", "(_", "item_", "._", "true", "\\u", "statement_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pop", "\\u", "module_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "if", "\\u", "false_", "=_", "\\u", "if", "\\u", "true_", "._", "Else", "_", "(_", "fal", "se", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "push", "\\u", "module_", "(_", "\\u", "if", "\\u", "false_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "(_", "self_", "._", "visit_", "(_", "item_", "._", "fal", "se", "\\u", "statement_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "item_", "._", "fal", "se", "\\u", "statement_", "is_", "not_", "None_", "else_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pop", "\\u", "module_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
RobotLocomotion/director/src/python/director/handdriver.py
[ { "content": "import os\nimport vtkAll as vtk\nimport math\nimport time\nimport numpy as np\n\nfrom director import transformUtils\nfrom director import lcmUtils\nfrom director.timercallback import TimerCallback\nfrom director import objectmodel as om\nfrom director import visualization as vis\nfrom director import applogic as app\nfrom director.debugVis import DebugData\nfrom director import ioUtils\nfrom director.simpletimer import SimpleTimer\nfrom director.utime import getUtime\nfrom director import robotstate\n\nimport drc as lcmdrc\nimport irobothand as lcmirobot\nimport robotiqhand as lcmrobotiq\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class IRobotHandDriver(object):\n\n MOTOR_FINGER_0 = 0\n MOTOR_FINGER_1 = 1\n MOTOR_THUMB = 2\n\n\n\n\n", "metadata": "root.IRobotHandDriver", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def __init__(self, side):\n\n assert side in ('left', 'right')\n self.side = side\n self.enabledMotors = [True, True, True, False]\n pass", "metadata": "root.IRobotHandDriver.__init__", "header": "['class', 'IRobotHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 30 }, { "content": " def sendCalibrate(self, withJig=True):\n msg = lcmirobot.calibrate_t()\n msg.utime = getUtime()\n msg.in_jig = withJig\n channel = 'IROBOT_%s_CALIBRATE' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.IRobotHandDriver.sendCalibrate", "header": "['class', 'IRobotHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 38 }, { "content": " def sendOpen(self, percentage=100.0):\n self.sendClose(100.0 - percentage)", "metadata": "root.IRobotHandDriver.sendOpen", "header": "['class', 'IRobotHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 45 }, { "content": " def sendClose(self, percentage=100.0):\n assert 0.0 <= percentage <= 100.0\n msg = lcmirobot.position_control_close_t()\n msg.utime = getUtime()\n msg.valid = [True, True, True, False]\n msg.close_fraction = percentage / 100.0\n\n channel = 'IROBOT_%s_POSITION_CONTROL_CLOSE' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.IRobotHandDriver.sendClose", "header": "['class', 'IRobotHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 48 }, { "content": "class RobotiqHandDriver(object):\n\n\n\n\n\n\n\n\n\n\n\n # NB: added by Wolfgang 2015-07-27\n # Not used on the Robotiq, but more for using the \n # RobotiqHandDriver as a more generic hand driver\n", "metadata": "root.RobotiqHandDriver", "header": "['module', '___EOS___']", "index": 59 }, { "content": " def __init__(self, side):\n\n assert side in ('left', 'right')\n self.side = side\n pass", "metadata": "root.RobotiqHandDriver.__init__", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 61 }, { "content": " def sendCalibrate(self):\n msg = lcmrobotiq.command_t()\n msg.utime = getUtime()\n msg.activate = 0\n msg.emergency_release = 0\n msg.do_move = 0\n msg.mode = 0\n msg.position = 0\n msg.force = 0\n msg.velocity = 0\n channel = 'ROBOTIQ_%s_COMMAND' % self.side.upper()\n lcmUtils.publish(channel, msg)\n\n time.sleep(0.1)\n msg.activate = 1\n lcmUtils.publish(channel, msg)", "metadata": "root.RobotiqHandDriver.sendCalibrate", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 68 }, { "content": " def sendDrop(self):\n msg = lcmrobotiq.command_t()\n msg.utime = getUtime()\n msg.activate = 1\n msg.emergency_release = 1\n msg.do_move = 0\n msg.mode = 0\n msg.position = 0\n msg.force = 0\n msg.velocity = 0\n channel = 'ROBOTIQ_%s_COMMAND' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.RobotiqHandDriver.sendDrop", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 85 }, { "content": " def sendOpen(self, percentage=100.0):\n self.sendClose(100.0 - percentage)", "metadata": "root.RobotiqHandDriver.sendOpen", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 98 }, { "content": " def sendClose(self, percentage=100.0):\n assert 0.0 <= percentage <= 100.0\n\n msg = lcmrobotiq.command_t()\n msg.utime = getUtime()\n msg.activate = 1\n msg.emergency_release = 0\n msg.do_move = 1\n msg.position = int(254 * (percentage/100.0))\n msg.force = 254\n msg.velocity = 254\n channel = 'ROBOTIQ_%s_COMMAND' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.RobotiqHandDriver.sendClose", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 101 }, { "content": " def sendCustom(self, position, force, velocity, mode):\n assert 0.0 <= position <= 100.0\n assert 0.0 <= force <= 100.0\n assert 0.0 <= velocity <= 100.0\n assert 0 <= int(mode) <= 4\n\n msg = lcmrobotiq.command_t()\n msg.utime = getUtime()\n msg.activate = 1\n msg.emergency_release = 0\n msg.do_move = 1\n msg.position = int(254 * (position/100.0))\n msg.force = int(254 * (force/100.0))\n msg.velocity = int(254 * (velocity/100.0))\n msg.mode = int(mode)\n channel = 'ROBOTIQ_%s_COMMAND' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.RobotiqHandDriver.sendCustom", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 115 }, { "content": " def sendRegrasp(self, position, force, velocity, mode):\n\n channel = 'ROBOTIQ_%s_STATUS' % self.side.upper()\n statusMsg = lcmUtils.captureMessage(channel, lcmrobotiq.status_t)\n\n avgPosition = (statusMsg.positionA +\n statusMsg.positionB +\n statusMsg.positionC)/3.0\n print avgPosition\n\n newPosition = avgPosition/254.0 * 100.0\n print newPosition\n if newPosition > 5.0:\n self.sendCustom(newPosition-5.0, force, velocity, mode)\n else:\n self.sendCustom(newPosition, force, velocity, mode)\n\n time.sleep(0.3)\n self.sendCustom(position, force, velocity, mode)", "metadata": "root.RobotiqHandDriver.sendRegrasp", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 133 }, { "content": " def sendFingerControl(self, positionA, positionB, positionC, force, velocity, scissor, mode):\n assert 0.0 <= positionA <= 254.0\n assert 0.0 <= positionB <= 254.0\n assert 0.0 <= positionC <= 254.0\n assert 0.0 <= force <= 100.0\n assert 0.0 <= velocity <= 100.0\n assert 0 <= int(mode) <= 4\n\n if not scissor is None:\n assert 0.0 <= scissor <= 254.0\n\n msg = lcmrobotiq.command_t()\n msg.utime = getUtime()\n msg.activate = 1\n msg.emergency_release = 0\n msg.do_move = 1\n msg.ifc = 1\n msg.positionA = int(positionA)\n msg.positionB = int(positionB)\n msg.positionC = int(positionC)\n msg.force = int(254 * (force/100.0))\n msg.velocity = int(254 * (velocity/100.0))\n msg.mode = int(mode)\n\n if not scissor is None:\n msg.isc = 1\n msg.positionS = int(scissor)\n\n channel = 'ROBOTIQ_%s_COMMAND' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.RobotiqHandDriver.sendFingerControl", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 153 }, { "content": " def setMode(self, mode):\n assert 0 <= int(mode) <= 4\n\n msg = lcmrobotiq.command_t()\n msg.utime = getUtime()\n msg.activate = 1\n msg.emergency_release = 0\n msg.do_move = 0\n msg.position = 0\n msg.force = 0\n msg.velocity = 0\n msg.mode = int(mode)\n channel = 'ROBOTIQ_%s_COMMAND' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.RobotiqHandDriver.setMode", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 184 }, { "content": " def sendDeactivate(self):\n msg = lcmrobotiq.command_t()\n msg.utime = getUtime()\n msg.activate = 0\n msg.emergency_release = 0\n msg.do_move = 0\n msg.mode = 0\n msg.position = 0\n msg.force = 0\n msg.velocity = 0\n channel = 'ROBOTIQ_%s_COMMAND' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.RobotiqHandDriver.sendDeactivate", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 202 }, { "content": " def sendActivate(self):\n msg = lcmrobotiq.command_t()\n msg.utime = getUtime()\n msg.activate = 1\n msg.emergency_release = 0\n msg.do_move = 0\n msg.mode = 0\n msg.position = 0\n msg.force = 0\n msg.velocity = 0\n channel = 'ROBOTIQ_%s_COMMAND' % self.side.upper()\n lcmUtils.publish(channel, msg)", "metadata": "root.RobotiqHandDriver.sendActivate", "header": "['class', 'RobotiqHandDriver', '(', 'object', ')', ':', '___EOS___']", "index": 215 } ]
[ { "span": "import os", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "import vtkAll as vtk", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 20 }, { "span": "import math", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 }, { "span": "import numpy as np", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 18 }, { "span": "from director import transformUtils", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 35 }, { "span": "from director.timercallback import TimerCallback", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 48 }, { "span": "from director import objectmodel as om", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 38 }, { "span": "from director import visualization as vis", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 41 }, { "span": "from director import applogic as app", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 36 }, { "span": "from director.debugVis import DebugData", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 39 }, { "span": "from director import ioUtils", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 28 }, { "span": "from director.simpletimer import SimpleTimer", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 44 }, { "span": "from director import robotstate", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 31 }, { "span": "import drc as lcmdrc", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 20 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "vtk", "All_", "as_", "vtk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "director_", "import_", "transform", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "import_", "lcm", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "._", "timer", "callback_", "import_", "Time", "r", "Callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "import_", "object", "model_", "as_", "om_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "import_", "visualization", "_", "as_", "vis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "import_", "appl", "ogi", "c_", "as_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "._", "debug", "Vis", "_", "import_", "Deb", "ug", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "import_", "io", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "._", "simple", "timer_", "import_", "Simple", "Timer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "._", "utime", "_", "import_", "get", "Ut", "ime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "director_", "import_", "robots", "tate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "dr", "c_", "as_", "lcm", "dr", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "iro", "bot", "hand_", "as_", "lcm", "iro", "bot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "robot", "iq", "hand_", "as_", "lcm", "robot", "iq_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "IR", "obo", "t", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "MOT", "OR", "\\u", "FIN", "GER", "\\u", "0_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "MOT", "OR", "\\u", "FIN", "GER", "\\u", "1_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "MOT", "OR", "\\u", "THUMB", "_", "=_", "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\\uNL\\u\\u\\u_", "\\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_", "IR", "obo", "t", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "side_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "side_", "in_", "(_", "'", "left", "'_", ",_", "'", "right", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "side_", "=_", "side_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "enable", "d", "Moto", "rs_", "=_", "[_", "True_", ",_", "True_", ",_", "True_", ",_", "False_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IR", "obo", "t", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Calibrat", "e_", "(_", "self_", ",_", "with", "Ji", "g_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "lcm", "iro", "bot_", "._", "calibrate", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "in", "\\u", "ji", "g_", "=_", "with", "Ji", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", "=_", "'", "IRO", "BOT", "\\u", "%", "s", "\\u", "CALI", "BRA", "TE", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IR", "obo", "t", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Open_", "(_", "self_", ",_", "percentage_", "=_", "100.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "Close_", "(_", "100.0_", "-_", "percentage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IR", "obo", "t", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Close_", "(_", "self_", ",_", "percentage_", "=_", "100.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0.0_", "<=_", "percentage_", "<=_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "lcm", "iro", "bot_", "._", "position", "\\u", "control", "\\u", "close", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "valid_", "=_", "[_", "True_", ",_", "True_", ",_", "True_", ",_", "False_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "close", "\\u", "fraction_", "=_", "percentage_", "/_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel_", "=_", "'", "IRO", "BOT", "\\u", "%", "s", "\\u", "POSITION", "\\u", "CONTR", "OL", "\\u", "CLOSE", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NB", ":", " ", "adde", "d", " ", "by", " ", "Wolf", "gang", " ", "201", "5", "-0", "7", "-", "27_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", " ", "used", " ", "on", " ", "the", " ", "Robot", "iq", ",", " ", "but", " ", "more", " ", "for", " ", "usi", "ng", " ", "the", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Robot", "iq", "Hand", "Drive", "r", " ", "as", " ", "a", " ", "more", " ", "gener", "ic", " ", "hand", " ", "driver_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "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_", ",_", "side_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "side_", "in_", "(_", "'", "left", "'_", ",_", "'", "right", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "side_", "=_", "side_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Calibrat", "e_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "lcm", "robot", "iq_", "._", "command", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "emergency", "\\u", "release_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "do", "\\u", "move_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "mode_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "force_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "velocity_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "COMMA", "ND", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Drop", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "lcm", "robot", "iq_", "._", "command", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "emergency", "\\u", "release_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "do", "\\u", "move_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "mode_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "force_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "velocity_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "COMMA", "ND", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Open_", "(_", "self_", ",_", "percentage_", "=_", "100.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "Close_", "(_", "100.0_", "-_", "percentage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Close_", "(_", "self_", ",_", "percentage_", "=_", "100.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0.0_", "<=_", "percentage_", "<=_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "lcm", "robot", "iq_", "._", "command", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "emergency", "\\u", "release_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "do", "\\u", "move_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position_", "=_", "int_", "(_", "254_", "*_", "(_", "percentage_", "/_", "100.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "force_", "=_", "254_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "velocity_", "=_", "254_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "COMMA", "ND", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Custom", "_", "(_", "self_", ",_", "position_", ",_", "force_", ",_", "velocity_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0.0_", "<=_", "position_", "<=_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0.0_", "<=_", "force_", "<=_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0.0_", "<=_", "velocity_", "<=_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0_", "<=_", "int_", "(_", "mode_", ")_", "<=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "lcm", "robot", "iq_", "._", "command", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "emergency", "\\u", "release_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "do", "\\u", "move_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position_", "=_", "int_", "(_", "254_", "*_", "(_", "position_", "/_", "100.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "force_", "=_", "int_", "(_", "254_", "*_", "(_", "force_", "/_", "100.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "velocity_", "=_", "int_", "(_", "254_", "*_", "(_", "velocity_", "/_", "100.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "mode_", "=_", "int_", "(_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "COMMA", "ND", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Regr", "asp", "_", "(_", "self_", ",_", "position_", ",_", "force_", ",_", "velocity_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "STATUS", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status", "Msg_", "=_", "lcm", "Utils_", "._", "captur", "e", "Message_", "(_", "channel_", ",_", "lcm", "robot", "iq_", "._", "status", "\\u", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "avg", "Position_", "=_", "(_", "status", "Msg_", "._", "position", "A_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "status", "Msg_", "._", "position", "B_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "status", "Msg_", "._", "position", "C_", ")_", "/_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "avg", "Position_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "Position_", "=_", "avg", "Position_", "/_", "254", ".0_", "*_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "new", "Position_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "Position_", ">_", "5.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "Custom", "_", "(_", "new", "Position_", "-_", "5.0_", ",_", "force_", ",_", "velocity_", ",_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "Custom", "_", "(_", "new", "Position_", ",_", "force_", ",_", "velocity_", ",_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "Custom", "_", "(_", "position_", ",_", "force_", ",_", "velocity_", ",_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Fin", "ger", "Control_", "(_", "self_", ",_", "position", "A_", ",_", "position", "B_", ",_", "position", "C_", ",_", "force_", ",_", "velocity_", ",_", "sci", "ssor", "_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0.0_", "<=_", "position", "A_", "<=_", "254", ".0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0.0_", "<=_", "position", "B_", "<=_", "254", ".0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0.0_", "<=_", "position", "C_", "<=_", "254", ".0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0.0_", "<=_", "force_", "<=_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0.0_", "<=_", "velocity_", "<=_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0_", "<=_", "int_", "(_", "mode_", ")_", "<=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "sci", "ssor", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0.0_", "<=_", "sci", "ssor", "_", "<=_", "254", ".0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "lcm", "robot", "iq_", "._", "command", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "emergency", "\\u", "release_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "do", "\\u", "move_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "ifc", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position", "A_", "=_", "int_", "(_", "position", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position", "B_", "=_", "int_", "(_", "position", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position", "C_", "=_", "int_", "(_", "position", "C_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "force_", "=_", "int_", "(_", "254_", "*_", "(_", "force_", "/_", "100.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "velocity_", "=_", "int_", "(_", "254_", "*_", "(_", "velocity_", "/_", "100.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "mode_", "=_", "int_", "(_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "sci", "ssor", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "._", "isc", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position", "S_", "=_", "int_", "(_", "sci", "ssor", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "COMMA", "ND", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Mode_", "(_", "self_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0_", "<=_", "int_", "(_", "mode_", ")_", "<=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "lcm", "robot", "iq_", "._", "command", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "emergency", "\\u", "release_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "do", "\\u", "move_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "force_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "velocity_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "mode_", "=_", "int_", "(_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "COMMA", "ND", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Dea", "ctivat", "e_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "lcm", "robot", "iq_", "._", "command", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "emergency", "\\u", "release_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "do", "\\u", "move_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "mode_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "force_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "velocity_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "COMMA", "ND", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Robot", "iq", "Hand", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Activat", "e_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "lcm", "robot", "iq_", "._", "command", "\\u", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "utime", "_", "=_", "get", "Ut", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "activate_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "emergency", "\\u", "release_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "do", "\\u", "move_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "mode_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "position_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "force_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "velocity_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", "=_", "'", "ROB", "OT", "IQ", "\\u", "%", "s", "\\u", "COMMA", "ND", "'_", "%_", "self_", "._", "side_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lcm", "Utils_", "._", "publish_", "(_", "channel_", ",_", "msg_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
ustuehler/git-cvs/cvsgit/command/init.py
[ { "content": "\"\"\"Command to initialize a Git repository with all the required\nmeta-data for 'git-cvs'.\"\"\"\n\nimport os.path\nimport sys\nimport time\n\nfrom cvsgit.main import Command, Conduit\nfrom cvsgit.i18n import _\n\n\nif __name__ == '__main__':\n init()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class init(Command):\n __doc__ = _(\n \"\"\"Initialize a Git repository to track a CVS repository.\n\n Usage: %prog [options] <repository> [directory]\n\n Initializes a Git repository and sets up the required meta-data to\n track a CVS repository. The 'repository' argument must be a local\n file system path pointing at the actual root of a CVS repository\n or at any module directory within the repository.\n\n If 'directory' is omitted, the current working directory will be\n initialized instead of the one specified.\n \"\"\")\n\n\n", "metadata": "root.init", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def initialize_options(self):\n self.repository = None\n self.add_option('--bare', action='store_true', help=\\\n _(\"Initialize a bare repository. See git-init(1).\"))\n self.add_option('--domain', metavar='DOMAIN', help=\\\n _(\"Set the 'cvs.domain' configuration option to the \"\n \"e-mail domain to use as a default value for unknown \"\n \"authors.\"))\n self.add_option('--quiet', action='store_true', help=\\\n _(\"Only print error and warning messages.\"))", "metadata": "root.init.initialize_options", "header": "['class', 'init', '(', 'Command', ')', ':', '___EOS___']", "index": 25 }, { "content": " def finalize_options(self):\n if len(self.args) < 1:\n self.usage_error(_('missing CVS repository path'))\n elif len(self.args) == 1:\n self.repository = self.args[0]\n self.directory = None\n elif len(self.args) == 2:\n self.repository = self.args[0]\n self.directory = self.args[1]\n else:\n self.usage_error(_('too many arguments'))", "metadata": "root.init.finalize_options", "header": "['class', 'init', '(', 'Command', ')', ':', '___EOS___']", "index": 36 }, { "content": " def run(self):\n conduit = Conduit(self.directory)\n conduit.init(self.repository,\n domain=self.options.domain,\n bare=self.options.bare,\n quiet=self.options.quiet)", "metadata": "root.init.run", "header": "['class', 'init', '(', 'Command', ')', ':', '___EOS___']", "index": 48 } ]
[ { "span": "import os.path", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 14 }, { "span": "import sys", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 10 }, { "span": "import time", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Command", " ", "to", " ", "initialize", " ", "a", " ", "Git", " ", "repos", "itor", "y", " ", "with", " ", "all", " ", "the", " ", "require", "d", "\\", "10", ";", "meta", "-", "data", " ", "for", " ", "'", "git", "-", "cvs", "'.", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "cvs", "git_", "._", "main_", "import_", "Command_", ",_", "Cond", "uit", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cvs", "git_", "._", "i18n_", "import_", "\\u_", "\\u\\u\\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 ", " _", "init_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "init_", "(_", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "doc\\u\\u_", "=_", "\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Initializ", "e", " ", "a", " ", "Git", " ", "repos", "itor", "y", " ", "to", " ", "track", " ", "a", " ", "CV", "S", " ", "repos", "itor", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Us", "age", ":", " ", "%", "prog", " ", "[", "options", "]", " ", "<", "repos", "itor", "y", ">", " ", "[", "director", "y", "]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "Git", " ", "repos", "itor", "y", " ", "and", " ", "sets", " ", "up", " ", "the", " ", "require", "d", " ", "meta", "-", "data", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "track", " ", "a", " ", "CV", "S", " ", "repos", "itor", "y", ".", " ", " ", "The", " ", "'", "repos", "itor", "y", "'", " ", "argu", "ment", " ", "must", " ", "be", " ", "a", " ", "local", "\\", "10", ";", " ", " ", " ", " ", "file", " ", "system", " ", "path", " ", "pointi", "ng", " ", "at", " ", "the", " ", "actual", " ", "root", " ", "of", " ", "a", " ", "CV", "S", " ", "repos", "itor", "y", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "at", " ", "any", " ", "module", " ", "director", "y", " ", "within", " ", "the", " ", "repos", "itor", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "'", "director", "y", "'", " ", "is", " ", "omit", "ted", ",", " ", "the", " ", "current", " ", "working", " ", "director", "y", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "initialize", "d", " ", "inst", "ead", " ", "of", " ", "the", " ", "one", " ", "specified", ".", "\\", "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_", "[SEP]_", "class_", "init_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "initialize", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "repository_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "option_", "(_", "'--", "bare", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Initializ", "e", " ", "a", " ", "bare", " ", "repos", "itor", "y", ".", " ", "See", " ", "git", "-", "init", "(", "1", ").\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "option_", "(_", "'--", "domain", "'_", ",_", "metavar_", "=_", "'", "DOM", "AIN", "'_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Set", " ", "the", " ", "'", "cvs", ".", "domain", "'", " ", "configura", "tion", " ", "option", " ", "to", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "e-", "mail", " ", "domain", " ", "to", " ", "use", " ", "as", " ", "a", " ", "default", " ", "value", " ", "for", " ", "unknown", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "author", "s", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "option_", "(_", "'--", "quie", "t", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "help_", "=_", "\\u_", "(_", "\"", "On", "ly", " ", "print", " ", "error", " ", "and", " ", "warn", "ing", " ", "message", "s", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "init_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "finalize", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "self_", "._", "args_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "usage", "\\u", "error_", "(_", "\\u_", "(_", "'", "missi", "ng", " ", "CV", "S", " ", "repos", "itor", "y", " ", "path", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "self_", "._", "args_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "repository_", "=_", "self_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "directory_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "self_", "._", "args_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "repository_", "=_", "self_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "directory_", "=_", "self_", "._", "args_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "usage", "\\u", "error_", "(_", "\\u_", "(_", "'", "too", " ", "many", " ", "argu", "ment", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "init_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conduit", "_", "=_", "Cond", "uit", "_", "(_", "self_", "._", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conduit", "_", "._", "init_", "(_", "self_", "._", "repository_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "self_", "._", "options_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bare", "_", "=_", "self_", "._", "options_", "._", "bare", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "quiet_", "=_", "self_", "._", "options_", "._", "quiet_", ")_", "\\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, 0, 1, 1, 1, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Constant in conditional expression or statement
cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/test/test_heapyc.py
[ { "content": " def test_1(self):\n\timport gc\n\tfrom sys import getrefcount as grc\n\n\tsupport.TestCase.setUp(self)\n\tsets = self.guppy.sets\n\theapdefs = getattr(sets.setsc, '_NyHeapDefs_'),\n\troot = []\n\theapyc = self.guppy.heapy.heapyc\n\tnodeset = sets.mutnodeset\n\tnodegraph = heapyc.NodeGraph\n\t\n\tclass T(object):\n\t __slots__ = 'a', '_hiding_tag_', 'tonly'\n\t pass\n\n\tclass U(T):\n\t __slots__ = 'b',\n\t pass\n\n\tclass V(object):\n\t __slots__ = 'c',\n\n\n\tgc.collect()\n\n\tns = nodeset()\n\ta = [ns]\n\ta.append(a)\n\tb = []\n\the = []\n\tc = []\n\tt = T()\n\ttonly = []\n\n\tt.a = a\n\tt._hiding_tag_ = he\n\tt.tonly = tonly\n\n\tu = U()\n\tu.a = a\n\tu._hiding_tag_ = he\n\tu.b = b\n\n\tv = V()\n\tv.c = c\n\n\ta = [x for x in [list]]\n\tdel x\n\n\tli = [he, a, b, c, t, u, v, T, U, V, ns, nodeset, list]\n\trcli0 = [grc(x) for x in li]\n\tdel x\n\n\tns |= li + range(10000, 10010)\n\troot.extend(li)\n\n\trcli = [grc(x) for x in li]\n\tdel x\n\n\trec = nodeset([x for x in li])\n\tx = None\n\n\trec.append(rec)\n\tns.add(rec)\n\trec._hiding_tag_ = rec\n\n\tif 1:\n\t hv = heapyc.HeapView(root, heapdefs)\n\t hv.register__hiding_tag__type(T)\n\t h = hv.heap()\n\t assert a in h\n\t assert c in h\n\t assert tonly in h\n\t hv._hiding_tag_ = he\n\t h = hv.heap()\n\t del x\n\t del h\n\t del hv\n\n\n\tns.discard(rec)\n\trec = None\n\tgc.collect()\n\n\tnrcli = [grc(x) for x in li]\n\tdel x\n\tself.aseq(rcli, nrcli)\n\n\troot[:]=[]\n\tns.clear()\n\n\tnrcli0 = [grc(x) for x in li]\n\tdel x\n\t\n\tself.aseq(rcli0, nrcli0)", "metadata": "root.TestLeak.test_1", "header": "['class', 'TestLeak', '(', 'support', '.', 'TestCase', ')', ':', '___EOS___']", "index": 251 }, { "content": " def test_weaky(self):\n\t# Test that the extra-type information in heapview\n\t# will still allow types to come, be used, and go, and be collected\n\t# This depends on that they are weakly-referenced \n\t# so internal heapview structures can remove them when they are\n\t# to be collected.\n\n\timport gc\n\tfrom sys import getrefcount as grc\n\n\tsupport.TestCase.setUp(self)\n\tsets = self.guppy.sets\n\theapdefs = getattr(sets.setsc, '_NyHeapDefs_'),\n\troot = []\n\theapyc = self.guppy.heapy.heapyc\n\tnodeset = sets.NodeSet\n\tnodegraph = heapyc.NodeGraph\n\t\n\tgc.collect()\n\n\tprobe = []\n\trcprobe = grc(probe)\n\n\tclass T(object):\n\t x = probe\n\n\tclass U(T):\n\t pass\n\tT.U = U\t# Make circular dependency\n\tt = T()\n\tu = U()\n\n\n\troot.append(t)\n\troot.append(u)\n\n\tif 1:\n\t hv = heapyc.HeapView(root, heapdefs)\n\t x = hv.heap()\n\t assert t in x\n\t x = None\n\n\n\tT = t = U = u = None\n\troot[:] = []\n\n\tgc.collect()\t# 2 collections needed sometimes? Note Apr 15 2005\n\n\tnrcprobe = grc(probe)\n\n\tself.aseq(nrcprobe, rcprobe)", "metadata": "root.TestLeak.test_weaky", "header": "['class', 'TestLeak', '(', 'support', '.', 'TestCase', ')', ':', '___EOS___']", "index": 348 } ]
[ { "span": "1:", "start_line": 318, "start_column": 4, "end_line": 318, "end_column": 5 }, { "span": "1:", "start_line": 384, "start_column": 4, "end_line": 384, "end_column": 5 } ]
[]
1
true
[ "[CLS]_", "Constant_", "in_", "conditional", "_", "expression_", "or_", "statement_", "[SEP]_", "class_", "Test", "Leak", "_", "(_", "support_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "import_", "gc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sys_", "import_", "getre", "fco", "unt_", "as_", "gr", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "support_", "._", "Test", "Case_", "._", "set", "Up_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sets_", "=_", "self_", "._", "gu", "ppy", "_", "._", "sets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "heap", "defs_", "=_", "getattr_", "(_", "sets_", "._", "sets", "c_", ",_", "'\\u", "Ny", "Hea", "p", "Defs", "\\u'_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "heap", "yc_", "=_", "self_", "._", "gu", "ppy", "_", "._", "heap", "y_", "._", "heap", "yc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes", "et_", "=_", "sets_", "._", "mut", "nodes", "et_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "graph_", "=_", "heap", "yc_", "._", "Node", "Graph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "T_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "\\u\\u", "slots\\u\\u_", "=_", "'", "a", "'_", ",_", "'\\u", "hid", "ing", "\\u", "tag", "\\u'_", ",_", "'", "ton", "ly", "'_", "\\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_", "class_", "U_", "(_", "T_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "\\u\\u", "slots\\u\\u_", "=_", "'", "b", "'_", ",_", "\\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_", "class_", "V_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "\\u\\u", "slots\\u\\u_", "=_", "'", "c", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ns_", "=_", "nodes", "et_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "[_", "ns_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "._", "append_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "he_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "T_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ton", "ly_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "a_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "\\u", "hid", "ing", "\\u", "tag", "\\u_", "=_", "he_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "ton", "ly_", "=_", "ton", "ly_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "u_", "=_", "U_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "a_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "\\u", "hid", "ing", "\\u", "tag", "\\u_", "=_", "he_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "b_", "=_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "v_", "=_", "V_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "._", "c_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "[_", "x_", "for_", "x_", "in_", "[_", "list_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "li_", "=_", "[_", "he_", ",_", "a_", ",_", "b_", ",_", "c_", ",_", "t_", ",_", "u_", ",_", "v_", ",_", "T_", ",_", "U_", ",_", "V_", ",_", "ns_", ",_", "nodes", "et_", ",_", "list_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rcli", "0_", "=_", "[_", "gr", "c_", "(_", "x_", ")_", "for_", "x_", "in_", "li_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ns_", "|=_", "li_", "+_", "range_", "(_", "10000_", ",_", "10010", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "extend_", "(_", "li_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rcli", "_", "=_", "[_", "gr", "c_", "(_", "x_", ")_", "for_", "x_", "in_", "li_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rec_", "=_", "nodes", "et_", "(_", "[_", "x_", "for_", "x_", "in_", "li_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rec_", "._", "append_", "(_", "rec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "._", "add_", "(_", "rec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec_", "._", "\\u", "hid", "ing", "\\u", "tag", "\\u_", "=_", "rec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "hv", "_", "=_", "heap", "yc_", "._", "Hea", "p", "View_", "(_", "root_", ",_", "heap", "defs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hv", "_", "._", "register", "\\u\\u", "hid", "ing", "\\u", "tag", "\\u\\u", "type_", "(_", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "hv", "_", "._", "heap_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "a_", "in_", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "in_", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "ton", "ly_", "in_", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hv", "_", "._", "\\u", "hid", "ing", "\\u", "tag", "\\u_", "=_", "he_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "hv", "_", "._", "heap_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "hv", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ns_", "._", "discard_", "(_", "rec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nr", "cli_", "=_", "[_", "gr", "c_", "(_", "x_", ")_", "for_", "x_", "in_", "li_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ase", "q_", "(_", "rcli", "_", ",_", "nr", "cli_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "[_", ":_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nr", "cli", "0_", "=_", "[_", "gr", "c_", "(_", "x_", ")_", "for_", "x_", "in_", "li_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ase", "q_", "(_", "rcli", "0_", ",_", "nr", "cli", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Leak", "_", "(_", "support_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "weak", "y_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "tha", "t", " ", "the", " ", "extra", "-", "type", " ", "informati", "on", " ", "in", " ", "heap", "view_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "still", " ", "allow", " ", "types", " ", "to", " ", "come", ",", " ", "be", " ", "used", ",", " ", "and", " ", "go", ",", " ", "and", " ", "be", " ", "collected", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "depend", "s", " ", "on", " ", "tha", "t", " ", "the", "y", " ", "are", " ", "weak", "ly", "-", "referenced", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "internal", " ", "heap", "view", " ", "structure", "s", " ", "can", " ", "remove", " ", "them", " ", "whe", "n", " ", "the", "y", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "be", " ", "collected", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "import_", "gc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sys_", "import_", "getre", "fco", "unt_", "as_", "gr", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "support_", "._", "Test", "Case_", "._", "set", "Up_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sets_", "=_", "self_", "._", "gu", "ppy", "_", "._", "sets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "heap", "defs_", "=_", "getattr_", "(_", "sets_", "._", "sets", "c_", ",_", "'\\u", "Ny", "Hea", "p", "Defs", "\\u'_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "heap", "yc_", "=_", "self_", "._", "gu", "ppy", "_", "._", "heap", "y_", "._", "heap", "yc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes", "et_", "=_", "sets_", "._", "Node", "Set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "graph_", "=_", "heap", "yc_", "._", "Node", "Graph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "probe_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rcp", "robe", "_", "=_", "gr", "c_", "(_", "probe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "T_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "x_", "=_", "probe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "U_", "(_", "T_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "T_", "._", "U_", "=_", "U_", "#", " ", "Make", " ", "circular", " ", "dependency_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "T_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "U_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "._", "append_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "append_", "(_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "hv", "_", "=_", "heap", "yc_", "._", "Hea", "p", "View_", "(_", "root_", ",_", "heap", "defs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "hv", "_", "._", "heap_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "t_", "in_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "T_", "=_", "t_", "=_", "U_", "=_", "u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "[_", ":_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "#", " ", "2", " ", "collection", "s", " ", "need", "ed", " ", "somet", "imes", "?", " ", "Not", "e", " ", "Ap", "r", " ", "15", " ", "2005", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nr", "cpro", "be_", "=_", "gr", "c_", "(_", "probe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ase", "q_", "(_", "nr", "cpro", "be_", ",_", "rcp", "robe", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unreachable code
dimagi/commcare-hq/custom/_legacy/pact/api.py
[ { "content": "def get_all_providers(invalidate=False):\n \"\"\"\n wrapper function to get all the providers for PACT and cache them.\n ugly for now - the number of entries is small enough that loading all and scanning on checking is small enough overhead on a single page load.\n \"\"\"\n if invalidate:\n cache.delete(PACT_PROVIDERS_FIXTURE_CACHE_KEY)\n raw_cached_fixtures = cache.get(PACT_PROVIDERS_FIXTURE_CACHE_KEY, None)\n if raw_cached_fixtures is None:\n #requery and cache\n pact_hp_group = Group.by_name(PACT_DOMAIN, PACT_HP_GROUPNAME)\n providers = FixtureDataItem.by_group(pact_hp_group)\n cache.set(PACT_PROVIDERS_FIXTURE_CACHE_KEY, json.dumps([x.to_json() for x in providers]))\n return providers\n else:\n try:\n json_data = json.loads(raw_cached_fixtures)\n #not necessary in the grand scheme of things - we could really just use raw JSON\n return [FixtureDataItem.wrap(x) for x in json_data]\n except Exception, ex:\n logging.error(\"Error loading json from cache key %s: %s\" % (PACT_PROVIDERS_FIXTURE_CACHE_KEY, ex))\n return []\n\n# cache.set('%s_casedoc' % self._id, json.dumps(self._case), PACT_CACHE_TIMEOUT)\n# xml_ret = cache.get('%s_schedule_xml' % self._id, None)\n pass", "metadata": "root.get_all_providers", "header": "['module', '___EOS___']", "index": 244 } ]
[ { "span": "pass", "start_line": 269, "start_column": 8, "end_line": 269, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "all", "\\u", "providers_", "(_", "invalidate", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "wrapp", "er", " ", "function", " ", "to", " ", "get", " ", "all", " ", "the", " ", "provide", "rs", " ", "for", " ", "PAC", "T", " ", "and", " ", "cache", " ", "them", ".", "\\", "10", ";", " ", " ", " ", " ", "ug", "ly", " ", "for", " ", "now", " ", "-", " ", "the", " ", "number", " ", "of", " ", "entri", "es", " ", "is", " ", "small", " ", "eno", "ugh", " ", "tha", "t", " ", "load", "ing", " ", "all", " ", "and", " ", "scanning", " ", "on", " ", "checking", " ", "is", " ", "small", " ", "eno", "ugh", " ", "overhead", " ", "on", " ", "a", " ", "single", " ", "page", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "invalidate", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cache_", "._", "delete_", "(_", "PAC", "T", "\\u", "PROVIDER", "S", "\\u", "FIXTURE", "\\u", "CACHE", "\\u", "KEY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raw", "\\u", "cache", "d\\u", "fixtures_", "=_", "cache_", "._", "get_", "(_", "PAC", "T", "\\u", "PROVIDER", "S", "\\u", "FIXTURE", "\\u", "CACHE", "\\u", "KEY_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "raw", "\\u", "cache", "d\\u", "fixtures_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "reque", "ry", " ", "and", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pac", "t", "\\u", "hp", "\\u", "group_", "=_", "Group_", "._", "by", "\\u", "name_", "(_", "PAC", "T", "\\u", "DOMAIN_", ",_", "PAC", "T", "\\u", "HP", "\\u", "GROU", "PN", "AME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "providers_", "=_", "Fix", "ture", "Data", "Item_", "._", "by", "\\u", "group_", "(_", "pac", "t", "\\u", "hp", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "._", "set_", "(_", "PAC", "T", "\\u", "PROVIDER", "S", "\\u", "FIXTURE", "\\u", "CACHE", "\\u", "KEY_", ",_", "json_", "._", "dumps_", "(_", "[_", "x_", "._", "to", "\\u", "json_", "(_", ")_", "for_", "x_", "in_", "providers_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "providers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "data_", "=_", "json_", "._", "loads_", "(_", "raw", "\\u", "cache", "d\\u", "fixtures_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "not", " ", "necessar", "y", " ", "in", " ", "the", " ", "grand", " ", "sche", "me", " ", "of", " ", "thing", "s", " ", "-", " ", "we", " ", "coul", "d", " ", "reall", "y", " ", "just", " ", "use", " ", "raw", " ", "JSON_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "[_", "Fix", "ture", "Data", "Item_", "._", "wrap_", "(_", "x_", ")_", "for_", "x_", "in_", "json", "\\u", "data_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "error_", "(_", "\"", "Error", " ", "load", "ing", " ", "json", " ", "from", " ", "cache", " ", "key", " ", "%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "PAC", "T", "\\u", "PROVIDER", "S", "\\u", "FIXTURE", "\\u", "CACHE", "\\u", "KEY_", ",_", "ex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "cache", ".", "set", "('", "%", "s", "\\u", "case", "doc", "'", " ", "%", " ", "self", ".\\u", "id", ",", " ", "json", ".", "dump", "s", "(", "self", ".\\u", "case", "),", " ", "PAC", "T", "\\u", "CACHE", "\\u", "TIME", "OUT", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "xml", "\\u", "ret", " ", "=", " ", "cache", ".", "get", "('", "%", "s", "\\u", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2 ]
Unused import
kdart/pycopia/mibs/pycopia/mibs/SNMPv2_TC_OID.py
[ { "content": "# python\n# This file is generated by a program (mib2py). \n\nimport SNMPv2_TC\n\nOIDMAP = {\n}\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import SNMPv2_TC", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 16 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "generat", "ed", " ", "by", " ", "a", " ", "program", " ", "(", "mib", "2py", ").", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "SN", "MP", "v2", "\\u", "TC_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "OID", "MAP_", "=_", "{_", "\\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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2 ]
Comparison using is when operands support `__eq__`
cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Monitor.py
[ { "content": " def exec_cmd(self, cmd, retdata=0, noblock=0):\n\tif cmd is not None:\n\t self.send_cmd(cmd)\n self.promptstate = False\n\tdatas = []\n\twhile 1:\n\t p = queue_get_interruptible(self.dataq, noblock)\n if p is None:\n if self.promptstate:\n break\n else:\n time.sleep(1)\n continue\n\t if p is CONN_CLOSED:\n\t\traise EOFError\n\t if p[0] == 'DATA':\n self.promptstate = False\n\t\tif retdata:\n\t\t datas.append(p[1])\n\t\telse:\n\t\t sys.stdout.write(p[1])\n\t elif p[0] == 'PROMPT':\n\t\tself.prompt = p[1]\n if self.dataq.empty():\n self.promptstate = True\n break\n else:\n self.promptstate = False\n\t else:\n\t\tassert 0\n\tif retdata:\n\t return ''.join(datas)", "metadata": "root.Handler.exec_cmd", "header": "['class', 'Handler', '(', 'SocketServer', '.', 'StreamRequestHandler', ')', ':', '___EOS___']", "index": 59 } ]
[ { "span": "p is CONN_CLOSED:", "start_line": 72, "start_column": 8, "end_line": 72, "end_column": 24 } ]
[]
1
false
[ "[CLS]_", "Compari", "son_", "using_", "is_", "when_", "operands_", "support_", " _", "`_", "\\u\\u", "eq\\u\\u_", "`_", "[SEP]_", "class_", "Handler_", "(_", "Sock", "et", "Server_", "._", "Stream", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exec", "\\u", "cmd_", "(_", "self_", ",_", "cmd_", ",_", "ret", "data_", "=_", "0_", ",_", "nob", "lock_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "cmd_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "self_", "._", "send", "\\u", "cmd_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prompt", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datas_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "p_", "=_", "queue", "\\u", "get", "\\u", "interrupt", "ible_", "(_", "self_", "._", "data", "q_", ",_", "nob", "lock_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "prompt", "state_", ":_", "\\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 ", " ", "_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "p_", "is_", "CONN", "\\u", "CLOSED", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "EO", "FE", "rror_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "p_", "[_", "0_", "]_", "==_", "'", "DATA", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "prompt", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ret", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t _", "datas_", "._", "append_", "(_", "p_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t _", "sys_", "._", "stdout_", "._", "write_", "(_", "p_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "0_", "]_", "==_", "'", "PROMPT", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "prompt_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "data", "q_", "._", "empty_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "prompt", "state_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "prompt", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "assert_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ret", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "return_", "''_", "._", "join_", "(_", "datas_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
linkyndy/remodel/tests/test_helpers.py
[ { "content": " def test_new_table(self):\n class Artist(Model):\n pass\n\n create_tables()\n self.assert_table_created('artists')", "metadata": "root.CreateTablesTests.test_new_table", "header": "['class', 'CreateTablesTests', '(', 'DbBaseTestCase', ')', ':', '___EOS___']", "index": 12 }, { "content": " def test_existing_table(self):\n class Artist(Model):\n pass\n\n create_tables()\n create_tables()\n self.assert_table_created('artists')", "metadata": "root.CreateTablesTests.test_existing_table", "header": "['class', 'CreateTablesTests', '(', 'DbBaseTestCase', ')', ':', '___EOS___']", "index": 19 }, { "content": " def setUp(self):\n super(DropTablesTests, self).setUp()\n\n class Artist(Model):\n pass\n\n create_tables()", "metadata": "root.DropTablesTests.setUp", "header": "['class', 'DropTablesTests', '(', 'DbBaseTestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_new_index(self):\n class Order(Model):\n belongs_to = ('Customer',)\n\n create_tables()\n create_indexes()\n self.assert_indexes_created('orders', ['customer_id'])", "metadata": "root.CreateIndexesTests.test_new_index", "header": "['class', 'CreateIndexesTests', '(', 'DbBaseTestCase', ')', ':', '___EOS___']", "index": 54 }, { "content": " def test_existing_index(self):\n class Order(Model):\n belongs_to = ('Customer',)\n\n create_tables()\n create_indexes()\n create_indexes()\n self.assert_indexes_created('orders', ['customer_id'])", "metadata": "root.CreateIndexesTests.test_existing_index", "header": "['class', 'CreateIndexesTests', '(', 'DbBaseTestCase', ')', ':', '___EOS___']", "index": 62 } ]
[ { "span": "Artist(", "start_line": 13, "start_column": 14, "end_line": 13, "end_column": 20 }, { "span": "Artist(", "start_line": 20, "start_column": 14, "end_line": 20, "end_column": 20 }, { "span": "Artist(", "start_line": 32, "start_column": 14, "end_line": 32, "end_column": 20 }, { "span": "Order(", "start_line": 55, "start_column": 14, "end_line": 55, "end_column": 19 }, { "span": "Order(", "start_line": 63, "start_column": 14, "end_line": 63, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Creat", "e", "Table", "s", "Tests_", "(_", "Db", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "new", "\\u", "table_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Artist_", "(_", "Model_", ")_", ":_", "\\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_", "create", "\\u", "tables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "table", "\\u", "created_", "(_", "'", "artist", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Table", "s", "Tests_", "(_", "Db", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "ing", "\\u", "table_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Artist_", "(_", "Model_", ")_", ":_", "\\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_", "create", "\\u", "tables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "tables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "table", "\\u", "created_", "(_", "'", "artist", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Drop", "Table", "s", "Tests_", "(_", "Db", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Drop", "Table", "s", "Tests_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Artist_", "(_", "Model_", ")_", ":_", "\\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_", "create", "\\u", "tables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Indexe", "s", "Tests_", "(_", "Db", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "new", "\\u", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Order_", "(_", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "belo", "ngs", "\\u", "to_", "=_", "(_", "'", "Custom", "er", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "create", "\\u", "tables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "indexes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "indexe", "s", "\\u", "created_", "(_", "'", "order", "s", "'_", ",_", "[_", "'", "customer", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Indexe", "s", "Tests_", "(_", "Db", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "ing", "\\u", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Order_", "(_", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "belo", "ngs", "\\u", "to_", "=_", "(_", "'", "Custom", "er", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "create", "\\u", "tables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "indexes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "indexes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "indexe", "s", "\\u", "created_", "(_", "'", "order", "s", "'_", ",_", "[_", "'", "customer", "\\u", "id", "'_", "]_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 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 ]
`__init__` method calls overridden method
CollabQ/CollabQ/bin/upload.py
[ { "content": "class AbstractRpcServer(object):\n \"\"\"Provides a common interface for a simple RPC server.\"\"\"\n\n\n\n\n\n\n", "metadata": "root.AbstractRpcServer", "header": "['module', '___EOS___']", "index": 139 }, { "content": " def __init__(self, host, auth_function, host_override=None, extra_headers={},\n save_cookies=False):\n \"\"\"Creates a new HttpRpcServer.\n\n Args:\n host: The host to send requests to.\n auth_function: A function that takes no arguments and returns an\n (email, password) tuple when called. Will be called if authentication\n is required.\n host_override: The host header to send to the server (defaults to host).\n extra_headers: A dict of extra headers to append to every request.\n save_cookies: If True, save the authentication cookies to local disk.\n If False, use an in-memory cookiejar instead. Subclasses must\n implement this functionality. Defaults to False.\n \"\"\"\n self.host = host\n self.host_override = host_override\n self.auth_function = auth_function\n self.authenticated = False\n self.extra_headers = extra_headers\n self.save_cookies = save_cookies\n self.opener = self._GetOpener()\n if self.host_override:\n logging.info(\"Server: %s; Host: %s\", self.host, self.host_override)\n else:\n logging.info(\"Server: %s\", self.host)", "metadata": "root.AbstractRpcServer.__init__", "header": "['class', 'AbstractRpcServer', '(', 'object', ')', ':', '___EOS___']", "index": 142 }, { "content": " def _GetOpener(self):\n \"\"\"Returns an OpenerDirector for making HTTP requests.\n\n Returns:\n A urllib2.OpenerDirector object.\n \"\"\"\n raise NotImplementedError()", "metadata": "root.AbstractRpcServer._GetOpener", "header": "['class', 'AbstractRpcServer', '(', 'object', ')', ':', '___EOS___']", "index": 169 }, { "content": " def _CreateRequest(self, url, data=None):\n \"\"\"Creates a new urllib request.\"\"\"\n logging.debug(\"Creating request for: '%s' with payload:\\n%s\", url, data)\n req = urllib2.Request(url, data=data)\n if self.host_override:\n req.add_header(\"Host\", self.host_override)\n for key, value in self.extra_headers.iteritems():\n req.add_header(key, value)\n return req", "metadata": "root.AbstractRpcServer._CreateRequest", "header": "['class', 'AbstractRpcServer', '(', 'object', ')', ':', '___EOS___']", "index": 177 }, { "content": " def _GetAuthToken(self, email, password):\n \"\"\"Uses ClientLogin to authenticate the user, returning an auth token.\n\n Args:\n email: The user's email address\n password: The user's password\n\n Raises:\n ClientLoginError: If there was an error authenticating with ClientLogin.\n HTTPError: If there was some other form of HTTP error.\n\n Returns:\n The authentication token returned by ClientLogin.\n \"\"\"\n account_type = \"GOOGLE\"\n if self.host.endswith(\".google.com\"):\n # Needed for use inside Google.\n account_type = \"HOSTED\"\n req = self._CreateRequest(\n url=\"https://www.google.com/accounts/ClientLogin\",\n data=urllib.urlencode({\n \"Email\": email,\n \"Passwd\": password,\n \"service\": \"ah\",\n \"source\": \"rietveld-codereview-upload\",\n \"accountType\": account_type,\n }),\n )\n try:\n response = self.opener.open(req)\n response_body = response.read()\n response_dict = dict(x.split(\"=\")\n for x in response_body.split(\"\\n\") if x)\n return response_dict[\"Auth\"]\n except urllib2.HTTPError, e:\n if e.code == 403:\n body = e.read()\n response_dict = dict(x.split(\"=\", 1) for x in body.split(\"\\n\") if x)\n raise ClientLoginError(req.get_full_url(), e.code, e.msg,\n e.headers, response_dict)\n else:\n raise", "metadata": "root.AbstractRpcServer._GetAuthToken", "header": "['class', 'AbstractRpcServer', '(', 'object', ')', ':', '___EOS___']", "index": 187 }, { "content": " def _GetAuthCookie(self, auth_token):\n \"\"\"Fetches authentication cookies for an authentication token.\n\n Args:\n auth_token: The authentication token returned by ClientLogin.\n\n Raises:\n HTTPError: If there was an error fetching the authentication cookies.\n \"\"\"\n # This is a dummy value to allow us to identify when we're successful.\n continue_location = \"http://localhost/\"\n args = {\"continue\": continue_location, \"auth\": auth_token}\n req = self._CreateRequest(\"http://%s/_ah/login?%s\" %\n (self.host, urllib.urlencode(args)))\n try:\n response = self.opener.open(req)\n except urllib2.HTTPError, e:\n response = e\n if (response.code != 302 or\n response.info()[\"location\"] != continue_location):\n raise urllib2.HTTPError(req.get_full_url(), response.code, response.msg,\n response.headers, response.fp)\n self.authenticated = True", "metadata": "root.AbstractRpcServer._GetAuthCookie", "header": "['class', 'AbstractRpcServer', '(', 'object', ')', ':', '___EOS___']", "index": 230 }, { "content": " def _Authenticate(self):\n \"\"\"Authenticates the user.\n\n The authentication process works as follows:\n 1) We get a username and password from the user\n 2) We use ClientLogin to obtain an AUTH token for the user\n (see http://code.google.com/apis/accounts/AuthForInstalledApps.html).\n 3) We pass the auth token to /_ah/login on the server to obtain an\n authentication cookie. If login was successful, it tries to redirect\n us to the URL we provided.\n\n If we attempt to access the upload API without first obtaining an\n authentication cookie, it returns a 401 response (or a 302) and\n directs us to authenticate ourselves with ClientLogin.\n \"\"\"\n for i in range(3):\n credentials = self.auth_function()\n try:\n auth_token = self._GetAuthToken(credentials[0], credentials[1])\n except ClientLoginError, e:\n if e.reason == \"BadAuthentication\":\n print >>sys.stderr, \"Invalid username or password.\"\n continue\n if e.reason == \"CaptchaRequired\":\n print >>sys.stderr, (\n \"Please go to\\n\"\n \"https://www.google.com/accounts/DisplayUnlockCaptcha\\n\"\n \"and verify you are a human. Then try again.\")\n break\n if e.reason == \"NotVerified\":\n print >>sys.stderr, \"Account not verified.\"\n break\n if e.reason == \"TermsNotAgreed\":\n print >>sys.stderr, \"User has not agreed to TOS.\"\n break\n if e.reason == \"AccountDeleted\":\n print >>sys.stderr, \"The user account has been deleted.\"\n break\n if e.reason == \"AccountDisabled\":\n print >>sys.stderr, \"The user account has been disabled.\"\n break\n if e.reason == \"ServiceDisabled\":\n print >>sys.stderr, (\"The user's access to the service has been \"\n \"disabled.\")\n break\n if e.reason == \"ServiceUnavailable\":\n print >>sys.stderr, \"The service is not available; try again later.\"\n break\n raise\n self._GetAuthCookie(auth_token)\n return", "metadata": "root.AbstractRpcServer._Authenticate", "header": "['class', 'AbstractRpcServer', '(', 'object', ')', ':', '___EOS___']", "index": 254 }, { "content": " def Send(self, request_path, payload=None,\n content_type=\"application/octet-stream\",\n timeout=None,\n **kwargs):\n \"\"\"Sends an RPC and returns the response.\n\n Args:\n request_path: The path to send the request to, eg /api/appversion/create.\n payload: The body of the request, or None to send an empty request.\n content_type: The Content-Type header to use.\n timeout: timeout in seconds; default None i.e. no timeout.\n (Note: for large requests on OS X, the timeout doesn't work right.)\n kwargs: Any keyword arguments are converted into query string parameters.\n\n Returns:\n The response body, as a string.\n \"\"\"\n # TODO: Don't require authentication. Let the server say\n # whether it is necessary.\n if not self.authenticated:\n self._Authenticate()\n\n old_timeout = socket.getdefaulttimeout()\n socket.setdefaulttimeout(timeout)\n try:\n tries = 0\n while True:\n tries += 1\n args = dict(kwargs)\n url = \"http://%s%s\" % (self.host, request_path)\n if args:\n url += \"?\" + urllib.urlencode(args)\n req = self._CreateRequest(url=url, data=payload)\n req.add_header(\"Content-Type\", content_type)\n try:\n f = self.opener.open(req)\n response = f.read()\n f.close()\n return response\n except urllib2.HTTPError, e:\n if tries > 3:\n raise\n elif e.code == 401 or e.code == 302:\n self._Authenticate()\n## elif e.code >= 500 and e.code < 600:\n## # Server Error - try again.\n## continue\n else:\n raise\n finally:\n socket.setdefaulttimeout(old_timeout)", "metadata": "root.AbstractRpcServer.Send", "header": "['class', 'AbstractRpcServer', '(', 'object', ')', ':', '___EOS___']", "index": 306 }, { "content": "class HttpRpcServer(AbstractRpcServer):\n \"\"\"Provides a simplified RPC-style interface for HTTP requests.\"\"\"\n\n", "metadata": "root.HttpRpcServer", "header": "['module', '___EOS___']", "index": 359 }, { "content": " def _Authenticate(self):\n \"\"\"Save the cookie jar after authentication.\"\"\"\n super(HttpRpcServer, self)._Authenticate()\n if self.save_cookies:\n StatusUpdate(\"Saving authentication cookies to %s\" % self.cookie_file)\n self.cookie_jar.save()", "metadata": "root.HttpRpcServer._Authenticate", "header": "['class', 'HttpRpcServer', '(', 'AbstractRpcServer', ')', ':', '___EOS___']", "index": 362 }, { "content": " def _GetOpener(self):\n \"\"\"Returns an OpenerDirector that supports cookies and ignores redirects.\n\n Returns:\n A urllib2.OpenerDirector object.\n \"\"\"\n opener = urllib2.OpenerDirector()\n opener.add_handler(urllib2.ProxyHandler())\n opener.add_handler(urllib2.UnknownHandler())\n opener.add_handler(urllib2.HTTPHandler())\n opener.add_handler(urllib2.HTTPDefaultErrorHandler())\n opener.add_handler(urllib2.HTTPSHandler())\n opener.add_handler(urllib2.HTTPErrorProcessor())\n if self.save_cookies:\n self.cookie_file = os.path.expanduser(\"~/.codereview_upload_cookies\")\n self.cookie_jar = cookielib.MozillaCookieJar(self.cookie_file)\n if os.path.exists(self.cookie_file):\n try:\n self.cookie_jar.load()\n self.authenticated = True\n StatusUpdate(\"Loaded authentication cookies from %s\" %\n self.cookie_file)\n except (cookielib.LoadError, IOError):\n # Failed to load cookies - just ignore them.\n pass\n else:\n # Create an empty cookie file with mode 600\n fd = os.open(self.cookie_file, os.O_CREAT, 0600)\n os.close(fd)\n # Always chmod the cookie file\n os.chmod(self.cookie_file, 0600)\n else:\n # Don't save cookies across runs of update.py.\n self.cookie_jar = cookielib.CookieJar()\n opener.add_handler(urllib2.HTTPCookieProcessor(self.cookie_jar))\n return opener", "metadata": "root.HttpRpcServer._GetOpener", "header": "['class', 'HttpRpcServer', '(', 'AbstractRpcServer', ')', ':', '___EOS___']", "index": 369 } ]
[ { "span": "self._GetOpener()", "start_line": 163, "start_column": 18, "end_line": 163, "end_column": 35 } ]
[ { "span": "def _GetOpener(self):", "start_line": 169, "start_column": 2, "end_line": 169, "end_column": 23 }, { "span": "def _GetOpener(self):", "start_line": 369, "start_column": 2, "end_line": 369, "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Abstract", "Rp", "c", "Server_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prov", "ides", " ", "a", " ", "common", " ", "interface", " ", "for", " ", "a", " ", "simple", " ", "RP", "C", " ", "server", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Abstract", "Rp", "c", "Server_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "host_", ",_", "auth", "\\u", "function_", ",_", "host", "\\u", "override_", "=_", "None_", ",_", "extra", "\\u", "headers_", "=_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "cookies_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "es", " ", "a", " ", "new", " ", "Http", "Rp", "c", "Server", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "host", ":", " ", "The", " ", "host", " ", "to", " ", "send", " ", "request", "s", " ", "to", ".", "\\", "10", ";", " ", " ", "auth", "\\u", "function", ":", " ", "A", " ", "function", " ", "tha", "t", " ", "take", "s", " ", "no", " ", "argu", "ment", "s", " ", "and", " ", "return", "s", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "(", "email", ",", " ", "password", ")", " ", "tuple", " ", "whe", "n", " ", "call", "ed", ".", " ", "Wil", "l", " ", "be", " ", "call", "ed", " ", "if", " ", "authenticat", "ion", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "require", "d", ".", "\\", "10", ";", " ", " ", "host", "\\u", "override", ":", " ", "The", " ", "host", " ", "header", " ", "to", " ", "send", " ", "to", " ", "the", " ", "server", " ", "(", "default", "s", " ", "to", " ", "host", ").", "\\", "10", ";", " ", " ", "extra", "\\u", "header", "s", ":", " ", "A", " ", "dict", " ", "of", " ", "extra", " ", "header", "s", " ", "to", " ", "append", " ", "to", " ", "every", " ", "request", ".", "\\", "10", ";", " ", " ", "save", "\\u", "cookie", "s", ":", " ", "If", " ", "Tru", "e", ",", " ", "save", " ", "the", " ", "authenticat", "ion", " ", "cookie", "s", " ", "to", " ", "local", " ", "disk", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "Fal", "se", ",", " ", "use", " ", "an", " ", "in", "-", "memory", " ", "cookie", "jar", " ", "inst", "ead", ".", " ", " ", "Subc", "lasse", "s", " ", "must", "\\", "10", ";", " ", " ", " ", " ", "implement", " ", "this", " ", "functional", "it", "y", ".", " ", " ", "Default", "s", " ", "to", " ", "Fal", "se", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "host_", "=_", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "host", "\\u", "override_", "=_", "host", "\\u", "override_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auth", "\\u", "function_", "=_", "auth", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "authenticated_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "extra", "\\u", "headers_", "=_", "extra", "\\u", "headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "save", "\\u", "cookies_", "=_", "save", "\\u", "cookies_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opener_", "=_", "self_", "._", "\\u", "Get", "Open", "er_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "host", "\\u", "override_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "info_", "(_", "\"", "Server", ":", " ", "%", "s", ";", " ", "Host", ":", " ", "%", "s", "\"_", ",_", "self_", "._", "host_", ",_", "self_", "._", "host", "\\u", "override_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "info_", "(_", "\"", "Server", ":", " ", "%", "s", "\"_", ",_", "self_", "._", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Rp", "c", "Server_", "(_", "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", "Get", "Open", "er_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "an", " ", "Open", "er", "Director", " ", "for", " ", "mak", "ing", " ", "HTTP", " ", "request", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "url", "lib", "2", ".", "Open", "er", "Director", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Rp", "c", "Server_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Creat", "e", "Request_", "(_", "self_", ",_", "url_", ",_", "data_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "es", " ", "a", " ", "new", " ", "url", "lib", " ", "request", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", "Creat", "ing", " ", "request", " ", "for", ":", " ", "'%", "s", "'", " ", "with", " ", "payload", ":\\\\", "n", "%", "s", "\"_", ",_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "urllib2_", "._", "Request_", "(_", "url_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "host", "\\u", "override_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "._", "add", "\\u", "header_", "(_", "\"", "Host", "\"_", ",_", "self_", "._", "host", "\\u", "override_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "extra", "\\u", "headers_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "._", "add", "\\u", "header_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "req_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Rp", "c", "Server_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Get", "Auth", "Token_", "(_", "self_", ",_", "email_", ",_", "password_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Us", "es", " ", "Client", "Logi", "n", " ", "to", " ", "authenticat", "e", " ", "the", " ", "user", ",", " ", "return", "ing", " ", "an", " ", "auth", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "email", ":", " ", " ", " ", " ", "The", " ", "user", "'", "s", " ", "email", " ", "address", "\\", "10", ";", " ", " ", "password", ":", " ", "The", " ", "user", "'", "s", " ", "password", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", "Client", "Logi", "n", "Error", ":", " ", "If", " ", "there", " ", "was", " ", "an", " ", "error", " ", "authenticat", "ing", " ", "with", " ", "Client", "Logi", "n", ".", "\\", "10", ";", " ", " ", "HTTP", "Error", ":", " ", "If", " ", "there", " ", "was", " ", "some", " ", "other", " ", "form", " ", "of", " ", "HTTP", " ", "error", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "The", " ", "authenticat", "ion", " ", "token", " ", "return", "ed", " ", "by", " ", "Client", "Logi", "n", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account", "\\u", "type_", "=_", "\"", "GO", "OG", "LE", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "host_", "._", "endswith_", "(_", "\".", "google", ".", "com", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Needed", " ", "for", " ", "use", " ", "insi", "de", " ", "Goo", "gle", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "account", "\\u", "type_", "=_", "\"", "HOST", "ED", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "req_", "=_", "self_", "._", "\\u", "Creat", "e", "Request_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "\"", "https", "://", "www", ".", "google", ".", "com", "/", "account", "s", "/", "Client", "Logi", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "urllib_", "._", "urlencode_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ema", "il", "\"_", ":_", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Passw", "d", "\"_", ":_", "password_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "service", "\"_", ":_", "\"", "ah", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "source", "\"_", ":_", "\"", "rie", "tve", "ld", "-", "coder", "evi", "ew", "-", "upload", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "account", "Type", "\"_", ":_", "account", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "opener_", "._", "open_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "body_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "dict_", "=_", "dict_", "(_", "x_", "._", "split_", "(_", "\"=\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "response", "\\u", "body_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", "if_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response", "\\u", "dict_", "[_", "\"", "Auth", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "code_", "==_", "403_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "e_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "dict_", "=_", "dict_", "(_", "x_", "._", "split_", "(_", "\"=\"_", ",_", "1_", ")_", "for_", "x_", "in_", "body_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", "if_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Client", "Logi", "n", "Error_", "(_", "req_", "._", "get", "\\u", "full", "\\u", "url_", "(_", ")_", ",_", "e_", "._", "code_", ",_", "e_", "._", "msg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "._", "headers_", ",_", "response", "\\u", "dict_", ")_", "\\u\\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_", "[SEP]_", "class_", "Abstract", "Rp", "c", "Server_", "(_", "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", "Get", "Auth", "Cookie_", "(_", "self_", ",_", "auth", "\\u", "token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fetche", "s", " ", "authenticat", "ion", " ", "cookie", "s", " ", "for", " ", "an", " ", "authenticat", "ion", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "auth", "\\u", "token", ":", " ", "The", " ", "authenticat", "ion", " ", "token", " ", "return", "ed", " ", "by", " ", "Client", "Logi", "n", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", "HTTP", "Error", ":", " ", "If", " ", "there", " ", "was", " ", "an", " ", "error", " ", "fetch", "ing", " ", "the", " ", "authenticat", "ion", " ", "cookie", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "dummy", " ", "value", " ", "to", " ", "allow", " ", "us", " ", "to", " ", "identify", " ", "whe", "n", " ", "we", "'", "re", " ", "success", "ful", "._", "\\u\\u\\uNL\\u\\u\\u_", "continue", "\\u", "location_", "=_", "\"", "http", "://", "local", "host", "/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "{_", "\"", "continue", "\"_", ":_", "continue", "\\u", "location_", ",_", "\"", "auth", "\"_", ":_", "auth", "\\u", "token_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "self_", "._", "\\u", "Creat", "e", "Request_", "(_", "\"", "http", "://", "%", "s", "/\\u", "ah", "/", "login", "?", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "host_", ",_", "urllib_", "._", "urlencode_", "(_", "args_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "opener_", "._", "open_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "response_", "._", "code_", "!=_", "302_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "._", "info_", "(_", ")_", "[_", "\"", "location", "\"_", "]_", "!=_", "continue", "\\u", "location_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "urllib2_", "._", "HTTP", "Error_", "(_", "req_", "._", "get", "\\u", "full", "\\u", "url_", "(_", ")_", ",_", "response_", "._", "code_", ",_", "response_", "._", "msg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "._", "headers_", ",_", "response_", "._", "fp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "authenticated_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Rp", "c", "Server_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Auth", "entica", "te_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Auth", "entica", "tes", " ", "the", " ", "user", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "authenticat", "ion", " ", "process", " ", "works", " ", "as", " ", "follow", "s", ":", "\\", "10", ";", " ", "1", ")", " ", "We", " ", "get", " ", "a", " ", "user", "name", " ", "and", " ", "password", " ", "from", " ", "the", " ", "user", "\\", "10", ";", " ", "2", ")", " ", "We", " ", "use", " ", "Client", "Logi", "n", " ", "to", " ", "obtain", " ", "an", " ", "AUTH", " ", "token", " ", "for", " ", "the", " ", "user", "\\", "10", ";", " ", " ", " ", " ", "(", "see", " ", "http", "://", "code", ".", "google", ".", "com", "/", "apis", "/", "account", "s", "/", "Auth", "For", "Install", "ed", "App", "s", ".", "html", ").", "\\", "10", ";", " ", "3", ")", " ", "We", " ", "pass", " ", "the", " ", "auth", " ", "token", " ", "to", " ", "/\\u", "ah", "/", "login", " ", "on", " ", "the", " ", "server", " ", "to", " ", "obtain", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "authenticat", "ion", " ", "cookie", ".", " ", "If", " ", "login", " ", "was", " ", "success", "ful", ",", " ", "it", " ", "trie", "s", " ", "to", " ", "redirec", "t", "\\", "10", ";", " ", " ", " ", " ", "us", " ", "to", " ", "the", " ", "URL", " ", "we", " ", "provided", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "we", " ", "atte", "mpt", " ", "to", " ", "access", " ", "the", " ", "upload", " ", "API", " ", "with", "out", " ", "first", " ", "obtain", "ing", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "authenticat", "ion", " ", "cookie", ",", " ", "it", " ", "return", "s", " ", "a", " ", "401", " ", "response", " ", "(", "or", " ", "a", " ", "302", ")", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "direct", "s", " ", "us", " ", "to", " ", "authenticat", "e", " ", "ours", "elv", "es", " ", "with", " ", "Client", "Logi", "n", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "credentials_", "=_", "self_", "._", "auth", "\\u", "function_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "auth", "\\u", "token_", "=_", "self_", "._", "\\u", "Get", "Auth", "Token_", "(_", "credentials_", "[_", "0_", "]_", ",_", "credentials_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Client", "Logi", "n", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "reason_", "==_", "\"", "Ba", "d", "Auth", "entica", "tion", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "\"", "Inva", "lid", " ", "user", "name", " ", "or", " ", "password", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "reason_", "==_", "\"", "Capt", "cha", "Requ", "ired", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ple", "ase", " ", "go", " ", "to", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "https", "://", "www", ".", "google", ".", "com", "/", "account", "s", "/", "Display", "Unlock", "Capt", "cha", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "and", " ", "verify", " ", "you", " ", "are", " ", "a", " ", "human", ".", " ", " ", "The", "n", " ", "try", " ", "again", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "reason_", "==_", "\"", "Not", "Verifie", "d", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "\"", "Account", " ", "not", " ", "verifie", "d", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "reason_", "==_", "\"", "Term", "s", "Not", "Agr", "eed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "\"", "User", " ", "has", " ", "not", " ", "agree", "d", " ", "to", " ", "TOS", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "reason_", "==_", "\"", "Account", "Delete", "d", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "\"", "The", " ", "user", " ", "account", " ", "has", " ", "bee", "n", " ", "delete", "d", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "reason_", "==_", "\"", "Account", "Disa", "ble", "d", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "\"", "The", " ", "user", " ", "account", " ", "has", " ", "bee", "n", " ", "disable", "d", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "reason_", "==_", "\"", "Service", "Disa", "ble", "d", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\"", "The", " ", "user", "'", "s", " ", "access", " ", "to", " ", "the", " ", "service", " ", "has", " ", "bee", "n", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "disable", "d", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "reason_", "==_", "\"", "Service", "Una", "vail", "able", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "\"", "The", " ", "service", " ", "is", " ", "not", " ", "avail", "able", ";", " ", "try", " ", "again", " ", "late", "r", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "Get", "Auth", "Cookie_", "(_", "auth", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Rp", "c", "Server_", "(_", "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_", "Send_", "(_", "self_", ",_", "request", "\\u", "path_", ",_", "payload_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "=_", "\"", "applica", "tion", "/", "oct", "et", "-", "stream", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sen", "ds", " ", "an", " ", "RP", "C", " ", "and", " ", "return", "s", " ", "the", " ", "response", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "request", "\\u", "path", ":", " ", "The", " ", "path", " ", "to", " ", "send", " ", "the", " ", "request", " ", "to", ",", " ", "eg", " ", "/", "api", "/", "app", "version", "/", "create", ".", "\\", "10", ";", " ", " ", "payload", ":", " ", "The", " ", "body", " ", "of", " ", "the", " ", "request", ",", " ", "or", " ", "Non", "e", " ", "to", " ", "send", " ", "an", " ", "empty", " ", "request", ".", "\\", "10", ";", " ", " ", "content", "\\u", "type", ":", " ", "The", " ", "Conten", "t", "-", "Type", " ", "header", " ", "to", " ", "use", ".", "\\", "10", ";", " ", " ", "timeo", "ut", ":", " ", "timeo", "ut", " ", "in", " ", "second", "s", ";", " ", "default", " ", "Non", "e", " ", "i", ".", "e", ".", " ", "no", " ", "timeo", "ut", ".", "\\", "10", ";", " ", " ", " ", " ", "(", "Not", "e", ":", " ", "for", " ", "large", " ", "request", "s", " ", "on", " ", "OS", " ", "X", ",", " ", "the", " ", "timeo", "ut", " ", "doe", "sn", "'", "t", " ", "work", " ", "right", ".)", "\\", "10", ";", " ", " ", "kwarg", "s", ":", " ", "Any", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "are", " ", "convert", "ed", " ", "int", "o", " ", "query", " ", "string", " ", "parameter", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "The", " ", "response", " ", "body", ",", " ", "as", " ", "a", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Don", "'", "t", " ", "require", " ", "authenticat", "ion", ".", " ", " ", "Let", " ", "the", " ", "server", " ", "say_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "ther", " ", "it", " ", "is", " ", "necessar", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "authenticated_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Auth", "entica", "te_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "old", "\\u", "timeout_", "=_", "socket_", "._", "getde", "fault", "timeout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "socket_", "._", "setdefault", "timeout_", "(_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tries_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tries_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "dict_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "\"", "http", "://", "%", "s", "%", "s", "\"_", "%_", "(_", "self_", "._", "host_", ",_", "request", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "+=_", "\"?\"_", "+_", "urllib_", "._", "urlencode_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "req_", "=_", "self_", "._", "\\u", "Creat", "e", "Request_", "(_", "url_", "=_", "url_", ",_", "data_", "=_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "._", "add", "\\u", "header_", "(_", "\"", "Conten", "t", "-", "Type", "\"_", ",_", "content", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "self_", "._", "opener_", "._", "open_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "HTTP", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "tries_", ">_", "3_", ":_", "\\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_", "e_", "._", "code_", "==_", "401_", "or_", "e_", "._", "code_", "==_", "302_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Auth", "entica", "te_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", " ", " ", "eli", "f", " ", "e", ".", "code", " ", ">=", " ", "500", " ", "and", " ", "e", ".", "code", " ", "<", " ", "600", ":_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", " ", "#", " ", "Server", " ", "Error", " ", "-", " ", "try", " ", "again", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\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_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "socket_", "._", "setdefault", "timeout_", "(_", "old", "\\u", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Http", "Rp", "c", "Server_", "(_", "Abstract", "Rp", "c", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prov", "ides", " ", "a", " ", "simplified", " ", "RP", "C", "-", "style", " ", "interface", " ", "for", " ", "HTTP", " ", "request", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Http", "Rp", "c", "Server_", "(_", "Abstract", "Rp", "c", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "Auth", "entica", "te_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Save", " ", "the", " ", "cookie", " ", "jar", " ", "after", " ", "authenticat", "ion", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Http", "Rp", "c", "Server_", ",_", "self_", ")_", "._", "\\u", "Auth", "entica", "te_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "save", "\\u", "cookies_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Status", "Update_", "(_", "\"", "Sav", "ing", " ", "authenticat", "ion", " ", "cookie", "s", " ", "to", " ", "%", "s", "\"_", "%_", "self_", "._", "cookie", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cookie", "\\u", "jar_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Http", "Rp", "c", "Server_", "(_", "Abstract", "Rp", "c", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Get", "Open", "er_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "an", " ", "Open", "er", "Director", " ", "tha", "t", " ", "support", "s", " ", "cookie", "s", " ", "and", " ", "ignores", " ", "redirec", "ts", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "url", "lib", "2", ".", "Open", "er", "Director", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opener_", "=_", "urllib2_", "._", "Open", "er", "Director", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opener_", "._", "add", "\\u", "handler_", "(_", "urllib2_", "._", "Pro", "xy", "Handler_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opener_", "._", "add", "\\u", "handler_", "(_", "urllib2_", "._", "Un", "know", "n", "Handler_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opener_", "._", "add", "\\u", "handler_", "(_", "urllib2_", "._", "HTTP", "Handler_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opener_", "._", "add", "\\u", "handler_", "(_", "urllib2_", "._", "HTTP", "Default", "Error", "Handler_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opener_", "._", "add", "\\u", "handler_", "(_", "urllib2_", "._", "HTTP", "SH", "andle", "r_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opener_", "._", "add", "\\u", "handler_", "(_", "urllib2_", "._", "HTTP", "Error", "Processor_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "save", "\\u", "cookies_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cookie", "\\u", "file_", "=_", "os_", "._", "path_", "._", "expanduser_", "(_", "\"~/", ".", "coder", "evi", "ew", "\\u", "upload", "\\u", "cookie", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cookie", "\\u", "jar_", "=_", "cookie", "lib_", "._", "Mo", "zilla", "Cooki", "e", "Jar_", "(_", "self_", "._", "cookie", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "cookie", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cookie", "\\u", "jar_", "._", "load_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "authenticated_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Status", "Update_", "(_", "\"", "Load", "ed", " ", "authenticat", "ion", " ", "cookie", "s", " ", "from", " ", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cookie", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "cookie", "lib_", "._", "Load", "Error_", ",_", "IO", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fail", "ed", " ", "to", " ", "load", " ", "cookie", "s", " ", "-", " ", "just", " ", "ignore", " ", "them", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "an", " ", "empty", " ", "cookie", " ", "file", " ", "with", " ", "mode", " ", "600_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd_", "=_", "os_", "._", "open_", "(_", "self_", "._", "cookie", "\\u", "file_", ",_", "os_", "._", "O", "\\u", "CRE", "AT_", ",_", "0_", "600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "close_", "(_", "fd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Al", "way", "s", " ", "chm", "od", " ", "the", " ", "cookie", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chmod_", "(_", "self_", "._", "cookie", "\\u", "file_", ",_", "0_", "600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "save", " ", "cookie", "s", " ", "acro", "ss", " ", "runs", " ", "of", " ", "update", ".", "py", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cookie", "\\u", "jar_", "=_", "cookie", "lib_", "._", "Cooki", "e", "Jar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "opener_", "._", "add", "\\u", "handler_", "(_", "urllib2_", "._", "HTTP", "Cooki", "e", "Processor_", "(_", "self_", "._", "cookie", "\\u", "jar_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "opener_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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
hycis/Pynet/pynet/datasets/cifar10.py
[ { "content": "import logging\nlogger = logging.getLogger(__name__)\nimport os\nimport cPickle\nimport numpy as np\nimport theano\nfloatX = theano.config.floatX\n\nfrom pynet.utils.mnist_ubyte import read_mnist_images\nfrom pynet.utils.mnist_ubyte import read_mnist_labels\nfrom pynet.datasets.dataset import SingleBlock\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Cifar10(SingleBlock):\n", "metadata": "root.Cifar10", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def __init__(self, **kwargs):\n\n im_dir = os.environ['PYNET_DATA_PATH'] + '/cifar10/'\n self.label_names = ['airplane', 'automobile', 'bird', 'cat', 'deer',\n 'dog', 'frog','horse','ship','truck']\n self.img_shape = (3,32,32)\n self.img_size = np.prod(self.img_shape)\n self.n_classes = 10\n fnames = ['data_batch_%i' % i for i in range(1,6)]\n\n X = []\n y = []\n for fname in fnames:\n data_path = im_dir + fname\n with open(data_path) as fin:\n data_batch = cPickle.load(fin)\n X.extend(data_batch['data'].tolist())\n y.extend(data_batch['labels'])\n X_npy = np.array(X, dtype=floatX)\n y_npy = np.zeros((len(y), 10), dtype=floatX)\n for i in xrange(len(y)):\n y_npy[i, y_npy[i]] = 1\n\n super(Cifar10, self).__init__(X=X_npy, y=y_npy, **kwargs)", "metadata": "root.Cifar10.__init__", "header": "['class', 'Cifar10', '(', 'SingleBlock', ')', ':', '___EOS___']", "index": 14 } ]
[ { "span": "from pynet.utils.mnist_ubyte import read_mnist_images", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 53 }, { "span": "from pynet.utils.mnist_ubyte import read_mnist_labels", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 53 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\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_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "theano_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "float", "X_", "=_", "theano_", "._", "config_", "._", "float", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyn", "et_", "._", "utils_", "._", "mni", "st", "\\u", "ubyte_", "import_", "read", "\\u", "mni", "st", "\\u", "images_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "utils_", "._", "mni", "st", "\\u", "ubyte_", "import_", "read", "\\u", "mni", "st", "\\u", "labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "datasets_", "._", "dataset_", "import_", "Sing", "le", "Block_", "\\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_", "Ci", "far", "10_", "(_", "Sing", "le", "Block_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ci", "far", "10_", "(_", "Sing", "le", "Block_", ")_", ":_", "\\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_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "im", "\\u", "dir_", "=_", "os_", "._", "environ_", "[_", "'", "PY", "NET", "\\u", "DATA", "\\u", "PATH", "'_", "]_", "+_", "'/", "cifar", "10", "/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "label", "\\u", "names_", "=_", "[_", "'", "airplane", "'_", ",_", "'", "autom", "obi", "le", "'_", ",_", "'", "bird", "'_", ",_", "'", "cat", "'_", ",_", "'", "dee", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dog", "'_", ",_", "'", "fro", "g", "'_", ",_", "'", "horse", "'_", ",_", "'", "ship", "'_", ",_", "'", "tru", "ck", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "img", "\\u", "shape_", "=_", "(_", "3_", ",_", "32_", ",_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "img", "\\u", "size_", "=_", "np_", "._", "prod_", "(_", "self_", "._", "img", "\\u", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "\\u", "classes_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fnames_", "=_", "[_", "'", "data\\u", "batch", "\\u", "%", "i", "'_", "%_", "i_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "6_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "X_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fname_", "in_", "fnames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "path_", "=_", "im", "\\u", "dir_", "+_", "fname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "data\\u", "path_", ")_", "as_", "fin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "batch_", "=_", "c", "Pickle_", "._", "load_", "(_", "fin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "._", "extend_", "(_", "data\\u", "batch_", "[_", "'", "data", "'_", "]_", "._", "tolist_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "._", "extend_", "(_", "data\\u", "batch_", "[_", "'", "labels", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "X", "\\u", "npy", "_", "=_", "np_", "._", "array_", "(_", "X_", ",_", "dtype_", "=_", "float", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "npy", "_", "=_", "np_", "._", "zeros_", "(_", "(_", "len_", "(_", "y_", ")_", ",_", "10_", ")_", ",_", "dtype_", "=_", "float", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "y_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y", "\\u", "npy", "_", "[_", "i_", ",_", "y", "\\u", "npy", "_", "[_", "i_", "]_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Ci", "far", "10_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "X_", "=_", "X", "\\u", "npy", "_", ",_", "y_", "=_", "y", "\\u", "npy", "_", ",_", "**_", "kwargs_", ")_" ]
[ 4, 4, 4, 4, 4, 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 ]
Unused import
bretth/django-pq/test_pq/test_worker.py
[ { "content": "import os\nimport time\nimport times\nfrom datetime import datetime\nfrom django.test import TransactionTestCase, TestCase\nfrom django.utils.timezone import utc\nfrom nose2.tools import params\n\nfrom pq import Queue\nfrom pq.queue import get_failed_queue\nfrom pq.worker import Worker\nfrom pq.job import Job\n\nfrom .fixtures import say_hello, div_by_zero, create_file_after_timeout\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestWorker(TransactionTestCase):\n", "metadata": "root.TestWorker", "header": "['module', '___EOS___']", "index": 16 }, { "content": " def setUp(self):\n self.fooq, self.barq = Queue('foo'), Queue('bar')", "metadata": "root.TestWorker.setUp", "header": "['class', 'TestWorker', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_create_worker(self):\n \"\"\"Worker creation.\"\"\"\n\n w = Worker.create([self.fooq, self.barq])\n self.assertEquals(w.queues, [self.fooq, self.barq])", "metadata": "root.TestWorker.test_create_worker", "header": "['class', 'TestWorker', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 20 }, { "content": "class TestWorkNoJobs(TransactionTestCase):\n", "metadata": "root.TestWorkNoJobs", "header": "['module', '___EOS___']", "index": 27 }, { "content": " def setUp(self):\n self.fooq, self.barq = Queue('foo'), Queue('bar')\n self.w = Worker.create([self.fooq, self.barq])", "metadata": "root.TestWorkNoJobs.setUp", "header": "['class', 'TestWorkNoJobs', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 28 }, { "content": " def test_work_no_jobs(self):\n self.assertEquals(self.w.work(burst=True), False,\n 'Did not expect any work on the queue.')", "metadata": "root.TestWorkNoJobs.test_work_no_jobs", "header": "['class', 'TestWorkNoJobs', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 32 }, { "content": "class TestWorkerWithJobs(TransactionTestCase):\n", "metadata": "root.TestWorkerWithJobs", "header": "['module', '___EOS___']", "index": 37 }, { "content": " def setUp(self):\n self.fooq, self.barq = Queue('foo'), Queue('bar')\n self.w = Worker.create([self.fooq, self.barq])\n self.fooq.enqueue(say_hello, name='Frank')", "metadata": "root.TestWorkerWithJobs.setUp", "header": "['class', 'TestWorkerWithJobs', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 38 }, { "content": " def test_worker_with_jobs(self):\n\n self.assertEquals(self.w.work(burst=True), True,\n 'Expected at least some work done.')", "metadata": "root.TestWorkerWithJobs.test_worker_with_jobs", "header": "['class', 'TestWorkerWithJobs', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 43 }, { "content": "class TestWorkViaStringArg(TransactionTestCase):\n", "metadata": "root.TestWorkViaStringArg", "header": "['module', '___EOS___']", "index": 49 }, { "content": " def setUp(self):\n self.q = Queue('foo')\n self.w = Worker.create([self.q])\n self.job = self.q.enqueue('test_pq.fixtures.say_hello', name='Frank')", "metadata": "root.TestWorkViaStringArg.setUp", "header": "['class', 'TestWorkViaStringArg', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": " def test_work_via_string_argument(self):\n \"\"\"Worker processes work fed via string arguments.\"\"\"\n\n self.assertEquals(self.w.work(burst=True), True,\n 'Expected at least some work done.')\n job = Job.objects.get(id=self.job.id)\n self.assertEquals(job.result, 'Hi there, Frank!')", "metadata": "root.TestWorkViaStringArg.test_work_via_string_argument", "header": "['class', 'TestWorkViaStringArg', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 55 }, { "content": "class TestWorkIsUnreadable(TransactionTestCase):\n\n", "metadata": "root.TestWorkIsUnreadable", "header": "['module', '___EOS___']", "index": 63 }, { "content": " def setUp(self):\n self.q = Queue()\n self.q.save()\n self.fq = get_failed_queue()\n self.w = Worker.create([self.q])", "metadata": "root.TestWorkIsUnreadable.setUp", "header": "['class', 'TestWorkIsUnreadable', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": " def test_work_is_unreadable(self):\n \"\"\"Unreadable jobs are put on the failed queue.\"\"\"\n\n self.assertEquals(self.fq.count, 0)\n self.assertEquals(self.q.count, 0)\n\n # NOTE: We have to fake this enqueueing for this test case.\n # What we're simulating here is a call to a function that is not\n # importable from the worker process.\n job = Job.create(func=div_by_zero, args=(3,))\n job.save()\n job.instance = 'nonexisting_job'\n job.queue = self.q\n job.save()\n\n\n self.assertEquals(self.q.count, 1)\n\n # All set, we're going to process it\n\n self.w.work(burst=True) # should silently pass\n self.assertEquals(self.q.count, 0)\n self.assertEquals(self.fq.count, 1)", "metadata": "root.TestWorkIsUnreadable.test_work_is_unreadable", "header": "['class', 'TestWorkIsUnreadable', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 71 }, { "content": "class TestWorkFails(TransactionTestCase):\n", "metadata": "root.TestWorkFails", "header": "['module', '___EOS___']", "index": 96 }, { "content": " def setUp(self):\n self.q = Queue()\n self.fq = get_failed_queue()\n self.w = Worker.create([self.q])\n self.job = self.q.enqueue(div_by_zero)\n self.enqueued_at = self.job.enqueued_at", "metadata": "root.TestWorkFails.setUp", "header": "['class', 'TestWorkFails', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 97 }, { "content": " def test_work_fails(self):\n \"\"\"Failing jobs are put on the failed queue.\"\"\"\n\n\n self.w.work(burst=True) # should silently pass\n\n # Postconditions\n self.assertEquals(self.q.count, 0)\n self.assertEquals(self.fq.count, 1)\n\n # Check the job\n job = Job.objects.get(id=self.job.id)\n self.assertEquals(job.origin, self.q.name)\n\n # Should be the original enqueued_at date, not the date of enqueueing\n # to the failed queue\n self.assertEquals(job.enqueued_at, self.enqueued_at)\n self.assertIsNotNone(job.exc_info) # should contain exc_info", "metadata": "root.TestWorkFails.test_work_fails", "header": "['class', 'TestWorkFails', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 104 }, { "content": "class TestWorkerCustomExcHandling(TransactionTestCase):\n\n\n\n", "metadata": "root.TestWorkerCustomExcHandling", "header": "['module', '___EOS___']", "index": 124 }, { "content": " def setUp(self):\n self.q = Queue()\n self.fq = get_failed_queue()\n def black_hole(job, *exc_info):\n # Don't fall through to default behaviour of moving to failed queue\n return False\n self.black_hole = black_hole\n self.job = self.q.enqueue(div_by_zero)", "metadata": "root.TestWorkerCustomExcHandling.setUp", "header": "['class', 'TestWorkerCustomExcHandling', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 126 }, { "content": " def test_custom_exc_handling(self):\n \"\"\"Custom exception handling.\"\"\"\n\n\n w = Worker.create([self.q], exc_handler=self.black_hole)\n w.work(burst=True) # should silently pass\n\n # Postconditions\n self.assertEquals(self.q.count, 0)\n self.assertEquals(self.fq.count, 0)\n\n # Check the job\n job = Job.objects.get(id=self.job.id)\n self.assertEquals(job.status, Job.FAILED)", "metadata": "root.TestWorkerCustomExcHandling.test_custom_exc_handling", "header": "['class', 'TestWorkerCustomExcHandling', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 137 }, { "content": "class TestWorkerTimeouts(TransactionTestCase):\n\n\n", "metadata": "root.TestWorkerTimeouts", "header": "['module', '___EOS___']", "index": 153 }, { "content": " def setUp(self):\n self.sentinel_file = '/tmp/.rq_sentinel'\n self.q = Queue()\n self.fq = get_failed_queue()\n self.w = Worker.create([self.q])", "metadata": "root.TestWorkerTimeouts.setUp", "header": "['class', 'TestWorkerTimeouts', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 155 }, { "content": " def test_timeouts(self):\n \"\"\"Worker kills jobs after timeout.\"\"\"\n\n # Put it on the queue with a timeout value\n jobr = self.q.enqueue(\n create_file_after_timeout,\n args=(self.sentinel_file, 4),\n timeout=1)\n\n self.assertEquals(os.path.exists(self.sentinel_file), False)\n self.w.work(burst=True)\n self.assertEquals(os.path.exists(self.sentinel_file), False)\n\n job = Job.objects.get(id=jobr.id)\n self.assertIn('JobTimeoutException', job.exc_info)", "metadata": "root.TestWorkerTimeouts.test_timeouts", "header": "['class', 'TestWorkerTimeouts', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 161 }, { "content": " def tearDown(self):\n try:\n os.unlink(self.sentinel_file)\n except OSError as e:\n if e.errno == 2:\n pass", "metadata": "root.TestWorkerTimeouts.tearDown", "header": "['class', 'TestWorkerTimeouts', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 177 }, { "content": "class TestWorkerSetsResultTTL(TransactionTestCase):\n\n", "metadata": "root.TestWorkerSetsResultTTL", "header": "['module', '___EOS___']", "index": 185 }, { "content": " def setUp(self):\n self.q = Queue()\n self.w = Worker.create([self.q])", "metadata": "root.TestWorkerSetsResultTTL.setUp", "header": "['class', 'TestWorkerSetsResultTTL', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 187 }, { "content": " @params((10,10), (-1,-1), (0, None))\n def test_worker_sets_result_ttl(self, ttl, outcome):\n \"\"\"Ensure that Worker properly sets result_ttl for individual jobs or deletes them.\"\"\"\n job = self.q.enqueue(say_hello, args=('Frank',), result_ttl=ttl)\n self.w.work(burst=True)\n try:\n rjob = Job.objects.get(id=job.id)\n result_ttl = rjob.result_ttl\n except Job.DoesNotExist:\n result_ttl = None\n\n self.assertEqual(result_ttl, outcome)", "metadata": "root.TestWorkerSetsResultTTL.test_worker_sets_result_ttl", "header": "['class', 'TestWorkerSetsResultTTL', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 191 }, { "content": "class TestWorkerDeletesExpiredTTL(TransactionTestCase):\n\n", "metadata": "root.TestWorkerDeletesExpiredTTL", "header": "['module', '___EOS___']", "index": 205 }, { "content": " def setUp(self):\n self.q = Queue()\n self.w = Worker.create([self.q])\n self.job = self.q.enqueue(say_hello, args=('Bob',), result_ttl=1)\n self.w.work(burst=True)", "metadata": "root.TestWorkerDeletesExpiredTTL.setUp", "header": "['class', 'TestWorkerDeletesExpiredTTL', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 207 }, { "content": " def test_worker_deletes_expired_ttl(self):\n \"\"\"Ensure that Worker deletes expired jobs\"\"\"\n time.sleep(1)\n self.w.work(burst=True)\n with self.assertRaises(Job.DoesNotExist) as exc:\n rjob = Job.objects.get(id=self.job.id)", "metadata": "root.TestWorkerDeletesExpiredTTL.test_worker_deletes_expired_ttl", "header": "['class', 'TestWorkerDeletesExpiredTTL', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 213 }, { "content": "class TestWorkerDequeueTimeout(TransactionTestCase):\n \"\"\"Simple test to ensure the worker finishes\"\"\"\n\n", "metadata": "root.TestWorkerDequeueTimeout", "header": "['module', '___EOS___']", "index": 221 }, { "content": " def setUp(self):\n self.q = Queue()\n self.w = Worker.create([self.q],\n expires_after=1,\n default_worker_ttl=1)", "metadata": "root.TestWorkerDequeueTimeout.setUp", "header": "['class', 'TestWorkerDequeueTimeout', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 224 }, { "content": " def test_worker_dequeue_timeout(self):\n self.w.work()\n self.assertEqual(self.w._expires_after, -1)", "metadata": "root.TestWorkerDequeueTimeout.test_worker_dequeue_timeout", "header": "['class', 'TestWorkerDequeueTimeout', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 230 }, { "content": "class TestRegisterHeartbeat(TransactionTestCase):\n\n", "metadata": "root.TestRegisterHeartbeat", "header": "['module', '___EOS___']", "index": 235 }, { "content": " def setUp(self):\n self.q = Queue()\n self.w = Worker.create([self.q], name='Test')\n self.w.heartbeat = datetime(2010,1,1, tzinfo=utc)", "metadata": "root.TestRegisterHeartbeat.setUp", "header": "['class', 'TestRegisterHeartbeat', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 237 }, { "content": " def test_worker_register_heartbeat(self):\n self.w.register_heartbeat(timeout=0)", "metadata": "root.TestRegisterHeartbeat.test_worker_register_heartbeat", "header": "['class', 'TestRegisterHeartbeat', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 242 } ]
[ { "span": "import times", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 12 }, { "span": "from django.test import TransactionTestCase, TestCase", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 53 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "times_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Transa", "ction", "Test", "Case_", ",_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "timezone_", "import_", "utc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose", "2_", "._", "tools_", "import_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pq_", "import_", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pq_", "._", "queue_", "import_", "get", "\\u", "fail", "ed", "\\u", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pq_", "._", "worker_", "import_", "Worker_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pq_", "._", "job_", "import_", "Job_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "fixtures_", "import_", "say", "\\u", "hello_", ",_", "div", "\\u", "by", "\\u", "zero_", ",_", "create", "\\u", "file", "\\u", "after", "\\u", "timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "Worker_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worker_", "(_", "Transa", "ction", "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_", "._", "foo", "q_", ",_", "self_", "._", "bar", "q_", "=_", "Queue_", "(_", "'", "foo", "'_", ")_", ",_", "Queue_", "(_", "'", "bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worker_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "worker_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Worke", "r", " ", "creati", "on", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "foo", "q_", ",_", "self_", "._", "bar", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "w_", "._", "queues_", ",_", "[_", "self_", "._", "foo", "q_", ",_", "self_", "._", "bar", "q_", "]_", ")_", "\\u\\u\\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", "Work", "No", "Jobs_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Work", "No", "Jobs_", "(_", "Transa", "ction", "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_", "._", "foo", "q_", ",_", "self_", "._", "bar", "q_", "=_", "Queue_", "(_", "'", "foo", "'_", ")_", ",_", "Queue_", "(_", "'", "bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "foo", "q_", ",_", "self_", "._", "bar", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Work", "No", "Jobs_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "work", "\\u", "no", "\\u", "jobs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", ",_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Di", "d", " ", "not", " ", "expect", " ", "any", " ", "work", " ", "on", " ", "the", " ", "queue", ".'_", ")_", "\\u\\u\\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", "Worke", "r", "With", "Jobs_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "With", "Jobs_", "(_", "Transa", "ction", "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_", "._", "foo", "q_", ",_", "self_", "._", "bar", "q_", "=_", "Queue_", "(_", "'", "foo", "'_", ")_", ",_", "Queue_", "(_", "'", "bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "foo", "q_", ",_", "self_", "._", "bar", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "foo", "q_", "._", "enqueue_", "(_", "say", "\\u", "hello_", ",_", "name_", "=_", "'", "Fran", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "With", "Jobs_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "worker", "\\u", "with", "\\u", "jobs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", ",_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Expect", "ed", " ", "at", " ", "leas", "t", " ", "some", " ", "work", " ", "don", "e", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Work", "Via", "String", "Arg_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Work", "Via", "String", "Arg_", "(_", "Transa", "ction", "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_", "._", "q_", "=_", "Queue_", "(_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "job_", "=_", "self_", "._", "q_", "._", "enqueue_", "(_", "'", "test\\u", "pq", ".", "fixture", "s", ".", "say", "\\u", "hell", "o", "'_", ",_", "name_", "=_", "'", "Fran", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Work", "Via", "String", "Arg_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "work", "\\u", "via", "\\u", "string", "\\u", "argument_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Worke", "r", " ", "process", "es", " ", "work", " ", "fed", " ", "via", " ", "string", " ", "argu", "ment", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", ",_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Expect", "ed", " ", "at", " ", "leas", "t", " ", "some", " ", "work", " ", "don", "e", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job_", "=_", "Job_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "self_", "._", "job_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "job_", "._", "result_", ",_", "'", "Hi", " ", "there", ",", " ", "Fran", "k", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Work", "Is", "Unrea", "dable", "_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Work", "Is", "Unrea", "dable", "_", "(_", "Transa", "ction", "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_", "._", "q_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "q_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fq", "_", "=_", "get", "\\u", "fail", "ed", "\\u", "queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Work", "Is", "Unrea", "dable", "_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "work", "\\u", "is", "\\u", "unread", "able_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Unrea", "dable", " ", "jobs", " ", "are", " ", "put", " ", "on", " ", "the", " ", "fail", "ed", " ", "queue", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "fq", "_", "._", "count_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "q_", "._", "count_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "We", " ", "have", " ", "to", " ", "fake", " ", "this", " ", "enqueue", "ing", " ", "for", " ", "this", " ", "test", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "we", "'", "re", " ", "simulati", "ng", " ", "here", " ", "is", " ", "a", " ", "call", " ", "to", " ", "a", " ", "function", " ", "tha", "t", " ", "is", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "importa", "ble", " ", "from", " ", "the", " ", "worker", " ", "process", "._", "\\u\\u\\uNL\\u\\u\\u_", "job_", "=_", "Job_", "._", "create_", "(_", "func_", "=_", "div", "\\u", "by", "\\u", "zero_", ",_", "args_", "=_", "(_", "3_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job_", "._", "instance_", "=_", "'", "nonexist", "ing", "\\u", "job", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job_", "._", "queue_", "=_", "self_", "._", "q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "q_", "._", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "set", ",", " ", "we", "'", "re", " ", "goi", "ng", " ", "to", " ", "process", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", "#", " ", "shou", "ld", " ", "silently", " ", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "q_", "._", "count_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "fq", "_", "._", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Work", "Fail", "s_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Work", "Fail", "s_", "(_", "Transa", "ction", "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_", "._", "q_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fq", "_", "=_", "get", "\\u", "fail", "ed", "\\u", "queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "job_", "=_", "self_", "._", "q_", "._", "enqueue_", "(_", "div", "\\u", "by", "\\u", "zero_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "enqueue", "d\\u", "at_", "=_", "self_", "._", "job_", "._", "enqueue", "d\\u", "at_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Work", "Fail", "s_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "work", "\\u", "fails_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fail", "ing", " ", "jobs", " ", "are", " ", "put", " ", "on", " ", "the", " ", "fail", "ed", " ", "queue", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", "#", " ", "shou", "ld", " ", "silently", " ", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Post", "conditions_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "q_", "._", "count_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "fq", "_", "._", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "job_", "\\u\\u\\uNL\\u\\u\\u_", "job_", "=_", "Job_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "self_", "._", "job_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "job_", "._", "origin_", ",_", "self_", "._", "q_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "be", " ", "the", " ", "original", " ", "enqueue", "d\\u", "at", " ", "date", ",", " ", "not", " ", "the", " ", "date", " ", "of", " ", "enqueue", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "fail", "ed", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "job_", "._", "enqueue", "d\\u", "at_", ",_", "self_", "._", "enqueue", "d\\u", "at_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not", "None_", "(_", "job_", "._", "exc", "\\u", "info_", ")_", "#", " ", "shou", "ld", " ", "contain", " ", "exc", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Worke", "r", "Custom", "Exc", "Hand", "ling_", "(_", "Transa", "ction", "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\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "Custom", "Exc", "Hand", "ling_", "(_", "Transa", "ction", "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_", "._", "q_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fq", "_", "=_", "get", "\\u", "fail", "ed", "\\u", "queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "black", "\\u", "hole_", "(_", "job_", ",_", "*_", "exc", "\\u", "info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "fall", " ", "through", " ", "to", " ", "default", " ", "behaviour", " ", "of", " ", "movin", "g", " ", "to", " ", "fail", "ed", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "black", "\\u", "hole_", "=_", "black", "\\u", "hole_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "job_", "=_", "self_", "._", "q_", "._", "enqueue_", "(_", "div", "\\u", "by", "\\u", "zero_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "Custom", "Exc", "Hand", "ling_", "(_", "Transa", "ction", "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", "exc", "\\u", "handling", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Custom", " ", "exception", " ", "handling", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ",_", "exc", "\\u", "handler_", "=_", "self_", "._", "black", "\\u", "hole_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", "#", " ", "shou", "ld", " ", "silently", " ", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Post", "conditions_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "q_", "._", "count_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "fq", "_", "._", "count_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "job_", "\\u\\u\\uNL\\u\\u\\u_", "job_", "=_", "Job_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "self_", "._", "job_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "job_", "._", "status_", ",_", "Job_", "._", "FAILED_", ")_", "\\u\\u\\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", "Worke", "r", "Time", "outs_", "(_", "Transa", "ction", "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_", "[SEP]_", "class_", "Test", "Worke", "r", "Time", "outs_", "(_", "Transa", "ction", "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_", "._", "sentinel", "\\u", "file_", "=_", "'/", "tmp", "/.", "rq", "\\u", "sentinel", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "q_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fq", "_", "=_", "get", "\\u", "fail", "ed", "\\u", "queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "Time", "outs_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "timeouts", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Worke", "r", " ", "kills", " ", "jobs", " ", "after", " ", "timeo", "ut", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Put", " ", "it", " ", "on", " ", "the", " ", "queue", " ", "with", " ", "a", " ", "timeo", "ut", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "job", "r_", "=_", "self_", "._", "q_", "._", "enqueue_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "create", "\\u", "file", "\\u", "after", "\\u", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "(_", "self_", "._", "sentinel", "\\u", "file_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "sentinel", "\\u", "file_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "sentinel", "\\u", "file_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "job_", "=_", "Job_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "job", "r_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "Jo", "b", "Time", "out", "Except", "ion", "'_", ",_", "job_", "._", "exc", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "Time", "outs_", "(_", "Transa", "ction", "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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "unlink_", "(_", "self_", "._", "sentinel", "\\u", "file_", ")_", "\\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 ", " _", "if_", "e_", "._", "errno_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Worke", "r", "Set", "s", "Result", "TTL", "_", "(_", "Transa", "ction", "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", "Worke", "r", "Set", "s", "Result", "TTL", "_", "(_", "Transa", "ction", "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_", "._", "q_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "Set", "s", "Result", "TTL", "_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "params_", "(_", "(_", "10_", ",_", "10_", ")_", ",_", "(_", "-_", "1_", ",_", "-_", "1_", ")_", ",_", "(_", "0_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "worker", "\\u", "sets", "\\u", "result", "\\u", "ttl_", "(_", "self_", ",_", "ttl_", ",_", "outcome_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ensur", "e", " ", "tha", "t", " ", "Worke", "r", " ", "proper", "ly", " ", "sets", " ", "result", "\\u", "ttl", " ", "for", " ", "individual", " ", "jobs", " ", "or", " ", "delete", "s", " ", "them", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job_", "=_", "self_", "._", "q_", "._", "enqueue_", "(_", "say", "\\u", "hello_", ",_", "args_", "=_", "(_", "'", "Fran", "k", "'_", ",_", ")_", ",_", "result", "\\u", "ttl_", "=_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rj", "ob_", "=_", "Job_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "job_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "ttl_", "=_", "rj", "ob_", "._", "result", "\\u", "ttl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Job_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "ttl_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result", "\\u", "ttl_", ",_", "outcome_", ")_", "\\u\\u\\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", "Worke", "r", "Delete", "s", "Expire", "d", "TTL", "_", "(_", "Transa", "ction", "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", "Worke", "r", "Delete", "s", "Expire", "d", "TTL", "_", "(_", "Transa", "ction", "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_", "._", "q_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "job_", "=_", "self_", "._", "q_", "._", "enqueue_", "(_", "say", "\\u", "hello_", ",_", "args_", "=_", "(_", "'", "Bob", "'_", ",_", ")_", ",_", "result", "\\u", "ttl_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "Delete", "s", "Expire", "d", "TTL", "_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "worker", "\\u", "delete", "s", "\\u", "expir", "ed", "\\u", "ttl_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ensur", "e", " ", "tha", "t", " ", "Worke", "r", " ", "delete", "s", " ", "expir", "ed", " ", "jobs", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "._", "work_", "(_", "burst", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Job_", "._", "Do", "es", "Not", "Exist_", ")_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rj", "ob_", "=_", "Job_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "self_", "._", "job_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Worke", "r", "Deq", "ueue", "Timeout_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Simple", " ", "test", " ", "to", " ", "ensure", " ", "the", " ", "worker", " ", "finish", "es", "\"\"\"_", "\\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", "Worke", "r", "Deq", "ueue", "Timeout_", "(_", "Transa", "ction", "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_", "._", "q_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expir", "es", "\\u", "after_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "worker", "\\u", "ttl_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Worke", "r", "Deq", "ueue", "Timeout_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "worker", "\\u", "dequeue", "\\u", "timeout_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "w_", "._", "work_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "w_", "._", "\\u", "expir", "es", "\\u", "after_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Register", "Heart", "beat_", "(_", "Transa", "ction", "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", "Register", "Heart", "beat_", "(_", "Transa", "ction", "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_", "._", "q_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "=_", "Worker_", "._", "create_", "(_", "[_", "self_", "._", "q_", "]_", ",_", "name_", "=_", "'", "Test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w_", "._", "heartbeat_", "=_", "datetime_", "(_", "2010_", ",_", "1_", ",_", "1_", ",_", "tzinfo_", "=_", "utc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Register", "Heart", "beat_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "worker", "\\u", "register", "\\u", "heartbeat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "w_", "._", "register", "\\u", "heartbeat_", "(_", "timeout_", "=_", "0_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
jookies/jasmin/jasmin/vendor/smpp/twisted/tests/test_smpp_server.py
[ { "content": " @unittest.skip('''Jasmin update: All vendor tests shall be skipped)''')\n def testRecievePduWhileUnbindPending(self):\n self._bind()\n self.proto.unbind()\n expected_pdu = operations.Unbind(seqNum=1)\n self.assertEqual(self.tr.value(), self.encoder.encode(expected_pdu))\n self.tr.clear()\n pdu = operations.SubmitSM(source_addr='t1', destination_addr='1208230', short_message='HELLO', seqNum=6)\n self.proto.dataReceived(self.encoder.encode(pdu))\n expected_pdu = operations.SubmitSMResp(seqNum=6)\n self.assertEqual(self.tr.value(), '')\n pdu = operations.UnbindResp(seqNum=1)\n self.proto.dataReceived(self.encoder.encode(pdu))", "metadata": "root.SMPPServerTestCase.testRecievePduWhileUnbindPending", "header": "['class', 'SMPPServerTestCase', '(', 'SMPPServerBaseTest', ')', ':', '___EOS___']", "index": 416 }, { "content": " @unittest.skip('''Jasmin update: All vendor tests shall be skipped)''')\n def testTRXServerUnbindRequestAfterSubmit(self):\n deferreds = []\n def _serviceHandler(system_id, smpp, pdu):\n d = defer.Deferred()\n deferreds.append(d)\n logging.debug(\"%s, %s, %s\", system_id, smpp, pdu)\n return d\n self.proto.dataRequestHandler = lambda *args, **kwargs: _serviceHandler(self.proto.system_id, *args, **kwargs)\n self._bind()\n\n pdu = operations.SubmitSM(source_addr='t1', destination_addr='1208230', short_message='HELLO', seqNum=1)\n self.proto.dataReceived(self.encoder.encode(pdu))\n unbind_d = self.proto.unbind()\n print self.tr.value()\n\n pdu2 = operations.SubmitSM(source_addr='t1', destination_addr='1208230', short_message='HELLO2', seqNum=2)\n self.proto.dataReceived(self.encoder.encode(pdu))\n \n self.assertEqual(1, len(deferreds))\n self.assertEqual(self.tr.value(), '')\n self.tr.clear()\n deferreds[-1].callback(pdu_types.CommandStatus.ESME_ROK)\n deferreds = deferreds[:-1]\n submit_resp_pdu = operations.SubmitSMResp(seqNum=1)\n\n unbind_pdu = operations.Unbind(seqNum=1)\n # We should have a reply here as our service handler should not be called\n self.assertEqual(self.tr.value(), '%s%s' % (self.encoder.encode(submit_resp_pdu), self.encoder.encode(unbind_pdu)))\n self.tr.clear()\n pdu = operations.UnbindResp(seqNum=1)\n self.proto.dataReceived(self.encoder.encode(pdu))", "metadata": "root.SMPPServerTestCase.testTRXServerUnbindRequestAfterSubmit", "header": "['class', 'SMPPServerTestCase', '(', 'SMPPServerBaseTest', ')', ':', '___EOS___']", "index": 460 } ]
[ { "span": "expected_pdu ", "start_line": 425, "start_column": 8, "end_line": 425, "end_column": 20 }, { "span": "unbind_d ", "start_line": 473, "start_column": 8, "end_line": 473, "end_column": 16 }, { "span": "pdu2 ", "start_line": 476, "start_column": 8, "end_line": 476, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "SM", "PP", "Server", "Test", "Case_", "(_", "SM", "PP", "Server", "Base", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip_", "(_", "'''", "Ja", "smi", "n", " ", "update", ":", " ", "All", " ", "vendor", " ", "tests", " ", "sha", "ll", " ", "be", " ", "skip", "ped", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test", "Rec", "ieve", "Pd", "u", "Whi", "le", "Unb", "ind", "Pend", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "bind_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "proto_", "._", "unbind", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "pdu_", "=_", "operations_", "._", "Unb", "ind_", "(_", "seq", "Num_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "tr_", "._", "value_", "(_", ")_", ",_", "self_", "._", "encoder_", "._", "encode_", "(_", "expected", "\\u", "pdu_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tr_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu_", "=_", "operations_", "._", "Submit", "SM_", "(_", "source", "\\u", "addr_", "=_", "'", "t1", "'_", ",_", "destinat", "ion", "\\u", "addr_", "=_", "'", "120", "823", "0", "'_", ",_", "short", "\\u", "message_", "=_", "'", "HELL", "O", "'_", ",_", "seq", "Num_", "=_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "proto_", "._", "data", "Received_", "(_", "self_", "._", "encoder_", "._", "encode_", "(_", "pdu_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "pdu_", "=_", "operations_", "._", "Submit", "SM", "Resp_", "(_", "seq", "Num_", "=_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "tr_", "._", "value_", "(_", ")_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu_", "=_", "operations_", "._", "Unb", "ind", "Resp_", "(_", "seq", "Num_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "proto_", "._", "data", "Received_", "(_", "self_", "._", "encoder_", "._", "encode_", "(_", "pdu_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SM", "PP", "Server", "Test", "Case_", "(_", "SM", "PP", "Server", "Base", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip_", "(_", "'''", "Ja", "smi", "n", " ", "update", ":", " ", "All", " ", "vendor", " ", "tests", " ", "sha", "ll", " ", "be", " ", "skip", "ped", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test", "TR", "XS", "erver", "Unb", "ind", "Request", "Af", "ter", "Submit", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defer", "reds", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "service", "Handler_", "(_", "system", "\\u", "id_", ",_", "smp", "p_", ",_", "pdu_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defer", "reds", "_", "._", "append_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"%", "s", ",", " ", "%", "s", ",", " ", "%", "s", "\"_", ",_", "system", "\\u", "id_", ",_", "smp", "p_", ",_", "pdu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "proto_", "._", "data", "Request", "Handler_", "=_", "lambda_", "*_", "args_", ",_", "**_", "kwargs_", ":_", "\\u", "service", "Handler_", "(_", "self_", "._", "proto_", "._", "system", "\\u", "id_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "bind_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pdu_", "=_", "operations_", "._", "Submit", "SM_", "(_", "source", "\\u", "addr_", "=_", "'", "t1", "'_", ",_", "destinat", "ion", "\\u", "addr_", "=_", "'", "120", "823", "0", "'_", ",_", "short", "\\u", "message_", "=_", "'", "HELL", "O", "'_", ",_", "seq", "Num_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "proto_", "._", "data", "Received_", "(_", "self_", "._", "encoder_", "._", "encode_", "(_", "pdu_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unbind", "\\u", "d_", "=_", "self_", "._", "proto_", "._", "unbind", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "self_", "._", "tr_", "._", "value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pdu", "2_", "=_", "operations_", "._", "Submit", "SM_", "(_", "source", "\\u", "addr_", "=_", "'", "t1", "'_", ",_", "destinat", "ion", "\\u", "addr_", "=_", "'", "120", "823", "0", "'_", ",_", "short", "\\u", "message_", "=_", "'", "HELL", "O", "2", "'_", ",_", "seq", "Num_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "proto_", "._", "data", "Received_", "(_", "self_", "._", "encoder_", "._", "encode_", "(_", "pdu_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "len_", "(_", "defer", "reds", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "tr_", "._", "value_", "(_", ")_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tr_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defer", "reds", "_", "[_", "-_", "1_", "]_", "._", "callback_", "(_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RO", "K_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defer", "reds", "_", "=_", "defer", "reds", "_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "submit", "\\u", "resp", "\\u", "pdu_", "=_", "operations_", "._", "Submit", "SM", "Resp_", "(_", "seq", "Num_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "unbind", "\\u", "pdu_", "=_", "operations_", "._", "Unb", "ind_", "(_", "seq", "Num_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "shou", "ld", " ", "have", " ", "a", " ", "repl", "y", " ", "here", " ", "as", " ", "our", " ", "service", " ", "handler", " ", "shou", "ld", " ", "not", " ", "be", " ", "called_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "tr_", "._", "value_", "(_", ")_", ",_", "'%", "s", "%", "s", "'_", "%_", "(_", "self_", "._", "encoder_", "._", "encode_", "(_", "submit", "\\u", "resp", "\\u", "pdu_", ")_", ",_", "self_", "._", "encoder_", "._", "encode_", "(_", "unbind", "\\u", "pdu_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tr_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu_", "=_", "operations_", "._", "Unb", "ind", "Resp_", "(_", "seq", "Num_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "proto_", "._", "data", "Received_", "(_", "self_", "._", "encoder_", "._", "encode_", "(_", "pdu_", ")_", ")_", "\\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,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/maya/site-packages/pymel-1.0.5/pymel/util/objectParser.py
[ { "content": "\"\"\"\n.. classtree:: ProxyUni\n\n.. dotgraph::\n\n main -> parse -> execute;\n main -> init;\n main -> cleanup;\n execute -> make_string;\n execute -> printf\n init -> make_string;\n main -> printf;\n execute -> compare;\n\n\"\"\"\n\nimport re, inspect, sys, os, tempfile\nimport types\ntry:\n import external.ply.lex as lex\n import external.ply.yacc as yacc\nexcept ImportError:\n import ply.lex as lex\n import ply.yacc as yacc\n\n#from namedtuple import namedtuple\nfrom common import capitalize, uncapitalize\nimport warnings\nfrom arguments import *\nfrom utilitytypes import *\n\n\n\n\n# increase from 0 to 1 or 2 for more debug feedback\n\n\n\n\n\n\n\nProxyUni = proxyClass( unicode, 'ProxyUni', module=__name__, dataFuncName='compileName', remove=['__getitem__', '__doc__']) # 2009 Beta 2.1 has issues with passing classes with __getitem__\n\n# For parsed objects, Token or upper level constructs\n\n# Parsers, all parser must derive from the Parser class\n\n\n\n\n\n# token parser, can directly use re\n\n# special purpose empty parser\n\n# derived TokenParser classes will be built for every token definition detected in Parser classes in this module\n\n\n\n\n\n\n\n# do it\n#_addedTokenClasses =_createTokenClasses(debug=verbose())\n\n# Build a dict of all existing Parser and Parsed classes in this module\n#class Parsed.classes(dict) :\n# __metaclass__ = metaStatic\n\n\n#def parsedClasses(module):\n# return dict(inspect.getmembers(module, isParsedClass))\n## Stores it at import so that the inspect method isn't recalled at each query\n#Parsed.classes(Parsed.classes)\n\n#class Parser.classes(dict) :\n# __metaclass__ = metaStatic\n\n\nParsed.classes = {}\nParser.classes = {}\n\n#def parserClasses(module):\n# return dict(inspect.getmembers(module, isParserClass))\n## Stores it at import so that the inspect method isn't recalled at each query\n#Parser.classes(Parser.classes)\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def verbose() :\n return 0", "metadata": "root.verbose", "header": "['module', '___EOS___']", "index": 35 }, { "content": "def currentfn() :\n try :\n return sys._getframe(1).f_code.co_name\n except :\n pass", "metadata": "root.currentfn", "header": "['module', '___EOS___']", "index": 38 }, { "content": "class NameParseError(Exception):\n pass", "metadata": "root.NameParseError", "header": "['module', '___EOS___']", "index": 45 }, { "content": "class ParsingWarning(UserWarning):\n pass", "metadata": "root.ParsingWarning", "header": "['module', '___EOS___']", "index": 48 }, { "content": "class Parsed(ProxyUni):\n\n _parser = None\n _accepts = ()\n _name = None\n classes = {}\n\n#class Parsed(unicode):\n#\n# _parser = None\n# _accepts = ()\n\n\n\n\n # init class attributes, all objects of a Parsed class share the same parser\n # TODO : check if it can be a problem with multithreading ? In that case we'll need a parser per instance\n\n\n\n # instance methods\n\n\n\n\n\n\n\n\n", "metadata": "root.Parsed", "header": "['module', '___EOS___']", "index": 56 }, { "content": " @classmethod\n def accepts(cls, other) :\n \"\"\" Checks if this Parsed class can accept another object as a subpart without reparsing \"\"\"\n if isinstance(other, Parsed) :\n for t in cls._accepts :\n if t == other.__class__.__name__ :\n return True\n return False", "metadata": "root.Parsed.accepts", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 68 }, { "content": " def compileName( self ):\n newname = u''\n partList = []\n def getParts( obj, newname ):\n try:\n for x in obj.parts:\n #print repr(x)\n newname = getParts(x, newname)\n except AttributeError:\n #print \"DEAD\", repr(obj)\n newname += unicode(obj._name)\n return newname\n self._name = getParts( self, newname )\n return self._name", "metadata": "root.Parsed.compileName", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 77 }, { "content": " @classmethod\n def getParserClass(cls, parsername ):\n pass", "metadata": "root.Parsed.getParserClass", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 92 }, { "content": " @classmethod\n def classparserbuild(cls, **kwargs):\n \"\"\" Inits class Parser, all instances of a Parsed class share the same yacc parser object \"\"\"\n\n clsname = cls.__name__\n try :\n # class declaration specifies a parser class\n parser = cls._parser\n except :\n # default rule\n parsername = cls.__name__+\"Parser\"\n parser = Parser.classes.get(parsername, None)\n cls._parser = parser\n warnings.warn (\"could not read '_parser' for %s, building Parser name %s from Parsed class name %s\" % (cls, parsername, clsname), UserWarning)\n\n if parser is not None :\n # if parser hasn't been built yet, build it\n if not isinstance(parser, Parser) :\n # parser is a class\n if inspect.isclass(parser) :\n parsername = parser.__name__\n if not issubclass (parser, Parser):\n raise ValueError, \"Parser %s specified in Parsed class %s is not a Parser class\" % (parsername, cls.__name__)\n # parser is a string\n elif parser in Parser.classes :\n parsername = parser\n parser = Parser.classes[parsername]\n else :\n raise ValueError, \"Invalid Parser specification %r in Parsed class %s\" % (parser, cls.__name__)\n\n # build class Parser, replace class _parser by the Parser instance object\n\n # print \"Building parser instance of Parser %s for Parsed class: %s\" % (parser, cls.__name__)\n # replace _parser attribute (which held a Parser class or classname) with parser class instance\n cls._parser = parser()\n cls._parser.build(**kwargs)\n # return cls._parser\n else :\n raise TypeError, \"Parsed class %s does not define a parser, check declarations\" % cls.__name__", "metadata": "root.Parsed.classparserbuild", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 98 }, { "content": " @classmethod\n def classparse(cls, data, **kwargs):\n clsname = cls.__name__\n data = unicode(data)\n debug = kwargs.get('debug', verbose())\n errmsg = ''\n # print \"Calling parser %s with debug %s\" % (cls.classparser(), debug)\n result = cls.classparser().parse(data, debug=debug)\n if cls.classparser().errorcount :\n # use error or warning ?\n errmsg = \"cannot parse '%s' to a valid %s, %d parser errors\" % (data, clsname, cls.classparser().errorcount)\n isValid = False\n elif not isinstance(result, cls) :\n # parse successful but returned a different class than exected\n errmsg = \"parsing '%s' is valid, but as a %s Parsed object, and not as a %s Parsed object as it was parsed against\" % (data, result.__class__.__name__, clsname)\n isValid = False\n elif not result == data :\n # should return a Parsed object with the same string value as the parsed string\n errmsg = \"parsing '%s' raised no error, but the resulting name is %s is different from the nput string %s \" % (result, data)\n isValid = False\n else :\n # parse successful\n isValid = True\n\n # check for error in parsing and correct and raise a warning or raise an error\n # TODO : corrections and error handling\n if not isValid :\n # can try to auto-correct some badly formed names\n raise NameParseError, errmsg\n\n # position is set to position of first found Parsed object\n if (result.sub) :\n result._pos = result.sub[0].pos\n else :\n result._pos = 0\n\n result._valid = True\n return result", "metadata": "root.Parsed.classparse", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 138 }, { "content": " @classmethod\n def classparser(cls):\n \"\"\" parser object for that class \"\"\"\n return cls._parser", "metadata": "root.Parsed.classparser", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 177 }, { "content": " def parse(self, data, **kwargs):\n return self.__class__.classparse(data, **kwargs)", "metadata": "root.Parsed.parse", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 184 }, { "content": " @property\n def parser(self):\n \"\"\" parser object for that class \"\"\"\n return self.__class__.classparser()", "metadata": "root.Parsed.parser", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 187 }, { "content": " @property\n def tokens(self ):\n \"\"\" iterates self as leaf level lexed tokens \"\"\"\n for i in expandArgs(self._sub) :\n if isinstance(i, Token) :\n yield i", "metadata": "root.Parsed.tokens", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 191 }, { "content": " @property\n def sub(self):\n \"\"\" Internally stored parsing data for this Parsed object sub parts \"\"\"\n return self._sub", "metadata": "root.Parsed.sub", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 197 }, { "content": " def setSubItem(self, index, value):\n \"\"\" Change the value of one of the Parsed sub parts. The new value will first be parsed as the same\n type as it is replacing.\"\"\"\n cls = self._sub[index].__class__\n sublist = list(self._sub)\n sublist[index] = cls(value)\n self._sub = tuple(sublist)", "metadata": "root.Parsed.setSubItem", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 202 }, { "content": " @property\n def pos(self):\n \"\"\" position of that Parsed object \"\"\"\n return self._pos", "metadata": "root.Parsed.pos", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 210 }, { "content": " def isValid(self):\n \"\"\" Validity \"\"\"\n return self._valid", "metadata": "root.Parsed.isValid", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 214 }, { "content": " def copy(self):\n \"\"\"return an new independent copy of the parsed object\"\"\"\n return self.__class__(self._sub)", "metadata": "root.Parsed.copy", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 218 }, { "content": " def findType(self, type):\n res = []\n for x in self.sub:\n if isinstance(x,type):\n res.append( x )\n else:\n res += x.findType(type)\n return res", "metadata": "root.Parsed.findType", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 222 }, { "content": " def __new__(cls, *args, **kwargs):\n \"\"\" Creation of a Parsed object from a LexToken, other Parsed of compatible type or string,\n if a string is passed it will be parsed and checked for compatibility with this Parsed type \"\"\"\n\n debug = kwargs.get('debug', verbose())\n # type checking\n data = None\n if args :\n if len(args) == 1:\n data = args[0]\n else :\n data = tuple(args)\n\n # some data (when initializing from single arg) can define the type of Parsed object to be created\n ptype = None\n if data is None :\n # only authorize Empty to be built without arguments\n ptype = 'Empty'\n elif isinstance(data, lex.LexToken) :\n ptype = kwargs.get('type', data.type)\n elif isinstance(data, Parsed) :\n ptype = data.__class__\n # can override type with the keyword 'type'\n ptype=kwargs.get('type', ptype)\n\n if (cls is Parsed or cls is Token) : #issubclass(cls, Token) ):\n if ptype is not None :\n if verbose():\n print \"__new__ called on Parsed/Token %s with type %r\" % (cls.__name__, ptype)\n newcls = Parsed.classes.get(ptype, None)\n # can only specify an existing subclass of cls\n if newcls is None :\n raise TypeError, \"Type %s does not correspond to any existing Parsed sub-class (%s does not exist)\" % (ptype, cls.__name__ )\n else :\n clsname = newcls.__name__\n if not issubclass(newcls, cls) :\n raise TypeError, \"Type %s would create a class %s that is not a sub-class of the class %s that __new__ was called on\" % (ptype, clsname, cls.__name__)\n else :\n raise TypeError, \"Class %s is an abstract class and can't be created directly, you must specify a valid sub-type\" % (cls.__name__)\n else :\n if verbose():\n print \"__new__ called on explicit class %s\" % (cls.__name__)\n clsname = cls.__name__\n newcls = cls\n\n # print \"Creating new instance of Parsed class: %r\" % newcls\n\n # process arguments and build, check arguments compatibility with that type\n pos = None\n sub = []\n valid = False\n value = data\n\n #if debug : print \"VALUE1\", value, repr(value)\n\n # special case for LexToken\n if isinstance(data, lex.LexToken) :\n if issubclass(newcls, Token) :\n # from a unique lex Token, do not check if also creating a Token\n sub = []\n pos = data.lexpos\n value = data.value\n valid = True\n else :\n # build a Token from it\n value = Token(data.value, ptype=data.type, pos=data.pos)\n\n if data is None :\n # Tokens can have default value to allow initialization without arguments\n try :\n value = newcls.default()\n valid = True\n except :\n valid = False\n elif isinstance(data, newcls) :\n #if debug : print \"IS INSTANCE\", data, repr(data)\n # from a similar class, copy it\n sub = data.sub\n pos = data.pos\n valid = data.isValid()\n value = unicode(data)\n elif newcls.accepts(data) :\n #if debug : print \"ACCEPTS\", data, repr(data)\n # from a compatible Parsed sub class, build the sub list from it\n sub.append(data)\n pos = data.pos\n valid = data.isValid()\n value = unicode(data)\n elif isSequence(data) and not isinstance(data, basestring):\n # building from sub parts, must be of the same type and in class _accepts\n # TODO : use yacc own rules for accepts\n if data :\n valid = True\n p = 0\n for arg in data :\n # converts LexTokens directly\n if isinstance(arg, lex.LexToken) :\n a = Token(arg.value, ptype=arg.type, pos=data.pos)\n else :\n a = arg\n # now check if it's a suitable sub-part or derived class\n if isinstance(a, newcls) :\n sub += a.sub\n elif newcls.accepts(a) :\n sub.append(a)\n else :\n valid = False\n break\n value = u\"\".join(map(unicode, data))\n if valid :\n pos = sub[0].pos\n else :\n sub = []\n else :\n value = ''\n else :\n if debug : print \"REPARSE\", data, repr(data)\n # reparse unless it's a Token we already know the type of\n value = unicode(data)\n if issubclass(newcls, Token) and newcls is not Token :\n sub = []\n pos = 0\n valid = True\n else :\n valid = False\n\n # parse if necessary\n if valid :\n # print \"No reparsing necessary for a resulting value %s (%r)\" % (value, value)\n strvalue = unicode(value)\n elif isinstance(value, basestring) :\n if debug :\n print \"%s: Will need to reparse value %r\" % (clsname, value)\n newcls.classparserbuild(debug=debug)\n if debug : print \"VALUE\", value, type(value)\n result = newcls.classparse(value, debug=debug)\n if debug : print \"RESULT\", result, type(result), isinstance(result, newcls)\n if result is not None and isinstance(result, newcls) :\n strvalue = unicode(result)\n valid = result._valid\n sub = result._sub\n pos = result._pos\n if debug : print \"SUB\", sub\n else :\n strvalue = ''\n valid = False\n else :\n raise TypeError, \"invalid argument(s) %r, cannot be parsed to create a Parsed object of type %s\" % (value, clsname)\n\n if valid :\n # create a unicode object with appropriate string value\n newobj = super(Parsed, cls).__new__(newcls)\n newobj._name = strvalue\n #if debug: print \"NAME\", newobj, type(newobj), sub#, inspect.getmro(newobj)\n # set instance attributes\n newobj._sub = tuple(sub)\n newobj._valid = valid\n # override for pos\n pos = kwargs.get('pos', pos)\n if pos is not None :\n pos += kwargs.get('offset', 0)\n\n if pos is None or (isinstance(pos, int) and pos>=0) :\n newobj._pos = pos\n else :\n raise ValueError, \"A Parsed pos can only be None or an unsigned int, %r invalid\" % pos\n\n return newobj", "metadata": "root.Parsed.__new__", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 231 }, { "content": " def __add__(self, other):\n \"\"\" p1.__add__(p2) <==> p1+p2\n if p1 and p2 are of the same Parsed type, it's equivalent to reparsing str(p1) + str(p2)\n if p2 is an accepted sub part of p1, it adds it to the sub-parts\n \"\"\"\n # The Parsed _accepts defines validity\n # TODO : use yacc own rules to check validity without a full reparse\n cls = self.__class__\n selfvalid = self.isValid()\n sublist = list(self.sub)\n value = unicode(self)\n # check other's type\n if isinstance(other, cls) :\n othervalid = other.isValid()\n sublist += other.sub\n elif self.accepts(other) :\n othervalid = other.isValid()\n sublist.append(other)\n elif isinstance(other, basestring) :\n othervalid = False\n else :\n raise TypeError, \"cannot add %s and %s\" % (type(self), type(other))\n\n if selfvalid and othervalid :\n # no reparse\n result = cls(*sublist)\n else :\n # reparse\n result = cls(unicode(self)+unicode(other))\n\n return result", "metadata": "root.Parsed.__add__", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 400 }, { "content": " def __repr__(self):\n return u\"%s('%s', %s)\" % (self.__class__.__name__, self, self.pos)", "metadata": "root.Parsed.__repr__", "header": "['class', 'Parsed', '(', 'ProxyUni', ')', ':', '___EOS___']", "index": 432 }, { "content": "class Parser(object):\n \"\"\" Abstract Base class for all name parsers \"\"\"\n classes = {}\n\n\n\n\n\n", "metadata": "root.Parser", "header": "['module', '___EOS___']", "index": 437 }, { "content": " def __new__(cls, *args, **kwargs):\n # this class is an abstract base class for all Parser classes, cannot be built directly\n\n if cls is Parser :\n # type argument can be the name of a Parser class or an instance of the class\n ptype=kwargs.get('type', None)\n if ptype is None :\n raise TypeError, \"must specify a Parser class\"\n elif isinstance(ptype, Parser) and not ptype is Parser :\n parsercls = ptype\n elif ptype in Parser.classes :\n parsercls = Parser.classes[ptype]\n else :\n raise TypeError, \"invalid Parser type: %s\" % ptype\n else :\n # subclasses of Parser\n parsercls = cls\n\n# if 'tokensDict' in parsercls.__dict__ and 'rulesDict' in parsercls.__dict__:\n# rulesDict = parsercls.rulesDict\n# tokensDict = parsercls.tokensDict\n# else:\n\n reserved = []\n# #reserved = [ k for k,v in parsercls.tokensDict.items() if not k.startswith( 't_') ]\n# if hasattr( parsercls, '_reserved'):\n# for k, v in parsercls._reserved.items():\n# # reserved should be a map of reserved names (as used in the code to parse) to token names (as used in PLY).\n# # as such, we only care about the PLY names, ie. the values\n# reserved.append(v)\n\n rulesDict, tokensDict = Parser.getRulesAndTokens( parsercls )\n\n tokens = tokensDict.keys()\n rules = list(rulesDict.keys())\n # Sort them by line number of declaration as it's how the yacc builder works to order rules\n # TODO : some more explicit rule order handling (when precedence isn't an option) ?\n rules.sort(lambda x,y: cmp(rulesDict[x].func_code.co_firstlineno,rulesDict[y].func_code.co_firstlineno))\n # print \"sorted rules:\", [(r, parsercls.rulesDict[r].func_code.co_firstlineno) for r in rules]\n rules = tuple(rules)\n\n parsercls.tokens = tuple( tokens + list(set(reserved)) )\n parsercls.rules = rules\n\n #print \"%s tokens %s\" % ( parsercls, parsercls.tokens )\n # class must have a start attribute for __init__, start can be None though\n # must not inherit start as parsed would not parse own class new rules\n if not 'start' in parsercls.__dict__ :\n parsercls.start = None\n\n # TODO : same for precedence rules\n return super(Parser, cls).__new__(parsercls, *args, **kwargs)", "metadata": "root.Parser.__new__", "header": "['class', 'Parser', '(', 'object', ')', ':', '___EOS___']", "index": 440 }, { "content": " def __init__(self, *args, **kwargs):\n self.errorcount = 0\n self.lexer = None\n self.parser = None", "metadata": "root.Parser.__init__", "header": "['class', 'Parser', '(', 'object', ')', ':', '___EOS___']", "index": 493 }, { "content": " def t_error(self,t):\n warnings.warn (\"illegal character in '%s' at %i: '%s'\" % (t.lexer.lexdata, t.lexpos, t.value[0]), ParsingWarning, stacklevel=1)\n self.errorcount += 1\n t.lexer.skip(1)", "metadata": "root.Parser.t_error", "header": "['class', 'Parser', '(', 'object', ')', ':', '___EOS___']", "index": 498 }, { "content": " def p_error(self,p):\n print \"error token\", p\n if p is None :\n warnings.warn (\"unexpected end of file\", ParsingWarning, stacklevel=1)\n else :\n warnings.warn (\"syntax error in '%s' at %i: '%s'\" % (p.lexer.lexdata, p.lexpos, p.value), ParsingWarning, stacklevel=1)\n self.errorcount += 1\n\n # Just discard the token and tell the parser it's okay.\n # yacc.errok()\n #yacc.errok(). This resets the parser state so it doesn't think it's in error-recovery mode. This will prevent an error token from being generated and will reset the internal error counters so that the next syntax error will call p_error() again.\n #yacc.token(). This returns the next token on the input stream.\n #yacc.restart(). This discards the entire parsing stack and resets the parser to its initial state.", "metadata": "root.Parser.p_error", "header": "['class', 'Parser', '(', 'object', ')', ':', '___EOS___']", "index": 503 }, { "content": " @staticmethod\n def getRulesAndTokens( parsercls ):\n \"\"\"\n build the tokens and precedence tuples from inherited declarations.\n gather tokens and rules definition from Parser class members (own and inherited)\n \"\"\"\n\n tokensDict = {}\n rulesDict = {}\n for name, obj in inspect.getmembers(parsercls):\n if name.startswith('t_') and name != 't_error' :\n\n if isinstance(obj, basestring) :\n v = obj\n elif inspect.isfunction(obj) or inspect.ismethod(obj) :\n v = obj.__doc__\n else :\n raise SyntaxError, \"Token definition %s defines neither a string nor a function, unable to parse\" % m[0]\n k = name[2:]\n tokensDict[k] = obj\n elif name.startswith('p_') and inspect.ismethod(obj) and name != 'p_error' :\n k = name[2:]\n rulesDict[k] = obj\n# elif name == '_reserved' and isinstance(obj,dict):\n# # reserved attribute holds a list of reserved token keywords.\n# # these should only exist on\n# print \"FOUND reserved!\"\n# for k,v in obj.items():\n# tokensDict[v]=None\n\n return rulesDict, tokensDict", "metadata": "root.Parser.getRulesAndTokens", "header": "['class', 'Parser', '(', 'object', ')', ':', '___EOS___']", "index": 517 }, { "content": " def build(self,**kwargs):\n debug = kwargs.get('debug', verbose())\n start = kwargs.get('start', self.__class__.start)\n parserspath = kwargs.get('outputdir', tempfile.gettempdir() )\n if debug :\n print \"nameparse parsers path\", parserspath\n method = kwargs.get('method', 'LALR')\n if debug :\n print \"Build for\", self.__class__.__name__\n print \"tokens:\"\n for t in self.__class__.tokens :\n # t is not always in tokensDict, not sure if this is bad or not...\n #print \"\\t%s = %r\" % (t, self.__class__.tokensDict[t])\n print \"\\t%s\" % (t)\n print \"rules:\"\n for t in self.__class__.rules :\n # t is not always in rulesDict, not sure if this is bad or not...\n #print \"\\t%s = %r\" % (t, self.__class__.rulesDict[t].__doc__)\n print \"\\t%s\" % (t)\n print \"start: %s\" % start\n\n if self.lexer is None :\n lextab=self.__class__.__name__+\"_lex\"\n lkwargs = {'debug':debug, 'lextab':lextab }\n self.lexer = lex.lex(object=self, **lkwargs)\n if self.parser is None :\n tabmodule=self.__class__.__name__+\"_yacc_\"+start\n pkwargs = {'outputdir':parserspath, 'debug':debug, 'tabmodule':tabmodule, 'start':start, 'method':method }\n self.parser = yacc.yacc(module=self, **pkwargs)", "metadata": "root.Parser.build", "header": "['class', 'Parser', '(', 'object', ')', ':', '___EOS___']", "index": 549 }, { "content": " def parse(self, data, **kwargs):\n self.errorcount = 0\n return self.parser.parse(data, lexer=self.lexer, **kwargs)", "metadata": "root.Parser.parse", "header": "['class', 'Parser', '(', 'object', ')', ':', '___EOS___']", "index": 579 }, { "content": "class Token(Parsed):\n \"\"\" A class for token types, allows direct initialization from a string and type without checking\n to avoid unnecessary double parse of the string \"\"\"\n pass", "metadata": "root.Token", "header": "['module', '___EOS___']", "index": 583 }, { "content": "class TokenParser(Parser):\n \"\"\" Abstract base class for Token parser \"\"\"\n _pattern = None\n _type = None\n\n", "metadata": "root.TokenParser", "header": "['module', '___EOS___']", "index": 591 }, { "content": " def build(self,**kwargs):\n pattern = kwargs.get('pattern', self.__class__._pattern)\n try :\n self.parser = re.compile(pattern)\n except :\n raise ValueError, \"cannot build Token Parser from pattern %r. you must set the _pattern attribute to a valid regular expression\" % pattern", "metadata": "root.TokenParser.build", "header": "['class', 'TokenParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 596 }, { "content": " def parse(self, data, **kwargs):\n self.errorcount = 0\n if self.parser.match(data) is not None :\n return Token(data, type=self._type, pos=0)\n else :\n warnings.warn (\"%s is not matching %s pattern %r\" % (data, self.__class__.__name__, self._pattern))\n self.errorcount += 1", "metadata": "root.TokenParser.parse", "header": "['class', 'TokenParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 603 }, { "content": "class EmptyTokenParser(Parser):\n\n", "metadata": "root.EmptyTokenParser", "header": "['module', '___EOS___']", "index": 612 }, { "content": " def build(self,**kwargs):\n pass", "metadata": "root.EmptyTokenParser.build", "header": "['class', 'EmptyTokenParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 614 }, { "content": " def parse(self, data, **kwargs):\n self.errorcount = 0\n if data :\n self.errorcount = 1\n else :\n return Empty()", "metadata": "root.EmptyTokenParser.parse", "header": "['class', 'EmptyTokenParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 617 }, { "content": "class EmptyParser(Parser):\n \"\"\" Parser for the empty production \"\"\"\n\n start = 'Empty'", "metadata": "root.EmptyParser", "header": "['module', '___EOS___']", "index": 626 }, { "content": " def p_empty(self, p) :\n 'Empty : '\n pass", "metadata": "root.EmptyParser.p_empty", "header": "['class', 'EmptyParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 630 }, { "content": "def isParsedClass (x) :\n try :\n return issubclass(x, Parsed)\n except :\n return False", "metadata": "root.isParsedClass", "header": "['module', '___EOS___']", "index": 634 }, { "content": "def isParserClass (x) :\n try :\n return issubclass(x, Parser)\n except :\n return False", "metadata": "root.isParserClass", "header": "['module', '___EOS___']", "index": 639 }, { "content": "def _printClassTree(cls):\n def _printTree(data, level):\n if isinstance(data, tuple):\n level += 1\n for d in data:\n _printTree(d, level)\n else:\n print data\n\n print cls\n tree = inspect.getclasstree(cls)\n print tree\n _printTree( tree )", "metadata": "root._printClassTree", "header": "['module', '___EOS___']", "index": 645 }, { "content": "class autoparsed(type):\n \"\"\"metaclass for dramatically reducing setup syntax for simple hierarchies\"\"\"", "metadata": "root.autoparsed", "header": "['module', '___EOS___']", "index": 660 }, { "content": " def __new__(mcl, classname, bases, classdict):\n\n\n newcls = super(autoparsed, mcl).__new__(mcl, classname, bases, classdict)\n module = __import__( newcls.__module__, globals(), locals(), [''] )\n #print \"autoparsed\", newcls\n\n if issubclass(newcls, Parsed):\n # find the attribute _parser, which holds the parser class for this Parsed type\n parsercls = classdict.get('_parser',None)\n\n\n if isParserClass(parsercls) or ( parsercls is None and '_rules' in classdict):\n\n rules = classdict.get('_rules',None)\n if rules is not None:\n # there's no parser, but there is a set of rules. use this to create a default parser\n if not isIterable(rules):\n raise TypeError, \"_rules attribute must be an iterable list of string rules\"\n\n # first add the rules to the parserdict as attributes, these will be converted to methods, below\n parserdict = {}\n for i, rule in enumerate(rules):\n attrname = 'p_%s_%02d' % ( classname, i+1)\n parserdict[ attrname ] = rule\n else:\n # parser already exists. use it, but use __dict__, not inherited info\n parserdict = parsercls.__dict__\n\n # a dictionary of updates to be made to the parser\n updatedict = {}\n\n # automatically set the start attribute to the name of this class\n if 'start' not in parserdict:\n updatedict['start'] = classname\n\n # gather up all the tokens and rules and store them separately\n tokensDict = {}\n rulesDict = {}\n reservedDict = {}\n accepts_set= set(classdict.get('_accepts', []) )\n\n classNameReg = re.compile('[a-zA-Z][a-zA-Z0-9]*')\n for name, obj in parserdict.items() :\n # print \"class %s has attribute %s\" % (parsercls.__name__, m)\n\n # RULES\n if name.startswith('p_') :\n shortname = name[2:]\n # shorthand syntax: needs to be converted to a function\n if isinstance(obj, basestring) :\n v = obj\n needsWrapping = True\n # regular syntax: already a function\n elif inspect.isfunction(obj) or inspect.ismethod(obj) :\n v = inspect.getdoc(obj)\n needsWrapping = False\n else :\n raise SyntaxError, \"Token definition %s defines neither a string nor a function, unable to parse\" % name\n\n # process the docstring\n accepts = []\n colonSplit = [ x.strip() for x in v.split(':')]\n if len(colonSplit) == 1:\n v = classname + ' : ' + v\n colonSplit = [classname, colonSplit[0] ]\n\n if len(colonSplit) ==2 and colonSplit[0] != '':\n pipeSplit = [ x.strip() for x in colonSplit[1].split('|') ]\n for grp in pipeSplit:\n # be sure to filter out ourselves\n accepts += [ x for x in grp.split() if classNameReg.match(x) and x!=classname ]\n\n # add the classes involved in the rules\n accepts_set.update( accepts )\n\n # create the function\n if needsWrapping:\n def p_func(self, p):\n p[0] = newcls( *p[1:len(p)] )\n p_func.__name__ = name\n p_func.__doc__ = v\n if verbose():\n print \"overwriting %s._parser.%s with yacc function: %r\" % ( classname, name, v)\n updatedict[name] = p_func\n rulesDict[name] = p_func\n # k = m[0][2:]\n # if k in tokensDict :\n # warnings.warn(\"Token %s redefined in Parser %s\" % (k, parser), UserWarning)\n # tokensDict[k] = v\n else:\n rulesDict[name] = obj\n\n # TOKENS\n elif name.startswith('t_') and name != 't_error' :\n shortname = name[2:]\n if isinstance(obj, basestring) :\n v = obj\n elif inspect.isfunction(obj) or inspect.ismethod(obj) :\n v = obj.__doc__\n else :\n raise SyntaxError, \"Token definition %s defines neither a string nor a function, unable to parse\" % name\n tokensDict[name] = obj\n\n if verbose():\n print \"%s accepts: %s\" % (newcls.__name__, list(accepts_set) )\n\n # find bases\n bases = []\n for parsedname in accepts_set:\n try:\n parsedcls = getattr( module, parsedname )\n except AttributeError:\n warnings.warn(\"Could not find a Parsed class %s in module %s. Assuming that it is an custom token.\" % (parsedname, module), UserWarning)\n continue\n\n try:\n parser = parsedcls._parser\n except AttributeError:\n try:\n parser = getattr( module, parsedname + 'Parser' )\n except AttributeError:\n raise SyntaxError, \"Cannot find parser class for parsed class %s. It should be explicitly or automatically created as %s._parser or be named %sParser\" % (parsedname, parsedname, parsedname )\n\n assert isinstance(parser, Parser) or (inspect.isclass(parser) and issubclass(parser, Parser)), '%s._parser is not a subclass of Parser, it is %r' % ( parsedname, parser )\n\n bases.append( parser )\n\n # some of our bases might be subclasses of other bases. we want the smallest list of superclasses, so weed out\n # other classes that are directly dependent on other bases\n newbases = []\n for i in bases:\n issuperclass = False\n #parents = inspect.getmro(i)\n for j in bases:\n if i in inspect.getmro(j)[1:]:\n issuperclass = True\n break\n if not issuperclass:\n newbases.append(i)\n\n newbases = sorted( newbases, key=lambda x: len(inspect.getmro(x)), reverse=True)\n\n #print \"%s bases\" % newcls.__name__\n\n for base in newbases:\n #print base\n #print '\\t', base.tokensDict\n #print '\\t', base.rulesDict\n tokensDict.update( base.tokensDict )\n rulesDict.update( base.rulesDict )\n# if hasattr(base, '_reserved'):\n# reservedDict.update( base._reserved )\n\n updatedict.update( tokensDict )\n updatedict.update( rulesDict )\n\n #for i, parent in enumerate(inspect.getmro(base)):\n # print '\\t'*i, parent\n #print inspect.getclasstree(bases)\n# for base in newbases:\n# _printClassTree( base )\n\n if rules is not None:\n #time to make the parser\n # we use the Rules in the 'accepts' list to determine the bases of this parser class\n\n # TODO : filter out bases that are superclasses of other bases: we only need one set\n\n parserName = classname + 'Parser'\n #newbases = sorted( newbases, key = lambda x: x.__name__)\n\n\n updatedict['tokensDict'] = tokensDict\n updatedict['rulesDict'] = rulesDict\n# updatedict['_reserved'] = reservedDict\n\n parserdict.update( updatedict )\n\n # create parser class\n parsercls = type( parserName, (Parser,), parserdict )\n parsercls.__module__ = module.__name__\n setattr( newcls, '_parser', parsercls)\n else:\n # update the existing parser\n for k, v in updatedict.iteritems():\n setattr( parsercls, k, v )\n\n setattr(newcls, '_accepts', tuple(accepts_set) )\n\n elif issubclass( newcls, Token ):\n # a token subclass defines its regex on the '_token' attr.\n # if this attr is defined, it causes a Parser class to be created for this token, along with\n # a rule, which is named after the class\n token = classdict.get('_token',None)\n if token is None:\n raise TypeError, \"Token classes that use the autoparsed metaclass must define a _token attribute\"\n\n #print \"automatically setting up token class for %s\" % newcls.__name__\n\n tokenBasename = classname + '_Token'\n tokenName = 't_' + tokenBasename\n ruleName = 'p_' + tokenBasename\n parserName = classname + 'Parser'\n\n if hasattr(token, '__name__'):\n #print \"setting token name to %s\" % tokenName\n token.__name__ = tokenName\n\n parserdict = {}\n parserdict[tokenName] = token\n\n tokensDict = {tokenName:token}\n\n# if hasattr(newcls, '_reserved'):\n# print \"adding _reserved to %s\" % parserName\n# parserdict['_reserved'] = newcls._reserved\n\n parserdict['tokensDict'] = tokensDict\n\n\n # the rule is named after the class\n doc = '''%s : %s ''' % ( classname, tokenBasename )\n #class _parser( Parser ): pass\n\n def rule(self, p):\n p[0] = newcls( p[1], pos=p.lexpos(1))\n rule.__name__ = ruleName\n rule.__doc__ = doc\n parserdict[ruleName] = rule\n parserdict['rulesDict'] = {ruleName:rule}\n\n # create the Parser class\n print \"creating parser %s\" % parserName\n parsercls = type( parserName, (Parser,), parserdict )\n parsercls.__module__ = module.__name__\n #setattr( _parser, tokenName, token )\n #setattr( _parser, ruleName, rule )\n setattr( newcls, '_parser', parsercls )\n\n\n return newcls", "metadata": "root.autoparsed.__new__", "header": "['class', 'autoparsed', '(', 'type', ')', ':', '___EOS___']", "index": 662 }, { "content": "def _getTokenPatterns(parsercls):\n tokensDict={}\n for name, obj in parsercls.__dict__.items() :\n # print \"class %s has attribute %s\" % (parsercls.__name__, m)\n if name.startswith('t_') and name != 't_error' :\n # strip off 't_'\n k = name[2:]\n if isinstance(obj, basestring) :\n v = obj\n elif inspect.isfunction(obj) or inspect.ismethod(obj) :\n v = obj.__doc__\n else :\n raise SyntaxError, \"Token definition %s defines neither a string nor a function, unable to parse\" % name\n k = name[2:]\n if k in tokensDict :\n warnings.warn(\"Token %s redefined in Parser %s\" % (k, parser), UserWarning)\n tokensDict[k] = v\n return tokensDict", "metadata": "root._getTokenPatterns", "header": "['module', '___EOS___']", "index": 905 }, { "content": "def process(module=None):\n \"\"\"cache out a dictionary of all Parsed and Parser classes, and create token classes\"\"\"\n if module:\n # User supplied a module object.\n if isinstance(module, types.ModuleType):\n module_dict = module.__dict__\n# elif isinstance(module, _INSTANCETYPE):\n# _items = [(k,getattr(module,k)) for k in dir(module)]\n# ldict = { }\n# for i in _items:\n# ldict[i[0]] = i[1]\n else:\n raise ValueError,\"Expected a module\"\n\n else:\n # No module given. We might be able to get information from the caller.\n # Throw an exception and unwind the traceback to get the globals\n\n try:\n raise RuntimeError\n except RuntimeError:\n e,b,t = sys.exc_info()\n f = t.tb_frame\n f = f.f_back # Walk out to our calling function\n module_dict = f.f_globals # Grab its globals dictionary\n\n #_createTokenClasses(ldict, debug=verbose() )\n\n parserDict = {}\n parsedDict = {}\n tokensDict = {}\n\n # gather up all tokens, parsers, and parsed\n for name, obj in module_dict.iteritems():\n if isParserClass(obj):\n parserDict[name]=obj\n tokensDict.update( _getTokenPatterns(obj) )\n\n\n # find Parsers that are stored on Parsed classes as _parser\n elif isParsedClass(obj):\n parsedDict[name]=obj\n if hasattr(obj, '_parser'):\n if isParserClass(obj._parser):\n tokensDict.update( _getTokenPatterns(obj._parser) )\n\n for token in tokensDict :\n pattern = tokensDict[token]\n parsedName = token\n parserName = token+\"Parser\"\n\n\n if verbose() :\n print \"adding class %s for token %s of pattern r'%s'\" % (parserName, token, pattern)\n\n class ThisTokenParser(TokenParser):\n \"\"\" Token Parser stub class \"\"\"\n # set the Token Parser class attributes\n ThisTokenParser.__name__ = parserName\n #ThisTokenParser.__doc__ = \"Parser for token %s=%r\" % (token, pattern)\n ThisTokenParser.__module__ = __name__\n ThisTokenParser._pattern = pattern\n ThisTokenParser._type = token\n # add to the module\n module_dict[parserName] = ThisTokenParser\n parserDict[parserName] = ThisTokenParser\n\n if verbose() :\n print \"adding class %s for token %s of pattern r'%s'\" % (parsedName, token, pattern)\n\n class ThisToken(Token):\n \"\"\" Token stub class \"\"\"\n # set the Token class attributes\n ThisToken.__name__ = parsedName\n # ThisToken.__doc__ = \"Parser for token %s=%r\" % (token, pattern)\n ThisToken.__module__ = __name__\n ThisToken._parser = ThisTokenParser\n # add to the module\n module_dict[parsedName] = ThisToken\n parsedDict[parsedName] = ThisToken\n\n\n Parser.classes = parserDict\n Parsed.classes = parsedDict", "metadata": "root.process", "header": "['module', '___EOS___']", "index": 949 } ]
[ { "span": "import re, inspect, sys, os, tempfile", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 37 }, { "span": "from common import capitalize, uncapitalize", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 43 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "..", " ", "class", "tree", "::", " ", "Pro", "xy", "Uni", "\\", "10", ";", "\\", "10", ";", "..", " ", "dot", "graph", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "main", " ", "->", " ", "parse", " ", "->", " ", "execute", ";", "\\", "10", ";", " ", " ", " ", " ", "main", " ", "->", " ", "init", ";", "\\", "10", ";", " ", " ", " ", " ", "main", " ", "->", " ", "clean", "up", ";", "\\", "10", ";", " ", " ", " ", " ", "execute", " ", "->", " ", "make", "\\u", "string", ";", "\\", "10", ";", " ", " ", " ", " ", "execute", " ", "->", " ", "printf", "\\", "10", ";", " ", " ", " ", " ", "init", " ", "->", " ", "make", "\\u", "string", ";", "\\", "10", ";", " ", " ", " ", " ", "main", " ", "->", " ", "printf", ";", "\\", "10", ";", " ", " ", " ", " ", "execute", " ", "->", " ", "compare", ";", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", ",_", "inspect_", ",_", "sys_", ",_", "os_", ",_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "external_", "._", "ply_", "._", "lex_", "as_", "lex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "external_", "._", "ply_", "._", "yac", "c_", "as_", "yac", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "ply_", "._", "lex_", "as_", "lex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ply_", "._", "yac", "c_", "as_", "yac", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "namedtupl", "e", " ", "import", " ", "namedtuple_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "common_", "import_", "capitalize_", ",_", "unca", "pit", "alize", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "arguments_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utility", "types_", "import_", "*_", "\\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_", "#", " ", "increase", " ", "from", " ", "0", " ", "to", " ", "1", " ", "or", " ", "2", " ", "for", " ", "more", " ", "debug", " ", "feedback_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Pro", "xy", "Uni", "_", "=_", "proxy", "Class_", "(_", "unicode_", ",_", "'", "Pro", "xy", "Uni", "'_", ",_", "module_", "=_", "\\u\\u", "name\\u\\u_", ",_", "data", "Func", "Name_", "=_", "'", "compile", "Name", "'_", ",_", "remove_", "=_", "[_", "'\\u", "\\u", "getitem", "\\u\\u'_", ",_", "'\\u", "\\u", "doc", "\\u\\u'_", "]_", ")_", "#", " ", "200", "9", " ", "Beta", " ", "2.1", " ", "has", " ", "issue", "s", " ", "with", " ", "passi", "ng", " ", "classe", "s", " ", "with", " ", "\\u\\u", "getitem\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "parsed", " ", "object", "s", ",", " ", "Token", " ", "or", " ", "upper", " ", "level", " ", "construct", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Parser", "s", ",", " ", "all", " ", "parser", " ", "must", " ", "derive", " ", "from", " ", "the", " ", "Parser", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "token", " ", "parser", ",", " ", "can", " ", "direct", "ly", " ", "use", " ", "re_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "special", " ", "purpose", " ", "empty", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "derive", "d", " ", "Token", "Parser", " ", "classe", "s", " ", "will", " ", "be", " ", "bui", "lt", " ", "for", " ", "every", " ", "token", " ", "definit", "ion", " ", "detect", "ed", " ", "in", " ", "Parser", " ", "classe", "s", " ", "in", " ", "this", " ", "module_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "do", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#\\u", "adde", "d", "Token", "Class", "es", " ", "=", "\\u", "create", "Token", "Class", "es", "(", "debug", "=", "verbo", "se", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "a", " ", "dict", " ", "of", " ", "all", " ", "exist", "ing", " ", "Parser", " ", "and", " ", "Pars", "ed", " ", "classe", "s", " ", "in", " ", "this", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", "class", " ", "Pars", "ed", ".", "classe", "s", "(", "dict", ")", " ", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u\\u", "metaclass", "\\u\\u", " ", "=", " ", " ", "meta", "Static", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "parsed", "Class", "es", "(", "module", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "dict", "(", "inspect", ".", "getmember", "s", "(", "module", ",", " ", "is", "Pars", "ed", "Class", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Stor", "es", " ", "it", " ", "at", " ", "import", " ", "so", " ", "tha", "t", " ", "the", " ", "inspect", " ", "method", " ", "isn", "'", "t", " ", "reca", "lle", "d", " ", "at", " ", "each", " ", "query_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Pars", "ed", ".", "classe", "s", "(", "Pars", "ed", ".", "classe", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "class", " ", "Parser", ".", "classe", "s", "(", "dict", ")", " ", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u\\u", "metaclass", "\\u\\u", " ", "=", " ", " ", "meta", "Static", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Pars", "ed_", "._", "classes_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Parser_", "._", "classes_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "parser", "Class", "es", "(", "module", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "dict", "(", "inspect", ".", "getmember", "s", "(", "module", ",", " ", "is", "Parser", "Class", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Stor", "es", " ", "it", " ", "at", " ", "import", " ", "so", " ", "tha", "t", " ", "the", " ", "inspect", " ", "method", " ", "isn", "'", "t", " ", "reca", "lle", "d", " ", "at", " ", "each", " ", "query_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Parser", ".", "classe", "s", "(", "Parser", ".", "classe", "s", ")_", "\\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_", "verbose_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "current", "fn_", "(_", ")_", ":_", "\\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_", "sys_", "._", "\\u", "getframe_", "(_", "1_", ")_", "._", "f", "\\u", "code_", "._", "co", "\\u", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Name", "Pars", "e", "Error_", "(_", "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_", "class_", "Pars", "ing", "Warning_", "(_", "User", "Warning_", ")_", ":_", "\\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_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "parser_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "accepts", "_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "classes_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "class", " ", "Pars", "ed", "(", "unicode", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u", "parser", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u", "accepts", " ", "=", " ", "()", "_", "\\u\\u\\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_", "#", " ", "init", " ", "class", " ", "attribute", "s", ",", " ", "all", " ", "object", "s", " ", "of", " ", "a", " ", "Pars", "ed", " ", "class", " ", "share", " ", "the", " ", "same", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", ":", " ", "check", " ", "if", " ", "it", " ", "can", " ", "be", " ", "a", " ", "problem", " ", "with", " ", "multit", "hread", "ing", " ", "?", " ", "In", " ", "tha", "t", " ", "case", " ", "we", "'", "ll", " ", "need", " ", "a", " ", "parser", " ", "per", " ", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "instance", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "accepts", "_", "(_", "cls_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Check", "s", " ", "if", " ", "this", " ", "Pars", "ed", " ", "class", " ", "can", " ", "accept", " ", "anot", "her", " ", "object", " ", "as", " ", "a", " ", "subpar", "t", " ", "with", "out", " ", "repar", "sing", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "other_", ",_", "Pars", "ed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "cls_", "._", "\\u", "accepts", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "t_", "==_", "other_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "compile", "Name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newname_", "=_", "u", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "part", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Parts_", "(_", "obj_", ",_", "newname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "obj_", "._", "parts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "repr", "(", "x", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "newname_", "=_", "get", "Parts_", "(_", "x_", ",_", "newname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "DEAD", "\",", " ", "repr", "(", "obj", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newname_", "+=_", "unicode_", "(_", "obj_", "._", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "newname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "name_", "=_", "get", "Parts_", "(_", "self_", ",_", "newname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Parser", "Class_", "(_", "cls_", ",_", "parser", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\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_", "class", "parser", "build_", "(_", "cls_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Ini", "ts", " ", "class", " ", "Parser", ",", " ", "all", " ", "instance", "s", " ", "of", " ", "a", " ", "Pars", "ed", " ", "class", " ", "share", " ", "the", " ", "same", " ", "yac", "c", " ", "parser", " ", "object", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cls", "name_", "=_", "cls_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "class", " ", "declaration", " ", "speci", "fie", "s", " ", "a", " ", "parser", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "cls_", "._", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "default", " ", "rule_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser", "name_", "=_", "cls_", "._", "\\u\\u", "name\\u\\u_", "+_", "\"", "Parser", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "Parser_", "._", "classes_", "._", "get_", "(_", "parser", "name_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "parser_", "=_", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "\"", "coul", "d", " ", "not", " ", "read", " ", "'\\u", "parser", "'", " ", "for", " ", "%", "s", ",", " ", "buildi", "ng", " ", "Parser", " ", "name", " ", "%", "s", " ", "from", " ", "Pars", "ed", " ", "class", " ", "name", " ", "%", "s", "\"_", "%_", "(_", "cls_", ",_", "parser", "name_", ",_", "cls", "name_", ")_", ",_", "User", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "parser_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "parser", " ", "hasn", "'", "t", " ", "bee", "n", " ", "bui", "lt", " ", "ye", "t", ",", " ", "build", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "parser_", ",_", "Parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parser", " ", "is", " ", "a", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "inspect_", "._", "iscl", "ass_", "(_", "parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parser", "name_", "=_", "parser_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "issubclass_", "(_", "parser_", ",_", "Parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Value", "Error_", ",_", "\"", "Parser", " ", "%", "s", " ", "specified", " ", "in", " ", "Pars", "ed", " ", "class", " ", "%", "s", " ", "is", " ", "not", " ", "a", " ", "Parser", " ", "class", "\"_", "%_", "(_", "parser", "name_", ",_", "cls_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parser", " ", "is", " ", "a", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "parser_", "in_", "Parser_", "._", "classes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parser", "name_", "=_", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "Parser_", "._", "classes_", "[_", "parser", "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 ", " ", "_", "raise_", "Value", "Error_", ",_", "\"", "Inva", "lid", " ", "Parser", " ", "specifica", "tion", " ", "%", "r", " ", "in", " ", "Pars", "ed", " ", "class", " ", "%", "s", "\"_", "%_", "(_", "parser_", ",_", "cls_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "class", " ", "Parser", ",", " ", "replace", " ", "class", " ", "\\u", "parser", " ", "by", " ", "the", " ", "Parser", " ", "instance", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "\"", "Building", " ", "parser", " ", "instance", " ", "of", " ", "Parser", " ", "%", "s", " ", "for", " ", "Pars", "ed", " ", "class", ":", " ", "%", "s", "\"", " ", "%", " ", "(", "parser", ",", " ", "cls", ".\\u", "\\u", "name", "\\u\\u)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "replace", " ", "\\u", "parser", " ", "attribute", " ", "(", "whi", "ch", " ", "hel", "d", " ", "a", " ", "Parser", " ", "class", " ", "or", " ", "class", "name", ")", " ", "with", " ", "parser", " ", "class", " ", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cls_", "._", "\\u", "parser_", "=_", "parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "parser_", "._", "build_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "cls", ".\\u", "parser_", "\\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_", "Type", "Error_", ",_", "\"", "Pars", "ed", " ", "class", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "defin", "e", " ", "a", " ", "parser", ",", " ", "check", " ", "declaration", "s", "\"_", "%_", "cls_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\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_", "class", "parse_", "(_", "cls_", ",_", "data_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls", "name_", "=_", "cls_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "unicode_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "=_", "kwargs_", "._", "get_", "(_", "'", "debug", "'_", ",_", "verbose_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errmsg_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "Call", "ing", " ", "parser", " ", "%", "s", " ", "with", " ", "debug", " ", "%", "s", "\"", " ", "%", " ", "(", "cls", ".", "class", "parser", "()", ",", " ", "debug", ")_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "cls_", "._", "class", "parser_", "(_", ")_", "._", "parse_", "(_", "data_", ",_", "debug_", "=_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cls_", "._", "class", "parser_", "(_", ")_", "._", "error", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "use", " ", "error", " ", "or", " ", "warn", "ing", " ", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errmsg_", "=_", "\"", "cann", "ot", " ", "parse", " ", "'%", "s", "'", " ", "to", " ", "a", " ", "valid", " ", "%", "s", ",", " ", "%", "d", " ", "parser", " ", "error", "s", "\"_", "%_", "(_", "data_", ",_", "cls", "name_", ",_", "cls_", "._", "class", "parser_", "(_", ")_", "._", "error", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "Valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "isinstance_", "(_", "result_", ",_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parse", " ", "success", "ful", " ", "but", " ", "return", "ed", " ", "a", " ", "different", " ", "class", " ", "than", " ", "exec", "ted_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errmsg_", "=_", "\"", "pars", "ing", " ", "'%", "s", "'", " ", "is", " ", "valid", ",", " ", "but", " ", "as", " ", "a", " ", "%", "s", " ", "Pars", "ed", " ", "object", ",", " ", "and", " ", "not", " ", "as", " ", "a", " ", "%", "s", " ", "Pars", "ed", " ", "object", " ", "as", " ", "it", " ", "was", " ", "parsed", " ", "against", "\"_", "%_", "(_", "data_", ",_", "result_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "cls", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "Valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "result_", "==_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "shou", "ld", " ", "return", " ", "a", " ", "Pars", "ed", " ", "object", " ", "with", " ", "the", " ", "same", " ", "string", " ", "value", " ", "as", " ", "the", " ", "parsed", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errmsg_", "=_", "\"", "pars", "ing", " ", "'%", "s", "'", " ", "raise", "d", " ", "no", " ", "error", ",", " ", "but", " ", "the", " ", "result", "ing", " ", "name", " ", "is", " ", "%", "s", " ", "is", " ", "different", " ", "from", " ", "the", " ", "nput", " ", "string", " ", "%", "s", " ", "\"_", "%_", "(_", "result_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "Valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parse", " ", "successful_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "Valid_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "error", " ", "in", " ", "pars", "ing", " ", "and", " ", "correct", " ", "and", " ", "raise", " ", "a", " ", "warn", "ing", " ", "or", " ", "raise", " ", "an", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", ":", " ", "corrections", " ", "and", " ", "error", " ", "handling", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "is", "Valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "can", " ", "try", " ", "to", " ", "auto", "-", "correct", " ", "some", " ", "bad", "ly", " ", "formed", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Name", "Pars", "e", "Error_", ",_", "errmsg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "position", " ", "is", " ", "set", " ", "to", " ", "position", " ", "of", " ", "first", " ", "found", " ", "Pars", "ed", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "result_", "._", "sub_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "\\u", "pos_", "=_", "result_", "._", "sub_", "[_", "0_", "]_", "._", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "\\u", "pos_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "._", "\\u", "valid_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\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_", "class", "parser_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "parser", " ", "object", " ", "for", " ", "tha", "t", " ", "class", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "._", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "data_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "class", "parse_", "(_", "data_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\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_", "parser_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "parser", " ", "object", " ", "for", " ", "tha", "t", " ", "class", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "class", "parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tokens_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "iterate", "s", " ", "self", " ", "as", " ", "leaf", " ", "level", " ", "lex", "ed", " ", "token", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "expand", "Args_", "(_", "self_", "._", "\\u", "sub_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "i_", ",_", "Token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\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_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sub_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Intern", "ally", " ", "store", "d", " ", "pars", "ing", " ", "data", " ", "for", " ", "this", " ", "Pars", "ed", " ", "object", " ", "sub", " ", "part", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "sub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Sub", "Item_", "(_", "self_", ",_", "index_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Change", " ", "the", " ", "value", " ", "of", " ", "one", " ", "of", " ", "the", " ", "Pars", "ed", " ", "sub", " ", "part", "s", ".", " ", " ", "The", " ", "new", " ", "value", " ", "will", " ", "first", " ", "be", " ", "parsed", " ", "as", " ", "the", " ", "same", "\\", "10", ";", " ", " ", " ", " ", "type", " ", "as", " ", "it", " ", "is", " ", "repla", "cing", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "=_", "self_", "._", "\\u", "sub_", "[_", "index_", "]_", "._", "\\u\\u", "class\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sublist_", "=_", "list_", "(_", "self_", "._", "\\u", "sub_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sublist_", "[_", "index_", "]_", "=_", "cls_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "sub_", "=_", "tuple_", "(_", "sublist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\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_", "pos_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "position", " ", "of", " ", "tha", "t", " ", "Pars", "ed", " ", "object", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Valid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Valid", "it", "y", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "valid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "copy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "an", " ", "new", " ", "independent", " ", "copy", " ", "of", " ", "the", " ", "parsed", " ", "object", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "self_", "._", "\\u", "sub_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "Type_", "(_", "self_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "self_", "._", "sub_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "x_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "._", "append_", "(_", "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 ", " _", "res_", "+=_", "x_", "._", "find", "Type_", "(_", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "new\\u\\u_", "(_", "cls_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Creat", "ion", " ", "of", " ", "a", " ", "Pars", "ed", " ", "object", " ", "from", " ", "a", " ", "Lex", "Token", ",", " ", "other", " ", "Pars", "ed", " ", "of", " ", "compatible", " ", "type", " ", "or", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", " ", "string", " ", "is", " ", "pass", "ed", " ", "it", " ", "will", " ", "be", " ", "parsed", " ", "and", " ", "checke", "d", " ", "for", " ", "compatibility", " ", "with", " ", "this", " ", "Pars", "ed", " ", "type", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "kwargs_", "._", "get_", "(_", "'", "debug", "'_", ",_", "verbose_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "type", " ", "checking", "_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "args_", "[_", "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 ", " _", "data_", "=_", "tuple_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "some", " ", "data", " ", "(", "whe", "n", " ", "initiali", "zin", "g", " ", "from", " ", "single", " ", "arg", ")", " ", "can", " ", "defin", "e", " ", "the", " ", "type", " ", "of", " ", "Pars", "ed", " ", "object", " ", "to", " ", "be", " ", "created_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ptype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "only", " ", "authoriz", "e", " ", "Emp", "ty", " ", "to", " ", "be", " ", "bui", "lt", " ", "with", "out", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ptype_", "=_", "'", "Emp", "ty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "data_", ",_", "lex_", "._", "Lex", "Token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ptype_", "=_", "kwargs_", "._", "get_", "(_", "'", "type", "'_", ",_", "data_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "data_", ",_", "Pars", "ed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ptype_", "=_", "data_", "._", "\\u\\u", "class\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "can", " ", "override", " ", "type", " ", "with", " ", "the", " ", "keyw", "ord", " ", "'", "type", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ptype_", "=_", "kwargs_", "._", "get_", "(_", "'", "type", "'_", ",_", "ptype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "cls_", "is_", "Pars", "ed_", "or_", "cls_", "is_", "Token_", ")_", ":_", "#", "issu", "bc", "lass", "(", "cls", ",", " ", "Token", ")", " ", "):", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ptype_", "is_", "not_", "None_", ":_", "\\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_", "\"\\u\\u", "new", "\\u\\u", " ", "call", "ed", " ", "on", " ", "Pars", "ed", "/", "Token", " ", "%", "s", " ", "with", " ", "type", " ", "%", "r", "\"_", "%_", "(_", "cls_", "._", "\\u\\u", "name\\u\\u_", ",_", "ptype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "newc", "ls_", "=_", "Pars", "ed_", "._", "classes_", "._", "get_", "(_", "ptype_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "can", " ", "only", " ", "speci", "fy", " ", "an", " ", "exist", "ing", " ", "subclass", " ", "of", " ", "cls_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "newc", "ls_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Type", "Error_", ",_", "\"", "Type", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "correspond", " ", "to", " ", "any", " ", "exist", "ing", " ", "Pars", "ed", " ", "sub", "-", "class", " ", "(%", "s", " ", "doe", "s", " ", "not", " ", "exist", ")\"_", "%_", "(_", "ptype_", ",_", "cls_", "._", "\\u\\u", "name\\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 ", " ", "_", "cls", "name_", "=_", "newc", "ls_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "issubclass_", "(_", "newc", "ls_", ",_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Type", "Error_", ",_", "\"", "Type", " ", "%", "s", " ", "wou", "ld", " ", "create", " ", "a", " ", "class", " ", "%", "s", " ", "tha", "t", " ", "is", " ", "not", " ", "a", " ", "sub", "-", "class", " ", "of", " ", "the", " ", "class", " ", "%", "s", " ", "tha", "t", " ", "\\u\\u", "new", "\\u\\u", " ", "was", " ", "call", "ed", " ", "on", "\"_", "%_", "(_", "ptype_", ",_", "cls", "name_", ",_", "cls_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", ",_", "\"", "Class", " ", "%", "s", " ", "is", " ", "an", " ", "abstract", " ", "class", " ", "and", " ", "can", "'", "t", " ", "be", " ", "created", " ", "direct", "ly", ",", " ", "you", " ", "must", " ", "speci", "fy", " ", "a", " ", "valid", " ", "sub", "-", "type", "\"_", "%_", "(_", "cls_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "verbose_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\u\\u", "new", "\\u\\u", " ", "call", "ed", " ", "on", " ", "explicit", " ", "class", " ", "%", "s", "\"_", "%_", "(_", "cls_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cls", "name_", "=_", "cls_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newc", "ls_", "=_", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "\"", "Creat", "ing", " ", "new", " ", "instance", " ", "of", " ", "Pars", "ed", " ", "class", ":", " ", "%", "r", "\"", " ", "%", " ", "newc", "ls_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "process", " ", "argu", "ment", "s", " ", "and", " ", "build", ",", " ", "check", " ", "argu", "ment", "s", " ", "compatibility", " ", "with", " ", "tha", "t", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pos_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "debug", " ", ":", " ", "print", " ", "\"", "VALU", "E1", "\",", " ", "value", ",", " ", "repr", "(", "value", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "special", " ", "case", " ", "for", " ", "Lex", "Token_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "data_", ",_", "lex_", "._", "Lex", "Token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issubclass_", "(_", "newc", "ls_", ",_", "Token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "from", " ", "a", " ", "unique", " ", "lex", " ", "Token", ",", " ", "do", " ", "not", " ", "check", " ", "if", " ", "als", "o", " ", "creati", "ng", " ", "a", " ", "Token_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "data_", "._", "lex", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "data_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "build", " ", "a", " ", "Token", " ", "from", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "Token_", "(_", "data_", "._", "value_", ",_", "ptype_", "=_", "data_", "._", "type_", ",_", "pos_", "=_", "data_", "._", "pos_", ")_", "\\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_", "data_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Token", "s", " ", "can", " ", "have", " ", "default", " ", "value", " ", "to", " ", "allow", " ", "initialization", " ", "with", "out", " ", "arguments_", "\\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 ", " _", "value_", "=_", "newc", "ls_", "._", "default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "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 ", " _", "valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "data_", ",_", "newc", "ls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "debug", " ", ":", " ", "print", " ", "\"", "IS", " ", "INSTANCE", "\",", " ", "data", ",", " ", "repr", "(", "data", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "a", " ", "similar", " ", "class", ",", " ", "copy", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub_", "=_", "data_", "._", "sub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "data_", "._", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "data_", "._", "is", "Valid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "unicode_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "newc", "ls_", "._", "accepts", "_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "debug", " ", ":", " ", "print", " ", "\"", "ACCEPT", "S", "\",", " ", "data", ",", " ", "repr", "(", "data", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "a", " ", "compatible", " ", "Pars", "ed", " ", "sub", " ", "class", ",", " ", "build", " ", "the", " ", "sub", " ", "list", " ", "from", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub_", "._", "append_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "data_", "._", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "data_", "._", "is", "Valid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "unicode_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "Sequence_", "(_", "data_", ")_", "and_", "not_", "isinstance_", "(_", "data_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "buildi", "ng", " ", "from", " ", "sub", " ", "part", "s", ",", " ", "must", " ", "be", " ", "of", " ", "the", " ", "same", " ", "type", " ", "and", " ", "in", " ", "class", " ", "\\u", "accepts", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", ":", " ", "use", " ", "yac", "c", " ", "own", " ", "rule", "s", " ", "for", " ", "accepts", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "valid_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "arg_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "convert", "s", " ", "Lex", "Token", "s", " ", "direct", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "arg_", ",_", "lex_", "._", "Lex", "Token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "a_", "=_", "Token_", "(_", "arg_", "._", "value_", ",_", "ptype_", "=_", "arg_", "._", "type_", ",_", "pos_", "=_", "data_", "._", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "a_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "check", " ", "if", " ", "it", "'", "s", " ", "a", " ", "suit", "able", " ", "sub", "-", "part", " ", "or", " ", "derive", "d", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "a_", ",_", "newc", "ls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sub_", "+=_", "a_", "._", "sub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "newc", "ls_", "._", "accepts", "_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sub_", "._", "append_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "valid_", "=_", "False_", "\\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_", "value_", "=_", "u", "\"\"_", "._", "join_", "(_", "map_", "(_", "unicode_", ",_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pos_", "=_", "sub_", "[_", "0_", "]_", "._", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sub_", "=_", "[_", "]_", "\\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 ", " _", "value_", "=_", "''_", "\\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_", "debug_", ":_", "print_", "\"", "REP", "AR", "SE", "\"_", ",_", "data_", ",_", "repr_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "repar", "se", " ", "unl", "ess", " ", "it", "'", "s", " ", "a", " ", "Token", " ", "we", " ", "alr", "ead", "y", " ", "know", " ", "the", " ", "type", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "value_", "=_", "unicode_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "issubclass_", "(_", "newc", "ls_", ",_", "Token_", ")_", "and_", "newc", "ls_", "is_", "not_", "Token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "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 ", " _", "valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parse", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "No", " ", "repar", "sing", " ", "necessar", "y", " ", "for", " ", "a", " ", "result", "ing", " ", "value", " ", "%", "s", " ", "(%", "r", ")\"", " ", "%", " ", "(", "value", ",", " ", "value", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str", "value_", "=_", "unicode_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "value_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"%", "s", ":", " ", "Wil", "l", " ", "need", " ", "to", " ", "repar", "se", " ", "value", " ", "%", "r", "\"_", "%_", "(_", "cls", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "newc", "ls_", "._", "class", "parser", "build_", "(_", "debug_", "=_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug_", ":_", "print_", "\"", "VALU", "E", "\"_", ",_", "value_", ",_", "type_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "newc", "ls_", "._", "class", "parse_", "(_", "value_", ",_", "debug_", "=_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug_", ":_", "print_", "\"", "RESU", "LT", "\"_", ",_", "result_", ",_", "type_", "(_", "result_", ")_", ",_", "isinstance_", "(_", "result_", ",_", "newc", "ls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "is_", "not_", "None_", "and_", "isinstance_", "(_", "result_", ",_", "newc", "ls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str", "value_", "=_", "unicode_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "result_", "._", "\\u", "valid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub_", "=_", "result_", "._", "\\u", "sub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "result_", "._", "\\u", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug_", ":_", "print_", "\"", "SUB", "\"_", ",_", "sub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str", "value_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", ",_", "\"", "invalid", " ", "argu", "ment", "(", "s", ")", " ", "%", "r", ",", " ", "cann", "ot", " ", "be", " ", "parsed", " ", "to", " ", "create", " ", "a", " ", "Pars", "ed", " ", "object", " ", "of", " ", "type", " ", "%", "s", "\"_", "%_", "(_", "value_", ",_", "cls", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "unicode", " ", "object", " ", "with", " ", "appropr", "iate", " ", "string", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newo", "bj_", "=_", "super_", "(_", "Pars", "ed_", ",_", "cls_", ")_", "._", "\\u\\u", "new\\u\\u_", "(_", "newc", "ls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newo", "bj_", "._", "\\u", "name_", "=_", "str", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "debug", ":", " ", "print", " ", "\"", "NAME", "\",", " ", "newo", "bj", ",", " ", "type", "(", "newo", "bj", "),", " ", "sub", "#", ",", " ", "inspect", ".", "getm", "ro", "(", "newo", "bj", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "instance", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "newo", "bj_", "._", "\\u", "sub_", "=_", "tuple_", "(_", "sub_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newo", "bj_", "._", "\\u", "valid_", "=_", "valid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "override", " ", "for", " ", "pos_", "\\u\\u\\uNL\\u\\u\\u_", "pos_", "=_", "kwargs_", "._", "get_", "(_", "'", "pos", "'_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pos_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "+=_", "kwargs_", "._", "get_", "(_", "'", "offset", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pos_", "is_", "None_", "or_", "(_", "isinstance_", "(_", "pos_", ",_", "int_", ")_", "and_", "pos_", ">=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newo", "bj_", "._", "\\u", "pos_", "=_", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "\"", "A", " ", "Pars", "ed", " ", "pos", " ", "can", " ", "only", " ", "be", " ", "Non", "e", " ", "or", " ", "an", " ", "unsigned", " ", "int", ",", " ", "%", "r", " ", "invalid", "\"_", "%_", "pos_", "\\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_", "newo", "bj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "add\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "p1", ".\\u", "\\u", "add", "\\u\\u", "(", "p2", ")", " ", "<=", "=>", " ", "p1", "+", "p2", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "p1", " ", "and", " ", "p2", " ", "are", " ", "of", " ", "the", " ", "same", " ", "Pars", "ed", " ", "type", ",", " ", "it", "'", "s", " ", "equivalent", " ", "to", " ", "repar", "sing", " ", "str", "(", "p1", ")", " ", "+", " ", "str", "(", "p2", ")", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "p2", " ", "is", " ", "an", " ", "accept", "ed", " ", "sub", " ", "part", " ", "of", " ", "p1", ",", " ", "it", " ", "adds", " ", "it", " ", "to", " ", "the", " ", "sub", "-", "part", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "Pars", "ed", " ", "\\u", "accepts", " ", "defin", "es", " ", "validity_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", ":", " ", "use", " ", "yac", "c", " ", "own", " ", "rule", "s", " ", "to", " ", "check", " ", "valid", "it", "y", " ", "with", "out", " ", "a", " ", "full", " ", "repar", "se_", "\\u\\u\\uNL\\u\\u\\u_", "cls_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self", "valid_", "=_", "self_", "._", "is", "Valid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sublist_", "=_", "list_", "(_", "self_", "._", "sub_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "unicode_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "other", "'", "s", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "other_", ",_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "valid_", "=_", "other_", "._", "is", "Valid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sublist_", "+=_", "other_", "._", "sub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "accepts", "_", "(_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "valid_", "=_", "other_", "._", "is", "Valid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sublist_", "._", "append_", "(_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "other_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", ",_", "\"", "cann", "ot", " ", "add", " ", "%", "s", " ", "and", " ", "%", "s", "\"_", "%_", "(_", "type_", "(_", "self_", ")_", ",_", "type_", "(_", "other_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self", "valid_", "and_", "other", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "repar", "se_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "cls_", "(_", "*_", "sublist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "repar", "se_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "cls_", "(_", "unicode_", "(_", "self_", ")_", "+_", "unicode_", "(_", "other_", ")_", ")_", "\\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_", "Pars", "ed_", "(_", "Pro", "xy", "Uni", "_", ")_", ":_", "\\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_", "u", "\"%", "s", "('", "%", "s", "',", " ", "%", "s", ")\"_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "self_", ",_", "self_", "._", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Abstract", " ", "Base", " ", "class", " ", "for", " ", "all", " ", "name", " ", "parser", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "classes_", "=_", "{_", "}_", "\\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\\uNL\\u\\u\\u_", "\\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_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "new\\u\\u_", "(_", "cls_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "class", " ", "is", " ", "an", " ", "abstract", " ", "base", " ", "class", " ", "for", " ", "all", " ", "Parser", " ", "classe", "s", ",", " ", "cann", "ot", " ", "be", " ", "bui", "lt", " ", "direct", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cls_", "is_", "Parser_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "type", " ", "argu", "ment", " ", "can", " ", "be", " ", "the", " ", "name", " ", "of", " ", "a", " ", "Parser", " ", "class", " ", "or", " ", "an", " ", "instance", " ", "of", " ", "the", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ptype_", "=_", "kwargs_", "._", "get_", "(_", "'", "type", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ptype_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", ",_", "\"", "must", " ", "speci", "fy", " ", "a", " ", "Parser", " ", "class", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "ptype_", ",_", "Parser_", ")_", "and_", "not_", "ptype_", "is_", "Parser_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser", "cls_", "=_", "ptype_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ptype_", "in_", "Parser_", "._", "classes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser", "cls_", "=_", "Parser_", "._", "classes_", "[_", "ptype_", "]_", "\\u\\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", " ", "Parser", " ", "type", ":", " ", "%", "s", "\"_", "%_", "ptype_", "\\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_", "#", " ", "subclasses", " ", "of", " ", "Parser_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser", "cls_", "=_", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "'", "token", "s", "Dict", "'", " ", "in", " ", "parser", "cls", ".\\u", "\\u", "dict", "\\u\\u", " ", "and", " ", "'", "rule", "s", "Dict", "'", " ", "in", " ", "parser", "cls", ".\\u", "\\u", "dict", "\\u\\u:", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "rule", "s", "Dict", " ", "=", " ", "parser", "cls", ".", "rule", "s", "Dict_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "token", "s", "Dict", " ", "=", " ", "parser", "cls", ".", "token", "s", "Dict_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reserved_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "#", "reserve", "d", " ", "=", " ", "[", " ", "k", " ", "for", " ", "k", ",", "v", " ", "in", " ", "parser", "cls", ".", "token", "s", "Dict", ".", "items", "()", " ", "if", " ", "not", " ", "k", ".", "startswith", "(", " ", "'", "t", "\\u", "')", " ", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "has", "attr", "(", " ", "parser", "cls", ",", " ", "'\\u", "reserve", "d", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "k", ",", " ", "v", " ", "in", " ", "parser", "cls", ".\\u", "reserve", "d", ".", "items", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "reserve", "d", " ", "shou", "ld", " ", "be", " ", "a", " ", "map", " ", "of", " ", "reserve", "d", " ", "names", " ", "(", "as", " ", "used", " ", "in", " ", "the", " ", "code", " ", "to", " ", "parse", ")", " ", "to", " ", "token", " ", "names", " ", "(", "as", " ", "used", " ", "in", " ", "PL", "Y", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "as", " ", "suc", "h", ",", " ", "we", " ", "only", " ", "care", " ", "abo", "ut", " ", "the", " ", "PL", "Y", " ", "names", ",", " ", "ie", ".", " ", "the", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "reserve", "d", ".", "append", "(", "v", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rule", "s", "Dict_", ",_", "token", "s", "Dict_", "=_", "Parser_", "._", "get", "Rule", "s", "And", "Tokens_", "(_", "parser", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tokens_", "=_", "token", "s", "Dict_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rules_", "=_", "list_", "(_", "rule", "s", "Dict_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sort", " ", "them", " ", "by", " ", "line", " ", "number", " ", "of", " ", "declaration", " ", "as", " ", "it", "'", "s", " ", "how", " ", "the", " ", "yac", "c", " ", "builde", "r", " ", "works", " ", "to", " ", "order", " ", "rules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", ":", " ", "some", " ", "more", " ", "explicit", " ", "rule", " ", "order", " ", "handling", " ", "(", "whe", "n", " ", "preceden", "ce", " ", "isn", "'", "t", " ", "an", " ", "option", ")", " ", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "rules_", "._", "sort_", "(_", "lambda_", "x_", ",_", "y_", ":_", "cmp_", "(_", "rule", "s", "Dict_", "[_", "x_", "]_", "._", "func", "\\u", "code_", "._", "co", "\\u", "firstl", "inen", "o_", ",_", "rule", "s", "Dict_", "[_", "y_", "]_", "._", "func", "\\u", "code_", "._", "co", "\\u", "firstl", "inen", "o_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "sorte", "d", " ", "rule", "s", ":\"", ",", " ", "[(", "r", ",", " ", "parser", "cls", ".", "rule", "s", "Dict", "[", "r", "].", "func", "\\u", "code", ".", "co", "\\u", "firstl", "inen", "o", ")", " ", "for", " ", "r", " ", "in", " ", "rule", "s", "]_", "\\u\\u\\uNL\\u\\u\\u_", "rules_", "=_", "tuple_", "(_", "rules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser", "cls_", "._", "tokens_", "=_", "tuple_", "(_", "tokens_", "+_", "list_", "(_", "set_", "(_", "reserved_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "cls_", "._", "rules_", "=_", "rules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"%", "s", " ", "token", "s", " ", "%", "s", "\"", " ", "%", " ", "(", " ", "parser", "cls", ",", " ", "parser", "cls", ".", "token", "s", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "must", " ", "have", " ", "a", " ", "start", " ", "attribute", " ", "for", " ", "\\u\\u", "init", "\\u\\u", ",", " ", "start", " ", "can", " ", "be", " ", "Non", "e", " ", "tho", "ugh", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "must", " ", "not", " ", "inherit", " ", "start", " ", "as", " ", "parsed", " ", "wou", "ld", " ", "not", " ", "parse", " ", "own", " ", "class", " ", "new", " ", "rules_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "'", "start", "'_", "in_", "parser", "cls_", "._", "\\u\\u", "dict\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser", "cls_", "._", "start_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", ":", " ", "same", " ", "for", " ", "preceden", "ce", " ", "rules_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Parser_", ",_", "cls_", ")_", "._", "\\u\\u", "new\\u\\u_", "(_", "parser", "cls_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lexer_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "t", "\\u", "error_", "(_", "self_", ",_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "\"", "ille", "gal", " ", "character", " ", "in", " ", "'%", "s", "'", " ", "at", " ", "%", "i", ":", " ", "'%", "s", "'\"_", "%_", "(_", "t_", "._", "lexer_", "._", "lex", "data_", ",_", "t_", "._", "lex", "pos_", ",_", "t_", "._", "value_", "[_", "0_", "]_", ")_", ",_", "Pars", "ing", "Warning_", ",_", "stacklevel_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "lexer_", "._", "skip_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "error_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "error", " ", "token", "\"_", ",_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "\"", "unexpected", " ", "end", " ", "of", " ", "file", "\"_", ",_", "Pars", "ing", "Warning_", ",_", "stacklevel_", "=_", "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 ", " _", "warnings_", "._", "warn_", "(_", "\"", "synta", "x", " ", "error", " ", "in", " ", "'%", "s", "'", " ", "at", " ", "%", "i", ":", " ", "'%", "s", "'\"_", "%_", "(_", "p_", "._", "lexer_", "._", "lex", "data_", ",_", "p_", "._", "lex", "pos_", ",_", "p_", "._", "value_", ")_", ",_", "Pars", "ing", "Warning_", ",_", "stacklevel_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "error", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ju", "st", " ", "discard", " ", "the", " ", "token", " ", "and", " ", "tell", " ", "the", " ", "parser", " ", "it", "'", "s", " ", "oka", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "yac", "c", ".", "erro", "k", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "yac", "c", ".", "erro", "k", "()", ".", " ", "Thi", "s", " ", "reset", "s", " ", "the", " ", "parser", " ", "state", " ", "so", " ", "it", " ", "doe", "sn", "'", "t", " ", "think", " ", "it", "'", "s", " ", "in", " ", "error", "-", "recover", "y", " ", "mode", ".", " ", "Thi", "s", " ", "will", " ", "prevent", " ", "an", " ", "error", " ", "token", " ", "from", " ", "bei", "ng", " ", "generat", "ed", " ", "and", " ", "will", " ", "reset", " ", "the", " ", "internal", " ", "error", " ", "counter", "s", " ", "so", " ", "tha", "t", " ", "the", " ", "next", " ", "synta", "x", " ", "error", " ", "will", " ", "call", " ", "p", "\\u", "error", "()", " ", "again", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "yac", "c", ".", "token", "()", ".", " ", "Thi", "s", " ", "return", "s", " ", "the", " ", "next", " ", "token", " ", "on", " ", "the", " ", "input", " ", "stream", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "yac", "c", ".", "restart", "()", ".", " ", "Thi", "s", " ", "discard", "s", " ", "the", " ", "entire", " ", "pars", "ing", " ", "stack", " ", "and", " ", "reset", "s", " ", "the", " ", "parser", " ", "to", " ", "its", " ", "initial", " ", "state", "._", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Rule", "s", "And", "Tokens_", "(_", "parser", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "build", " ", "the", " ", "token", "s", " ", "and", " ", "preceden", "ce", " ", "tuple", "s", " ", "from", " ", "inherited", " ", "declaration", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "gather", " ", "token", "s", " ", "and", " ", "rule", "s", " ", "definit", "ion", " ", "from", " ", "Parser", " ", "class", " ", "member", "s", " ", "(", "own", " ", "and", " ", "inherited", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "token", "s", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", ",_", "obj_", "in_", "inspect_", "._", "getmember", "s_", "(_", "parser", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "._", "startswith_", "(_", "'", "t", "\\u'_", ")_", "and_", "name_", "!=_", "'", "t", "\\u", "error", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "obj_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "inspect_", "._", "isf", "unction_", "(_", "obj_", ")_", "or_", "inspect_", "._", "isme", "thod", "_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "obj_", "._", "\\u\\u", "doc\\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 ", " ", "_", "raise_", "Syntax", "Error_", ",_", "\"", "Token", " ", "definit", "ion", " ", "%", "s", " ", "defin", "es", " ", "nei", "ther", " ", "a", " ", "string", " ", "nor", " ", "a", " ", "function", ",", " ", "una", "ble", " ", "to", " ", "parse", "\"_", "%_", "m_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "k_", "=_", "name_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token", "s", "Dict_", "[_", "k_", "]_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "._", "startswith_", "(_", "'", "p", "\\u'_", ")_", "and_", "inspect_", "._", "isme", "thod", "_", "(_", "obj_", ")_", "and_", "name_", "!=_", "'", "p", "\\u", "error", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "name_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "Dict_", "[_", "k_", "]_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "eli", "f", " ", "name", " ", "==", " ", "'\\u", "reserve", "d", "'", " ", "and", " ", "isin", "stance", "(", "obj", ",", "dict", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "reserve", "d", " ", "attribute", " ", "hold", "s", " ", "a", " ", "list", " ", "of", " ", "reserve", "d", " ", "token", " ", "keywords", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "these", " ", "shou", "ld", " ", "only", " ", "exist", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "\"", "FO", "UND", " ", "reserve", "d", "!\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "k", ",", "v", " ", "in", " ", "obj", ".", "items", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "token", "s", "Dict", "[", "v", "]=", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "rule", "s", "Dict_", ",_", "token", "s", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "=_", "kwargs_", "._", "get_", "(_", "'", "debug", "'_", ",_", "verbose_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "kwargs_", "._", "get_", "(_", "'", "start", "'_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "spath_", "=_", "kwargs_", "._", "get_", "(_", "'", "output", "dir", "'_", ",_", "tempfile_", "._", "gettempdir_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "name", "parse", " ", "parser", "s", " ", "path", "\"_", ",_", "parser", "spath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "method_", "=_", "kwargs_", "._", "get_", "(_", "'", "method", "'_", ",_", "'", "LA", "LR", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Build", " ", "for", "\"_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "token", "s", ":\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "t", " ", "is", " ", "not", " ", "alw", "ay", "s", " ", "in", " ", "token", "s", "Dict", ",", " ", "not", " ", "sure", " ", "if", " ", "this", " ", "is", " ", "bad", " ", "or", " ", "not", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"\\\\", "t", "%", "s", " ", "=", " ", "%", "r", "\"", " ", "%", " ", "(", "t", ",", " ", "self", ".\\u", "\\u", "class", "\\u\\u", ".", "token", "s", "Dict", "[", "t", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "t", "%", "s", "\"_", "%_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "rule", "s", ":\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "rules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "t", " ", "is", " ", "not", " ", "alw", "ay", "s", " ", "in", " ", "rule", "s", "Dict", ",", " ", "not", " ", "sure", " ", "if", " ", "this", " ", "is", " ", "bad", " ", "or", " ", "not", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"\\\\", "t", "%", "s", " ", "=", " ", "%", "r", "\"", " ", "%", " ", "(", "t", ",", " ", "self", ".\\u", "\\u", "class", "\\u\\u", ".", "rule", "s", "Dict", "[", "t", "].", "\\u\\u", "doc", "\\u\\u)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "t", "%", "s", "\"_", "%_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "start", ":", " ", "%", "s", "\"_", "%_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "lexer_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lex", "tab_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "+_", "\"\\u", "lex", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lk", "war", "gs_", "=_", "{_", "'", "debug", "'_", ":_", "debug_", ",_", "'", "lex", "tab", "'_", ":_", "lex", "tab_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lexer_", "=_", "lex_", "._", "lex_", "(_", "object_", "=_", "self_", ",_", "**_", "lk", "war", "gs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "parser_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tab", "module_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "+_", "\"\\u", "yac", "c\\u", "\"_", "+_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pk", "war", "gs_", "=_", "{_", "'", "output", "dir", "'_", ":_", "parser", "spath_", ",_", "'", "debug", "'_", ":_", "debug_", ",_", "'", "tab", "module", "'_", ":_", "tab", "module_", ",_", "'", "start", "'_", ":_", "start_", ",_", "'", "method", "'_", ":_", "method_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser_", "=_", "yac", "c_", "._", "yac", "c_", "(_", "module_", "=_", "self_", ",_", "**_", "pk", "war", "gs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "data_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "parser_", "._", "parse_", "(_", "data_", ",_", "lexer_", "=_", "self_", "._", "lexer_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Token_", "(_", "Pars", "ed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "A", " ", "class", " ", "for", " ", "token", " ", "types", ",", " ", "allow", "s", " ", "direct", " ", "initialization", " ", "from", " ", "a", " ", "string", " ", "and", " ", "type", " ", "with", "out", " ", "checking", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "avoid", " ", "unne", "cess", "ary", " ", "double", " ", "parse", " ", "of", " ", "the", " ", "string", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Token", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Abstract", " ", "base", " ", "class", " ", "for", " ", "Token", " ", "parser", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "pattern_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Token", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "build_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pattern_", "=_", "kwargs_", "._", "get_", "(_", "'", "pattern", "'_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parser_", "=_", "re_", "._", "compile_", "(_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "\"", "cann", "ot", " ", "build", " ", "Token", " ", "Parser", " ", "from", " ", "pattern", " ", "%", "r", ".", " ", "you", " ", "must", " ", "set", " ", "the", " ", "\\u", "pattern", " ", "attribute", " ", "to", " ", "a", " ", "valid", " ", "regular", " ", "express", "ion", "\"_", "%_", "pattern_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "data_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser_", "._", "match_", "(_", "data_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Token_", "(_", "data_", ",_", "type_", "=_", "self_", "._", "\\u", "type_", ",_", "pos_", "=_", "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 ", " _", "warnings_", "._", "warn_", "(_", "\"%", "s", " ", "is", " ", "not", " ", "matchi", "ng", " ", "%", "s", " ", "pattern", " ", "%", "r", "\"_", "%_", "(_", "data_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "self_", "._", "\\u", "pattern_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Emp", "ty", "Token", "Parser_", "(_", "Parser_", ")_", ":_", "\\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_", "Emp", "ty", "Token", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "build_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Token", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "data_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Empty_", "(_", ")_", "\\u\\u\\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_", "Emp", "ty", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Parser", " ", "for", " ", "the", " ", "empty", " ", "producti", "on", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "=_", "'", "Emp", "ty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "p", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Emp", "ty", " ", ":", " ", "'_", "\\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_", "is", "Pars", "ed", "Class_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "issubclass_", "(_", "x_", ",_", "Pars", "ed_", ")_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Parser", "Class_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "issubclass_", "(_", "x_", ",_", "Parser_", ")_", "\\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_", "[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", "print", "Class", "Tree_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "print", "Tree_", "(_", "data_", ",_", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "data_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "print", "Tree_", "(_", "d_", ",_", "level_", ")_", "\\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_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tree_", "=_", "inspect_", "._", "getc", "lass", "tree_", "(_", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "print", "Tree_", "(_", "tree_", ")_", "\\u\\u\\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_", "autop", "arse", "d_", "(_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "metaclass", " ", "for", " ", "dra", "matical", "ly", " ", "reduc", "ing", " ", "setup", " ", "synta", "x", " ", "for", " ", "simple", " ", "hier", "archi", "es", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "autop", "arse", "d_", "(_", "type_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "new\\u\\u_", "(_", "mcl", "_", ",_", "classname_", ",_", "bases_", ",_", "classd", "ict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newc", "ls_", "=_", "super_", "(_", "autop", "arse", "d_", ",_", "mcl", "_", ")_", "._", "\\u\\u", "new\\u\\u_", "(_", "mcl", "_", ",_", "classname_", ",_", "bases_", ",_", "classd", "ict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "=_", "\\u\\u", "import\\u\\u_", "(_", "newc", "ls_", "._", "\\u\\u", "module\\u\\u_", ",_", "globals_", "(_", ")_", ",_", "locals_", "(_", ")_", ",_", "[_", "''_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "autop", "arse", "d", "\",", " ", "newc", "ls_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "issubclass_", "(_", "newc", "ls_", ",_", "Pars", "ed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "find", " ", "the", " ", "attribute", " ", "\\u", "parser", ",", " ", "whi", "ch", " ", "hold", "s", " ", "the", " ", "parser", " ", "class", " ", "for", " ", "this", " ", "Pars", "ed", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser", "cls_", "=_", "classd", "ict_", "._", "get_", "(_", "'\\u", "parser", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "Parser", "Class_", "(_", "parser", "cls_", ")_", "or_", "(_", "parser", "cls_", "is_", "None_", "and_", "'\\u", "rule", "s", "'_", "in_", "classd", "ict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rules_", "=_", "classd", "ict_", "._", "get_", "(_", "'\\u", "rule", "s", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rules_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "there", "'", "s", " ", "no", " ", "parser", ",", " ", "but", " ", "there", " ", "is", " ", "a", " ", "set", " ", "of", " ", "rule", "s", ".", " ", "use", " ", "this", " ", "to", " ", "create", " ", "a", " ", "default", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "not_", "is", "Iterable_", "(_", "rules_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Type", "Error_", ",_", "\"\\u", "rule", "s", " ", "attribute", " ", "must", " ", "be", " ", "an", " ", "iterable", " ", "list", " ", "of", " ", "string", " ", "rule", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "add", " ", "the", " ", "rule", "s", " ", "to", " ", "the", " ", "parser", "dict", " ", "as", " ", "attribute", "s", ",", " ", "these", " ", "will", " ", "be", " ", "convert", "ed", " ", "to", " ", "method", "s", ",", " ", "below_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "rule_", "in_", "enumerate_", "(_", "rules_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "attrname_", "=_", "'", "p", "\\u", "%", "s", "\\u", "%", "02", "d", "'_", "%_", "(_", "classname_", ",_", "i_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "dict_", "[_", "attrname_", "]_", "=_", "rule_", "\\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_", "#", " ", "parser", " ", "alr", "ead", "y", " ", "exist", "s", ".", " ", "use", " ", "it", ",", " ", "but", " ", "use", " ", "\\u\\u", "dict", "\\u\\u", ",", " ", "not", " ", "inherited", " ", "info_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parser", "dict_", "=_", "parser", "cls_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "dictionar", "y", " ", "of", " ", "update", "s", " ", "to", " ", "be", " ", "made", " ", "to", " ", "the", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "update", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "automati", "call", "y", " ", "set", " ", "the", " ", "start", " ", "attribute", " ", "to", " ", "the", " ", "name", " ", "of", " ", "this", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "start", "'_", "not_", "in_", "parser", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "update", "dict_", "[_", "'", "start", "'_", "]_", "=_", "classname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gather", " ", "up", " ", "all", " ", "the", " ", "token", "s", " ", "and", " ", "rule", "s", " ", "and", " ", "store", " ", "them", " ", "separately", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "token", "s", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reserve", "d", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accepts", "\\u", "set_", "=_", "set_", "(_", "classd", "ict_", "._", "get_", "(_", "'\\u", "accepts", "'_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class", "Name", "Reg_", "=_", "re_", "._", "compile_", "(_", "'[", "a", "-", "z", "A", "-", "Z", "][", "a", "-", "z", "A", "-", "Z", "0", "-", "9", "]*'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", ",_", "obj_", "in_", "parser", "dict_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "class", " ", "%", "s", " ", "has", " ", "attribute", " ", "%", "s", "\"", " ", "%", " ", "(", "parser", "cls", ".\\u", "\\u", "name", "\\u\\u", ",", " ", "m", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "RULES", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "name_", "._", "startswith_", "(_", "'", "p", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "shortname_", "=_", "name_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "short", "hand", " ", "synta", "x", ":", " ", "need", "s", " ", "to", " ", "be", " ", "convert", "ed", " ", "to", " ", "a", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "obj_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "need", "s", "Wrapp", "ing_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "regular", " ", "synta", "x", ":", " ", "alr", "ead", "y", " ", "a", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "inspect_", "._", "isf", "unction_", "(_", "obj_", ")_", "or_", "inspect_", "._", "isme", "thod", "_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "inspect_", "._", "getd", "oc_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "need", "s", "Wrapp", "ing_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Syntax", "Error_", ",_", "\"", "Token", " ", "definit", "ion", " ", "%", "s", " ", "defin", "es", " ", "nei", "ther", " ", "a", " ", "string", " ", "nor", " ", "a", " ", "function", ",", " ", "una", "ble", " ", "to", " ", "parse", "\"_", "%_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "process", " ", "the", " ", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "accepts", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colon", "Split_", "=_", "[_", "x_", "._", "strip_", "(_", ")_", "for_", "x_", "in_", "v_", "._", "split_", "(_", "':'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "colon", "Split_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "classname_", "+_", "'", " ", ":", " ", "'_", "+_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colon", "Split_", "=_", "[_", "classname_", ",_", "colon", "Split_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "colon", "Split_", ")_", "==_", "2_", "and_", "colon", "Split_", "[_", "0_", "]_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pipe", "Split_", "=_", "[_", "x_", "._", "strip_", "(_", ")_", "for_", "x_", "in_", "colon", "Split_", "[_", "1_", "]_", "._", "split_", "(_", "'|'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "grp_", "in_", "pipe", "Split_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "be", " ", "sure", " ", "to", " ", "filter", " ", "out", " ", "ours", "elv", "es_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "accepts", "_", "+=_", "[_", "x_", "for_", "x_", "in_", "grp_", "._", "split_", "(_", ")_", "if_", "class", "Name", "Reg_", "._", "match_", "(_", "x_", ")_", "and_", "x_", "!=_", "classname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "the", " ", "classe", "s", " ", "involved", " ", "in", " ", "the", " ", "rules_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "accepts", "\\u", "set_", "._", "update_", "(_", "accepts", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "need", "s", "Wrapp", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "def_", "p", "\\u", "func_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "p_", "[_", "0_", "]_", "=_", "newc", "ls_", "(_", "*_", "p_", "[_", "1_", ":_", "len_", "(_", "p_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p", "\\u", "func_", "._", "\\u\\u", "name\\u\\u_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p", "\\u", "func_", "._", "\\u\\u", "doc\\u\\u_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verbose_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"", "overwrit", "ing", " ", "%", "s", ".\\u", "parser", ".", "%", "s", " ", "with", " ", "yac", "c", " ", "function", ":", " ", "%", "r", "\"_", "%_", "(_", "classname_", ",_", "name_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "update", "dict_", "[_", "name_", "]_", "=_", "p", "\\u", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "Dict_", "[_", "name_", "]_", "=_", "p", "\\u", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "k", " ", "=", " ", "m", "[", "0", "][", "2", ":]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "if", " ", "k", " ", "in", " ", "token", "s", "Dict", " ", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "warn", "ings", ".", "warn", "(\"", "Token", " ", "%", "s", " ", "rede", "fined", " ", "in", " ", "Parser", " ", "%", "s", "\"", " ", "%", " ", "(", "k", ",", " ", "parser", "),", " ", "User", "Warn", "ing", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "token", "s", "Dict", "[", "k", "]", " ", "=", " ", "v_", "\\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 ", " ", " _", "rule", "s", "Dict_", "[_", "name_", "]_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOKEN", "S_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "._", "startswith_", "(_", "'", "t", "\\u'_", ")_", "and_", "name_", "!=_", "'", "t", "\\u", "error", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "shortname_", "=_", "name_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "obj_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "inspect_", "._", "isf", "unction_", "(_", "obj_", ")_", "or_", "inspect_", "._", "isme", "thod", "_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "obj_", "._", "\\u\\u", "doc\\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 ", " ", " _", "raise_", "Syntax", "Error_", ",_", "\"", "Token", " ", "definit", "ion", " ", "%", "s", " ", "defin", "es", " ", "nei", "ther", " ", "a", " ", "string", " ", "nor", " ", "a", " ", "function", ",", " ", "una", "ble", " ", "to", " ", "parse", "\"_", "%_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "token", "s", "Dict_", "[_", "name_", "]_", "=_", "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_", "if_", "verbose_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "\"%", "s", " ", "accepts", ":", " ", "%", "s", "\"_", "%_", "(_", "newc", "ls_", "._", "\\u\\u", "name\\u\\u_", ",_", "list_", "(_", "accepts", "\\u", "set_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "bases_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bases_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "parsed", "name_", "in_", "accepts", "\\u", "set_", ":_", "\\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", "cls_", "=_", "getattr_", "(_", "module_", ",_", "parsed", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "warnings_", "._", "warn_", "(_", "\"", "Cou", "ld", " ", "not", " ", "find", " ", "a", " ", "Pars", "ed", " ", "class", " ", "%", "s", " ", "in", " ", "module", " ", "%", "s", ".", " ", " ", "Assu", "ming", " ", "tha", "t", " ", "it", " ", "is", " ", "an", " ", "custom", " ", "token", ".\"_", "%_", "(_", "parsed", "name_", ",_", "module_", ")_", ",_", "User", "Warning_", ")_", "\\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 ", " ", " _", "parser_", "=_", "parsed", "cls_", "._", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "parser_", "=_", "getattr_", "(_", "module_", ",_", "parsed", "name_", "+_", "'", "Parser", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Syntax", "Error_", ",_", "\"", "Cann", "ot", " ", "find", " ", "parser", " ", "class", " ", "for", " ", "parsed", " ", "class", " ", "%", "s", ".", " ", "It", " ", "shou", "ld", " ", "be", " ", "explicit", "ly", " ", "or", " ", "automati", "call", "y", " ", "created", " ", "as", " ", "%", "s", ".\\u", "parser", " ", "or", " ", "be", " ", "named", " ", "%", "s", "Parser", "\"_", "%_", "(_", "parsed", "name_", ",_", "parsed", "name_", ",_", "parsed", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "isinstance_", "(_", "parser_", ",_", "Parser_", ")_", "or_", "(_", "inspect_", "._", "iscl", "ass_", "(_", "parser_", ")_", "and_", "issubclass_", "(_", "parser_", ",_", "Parser_", ")_", ")_", ",_", "'%", "s", ".\\u", "parser", " ", "is", " ", "not", " ", "a", " ", "subclass", " ", "of", " ", "Parser", ",", " ", "it", " ", "is", " ", "%", "r", "'_", "%_", "(_", "parsed", "name_", ",_", "parser_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bases_", "._", "append_", "(_", "parser_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "some", " ", "of", " ", "our", " ", "base", "s", " ", "mig", "ht", " ", "be", " ", "subclasses", " ", "of", " ", "other", " ", "base", "s", ".", " ", " ", "we", " ", "want", " ", "the", " ", "smallest", " ", "list", " ", "of", " ", "superclass", "es", ",", " ", "so", " ", "wee", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "classe", "s", " ", "tha", "t", " ", "are", " ", "direct", "ly", " ", "dependent", " ", "on", " ", "other", " ", "bases_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "newb", "ases", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "bases_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "issu", "perc", "lass_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "parents", " ", "=", " ", "inspect", ".", "getm", "ro", "(", "i", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "j_", "in_", "bases_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "i_", "in_", "inspect_", "._", "getm", "ro_", "(_", "j_", ")_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "issu", "perc", "lass_", "=_", "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_", "issu", "perc", "lass_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "newb", "ases", "_", "._", "append_", "(_", "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_", "newb", "ases", "_", "=_", "sorted_", "(_", "newb", "ases", "_", ",_", "key_", "=_", "lambda_", "x_", ":_", "len_", "(_", "inspect_", "._", "getm", "ro_", "(_", "x_", ")_", ")_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"%", "s", " ", "base", "s", "\"", " ", "%", " ", "newc", "ls", ".\\u", "\\u", "name\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "base_", "in_", "newb", "ases", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "base_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'\\\\", "t", "',", " ", "base", ".", "token", "s", "Dict_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'\\\\", "t", "',", " ", "base", ".", "rule", "s", "Dict_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "token", "s", "Dict_", "._", "update_", "(_", "base_", "._", "token", "s", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "Dict_", "._", "update_", "(_", "base_", "._", "rule", "s", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "if", " ", "has", "attr", "(", "base", ",", " ", "'\\u", "reserve", "d", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "reserve", "d", "Dict", ".", "update", "(", " ", "base", ".\\u", "reserve", "d", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "update", "dict_", "._", "update_", "(_", "token", "s", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "dict_", "._", "update_", "(_", "rule", "s", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "for", " ", "i", ",", " ", "parent", " ", "in", " ", "enumerate", "(", "inspect", ".", "getm", "ro", "(", "base", "))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'\\\\", "t", "'*", "i", ",", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "inspect", ".", "getc", "lass", "tree", "(", "base", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "for", " ", "base", " ", "in", " ", "newb", "ases", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "\\u", "print", "Class", "Tree", "(", " ", "base", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rules_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "time", " ", "to", " ", "make", " ", "the", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "use", " ", "the", " ", "Rule", "s", " ", "in", " ", "the", " ", "'", "accepts", "'", " ", "list", " ", "to", " ", "dete", "rmin", "e", " ", "the", " ", "base", "s", " ", "of", " ", "this", " ", "parser", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", ":", " ", "filter", " ", "out", " ", "base", "s", " ", "tha", "t", " ", "are", " ", "superclass", "es", " ", "of", " ", "other", " ", "base", "s", ":", " ", "we", " ", "only", " ", "need", " ", "one", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parser", "Name_", "=_", "classname_", "+_", "'", "Parser", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "newb", "ases", " ", "=", " ", "sorte", "d", "(", " ", "newb", "ases", ",", " ", "key", " ", "=", " ", "lambda", " ", "x", ":", " ", "x", ".\\u", "\\u", "name", "\\u\\u)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "update", "dict_", "[_", "'", "token", "s", "Dict", "'_", "]_", "=_", "token", "s", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "dict_", "[_", "'", "rule", "s", "Dict", "'_", "]_", "=_", "rule", "s", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "update", "dict", "['", "\\u", "reserve", "d", "']", " ", "=", " ", "reserve", "d", "Dict_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser", "dict_", "._", "update_", "(_", "update", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "parser", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "parser", "cls_", "=_", "type_", "(_", "parser", "Name_", ",_", "(_", "Parser_", ",_", ")_", ",_", "parser", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "cls_", "._", "\\u\\u", "module\\u\\u_", "=_", "module_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "newc", "ls_", ",_", "'\\u", "parser", "'_", ",_", "parser", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "the", " ", "exist", "ing", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "k_", ",_", "v_", "in_", "update", "dict_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "setattr_", "(_", "parser", "cls_", ",_", "k_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setattr_", "(_", "newc", "ls_", ",_", "'\\u", "accepts", "'_", ",_", "tuple_", "(_", "accepts", "\\u", "set_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "issubclass_", "(_", "newc", "ls_", ",_", "Token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "a", " ", "token", " ", "subclass", " ", "defin", "es", " ", "its", " ", "regex", " ", "on", " ", "the", " ", "'\\u", "token", "'", " ", "attr", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "this", " ", "attr", " ", "is", " ", "defin", "ed", ",", " ", "it", " ", "caus", "es", " ", "a", " ", "Parser", " ", "class", " ", "to", " ", "be", " ", "created", " ", "for", " ", "this", " ", "token", ",", " ", "along", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "rule", ",", " ", "whi", "ch", " ", "is", " ", "named", " ", "after", " ", "the", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token_", "=_", "classd", "ict_", "._", "get_", "(_", "'\\u", "token", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "token_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Type", "Error_", ",_", "\"", "Token", " ", "classe", "s", " ", "tha", "t", " ", "use", " ", "the", " ", "autop", "arse", "d", " ", "metaclass", " ", "must", " ", "defin", "e", " ", "a", " ", "\\u", "token", " ", "attribute", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "automati", "call", "y", " ", "setti", "ng", " ", "up", " ", "token", " ", "class", " ", "for", " ", "%", "s", "\"", " ", "%", " ", "newc", "ls", ".\\u", "\\u", "name\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "token", "Base", "name_", "=_", "classname_", "+_", "'\\u", "Token", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token", "Name_", "=_", "'", "t", "\\u'_", "+_", "token", "Base", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Name_", "=_", "'", "p", "\\u'_", "+_", "token", "Base", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "Name_", "=_", "classname_", "+_", "'", "Parser", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "token_", ",_", "'\\u", "\\u", "name", "\\u\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "setti", "ng", " ", "token", " ", "name", " ", "to", " ", "%", "s", "\"", " ", "%", " ", "token", "Name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "token_", "._", "\\u\\u", "name\\u\\u_", "=_", "token", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "dict_", "[_", "token", "Name_", "]_", "=_", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "token", "s", "Dict_", "=_", "{_", "token", "Name_", ":_", "token_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "has", "attr", "(", "newc", "ls", ",", " ", "'\\u", "reserve", "d", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "print", " ", "\"", "addin", "g", " ", "\\u", "reserve", "d", " ", "to", " ", "%", "s", "\"", " ", "%", " ", "parser", "Name_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "parser", "dict", "['", "\\u", "reserve", "d", "']", " ", "=", " ", "newc", "ls", ".\\u", "reserved_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser", "dict_", "[_", "'", "token", "s", "Dict", "'_", "]_", "=_", "token", "s", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "rule", " ", "is", " ", "named", " ", "after", " ", "the", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "'''", "%", "s", " ", ":", " ", "%", "s", " ", "'''_", "%_", "(_", "classname_", ",_", "token", "Base", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "class", " ", "\\u", "parser", "(", " ", "Parser", " ", "):", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "rule_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "p_", "[_", "0_", "]_", "=_", "newc", "ls_", "(_", "p_", "[_", "1_", "]_", ",_", "pos_", "=_", "p_", "._", "lex", "pos_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rule_", "._", "\\u\\u", "name\\u\\u_", "=_", "rule", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule_", "._", "\\u\\u", "doc\\u\\u_", "=_", "doc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "dict_", "[_", "rule", "Name_", "]_", "=_", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "dict_", "[_", "'", "rule", "s", "Dict", "'_", "]_", "=_", "{_", "rule", "Name_", ":_", "rule_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "Parser", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "creati", "ng", " ", "parser", " ", "%", "s", "\"_", "%_", "parser", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "cls_", "=_", "type_", "(_", "parser", "Name_", ",_", "(_", "Parser_", ",_", ")_", ",_", "parser", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "cls_", "._", "\\u\\u", "module\\u\\u_", "=_", "module_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "setattr", "(", " ", "\\u", "parser", ",", " ", "token", "Name", ",", " ", "token", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "setattr", "(", " ", "\\u", "parser", ",", " ", "rule", "Name", ",", " ", "rule", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "setattr_", "(_", "newc", "ls_", ",_", "'\\u", "parser", "'_", ",_", "parser", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "newc", "ls_", "\\u\\u\\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", "get", "Token", "Patterns", "_", "(_", "parser", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token", "s", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", ",_", "obj_", "in_", "parser", "cls_", "._", "\\u\\u", "dict\\u\\u_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "class", " ", "%", "s", " ", "has", " ", "attribute", " ", "%", "s", "\"", " ", "%", " ", "(", "parser", "cls", ".\\u", "\\u", "name", "\\u\\u", ",", " ", "m", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "._", "startswith_", "(_", "'", "t", "\\u'_", ")_", "and_", "name_", "!=_", "'", "t", "\\u", "error", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "strip", " ", "off", " ", "'", "t", "\\u'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "name_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "obj_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "inspect_", "._", "isf", "unction_", "(_", "obj_", ")_", "or_", "inspect_", "._", "isme", "thod", "_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "obj_", "._", "\\u\\u", "doc\\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 ", " _", "raise_", "Syntax", "Error_", ",_", "\"", "Token", " ", "definit", "ion", " ", "%", "s", " ", "defin", "es", " ", "nei", "ther", " ", "a", " ", "string", " ", "nor", " ", "a", " ", "function", ",", " ", "una", "ble", " ", "to", " ", "parse", "\"_", "%_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "k_", "=_", "name_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "k_", "in_", "token", "s", "Dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "\"", "Token", " ", "%", "s", " ", "rede", "fined", " ", "in", " ", "Parser", " ", "%", "s", "\"_", "%_", "(_", "k_", ",_", "parser_", ")_", ",_", "User", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "token", "s", "Dict_", "[_", "k_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "token", "s", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "process_", "(_", "module_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "cache", " ", "out", " ", "a", " ", "dictionar", "y", " ", "of", " ", "all", " ", "Pars", "ed", " ", "and", " ", "Parser", " ", "classe", "s", ",", " ", "and", " ", "create", " ", "token", " ", "classe", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "User", " ", "supplie", "d", " ", "a", " ", "module", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "module_", ",_", "types_", "._", "Modul", "e", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module", "\\u", "dict_", "=_", "module_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "eli", "f", " ", "isin", "stance", "(", "module", ",", " ", "\\u", "INSTANCE", "TYPE", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u", "items", " ", "=", " ", "[(", "k", ",", "getattr", "(", "module", ",", "k", "))", " ", "for", " ", "k", " ", "in", " ", "dir", "(", "module", ")]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "ldi", "ct", " ", "=", " ", "{", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "i", " ", "in", " ", "\\u", "items", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "ldi", "ct", "[", "i", "[", "0", "]]", " ", "=", " ", "i", "[", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "\"", "Expect", "ed", " ", "a", " ", "module", "\"_", "\\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_", "#", " ", "No", " ", "module", " ", "give", "n", ".", " ", " ", "We", " ", "mig", "ht", " ", "be", " ", "able", " ", "to", " ", "get", " ", "informati", "on", " ", "from", " ", "the", " ", "caller", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Throw", " ", "an", " ", "exception", " ", "and", " ", "unw", "ind", " ", "the", " ", "traceback", " ", "to", " ", "get", " ", "the", " ", "globals_", "\\u\\u\\uNL\\u\\u\\u_", "\\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 ", " _", "raise_", "Run", "time", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Run", "time", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", ",_", "b_", ",_", "t_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "t_", "._", "tb", "\\u", "frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "f_", "._", "f", "\\u", "back_", "#", " ", "Walk", " ", "out", " ", "to", " ", "our", " ", "calling", " ", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "dict_", "=_", "f_", "._", "f", "\\u", "globals_", "#", " ", "Grab", " ", "its", " ", "globals", " ", "dictionary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#\\u", "create", "Token", "Class", "es", "(", "ldi", "ct", ",", " ", "debug", "=", "verbo", "se", "()", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token", "s", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gather", " ", "up", " ", "all", " ", "token", "s", ",", " ", "parser", "s", ",", " ", "and", " ", "parsed_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", ",_", "obj_", "in_", "module", "\\u", "dict_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "Parser", "Class_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser", "Dict_", "[_", "name_", "]_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token", "s", "Dict_", "._", "update_", "(_", "\\u", "get", "Token", "Patterns", "_", "(_", "obj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "Parser", "s", " ", "tha", "t", " ", "are", " ", "store", "d", " ", "on", " ", "Pars", "ed", " ", "classe", "s", " ", "as", " ", "\\u", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "Pars", "ed", "Class_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parsed", "Dict_", "[_", "name_", "]_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "obj_", ",_", "'\\u", "parser", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "Parser", "Class_", "(_", "obj_", "._", "\\u", "parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "token", "s", "Dict_", "._", "update_", "(_", "\\u", "get", "Token", "Patterns", "_", "(_", "obj_", "._", "\\u", "parser_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "token_", "in_", "token", "s", "Dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pattern_", "=_", "token", "s", "Dict_", "[_", "token_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "Name_", "=_", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "Name_", "=_", "token_", "+_", "\"", "Parser", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "verbose_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "addin", "g", " ", "class", " ", "%", "s", " ", "for", " ", "token", " ", "%", "s", " ", "of", " ", "pattern", " ", "r", "'%", "s", "'\"_", "%_", "(_", "parser", "Name_", ",_", "token_", ",_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Thi", "s", "Token", "Parser_", "(_", "Token", "Parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Token", " ", "Parser", " ", "stub", " ", "class", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "the", " ", "Token", " ", "Parser", " ", "class", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Thi", "s", "Token", "Parser_", "._", "\\u\\u", "name\\u\\u_", "=_", "parser", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Thi", "s", "Token", "Parser", ".\\u", "\\u", "doc", "\\u\\u", " ", "=", " ", "\"", "Parser", " ", "for", " ", "token", " ", "%", "s", "=", "%", "r", "\"", " ", "%", " ", "(", "token", ",", " ", "pattern", ")_", "\\u\\u\\uNL\\u\\u\\u_", "Thi", "s", "Token", "Parser_", "._", "\\u\\u", "module\\u\\u_", "=_", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Thi", "s", "Token", "Parser_", "._", "\\u", "pattern_", "=_", "pattern_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Thi", "s", "Token", "Parser_", "._", "\\u", "type_", "=_", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "to", " ", "the", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "dict_", "[_", "parser", "Name_", "]_", "=_", "Thi", "s", "Token", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser", "Dict_", "[_", "parser", "Name_", "]_", "=_", "Thi", "s", "Token", "Parser_", "\\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_", "\"", "addin", "g", " ", "class", " ", "%", "s", " ", "for", " ", "token", " ", "%", "s", " ", "of", " ", "pattern", " ", "r", "'%", "s", "'\"_", "%_", "(_", "parsed", "Name_", ",_", "token_", ",_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Thi", "s", "Token_", "(_", "Token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Token", " ", "stub", " ", "class", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "the", " ", "Token", " ", "class", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Thi", "s", "Token_", "._", "\\u\\u", "name\\u\\u_", "=_", "parsed", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", "Token", ".\\u", "\\u", "doc", "\\u\\u", " ", "=", " ", "\"", "Parser", " ", "for", " ", "token", " ", "%", "s", "=", "%", "r", "\"", " ", "%", " ", "(", "token", ",", " ", "pattern", ")_", "\\u\\u\\uNL\\u\\u\\u_", "Thi", "s", "Token_", "._", "\\u\\u", "module\\u\\u_", "=_", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Thi", "s", "Token_", "._", "\\u", "parser_", "=_", "Thi", "s", "Token", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "to", " ", "the", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "dict_", "[_", "parsed", "Name_", "]_", "=_", "Thi", "s", "Token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "Dict_", "[_", "parsed", "Name_", "]_", "=_", "Thi", "s", "Token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Parser_", "._", "classes_", "=_", "parser", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pars", "ed_", "._", "classes_", "=_", "parsed", "Dict_" ]
[ 4, 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, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 ]
Except block handles 'BaseException'
catap/namebench/tools/check_dns_servers.py
[ { "content": "#!/usr/bin/env python\n# Copyright 2009 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Tool for checking a lot of DNS servers from stdin for possible inclusion.\"\"\"\n\n__author__ = '[email protected] (Thomas Stromberg)'\n\n\nimport csv\nimport re\nimport sys\nimport GeoIP\nsys.path.append('..')\nsys.path.append('/Users/tstromberg/namebench')\nimport third_party\nfrom libnamebench import nameserver_list\nfrom libnamebench import config\nfrom libnamebench import addr_util\n\nimport check_nameserver_popularity\n\ngi = GeoIP.open('/usr/local/share/GeoLiteCity.dat', GeoIP.GEOIP_MEMORY_CACHE)\nasn_lookup = GeoIP.open('/usr/local/share/GeoIPASNum.dat', GeoIP.GEOIP_MEMORY_CACHE)\n\nexisting_nameservers = config.GetLocalNameServerList()\ncheck_ns = []\noutput = csv.writer(open('output.csv', 'w'))\n\nfor line in sys.stdin:\n ips = addr_util.ExtractIPsFromString(line)\n for ip in ips:\n print ip\n # disable IPV6 until we can improve our regular expression matching\n if ':' in ip:\n continue\n\n if ip not in existing_nameservers:\n check_ns.append((ip, ip))\n\nif not check_ns:\n print \"no new servers to check\"\n sys.exit(1)\nelse:\n print \"%s servers to check\" % len(check_ns)\nprint '-' * 80\nnameserver_list.MAX_INITIAL_HEALTH_THREAD_COUNT = 100\nnameservers = nameserver_list.NameServers([],\n global_servers=check_ns,\n timeout=10,\n health_timeout=10,\n threads=100,\n num_servers=5000,\n skip_cache_collusion_checks=True,\n)\nnameservers.min_healthy_percent = 0\nsanity_checks = config.GetLocalSanityChecks()\ntry:\n nameservers.CheckHealth(sanity_checks['primary'], sanity_checks['secondary'])\nexcept nameserver_list.TooFewNameservers:\n pass\nprint '-' * 80\n\nfor ns in nameservers:\n try:\n details = gi.record_by_addr(ns.ip)\n except:\n pass\n\n if not details:\n details = {}\n\n city = details.get('city', '')\n if city:\n city = city.decode('latin-1')\n latitude = details.get('latitude', '')\n longitude = details.get('longitude', '')\n country = details.get('country_name', '')\n if country:\n country = country.decode('latin-1')\n country_code = details.get('country_code', '')\n region = details.get('region_name', '')\n if region:\n region = region.decode('latin-1')\n \n try:\n results = check_nameserver_popularity.CheckPopularity(ns.ip)\n urls = [ x['Url'] for x in results ]\n except:\n urls = ['(exception)']\n num_urls = len(urls)\n main = \"%s=UNKNOWN\" % ns.ip\n\n if 'Responded with: REFUSED' in ns.warnings:\n note = '_REFUSED_'\n elif 'a.root-servers.net.: Timeout' in ns.warnings:\n note = '_TIMEOUT_'\n elif 'No answer (NOERROR): a.root-servers.net.' in ns.warnings:\n note = '_NOANSWER_'\n elif ns.warnings:\n note = '_WARNING/%s_' % '/'.join(list(ns.warnings))\n else:\n note = ''\n\n if ns.hostname != ns.ip:\n domain = addr_util.GetDomainPartOfHostname(ns.hostname)\n if domain:\n good_urls = [x for x in urls if re.search(domain, x, re.I)]\n if good_urls:\n urls = good_urls\n\n geo = '/'.join([x for x in [country_code, region, city] if x and not x.isdigit()]).encode('utf-8')\n coords = ','.join(map(str, [latitude,longitude]))\n asn = asn_lookup.org_by_addr(ns.ip)\n row = [ns.ip, 'regional', 'UNKNOWN', '', ns.hostname, geo, coords, asn, note, num_urls, ' '.join(urls[:2]), ns.version]\n print row\n output.writerow(row)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 77, "start_column": 2, "end_line": 77, "end_column": 9 }, { "span": "except:", "start_line": 99, "start_column": 2, "end_line": 99, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "200", "9", " ", "Goo", "gle", " ", "Inc", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Tool", " ", "for", " ", "checking", " ", "a", " ", "lot", " ", "of", " ", "DNS", " ", "server", "s", " ", "from", " ", "std", "in", " ", "for", " ", "possib", "le", " ", "inclusion", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "tstr", "omb", "erg", "@", "google", ".", "com", " ", "(", "Tho", "mas", " ", "Str", "omb", "erg", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Geo", "IP_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "'..'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "'/", "User", "s", "/", "tstr", "omb", "erg", "/", "name", "bench", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "third", "\\u", "party_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "libname", "bench_", "import_", "nameserv", "er", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "libname", "bench_", "import_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "libname", "bench_", "import_", "addr", "\\u", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "check", "\\u", "nameserv", "er", "\\u", "popular", "ity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gi_", "=_", "Geo", "IP_", "._", "open_", "(_", "'/", "usr", "/", "local", "/", "share", "/", "Geo", "Lite", "Cit", "y", ".", "dat", "'_", ",_", "Geo", "IP_", "._", "GEO", "IP", "\\u", "MEM", "ORY", "\\u", "CACHE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "asn", "\\u", "lookup_", "=_", "Geo", "IP_", "._", "open_", "(_", "'/", "usr", "/", "local", "/", "share", "/", "Geo", "IPA", "SN", "um", ".", "dat", "'_", ",_", "Geo", "IP_", "._", "GEO", "IP", "\\u", "MEM", "ORY", "\\u", "CACHE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exist", "ing", "\\u", "nameservers", "_", "=_", "config_", "._", "Get", "Local", "Name", "Server", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "check", "\\u", "ns_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "=_", "csv_", "._", "writer_", "(_", "open_", "(_", "'", "output", ".", "csv", "'_", ",_", "'", "w", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "line_", "in_", "sys_", "._", "stdin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ips_", "=_", "addr", "\\u", "util_", "._", "Extract", "IP", "s", "Fro", "m", "String_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ip_", "in_", "ips_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "ip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "disable", " ", "IP", "V6", " ", "unti", "l", " ", "we", " ", "can", " ", "improve", " ", "our", " ", "regular", " ", "express", "ion", " ", "matching_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "':'_", "in_", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ip_", "not_", "in_", "exist", "ing", "\\u", "nameservers", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "ns_", "._", "append_", "(_", "(_", "ip_", ",_", "ip_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "check", "\\u", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "no", " ", "new", " ", "server", "s", " ", "to", " ", "check", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "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 ", " _", "print_", "\"%", "s", " ", "server", "s", " ", "to", " ", "check", "\"_", "%_", "len_", "(_", "check", "\\u", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'-'_", "*_", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nameserv", "er", "\\u", "list_", "._", "MAX", "\\u", "INITIAL", "\\u", "HEAL", "TH", "\\u", "THREAD", "\\u", "COUNT_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nameservers", "_", "=_", "nameserv", "er", "\\u", "list_", "._", "Name", "Server", "s_", "(_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "global", "\\u", "servers_", "=_", "check", "\\u", "ns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "health", "\\u", "timeout_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "threads_", "=_", "100_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "servers_", "=_", "5000_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "skip", "\\u", "cache", "\\u", "coll", "usion", "\\u", "checks_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nameservers", "_", "._", "min", "\\u", "healthy", "\\u", "percent_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sanity", "\\u", "checks_", "=_", "config_", "._", "Get", "Local", "Sanit", "y", "Check", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nameservers", "_", "._", "Check", "Health", "_", "(_", "sanity", "\\u", "checks_", "[_", "'", "primary", "'_", "]_", ",_", "sanity", "\\u", "checks_", "[_", "'", "second", "ary", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "nameserv", "er", "\\u", "list_", "._", "Too", "Fe", "w", "Names", "erver", "s_", ":_", "\\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_", "print_", "'-'_", "*_", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ns_", "in_", "nameservers", "_", ":_", "\\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 ", " _", "details_", "=_", "gi_", "._", "record", "\\u", "by", "\\u", "addr_", "(_", "ns_", "._", "ip_", ")_", "\\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_", "if_", "not_", "details_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "details_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "city_", "=_", "details_", "._", "get_", "(_", "'", "city", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "city_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "city_", "=_", "city_", "._", "decode_", "(_", "'", "latin", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "latitude_", "=_", "details_", "._", "get_", "(_", "'", "latitude", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "longitude_", "=_", "details_", "._", "get_", "(_", "'", "longitude", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "country_", "=_", "details_", "._", "get_", "(_", "'", "countr", "y", "\\u", "name", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "country_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "country_", "=_", "country_", "._", "decode_", "(_", "'", "latin", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "countr", "y", "\\u", "code_", "=_", "details_", "._", "get_", "(_", "'", "countr", "y", "\\u", "code", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "region_", "=_", "details_", "._", "get_", "(_", "'", "region", "\\u", "name", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "region_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "region_", "=_", "region_", "._", "decode_", "(_", "'", "latin", "-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 ", " _", "results_", "=_", "check", "\\u", "nameserv", "er", "\\u", "popular", "ity_", "._", "Check", "Popula", "rity", "_", "(_", "ns_", "._", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urls_", "=_", "[_", "x_", "[_", "'", "Ur", "l", "'_", "]_", "for_", "x_", "in_", "results_", "]_", "\\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 ", " _", "urls_", "=_", "[_", "'(", "exception", ")'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "num", "\\u", "urls_", "=_", "len_", "(_", "urls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main_", "=_", "\"%", "s", "=", "UNK", "NOW", "N", "\"_", "%_", "ns_", "._", "ip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Responde", "d", " ", "with", ":", " ", "REF", "USED", "'_", "in_", "ns_", "._", "warnings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "note_", "=_", "'\\u", "REF", "USED", "\\u'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "a", ".", "root", "-", "server", "s", ".", "net", ".:", " ", "Time", "out", "'_", "in_", "ns_", "._", "warnings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "note_", "=_", "'\\u", "TIME", "OUT", "\\u'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "No", " ", "answer", " ", "(", "NO", "ERROR", "):", " ", "a", ".", "root", "-", "server", "s", ".", "net", ".'_", "in_", "ns_", "._", "warnings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "note_", "=_", "'\\u", "NO", "ANSWER", "\\u'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ns_", "._", "warnings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "note_", "=_", "'\\u", "WARN", "ING", "/", "%", "s", "\\u'_", "%_", "'/'_", "._", "join_", "(_", "list_", "(_", "ns_", "._", "warnings_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "note_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ns_", "._", "hostname_", "!=_", "ns_", "._", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "domain_", "=_", "addr", "\\u", "util_", "._", "Get", "Doma", "in", "Part", "Of", "Host", "name_", "(_", "ns_", "._", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "domain_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "good", "\\u", "urls_", "=_", "[_", "x_", "for_", "x_", "in_", "urls_", "if_", "re_", "._", "search_", "(_", "domain_", ",_", "x_", ",_", "re_", "._", "I_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "good", "\\u", "urls_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "urls_", "=_", "good", "\\u", "urls_", "\\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_", "geo_", "=_", "'/'_", "._", "join_", "(_", "[_", "x_", "for_", "x_", "in_", "[_", "countr", "y", "\\u", "code_", ",_", "region_", ",_", "city_", "]_", "if_", "x_", "and_", "not_", "x_", "._", "isdigit_", "(_", ")_", "]_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coords_", "=_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "[_", "latitude_", ",_", "longitude_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "asn_", "=_", "asn", "\\u", "lookup_", "._", "org", "\\u", "by", "\\u", "addr_", "(_", "ns_", "._", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "[_", "ns_", "._", "ip_", ",_", "'", "regional", "'_", ",_", "'", "UNK", "NOW", "N", "'_", ",_", "''_", ",_", "ns_", "._", "hostname_", ",_", "geo_", ",_", "coords_", ",_", "asn_", ",_", "note_", ",_", "num", "\\u", "urls_", ",_", "'", " ", "'_", "._", "join_", "(_", "urls_", "[_", ":_", "2_", "]_", ")_", ",_", "ns_", "._", "version_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "._", "writerow_", "(_", "row_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Comparison of constants
rusthon/Rusthon/regtests/str/compare.py
[ { "content": "def main():\n\ta = 'XYZ'\n\tb = 'XYZ'\n\tassert( a == b )\n\n\tx = False\n\tif 'a' < 'b':\n\t\tx = True\n\n\tassert( x==True )\n\n\tassert( 'a' < 'b' )", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 4 } ]
[ { "span": "'a' < 'b':", "start_line": 10, "start_column": 4, "end_line": 10, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Compari", "son_", "of_", "constants_", "[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", "_", "a_", "=_", "'", "XY", "Z", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "'", "XY", "Z", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "a_", "==_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "a", "'_", "<_", "'", "b", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "x_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "(_", "x_", "==_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "'", "a", "'_", "<_", "'", "b", "'_", ")_", "\\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, 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 ]
Unreachable code
anandology/pyjamas/library/gwt/ui/Hidden.py
[ { "content": " def setName(self, name):\n if name is None:\n raise ValueError(\"Name cannot be null\")\n console.error(\"Name cannot be null\")\n elif len(name) == 0:\n raise ValueError(\"Name cannot be an empty string.\")\n console.error(\"Name cannot be an empty string.\")\n DOM.setAttribute(self.getElement(), \"name\", name)", "metadata": "root.Hidden.setName", "header": "['class', 'Hidden', '(', 'Widget', ')', ':', '___EOS___']", "index": 57 } ]
[ { "span": "console.error(\"Name cannot be null\")", "start_line": 60, "start_column": 12, "end_line": 60, "end_column": 48 }, { "span": "console.error(\"Name cannot be an empty string.\")", "start_line": 63, "start_column": 12, "end_line": 63, "end_column": 60 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Hidden_", "(_", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Name_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Name", " ", "cann", "ot", " ", "be", " ", "null", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "console_", "._", "error_", "(_", "\"", "Name", " ", "cann", "ot", " ", "be", " ", "null", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "name_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Name", " ", "cann", "ot", " ", "be", " ", "an", " ", "empty", " ", "string", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "console_", "._", "error_", "(_", "\"", "Name", " ", "cann", "ot", " ", "be", " ", "an", " ", "empty", " ", "string", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "DOM_", "._", "set", "Attribute_", "(_", "self_", "._", "get", "Element_", "(_", ")_", ",_", "\"", "name", "\"_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
spaceboats/busbus/busbus/provider/gtfs.py
[ { "content": "from __future__ import division\n\nimport busbus\nimport busbus.entity\nfrom busbus.queryable import Queryable\nfrom busbus import util\nfrom busbus.util.arrivals import ArrivalQueryable, ArrivalGeneratorBase\nfrom busbus.util.csv import CSVReader\n\nimport apsw\nimport arrow\nimport collections\nimport datetime\nimport hashlib\nimport heapq\nimport itertools\nimport operator\nimport os\nimport phonenumbers\nfrom pkg_resources import resource_string\nimport six\nimport zipfile\n\n\n# This must be the same as the user_version pragma in gtfs.sql\nSCHEMA_USER_VERSION = 2015020201\n\n\n\n\n\n\nFIX_TYPE_MAP = {\n 'date': date_to_sql_string,\n 'gtfstime': parse_gtfs_time,\n 'integer': int,\n 'real': float,\n 'timedelta': int,\n 'text': lambda s: s,\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 parse_gtfs_time(timestr):\n \"\"\"\n GTFS time strings are HH:MM:SS (or H:MM:SS if the hours field is less than\n 10). The time is relative to noon on a given day, and the hours field can\n go over 23 to represent a time on the following day (GTFS time never\n decreases in a given trip).\n\n This function is not quite that picky, but its behavior is undefined if\n it's given a string not following the specification.\n\n This function returns a timedelta, which contains the number of seconds\n since noon represented by a time on a given day.\n \"\"\"\n split = timestr.split(':')\n seconds = int(split[-1])\n minutes = int(split[-2]) if len(split) > 1 else 0\n hours = int(split[-3]) if len(split) > 2 else 0\n return (hours - 12) * 3600 + minutes * 60 + seconds", "metadata": "root.parse_gtfs_time", "header": "['module', '___EOS___']", "index": 28 }, { "content": "def date_to_sql_string(datestr):\n return '-'.join((datestr[:4], datestr[4:6], datestr[6:]))", "metadata": "root.date_to_sql_string", "header": "['module', '___EOS___']", "index": 48 }, { "content": "class SQLEntityMixin(object):\n\n\n\n", "metadata": "root.SQLEntityMixin", "header": "['module', '___EOS___']", "index": 62 }, { "content": " def __eq__(self, other):\n if not isinstance(other, SQLEntityMixin):\n return False\n return (self.id == getattr(other, 'id', not self.id) and\n self.provider == getattr(other, 'provider', not self.provider))", "metadata": "root.SQLEntityMixin.__eq__", "header": "['class', 'SQLEntityMixin', '(', 'object', ')', ':', '___EOS___']", "index": 64 }, { "content": " @classmethod\n def _build_select(cls, columns, named_params=False):\n query = 'select {0} from {1}'.format(\n ', '.join('{1} as {0}'.format(k, v)\n for k, v in cls.__field_map__.items()),\n cls.__table__)\n if columns:\n if named_params:\n query += ' where {0}'.format(\n ' and '.join('{0}=:{0}'.format(c) for c in columns))\n else:\n query += ' where {0}'.format(\n ' and '.join('{0}=?'.format(c) for c in columns))\n return query", "metadata": "root.SQLEntityMixin._build_select", "header": "['class', 'SQLEntityMixin', '(', 'object', ')', ':', '___EOS___']", "index": 70 }, { "content": " def _query(self, **kwargs):\n return self.provider._query(self.__class__, **kwargs)", "metadata": "root.SQLEntityMixin._query", "header": "['class', 'SQLEntityMixin', '(', 'object', ')', ':', '___EOS___']", "index": 85 }, { "content": " @classmethod\n def from_id(cls, provider, id, default=None):\n \"\"\"\n Special case of _query that doesn't require an instantiated object\n and to fetch by a specific column name.\n \"\"\"\n id_field = cls.__field_map__['id']\n result = provider._query(cls, **{id_field: id}).fetchone()\n if result is None:\n return default\n else:\n return cls(provider, **dict(result))", "metadata": "root.SQLEntityMixin.from_id", "header": "['class', 'SQLEntityMixin', '(', 'object', ')', ':', '___EOS___']", "index": 88 }, { "content": "class GTFSAgency(SQLEntityMixin, busbus.Agency):\n __table__ = 'agency'\n __field_map__ = {\n 'id': 'agency_id',\n 'name': 'agency_name',\n 'url': 'agency_url',\n 'timezone': 'agency_timezone',\n 'lang': 'agency_lang',\n 'phone_human': 'agency_phone',\n 'fare_url': 'agency_fare_url',\n }\n", "metadata": "root.GTFSAgency", "header": "['module', '___EOS___']", "index": 102 }, { "content": " def __init__(self, provider, **data):\n if data.get('lang'):\n data['lang'] = data['lang'].lower()\n if data.get('phone_human') and getattr(provider, 'country'):\n phone = phonenumbers.parse(data['phone_human'], provider.country)\n data['phone_e164'] = phonenumbers.format_number(\n phone, phonenumbers.PhoneNumberFormat.E164)\n\n super(GTFSAgency, self).__init__(provider, **data)", "metadata": "root.GTFSAgency.__init__", "header": "['class', 'GTFSAgency', '(', 'SQLEntityMixin', ',', 'busbus', '.', 'Agency', ')', ':', '___EOS___']", "index": 114 }, { "content": "class GTFSStop(SQLEntityMixin, busbus.Stop):\n __table__ = 'stops'\n __field_map__ = {\n 'id': 'stop_id',\n 'code': 'stop_code',\n 'name': 'stop_name',\n 'description': 'stop_desc',\n 'latitude': 'stop_lat',\n 'longitude': 'stop_lon',\n 'url': 'stop_url',\n '_parent_id': 'parent_station',\n 'timezone': 'stop_timezone',\n '_accessible': 'wheelchair_boarding',\n }\n\n\n", "metadata": "root.GTFSStop", "header": "['module', '___EOS___']", "index": 125 }, { "content": " def __init__(self, provider, **data):\n if data.get('_parent_id'):\n data['parent'] = busbus.entity.LazyEntityProperty(\n provider.get, busbus.Stop, data['_parent_id'])\n if not data.get('timezone'):\n data['timezone'] = provider._timezone\n if '_accessible' in data:\n pass # FIXME\n\n super(GTFSStop, self).__init__(provider, **data)", "metadata": "root.GTFSStop.__init__", "header": "['class', 'GTFSStop', '(', 'SQLEntityMixin', ',', 'busbus', '.', 'Stop', ')', ':', '___EOS___']", "index": 140 }, { "content": " @property\n def routes(self):\n result = self.provider.conn.cursor().execute(\n '''select route_id from _stops_routes where\n stop_id=? and _feed=?''',\n (self.id, self.provider.feed_id))\n return Queryable(self.provider.get(busbus.Route, row['route_id'])\n for row in result)", "metadata": "root.GTFSStop.routes", "header": "['class', 'GTFSStop', '(', 'SQLEntityMixin', ',', 'busbus', '.', 'Stop', ')', ':', '___EOS___']", "index": 151 }, { "content": " @property\n def children(self):\n result = self._query(parent_station=self.id)\n return Queryable(GTFSStop(self.provider, **dict(row))\n for row in result)", "metadata": "root.GTFSStop.children", "header": "['class', 'GTFSStop', '(', 'SQLEntityMixin', ',', 'busbus', '.', 'Stop', ')', ':', '___EOS___']", "index": 160 }, { "content": "class GTFSRoute(SQLEntityMixin, busbus.Route):\n __table__ = 'routes'\n __field_map__ = {\n 'id': 'route_id',\n '_agency_id': 'agency_id',\n 'short_name': 'route_short_name',\n 'name': 'route_long_name',\n 'description': 'route_desc',\n '_type': 'route_type',\n 'url': 'route_url',\n 'color': 'route_color',\n 'text_color': 'route_text_color',\n }\n\n\n", "metadata": "root.GTFSRoute", "header": "['module', '___EOS___']", "index": 167 }, { "content": " def __init__(self, provider, **data):\n if '_agency_id' in data:\n data['agency'] = busbus.entity.LazyEntityProperty(\n provider.get, busbus.Agency, data['_agency_id'])\n if '_type' in data:\n pass # FIXME\n if data.get('name') is None:\n data['name'] = data.pop('short_name')\n\n super(GTFSRoute, self).__init__(provider, **data)", "metadata": "root.GTFSRoute.__init__", "header": "['class', 'GTFSRoute', '(', 'SQLEntityMixin', ',', 'busbus', '.', 'Route', ')', ':', '___EOS___']", "index": 181 }, { "content": " @property\n def stops(self):\n result = self.provider.conn.cursor().execute(\n '''select stop_id from _stops_routes where\n route_id=? and _feed=?''',\n (self.id, self.provider.feed_id))\n return Queryable(self.provider.get(busbus.Stop, row['stop_id'])\n for row in result)", "metadata": "root.GTFSRoute.stops", "header": "['class', 'GTFSRoute', '(', 'SQLEntityMixin', ',', 'busbus', '.', 'Route', ')', ':', '___EOS___']", "index": 192 }, { "content": " @property\n def directions(self):\n hashes = []\n t_query = \"\"\"select trip_headsign, trip_short_name, bikes_allowed,\n trip_id from trips where route_id=:route_id and _feed=:_feed\"\"\"\n t_filter = {'route_id': self.id, '_feed': self.provider.feed_id}\n cur = self.provider.conn.cursor()\n for trip in cur.execute(t_query, t_filter):\n direction = {}\n innercur = self.provider.conn.cursor()\n result = innercur.execute(\n \"\"\"select s.* from stop_times as st join stops as s\n on st.stop_id=s.stop_id and st._feed=s._feed\n where st.trip_id=:t_id and st._feed=:_feed\"\"\",\n {'t_id': trip['trip_id'], '_feed': self.provider.feed_id})\n direction['stops'] = [GTFSStop(self.provider, **dict(row))\n for row in result]\n if trip['trip_headsign'] is not None:\n direction['headsign'] = trip['trip_headsign']\n if trip['trip_short_name'] is not None:\n direction['short_name'] = trip['trip_short_name']\n if trip['bikes_allowed'] is not None:\n direction['bikes_ok'] = trip['bikes_allowed']\n h = util.freezehash(direction)\n if h not in hashes:\n hashes.append(h)\n yield direction", "metadata": "root.GTFSRoute.directions", "header": "['class', 'GTFSRoute', '(', 'SQLEntityMixin', ',', 'busbus', '.', 'Route', ')', ':', '___EOS___']", "index": 201 }, { "content": "class GTFSArrivalGenerator(ArrivalGeneratorBase):\n realtime = False\n\n\n\n\n\n\n", "metadata": "root.GTFSArrivalGenerator", "header": "['module', '___EOS___']", "index": 230 }, { "content": " def __init__(self, provider, stops, routes, start, end):\n super(GTFSArrivalGenerator, self).__init__(provider, stops, routes,\n start, end)\n\n if self.stops is None:\n if self.routes is None:\n self.stops = self.provider.stops\n self.routes = self.provider.routes\n else:\n stops_dict = {}\n for route in self.routes:\n for stop in route.stops:\n stops_dict[stop.id] = stop\n self.stops = stops_dict.values()\n else:\n if self.routes is None:\n routes_dict = {}\n for stop in self.stops:\n for route in stop.routes:\n routes_dict[route.id] = route\n self.routes = routes_dict.values()\n\n self.service_cache = {}\n self.freq_cache = {}\n self.it = None", "metadata": "root.GTFSArrivalGenerator.__init__", "header": "['class', 'GTFSArrivalGenerator', '(', 'ArrivalGeneratorBase', ')', ':', '___EOS___']", "index": 233 }, { "content": " def _stop_times(self, stop, route):\n return self.provider.conn.cursor().execute(\n '''select t.*, arr, departure_time from\n (select trip_id, _min_arrival_time, service_id, trip_headsign,\n trip_short_name, bikes_allowed from trips where\n route_id=:route_id and _feed=:_feed) as t\n join\n (select trip_id, coalesce(arrival_time, _arrival_interpolate)\n as arr, departure_time from stop_times where stop_id=:stop_id\n and _feed=:_feed) as st\n on t.trip_id=st.trip_id order by arr asc''',\n {'stop_id': stop.id, 'route_id': route.id,\n '_feed': self.provider.feed_id})", "metadata": "root.GTFSArrivalGenerator._stop_times", "header": "['class', 'GTFSArrivalGenerator', '(', 'ArrivalGeneratorBase', ')', ':', '___EOS___']", "index": 259 }, { "content": " def _build_iterable(self):\n iters = []\n stops = busbus.Stop.add_children(self.stops)\n for stop, route in itertools.product(stops, self.routes):\n for stop_time in self._stop_times(stop, route):\n iters.append(self._build_arrivals(stop, route, stop_time))\n return heapq.merge(*iters)", "metadata": "root.GTFSArrivalGenerator._build_iterable", "header": "['class', 'GTFSArrivalGenerator', '(', 'ArrivalGeneratorBase', ')', ':', '___EOS___']", "index": 273 }, { "content": " def _build_arrivals(self, stop, route, stop_time):\n def build_arr(day, offset=None):\n if offset is None:\n offset = datetime.timedelta()\n time = day + datetime.timedelta(seconds=stop_time['arr']) + offset\n if not (self.start <= time <= self.end):\n return\n dep = (day + stop_time['departure_time'] + offset if\n stop_time['departure_time'] else None)\n bikes_ok = {1: True, 2: False}.get(stop_time['bikes_allowed'])\n return busbus.Arrival(self.provider, stop=stop, route=route,\n time=time, departure_time=dep,\n headsign=stop_time['trip_headsign'],\n short_name=stop_time['trip_short_name'],\n bikes_ok=bikes_ok, realtime=False)\n\n days = filter(self._valid_date_filter(stop_time['service_id']),\n arrow.Arrow.range('day', self.start.floor('day'),\n self.end.ceil('day')))\n freqs = self._frequencies(stop_time['trip_id'])\n trip_start = stop_time['_min_arrival_time']\n for day in days:\n # GTFS time is relative to noon\n day = day.replace(hours=12)\n for freq in freqs:\n freq_start = day + freq['start_time']\n freq_end = day + freq['end_time']\n rel_time = freq_start - (day + trip_start)\n offset = datetime.timedelta()\n while freq_start + offset <= freq_end:\n arrival = build_arr(day, offset + rel_time)\n if arrival:\n yield arrival\n offset += freq['headway_secs']\n if not freqs:\n arrival = build_arr(day)\n if arrival:\n yield arrival", "metadata": "root.GTFSArrivalGenerator._build_arrivals", "header": "['class', 'GTFSArrivalGenerator', '(', 'ArrivalGeneratorBase', ')', ':', '___EOS___']", "index": 281 }, { "content": " def _valid_date_filter(self, service_id):\n def valid_date(day):\n serv = self._service(service_id)\n weekday = day.format('dddd').lower()\n day = day.date() # convert from Arrow to datetime.date\n # schedule exceptions: 1 = added, 2 = removed\n return ((serv['start_date'] <= day <= serv['end_date']) and\n (serv['exceptions'].get(day, 0) != 2) and\n (serv[weekday] or serv['exceptions'].get(day, 0) == 1))\n return valid_date", "metadata": "root.GTFSArrivalGenerator._valid_date_filter", "header": "['class', 'GTFSArrivalGenerator', '(', 'ArrivalGeneratorBase', ')', ':', '___EOS___']", "index": 320 }, { "content": " def _frequencies(self, trip_id):\n if trip_id not in self.freq_cache:\n query = \"\"\"select start_time, end_time, headway_secs\n from frequencies where trip_id=:trip_id and\n _feed=:_feed order by start_time asc\"\"\"\n filter = {'trip_id': trip_id, '_feed': self.provider.feed_id}\n cur = self.provider.conn.cursor()\n self.freq_cache[trip_id] = cur.execute(query, filter).fetchall()\n return self.freq_cache[trip_id]", "metadata": "root.GTFSArrivalGenerator._frequencies", "header": "['class', 'GTFSArrivalGenerator', '(', 'ArrivalGeneratorBase', ')', ':', '___EOS___']", "index": 331 }, { "content": " def _service(self, id):\n if id not in self.service_cache:\n c_query = \"\"\"select start_date, end_date, monday, tuesday,\n wednesday, thursday, friday, saturday, sunday from calendar\n where service_id=:service_id and _feed=:_feed\"\"\"\n c_filter = {'service_id': id, '_feed': self.provider.feed_id}\n cur = self.provider.conn.cursor()\n self.service_cache[id] = dict(next(cur.execute(c_query, c_filter)))\n\n cd_query = \"\"\"select date, exception_type as e from calendar_dates\n where service_id=:service_id and _feed=:_feed\"\"\"\n cd_result = cur.execute(cd_query, c_filter)\n self.service_cache[id]['exceptions'] = {r['date']: r['e']\n for r in cd_result}\n return self.service_cache[id]", "metadata": "root.GTFSArrivalGenerator._service", "header": "['class', 'GTFSArrivalGenerator', '(', 'ArrivalGeneratorBase', ')', ':', '___EOS___']", "index": 341 }, { "content": "def gtfs_row_tracer(cur, row):\n type_map = {\n 'date': lambda s: datetime.date(int(s[:4]), int(s[5:7]), int(s[8:])),\n 'gtfstime': lambda i: datetime.timedelta(seconds=i),\n 'timedelta': lambda i: datetime.timedelta(seconds=i),\n }\n desc = cur.getdescription()\n return {desc[i][0]: (type_map.get(desc[i][1], lambda s: s)(x)\n if row[i] is not None else None)\n for i, x in enumerate(row)}", "metadata": "root.gtfs_row_tracer", "header": "['module', '___EOS___']", "index": 358 }, { "content": "class GTFSMixin(object):\n \"\"\"\n Mixin to parse transit data from a General Transit Feed Specification feed.\n\n GTFS is defined at https://developers.google.com/transit/gtfs/\n \"\"\"\n\n\n\n\n\n\n\n\n", "metadata": "root.GTFSMixin", "header": "['module', '___EOS___']", "index": 370 }, { "content": " def __init__(self, engine, gtfs_url):\n super(GTFSMixin, self).__init__(engine)\n\n if isinstance(self.engine.config['gtfs_db_path'], apsw.Connection):\n self.conn = self.engine.config['gtfs_db_path']\n else:\n self.conn = apsw.Connection(self.engine.config['gtfs_db_path'])\n self.conn.setrowtrace(gtfs_row_tracer)\n cur = self.conn.cursor()\n\n version = next(cur.execute('pragma user_version'))['user_version']\n if version == 0:\n script = resource_string(\n __name__, 'gtfs_{0}.sql'.format(SCHEMA_USER_VERSION))\n if isinstance(script, six.binary_type):\n script = script.decode('utf-8')\n cur.execute(script)\n elif version < SCHEMA_USER_VERSION:\n raise NotImplementedError()\n elif version > SCHEMA_USER_VERSION:\n raise RuntimeError('Database version is {0}, but only version {1} '\n 'is known'.format(version, SCHEMA_USER_VERSION))\n\n tables = [r['name'] for r in cur.execute('select name from '\n 'sqlite_master where '\n 'type=\"table\"')\n if not r['name'].startswith('_')]\n\n if isinstance(gtfs_url, six.binary_type):\n gtfs_url = gtfs_url.decode('utf-8')\n resp = self._cached_requests.get(gtfs_url)\n zip = six.BytesIO(resp.content).getvalue()\n hash = hashlib.sha256(zip).hexdigest()\n\n resp = [x['id'] for x in cur.execute(\n 'select id from _feeds where url=? AND sha256sum=?',\n (gtfs_url, hash))]\n if len(resp) == 1:\n self.feed_id = resp[0]\n else:\n cur.execute('begin transaction')\n old_ids = [(x['id'],) for x in cur.execute(\n '''select id from _feeds where url=?''', (gtfs_url,))]\n cur.executemany('delete from _feeds where id=?', old_ids)\n for table in tables:\n cur.executemany('delete from {0} where _feed=?'.format(table),\n old_ids)\n\n cur.execute('insert into _feeds (url, sha256sum) '\n 'values (?, ?)', (gtfs_url, hash))\n self.feed_id = self.conn.last_insert_rowid()\n with zipfile.ZipFile(six.BytesIO(zip)) as z:\n for table in tables:\n filename = table + '.txt'\n if filename not in z.namelist():\n continue\n with z.open(filename) as f:\n data = CSVReader(f)\n columns = []\n coldata = []\n for x in cur.execute(\n 'pragma table_info({0})'.format(table)):\n if x['name'] in data.header:\n columns.append(x['name'])\n coldata.append((\n x['type'], data.header.index(x['name'])))\n # _feed must be at end\n columns.append('_feed')\n\n stmt = ('insert into {0} ({1}) values ({2})'\n .format(table, ', '.join(columns),\n ', '.join(('?',) * len(columns))))\n\n def row_gen(row):\n for t, idx in coldata:\n if idx < len(row) and row[idx] is not None:\n yield FIX_TYPE_MAP[t](row[idx])\n else:\n yield None\n yield self.feed_id\n cur.executemany(stmt, (row_gen(row) for row in data))\n cur.execute('commit transaction')\n\n cur.execute('begin transaction')\n for row in cur.execute(\n '''select trip_id from trips where _feed=?''',\n (self.feed_id,)):\n innercur = self.conn.cursor()\n trip_id = row['trip_id']\n\n # interpolate missing stop times\n known_times = {r['seq']: dict(r) for r in innercur.execute(\n '''select arrival_time as a, departure_time as d,\n stop_sequence as seq from stop_times where trip_id=:trip_id\n and _feed=:_feed and arrival_time is not null\n order by stop_sequence asc''',\n {'trip_id': trip_id, '_feed': self.feed_id})}\n if not known_times:\n # this trip is headway only\n continue\n unknown_times = [r['stop_sequence'] for r in innercur.execute(\n '''select stop_sequence from stop_times where\n trip_id=:trip_id and _feed=:_feed and\n arrival_time is null order by stop_sequence asc''',\n {'trip_id': trip_id, '_feed': self.feed_id})]\n for i, seq in enumerate(unknown_times):\n left = max(filter(lambda k: k < seq, known_times))\n right = min(filter(lambda k: k > seq, known_times))\n start = known_times[left].get('d', known_times[left]['a'])\n gap = known_times[right]['a'] - start\n count = len(list(filter(lambda k: left < k < right,\n unknown_times))) + 1\n time = ((gap.total_seconds() * (i + 1) / count) +\n start.total_seconds())\n innercur.execute(\n '''update stop_times set _arrival_interpolate=:a where\n trip_id=:trip_id and _feed=:_feed and\n stop_sequence=:seq''',\n {'trip_id': trip_id, '_feed': self.feed_id,\n 'a': time, 'seq': seq})\n\n # fill in _min_arrival_time\n min_time = innercur.execute(\n '''select min(coalesce(arrival_time, _arrival_interpolate))\n as min_time from stop_times where trip_id=? and _feed=?''',\n (trip_id, self.feed_id)).fetchone()['min_time']\n innercur.execute('''update trips set _min_arrival_time=?\n where trip_id=? and _feed=?''',\n (min_time, trip_id, self.feed_id))\n\n cur.execute(\n '''insert into _stops_routes (stop_id, route_id, _feed)\n select distinct st.stop_id, t.route_id, t._feed from\n (select trip_id, stop_id from stop_times where _feed=:_feed)\n as st join\n (select trip_id, route_id, _feed from trips where _feed=:_feed)\n as t on st.trip_id=t.trip_id''', {'_feed': self.feed_id})\n cur.execute('commit transaction')", "metadata": "root.GTFSMixin.__init__", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 377 }, { "content": " def _query(self, cls, **kwargs):\n if '_feed' not in kwargs:\n kwargs['_feed'] = self.feed_id\n cur = self.conn.cursor()\n return cur.execute(cls._build_select(\n kwargs.keys(), named_params=True), kwargs)", "metadata": "root.GTFSMixin._query", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 516 }, { "content": " def _entity_builder(self, cls, **kwargs):\n query = self._query(cls, **kwargs)\n return Queryable(cls(self, **row) for row in query)", "metadata": "root.GTFSMixin._entity_builder", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 523 }, { "content": " def get(self, cls, id, default=None):\n typemap = {\n busbus.Agency: GTFSAgency,\n busbus.Stop: GTFSStop,\n busbus.Route: GTFSRoute,\n }\n try:\n cls = util.entity_type(cls)\n except TypeError:\n return default\n if cls in typemap:\n return typemap[cls].from_id(self, id, default)\n else:\n return default", "metadata": "root.GTFSMixin.get", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 527 }, { "content": " @property\n def _timezone(self):\n for agency in self.agencies:\n if agency.timezone:\n return agency.timezone\n return None", "metadata": "root.GTFSMixin._timezone", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 542 }, { "content": " @property\n def agencies(self):\n return self._entity_builder(GTFSAgency)", "metadata": "root.GTFSMixin.agencies", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 549 }, { "content": " @property\n def stops(self):\n return self._entity_builder(GTFSStop)", "metadata": "root.GTFSMixin.stops", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 553 }, { "content": " @property\n def routes(self):\n return self._entity_builder(GTFSRoute)", "metadata": "root.GTFSMixin.routes", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 557 }, { "content": " @property\n def arrivals(self):\n return ArrivalQueryable(self, GTFSArrivalGenerator)", "metadata": "root.GTFSMixin.arrivals", "header": "['class', 'GTFSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 561 } ]
[ { "span": "import collections", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 18 }, { "span": "import operator", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 15 }, { "span": "import os", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 9 } ]
[]
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_", "bus", "bus_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "bus", "bus_", "._", "entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bus", "bus_", "._", "query", "able_", "import_", "Query", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bus", "bus_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bus", "bus_", "._", "util_", "._", "arrival", "s_", "import_", "Arriv", "al", "Query", "able_", ",_", "Arriv", "al", "Generat", "or", "Base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bus", "bus_", "._", "util_", "._", "csv_", "import_", "CSV", "Reader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "aps", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "arrow_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "heapq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "itertools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "phone", "numbers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pkg", "\\u", "resources_", "import_", "resource", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zipfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "must", " ", "be", " ", "the", " ", "same", " ", "as", " ", "the", " ", "user", "\\u", "version", " ", "pragma", " ", "in", " ", "gtfs", ".", "sql_", "\\u\\u\\uNL\\u\\u\\u_", "SCHE", "MA", "\\u", "USER", "\\u", "VERSION_", "=_", "20150", "2020", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "FIX", "\\u", "TYPE", "\\u", "MAP_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "date", "\\u", "to", "\\u", "sql", "\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gtfs", "time", "'_", ":_", "parse", "\\u", "gtfs", "\\u", "time_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "integ", "er", "'_", ":_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "real", "'_", ":_", "float_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timedelta", "'_", ":_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "lambda_", "s_", ":_", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "parse", "\\u", "gtfs", "\\u", "time_", "(_", "timestr", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "GT", "FS", " ", "time", " ", "string", "s", " ", "are", " ", "HH", ":", "MM", ":", "SS", " ", "(", "or", " ", "H", ":", "MM", ":", "SS", " ", "if", " ", "the", " ", "hour", "s", " ", "field", " ", "is", " ", "less", " ", "than", "\\", "10", ";", " ", " ", " ", " ", "10", ").", " ", "The", " ", "time", " ", "is", " ", "relative", " ", "to", " ", "noo", "n", " ", "on", " ", "a", " ", "give", "n", " ", "day", ",", " ", "and", " ", "the", " ", "hour", "s", " ", "field", " ", "can", "\\", "10", ";", " ", " ", " ", " ", "go", " ", "over", " ", "23", " ", "to", " ", "represent", " ", "a", " ", "time", " ", "on", " ", "the", " ", "follow", "ing", " ", "day", " ", "(", "GT", "FS", " ", "time", " ", "neve", "r", "\\", "10", ";", " ", " ", " ", " ", "decrease", "s", " ", "in", " ", "a", " ", "give", "n", " ", "trip", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "is", " ", "not", " ", "quite", " ", "tha", "t", " ", "pick", "y", ",", " ", "but", " ", "its", " ", "behavior", " ", "is", " ", "undefined", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "it", "'", "s", " ", "give", "n", " ", "a", " ", "string", " ", "not", " ", "follow", "ing", " ", "the", " ", "specifica", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "return", "s", " ", "a", " ", "timedelta", ",", " ", "whi", "ch", " ", "contain", "s", " ", "the", " ", "number", " ", "of", " ", "second", "s", "\\", "10", ";", " ", " ", " ", " ", "sinc", "e", " ", "noo", "n", " ", "represent", "ed", " ", "by", " ", "a", " ", "time", " ", "on", " ", "a", " ", "give", "n", " ", "day", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split_", "=_", "timestr", "_", "._", "split_", "(_", "':'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seconds_", "=_", "int_", "(_", "split_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minutes_", "=_", "int_", "(_", "split_", "[_", "-_", "2_", "]_", ")_", "if_", "len_", "(_", "split_", ")_", ">_", "1_", "else_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hours_", "=_", "int_", "(_", "split_", "[_", "-_", "3_", "]_", ")_", "if_", "len_", "(_", "split_", ")_", ">_", "2_", "else_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "hours_", "-_", "12_", ")_", "*_", "3600_", "+_", "minutes_", "*_", "60_", "+_", "seconds_", "\\u\\u\\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_", "date", "\\u", "to", "\\u", "sql", "\\u", "string_", "(_", "datestr", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'-'_", "._", "join_", "(_", "(_", "datestr", "_", "[_", ":_", "4_", "]_", ",_", "datestr", "_", "[_", "4_", ":_", "6_", "]_", ",_", "datestr", "_", "[_", "6_", ":_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "SQL", "Entit", "y", "Mixin_", "(_", "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_", "[SEP]_", "class_", "SQL", "Entit", "y", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "other_", ",_", "SQL", "Entit", "y", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "self_", "._", "id_", "==_", "getattr_", "(_", "other_", ",_", "'", "id", "'_", ",_", "not_", "self_", "._", "id_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "provider_", "==_", "getattr_", "(_", "other_", ",_", "'", "provide", "r", "'_", ",_", "not_", "self_", "._", "provider_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Entit", "y", "Mixin_", "(_", "object_", ")_", ":_", "\\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", "build", "\\u", "select_", "(_", "cls_", ",_", "columns_", ",_", "named", "\\u", "params_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "'", "select", " ", "{", "0", "}", " ", "from", " ", "{", "1", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "'{", "1", "}", " ", "as", " ", "{", "0", "}'_", "._", "format_", "(_", "k_", ",_", "v_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "cls_", "._", "\\u\\u", "field", "\\u", "map", "\\u\\u_", "._", "items_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cls_", "._", "\\u\\u", "table\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "named", "\\u", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "+=_", "'", " ", "where", " ", "{", "0", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "and", " ", "'_", "._", "join_", "(_", "'{", "0", "}=", ":", "{", "0", "}'_", "._", "format_", "(_", "c_", ")_", "for_", "c_", "in_", "columns_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "+=_", "'", " ", "where", " ", "{", "0", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "and", " ", "'_", "._", "join_", "(_", "'{", "0", "}=", "?'_", "._", "format_", "(_", "c_", ")_", "for_", "c_", "in_", "columns_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Entit", "y", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "query_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "provider_", "._", "\\u", "query_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Entit", "y", "Mixin_", "(_", "object_", ")_", ":_", "\\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_", "from", "\\u", "id_", "(_", "cls_", ",_", "provider_", ",_", "id_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Special", " ", "case", " ", "of", " ", "\\u", "query", " ", "tha", "t", " ", "doe", "sn", "'", "t", " ", "require", " ", "an", " ", "instantiate", "d", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "to", " ", "fetch", " ", "by", " ", "a", " ", "specific", " ", "column", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id", "\\u", "field_", "=_", "cls_", "._", "\\u\\u", "field", "\\u", "map", "\\u\\u_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "provider_", "._", "\\u", "query_", "(_", "cls_", ",_", "**_", "{_", "id", "\\u", "field_", ":_", "id_", "}_", ")_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cls_", "(_", "provider_", ",_", "**_", "dict_", "(_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "GT", "FS", "Agency", "_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Agency", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "table\\u\\u_", "=_", "'", "agency", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "field", "\\u", "map", "\\u\\u_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "'", "agency", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "agency", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "'", "agency", "\\u", "url", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timezon", "e", "'_", ":_", "'", "agency", "\\u", "timezon", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lang", "'_", ":_", "'", "agency", "\\u", "lang", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "\\u", "human", "'_", ":_", "'", "agency", "\\u", "phone", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fare", "\\u", "url", "'_", ":_", "'", "agency", "\\u", "fare", "\\u", "url", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Agency", "_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Agency", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "provider_", ",_", "**_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "data_", "._", "get_", "(_", "'", "lang", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "lang", "'_", "]_", "=_", "data_", "[_", "'", "lang", "'_", "]_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", "._", "get_", "(_", "'", "phone", "\\u", "human", "'_", ")_", "and_", "getattr_", "(_", "provider_", ",_", "'", "countr", "y", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "phone_", "=_", "phone", "numbers_", "._", "parse_", "(_", "data_", "[_", "'", "phone", "\\u", "human", "'_", "]_", ",_", "provider_", "._", "country_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "phone", "\\u", "e1", "64", "'_", "]_", "=_", "phone", "numbers_", "._", "format\\u", "number_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "phone_", ",_", "phone", "numbers_", "._", "Phone", "Number", "Format_", "._", "E1", "64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "GT", "FS", "Agency", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "provider_", ",_", "**_", "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_", "GT", "FS", "Stop_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Stop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "table\\u\\u_", "=_", "'", "stop", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "field", "\\u", "map", "\\u\\u_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "'", "stop", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "'_", ":_", "'", "stop", "\\u", "code", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "stop", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "'", "stop", "\\u", "desc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "latitude", "'_", ":_", "'", "stop", "\\u", "lat", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "longitude", "'_", ":_", "'", "stop", "\\u", "lon", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "'", "stop", "\\u", "url", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "parent", "\\u", "id", "'_", ":_", "'", "parent", "\\u", "station", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timezon", "e", "'_", ":_", "'", "stop", "\\u", "timezon", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "accessible", "'_", ":_", "'", "wheel", "chair", "\\u", "board", "ing", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "GT", "FS", "Stop_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Stop_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "provider_", ",_", "**_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "data_", "._", "get_", "(_", "'\\u", "parent", "\\u", "id", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "parent", "'_", "]_", "=_", "bus", "bus_", "._", "entity_", "._", "La", "zy", "Entit", "y", "Property_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "provider_", "._", "get_", ",_", "bus", "bus_", "._", "Stop_", ",_", "data_", "[_", "'\\u", "parent", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "data_", "._", "get_", "(_", "'", "timezon", "e", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "timezon", "e", "'_", "]_", "=_", "provider_", "._", "\\u", "timezone_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'\\u", "accessible", "'_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "#", " ", "FIX", "ME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "GT", "FS", "Stop_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "provider_", ",_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Stop_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Stop_", ")_", ":_", "\\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_", "routes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "provider_", "._", "conn_", "._", "cursor_", "(_", ")_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "select", " ", "route", "\\u", "id", " ", "from", " ", "\\u", "stop", "s", "\\u", "route", "s", " ", "where", "\\", "10", ";", " ", " ", " ", " ", "stop", "\\u", "id", "=?", " ", "and", " ", "\\u", "feed", "=?", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "id_", ",_", "self_", "._", "provider_", "._", "feed", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Query", "able_", "(_", "self_", "._", "provider_", "._", "get_", "(_", "bus", "bus_", "._", "Route_", ",_", "row_", "[_", "'", "route", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Stop_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Stop_", ")_", ":_", "\\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_", "children_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "query_", "(_", "parent", "\\u", "station_", "=_", "self_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Query", "able_", "(_", "GT", "FS", "Stop_", "(_", "self_", "._", "provider_", ",_", "**_", "dict_", "(_", "row_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "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_", "GT", "FS", "Route_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Route_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "table\\u\\u_", "=_", "'", "route", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "field", "\\u", "map", "\\u\\u_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "'", "route", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "agency", "\\u", "id", "'_", ":_", "'", "agency", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "short", "\\u", "name", "'_", ":_", "'", "route", "\\u", "short", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "route", "\\u", "long", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "'", "route", "\\u", "desc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "type", "'_", ":_", "'", "route", "\\u", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "'", "route", "\\u", "url", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "color", "'_", ":_", "'", "route", "\\u", "color", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "\\u", "color", "'_", ":_", "'", "route", "\\u", "text", "\\u", "color", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "GT", "FS", "Route_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Route_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "provider_", ",_", "**_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'\\u", "agency", "\\u", "id", "'_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "agency", "'_", "]_", "=_", "bus", "bus_", "._", "entity_", "._", "La", "zy", "Entit", "y", "Property_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "provider_", "._", "get_", ",_", "bus", "bus_", "._", "Agency", "_", ",_", "data_", "[_", "'\\u", "agency", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'\\u", "type", "'_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "#", " ", "FIX", "ME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", "._", "get_", "(_", "'", "name", "'_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "name", "'_", "]_", "=_", "data_", "._", "pop_", "(_", "'", "short", "\\u", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "GT", "FS", "Route_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "provider_", ",_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Route_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Route_", ")_", ":_", "\\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_", "stops_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "provider_", "._", "conn_", "._", "cursor_", "(_", ")_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "select", " ", "stop", "\\u", "id", " ", "from", " ", "\\u", "stop", "s", "\\u", "route", "s", " ", "where", "\\", "10", ";", " ", " ", " ", " ", "route", "\\u", "id", "=?", " ", "and", " ", "\\u", "feed", "=?", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "id_", ",_", "self_", "._", "provider_", "._", "feed", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Query", "able_", "(_", "self_", "._", "provider_", "._", "get_", "(_", "bus", "bus_", "._", "Stop_", ",_", "row_", "[_", "'", "stop", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Route_", "(_", "SQL", "Entit", "y", "Mixin_", ",_", "bus", "bus_", "._", "Route_", ")_", ":_", "\\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_", "directions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hashes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "query_", "=_", "\"\"\"", "select", " ", "trip", "\\u", "head", "sign", ",", " ", "trip", "\\u", "short", "\\u", "name", ",", " ", "bike", "s", "\\u", "allow", "ed", ",", "\\", "10", ";", " ", " ", " ", " ", "trip", "\\u", "id", " ", "from", " ", "trips", " ", "where", " ", "route", "\\u", "id", "=", ":", "route", "\\u", "id", " ", "and", " ", "\\u", "feed", "=", ":\\u", "feed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "filter_", "=_", "{_", "'", "route", "\\u", "id", "'_", ":_", "self_", "._", "id_", ",_", "'\\u", "feed", "'_", ":_", "self_", "._", "provider_", "._", "feed", "\\u", "id_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "self_", "._", "provider_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "trip_", "in_", "cur_", "._", "execute_", "(_", "t", "\\u", "query_", ",_", "t", "\\u", "filter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "direction_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inner", "cur_", "=_", "self_", "._", "provider_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "inner", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "select", " ", "s", ".*", " ", "from", " ", "stop", "\\u", "times", " ", "as", " ", "st", " ", "join", " ", "stop", "s", " ", "as", " ", "s", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "st", ".", "stop", "\\u", "id", "=", "s", ".", "stop", "\\u", "id", " ", "and", " ", "st", ".\\u", "feed", "=", "s", ".\\u", "feed", "\\", "10", ";", " ", " ", " ", " ", "where", " ", "st", ".", "trip", "\\u", "id", "=", ":", "t", "\\u", "id", " ", "and", " ", "st", ".\\u", "feed", "=", ":\\u", "feed", "\"\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "t", "\\u", "id", "'_", ":_", "trip_", "[_", "'", "trip", "\\u", "id", "'_", "]_", ",_", "'\\u", "feed", "'_", ":_", "self_", "._", "provider_", "._", "feed", "\\u", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "direction_", "[_", "'", "stop", "s", "'_", "]_", "=_", "[_", "GT", "FS", "Stop_", "(_", "self_", "._", "provider_", ",_", "**_", "dict_", "(_", "row_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "result_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "trip_", "[_", "'", "trip", "\\u", "head", "sign", "'_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "direction_", "[_", "'", "head", "sign", "'_", "]_", "=_", "trip_", "[_", "'", "trip", "\\u", "head", "sign", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "trip_", "[_", "'", "trip", "\\u", "short", "\\u", "name", "'_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "direction_", "[_", "'", "short", "\\u", "name", "'_", "]_", "=_", "trip_", "[_", "'", "trip", "\\u", "short", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "trip_", "[_", "'", "bike", "s", "\\u", "allow", "ed", "'_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "direction_", "[_", "'", "bike", "s", "\\u", "ok", "'_", "]_", "=_", "trip_", "[_", "'", "bike", "s", "\\u", "allow", "ed", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h_", "=_", "util_", "._", "freez", "eh", "ash_", "(_", "direction_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "h_", "not_", "in_", "hashes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hashes_", "._", "append_", "(_", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "direction_", "\\u\\u\\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_", "GT", "FS", "Arriv", "al", "Generator_", "(_", "Arriv", "al", "Generat", "or", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "realtime", "_", "=_", "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_", "[SEP]_", "class_", "GT", "FS", "Arriv", "al", "Generator_", "(_", "Arriv", "al", "Generat", "or", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "provider_", ",_", "stops_", ",_", "routes_", ",_", "start_", ",_", "end_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "GT", "FS", "Arriv", "al", "Generator_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "provider_", ",_", "stops_", ",_", "routes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "stops_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "routes_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stops_", "=_", "self_", "._", "provider_", "._", "stops_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "routes_", "=_", "self_", "._", "provider_", "._", "routes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stop", "s", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "route_", "in_", "self_", "._", "routes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "stop_", "in_", "route_", "._", "stops_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "stop", "s", "\\u", "dict_", "[_", "stop_", "._", "id_", "]_", "=_", "stop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stops_", "=_", "stop", "s", "\\u", "dict_", "._", "values_", "(_", ")_", "\\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_", "self_", "._", "routes_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "route", "s", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "stop_", "in_", "self_", "._", "stops_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "route_", "in_", "stop_", "._", "routes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "route", "s", "\\u", "dict_", "[_", "route_", "._", "id_", "]_", "=_", "route_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "routes_", "=_", "route", "s", "\\u", "dict_", "._", "values_", "(_", ")_", "\\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_", "._", "service", "\\u", "cache_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "freq", "\\u", "cache_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "it_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Arriv", "al", "Generator_", "(_", "Arriv", "al", "Generat", "or", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "stop", "\\u", "times_", "(_", "self_", ",_", "stop_", ",_", "route_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "provider_", "._", "conn_", "._", "cursor_", "(_", ")_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "select", " ", "t", ".*", ",", " ", "arr", ",", " ", "departure", "\\u", "time", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "(", "select", " ", "trip", "\\u", "id", ",", " ", "\\u", "min", "\\u", "arrival", "\\u", "time", ",", " ", "service", "\\u", "id", ",", " ", "trip", "\\u", "head", "sign", ",", "\\", "10", ";", " ", " ", " ", " ", "trip", "\\u", "short", "\\u", "name", ",", " ", "bike", "s", "\\u", "allow", "ed", " ", "from", " ", "trips", " ", "where", "\\", "10", ";", " ", " ", " ", " ", "route", "\\u", "id", "=", ":", "route", "\\u", "id", " ", "and", " ", "\\u", "feed", "=", ":\\u", "feed", ")", " ", "as", " ", "t", "\\", "10", ";", " ", " ", " ", " ", "join", "\\", "10", ";", " ", " ", " ", " ", "(", "select", " ", "trip", "\\u", "id", ",", " ", "coalesce", "(", "arrival", "\\u", "time", ",", " ", "\\u", "arrival", "\\u", "interpolat", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "arr", ",", " ", "departure", "\\u", "time", " ", "from", " ", "stop", "\\u", "times", " ", "where", " ", "stop", "\\u", "id", "=", ":", "stop", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "\\u", "feed", "=", ":\\u", "feed", ")", " ", "as", " ", "st", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "t", ".", "trip", "\\u", "id", "=", "st", ".", "trip", "\\u", "id", " ", "order", " ", "by", " ", "arr", " ", "asc", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "stop", "\\u", "id", "'_", ":_", "stop_", "._", "id_", ",_", "'", "route", "\\u", "id", "'_", ":_", "route_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "feed", "'_", ":_", "self_", "._", "provider_", "._", "feed", "\\u", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Arriv", "al", "Generator_", "(_", "Arriv", "al", "Generat", "or", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "build", "\\u", "iterable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stops_", "=_", "bus", "bus_", "._", "Stop_", "._", "add", "\\u", "children_", "(_", "self_", "._", "stops_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "stop_", ",_", "route_", "in_", "itertools_", "._", "product_", "(_", "stops_", ",_", "self_", "._", "routes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "stop", "\\u", "time_", "in_", "self_", "._", "\\u", "stop", "\\u", "times_", "(_", "stop_", ",_", "route_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iters_", "._", "append_", "(_", "self_", "._", "\\u", "build", "\\u", "arrival", "s_", "(_", "stop_", ",_", "route_", ",_", "stop", "\\u", "time_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "heapq_", "._", "merge_", "(_", "*_", "iters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Arriv", "al", "Generator_", "(_", "Arriv", "al", "Generat", "or", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "build", "\\u", "arrival", "s_", "(_", "self_", ",_", "stop_", ",_", "route_", ",_", "stop", "\\u", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "build", "\\u", "arr_", "(_", "day_", ",_", "offset_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "offset_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "datetime_", "._", "timedelta_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "=_", "day_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "stop", "\\u", "time_", "[_", "'", "arr", "'_", "]_", ")_", "+_", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "self_", "._", "start_", "<=_", "time_", "<=_", "self_", "._", "end_", ")_", ":_", "\\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_", "dep_", "=_", "(_", "day_", "+_", "stop", "\\u", "time_", "[_", "'", "departure", "\\u", "time", "'_", "]_", "+_", "offset_", "if_", "\\u\\u\\uNL\\u\\u\\u_", "stop", "\\u", "time_", "[_", "'", "departure", "\\u", "time", "'_", "]_", "else_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bike", "s", "\\u", "ok_", "=_", "{_", "1_", ":_", "True_", ",_", "2_", ":_", "False_", "}_", "._", "get_", "(_", "stop", "\\u", "time_", "[_", "'", "bike", "s", "\\u", "allow", "ed", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "bus", "bus_", "._", "Arriv", "al_", "(_", "self_", "._", "provider_", ",_", "stop_", "=_", "stop_", ",_", "route_", "=_", "route_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "=_", "time_", ",_", "departure", "\\u", "time_", "=_", "dep_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "head", "sign_", "=_", "stop", "\\u", "time_", "[_", "'", "trip", "\\u", "head", "sign", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "short", "\\u", "name_", "=_", "stop", "\\u", "time_", "[_", "'", "trip", "\\u", "short", "\\u", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bike", "s", "\\u", "ok_", "=_", "bike", "s", "\\u", "ok_", ",_", "realtime", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "days_", "=_", "filter_", "(_", "self_", "._", "\\u", "valid", "\\u", "date", "\\u", "filter_", "(_", "stop", "\\u", "time_", "[_", "'", "service", "\\u", "id", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arrow_", "._", "Arrow", "_", "._", "range_", "(_", "'", "day", "'_", ",_", "self_", "._", "start_", "._", "floor_", "(_", "'", "day", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "end_", "._", "ceil_", "(_", "'", "day", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "freqs_", "=_", "self_", "._", "\\u", "frequencies_", "(_", "stop", "\\u", "time_", "[_", "'", "trip", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trip", "\\u", "start_", "=_", "stop", "\\u", "time_", "[_", "'\\u", "min", "\\u", "arrival", "\\u", "time", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "day_", "in_", "days_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "GT", "FS", " ", "time", " ", "is", " ", "relative", " ", "to", " ", "noo", "n_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "day_", "=_", "day_", "._", "replace_", "(_", "hours_", "=_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "freq_", "in_", "freqs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "freq", "\\u", "start_", "=_", "day_", "+_", "freq_", "[_", "'", "start", "\\u", "time", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "freq", "\\u", "end_", "=_", "day_", "+_", "freq_", "[_", "'", "end", "\\u", "time", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rel", "\\u", "time_", "=_", "freq", "\\u", "start_", "-_", "(_", "day_", "+_", "trip", "\\u", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "datetime_", "._", "timedelta_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "freq", "\\u", "start_", "+_", "offset_", "<=_", "freq", "\\u", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "arrival", "_", "=_", "build", "\\u", "arr_", "(_", "day_", ",_", "offset_", "+_", "rel", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arrival", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "yield_", "arrival", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "offset_", "+=_", "freq_", "[_", "'", "head", "way", "\\u", "secs", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "freqs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arrival", "_", "=_", "build", "\\u", "arr_", "(_", "day_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arrival", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "arrival", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Arriv", "al", "Generator_", "(_", "Arriv", "al", "Generat", "or", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "valid", "\\u", "date", "\\u", "filter_", "(_", "self_", ",_", "service", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "valid", "\\u", "date_", "(_", "day_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "serv_", "=_", "self_", "._", "\\u", "service_", "(_", "service", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "weekday_", "=_", "day_", "._", "format_", "(_", "'", "ddd", "d", "'_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "day_", "=_", "day_", "._", "date_", "(_", ")_", "#", " ", "convert", " ", "from", " ", "Arrow", " ", "to", " ", "datetime", ".", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "schedule", " ", "exception", "s", ":", " ", "1", " ", "=", " ", "adde", "d", ",", " ", "2", " ", "=", " ", "removed_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "(_", "serv_", "[_", "'", "start", "\\u", "date", "'_", "]_", "<=_", "day_", "<=_", "serv_", "[_", "'", "end", "\\u", "date", "'_", "]_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "serv_", "[_", "'", "exception", "s", "'_", "]_", "._", "get_", "(_", "day_", ",_", "0_", ")_", "!=_", "2_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "serv_", "[_", "weekday_", "]_", "or_", "serv_", "[_", "'", "exception", "s", "'_", "]_", "._", "get_", "(_", "day_", ",_", "0_", ")_", "==_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "valid", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Arriv", "al", "Generator_", "(_", "Arriv", "al", "Generat", "or", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "frequencies_", "(_", "self_", ",_", "trip", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "trip", "\\u", "id_", "not_", "in_", "self_", "._", "freq", "\\u", "cache_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "\"\"\"", "select", " ", "start", "\\u", "time", ",", " ", "end", "\\u", "time", ",", " ", "head", "way", "\\u", "secs", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "freque", "ncie", "s", " ", "where", " ", "trip", "\\u", "id", "=", ":", "trip", "\\u", "id", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "\\u", "feed", "=", ":\\u", "feed", " ", "order", " ", "by", " ", "start", "\\u", "time", " ", "asc", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filter_", "=_", "{_", "'", "trip", "\\u", "id", "'_", ":_", "trip", "\\u", "id_", ",_", "'\\u", "feed", "'_", ":_", "self_", "._", "provider_", "._", "feed", "\\u", "id_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "self_", "._", "provider_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "freq", "\\u", "cache_", "[_", "trip", "\\u", "id_", "]_", "=_", "cur_", "._", "execute_", "(_", "query_", ",_", "filter_", ")_", "._", "fetchall_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "freq", "\\u", "cache_", "[_", "trip", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FS", "Arriv", "al", "Generator_", "(_", "Arriv", "al", "Generat", "or", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "service_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "id_", "not_", "in_", "self_", "._", "service", "\\u", "cache_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "query_", "=_", "\"\"\"", "select", " ", "start", "\\u", "date", ",", " ", "end", "\\u", "date", ",", " ", "mond", "ay", ",", " ", "tu", "esd", "ay", ",", "\\", "10", ";", " ", " ", " ", " ", "wed", "nes", "day", ",", " ", "thu", "rsd", "ay", ",", " ", "fri", "day", ",", " ", "satur", "day", ",", " ", "sund", "ay", " ", "from", " ", "calendar", "\\", "10", ";", " ", " ", " ", " ", "where", " ", "service", "\\u", "id", "=", ":", "service", "\\u", "id", " ", "and", " ", "\\u", "feed", "=", ":\\u", "feed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c\\u", "filter_", "=_", "{_", "'", "service", "\\u", "id", "'_", ":_", "id_", ",_", "'\\u", "feed", "'_", ":_", "self_", "._", "provider_", "._", "feed", "\\u", "id_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "self_", "._", "provider_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service", "\\u", "cache_", "[_", "id_", "]_", "=_", "dict_", "(_", "next_", "(_", "cur_", "._", "execute_", "(_", "c\\u", "query_", ",_", "c\\u", "filter_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cd", "\\u", "query_", "=_", "\"\"\"", "select", " ", "date", ",", " ", "exception", "\\u", "type", " ", "as", " ", "e", " ", "from", " ", "calendar", "\\u", "dates", "\\", "10", ";", " ", " ", " ", " ", "where", " ", "service", "\\u", "id", "=", ":", "service", "\\u", "id", " ", "and", " ", "\\u", "feed", "=", ":\\u", "feed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cd", "\\u", "result_", "=_", "cur_", "._", "execute_", "(_", "cd", "\\u", "query_", ",_", "c\\u", "filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service", "\\u", "cache_", "[_", "id_", "]_", "[_", "'", "exception", "s", "'_", "]_", "=_", "{_", "r_", "[_", "'", "date", "'_", "]_", ":_", "r_", "[_", "'", "e", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "r_", "in_", "cd", "\\u", "result_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "service", "\\u", "cache_", "[_", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gtfs", "\\u", "row", "\\u", "tracer_", "(_", "cur_", ",_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type", "\\u", "map_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "lambda_", "s_", ":_", "datetime_", "._", "date_", "(_", "int_", "(_", "s_", "[_", ":_", "4_", "]_", ")_", ",_", "int_", "(_", "s_", "[_", "5_", ":_", "7_", "]_", ")_", ",_", "int_", "(_", "s_", "[_", "8_", ":_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gtfs", "time", "'_", ":_", "lambda_", "i_", ":_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "i_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timedelta", "'_", ":_", "lambda_", "i_", ":_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "i_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "desc_", "=_", "cur_", "._", "getde", "script", "ion_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "desc_", "[_", "i_", "]_", "[_", "0_", "]_", ":_", "(_", "type", "\\u", "map_", "._", "get_", "(_", "desc_", "[_", "i_", "]_", "[_", "1_", "]_", ",_", "lambda_", "s_", ":_", "s_", ")_", "(_", "x_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "row_", "[_", "i_", "]_", "is_", "not_", "None_", "else_", "None_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "x_", "in_", "enumerate_", "(_", "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_", "class_", "GT", "FSM", "ix", "in_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Mix", "in", " ", "to", " ", "parse", " ", "transit", " ", "data", " ", "from", " ", "a", " ", "General", " ", "Transi", "t", " ", "Feed", " ", "Specification", " ", "feed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "GT", "FS", " ", "is", " ", "defin", "ed", " ", "at", " ", "https", "://", "developer", "s", ".", "google", ".", "com", "/", "transit", "/", "gtfs", "/", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "engine_", ",_", "gtfs", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "GT", "FSM", "ix", "in_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "self_", "._", "engine_", "._", "config_", "[_", "'", "gtfs", "\\u", "db", "\\u", "path", "'_", "]_", ",_", "aps", "w_", "._", "Connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "conn_", "=_", "self_", "._", "engine_", "._", "config_", "[_", "'", "gtfs", "\\u", "db", "\\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 ", " _", "self_", "._", "conn_", "=_", "aps", "w_", "._", "Connection_", "(_", "self_", "._", "engine_", "._", "config_", "[_", "'", "gtfs", "\\u", "db", "\\u", "path", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "conn_", "._", "set", "row", "trace_", "(_", "gtfs", "\\u", "row", "\\u", "tracer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "self_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "next_", "(_", "cur_", "._", "execute_", "(_", "'", "pragma", " ", "user", "\\u", "version", "'_", ")_", ")_", "[_", "'", "user", "\\u", "version", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "version_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script_", "=_", "resource", "\\u", "string_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "name\\u\\u_", ",_", "'", "gtfs", "\\u{", "0", "}.", "sql", "'_", "._", "format_", "(_", "SCHE", "MA", "\\u", "USER", "\\u", "VERSION_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "script_", ",_", "six_", "._", "binar", "y", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script_", "=_", "script_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cur_", "._", "execute_", "(_", "script_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "version_", "<_", "SCHE", "MA", "\\u", "USER", "\\u", "VERSION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "version_", ">_", "SCHE", "MA", "\\u", "USER", "\\u", "VERSION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'", "Databa", "se", " ", "version", " ", "is", " ", "{", "0", "},", " ", "but", " ", "only", " ", "version", " ", "{", "1", "}", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", " ", "know", "n", "'_", "._", "format_", "(_", "version_", ",_", "SCHE", "MA", "\\u", "USER", "\\u", "VERSION_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tables_", "=_", "[_", "r_", "[_", "'", "name", "'_", "]_", "for_", "r_", "in_", "cur_", "._", "execute_", "(_", "'", "select", " ", "name", " ", "from", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sql", "ite", "\\u", "master", " ", "where", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "=\"", "table", "\"'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "r_", "[_", "'", "name", "'_", "]_", "._", "startswith_", "(_", "'\\u'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "gtfs", "\\u", "url_", ",_", "six_", "._", "binar", "y", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gtfs", "\\u", "url_", "=_", "gtfs", "\\u", "url_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "self_", "._", "\\u", "cache", "d\\u", "requests_", "._", "get_", "(_", "gtfs", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zip_", "=_", "six_", "._", "Byte", "s", "IO_", "(_", "resp_", "._", "content_", ")_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hash_", "=_", "hashlib_", "._", "sha256_", "(_", "zip_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "[_", "x_", "[_", "'", "id", "'_", "]_", "for_", "x_", "in_", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "select", " ", "id", " ", "from", " ", "\\u", "feed", "s", " ", "where", " ", "url", "=?", " ", "AND", " ", "sha2", "56", "sum", "=?'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "gtfs", "\\u", "url_", ",_", "hash_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "resp_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "feed", "\\u", "id_", "=_", "resp_", "[_", "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 ", " _", "cur_", "._", "execute_", "(_", "'", "begin", " ", "transaction", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "ids_", "=_", "[_", "(_", "x_", "[_", "'", "id", "'_", "]_", ",_", ")_", "for_", "x_", "in_", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "select", " ", "id", " ", "from", " ", "\\u", "feed", "s", " ", "where", " ", "url", "=?", "'''_", ",_", "(_", "gtfs", "\\u", "url_", ",_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "._", "executemany", "_", "(_", "'", "delete", " ", "from", " ", "\\u", "feed", "s", " ", "where", " ", "id", "=?'_", ",_", "old", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "table_", "in_", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cur_", "._", "executemany", "_", "(_", "'", "delete", " ", "from", " ", "{", "0", "}", " ", "where", " ", "\\u", "feed", "=?'_", "._", "format_", "(_", "table_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cur_", "._", "execute_", "(_", "'", "insert", " ", "int", "o", " ", "\\u", "feed", "s", " ", "(", "url", ",", " ", "sha2", "56", "sum", ")", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "values", " ", "(?", ",", " ", "?)'", "_", ",_", "(_", "gtfs", "\\u", "url_", ",_", "hash_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "feed", "\\u", "id_", "=_", "self_", "._", "conn_", "._", "last", "\\u", "insert", "\\u", "rowid", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "zipfile_", "._", "Zip", "File_", "(_", "six_", "._", "Byte", "s", "IO_", "(_", "zip_", ")_", ")_", "as_", "z_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "table_", "in_", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "filename_", "=_", "table_", "+_", "'.", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filename_", "not_", "in_", "z_", "._", "namelist_", "(_", ")_", ":_", "\\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_", "with_", "z_", "._", "open_", "(_", "filename_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "data_", "=_", "CSV", "Reader_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "columns_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cold", "ata_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pragma", " ", "table", "\\u", "info", "({", "0", "})'_", "._", "format_", "(_", "table_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "x_", "[_", "'", "name", "'_", "]_", "in_", "data_", "._", "header_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "columns_", "._", "append_", "(_", "x_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cold", "ata_", "._", "append_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "[_", "'", "type", "'_", "]_", ",_", "data_", "._", "header_", "._", "index_", "(_", "x_", "[_", "'", "name", "'_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "\\u", "feed", " ", "must", " ", "be", " ", "at", " ", "end_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "columns_", "._", "append_", "(_", "'\\u", "feed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stmt_", "=_", "(_", "'", "insert", " ", "int", "o", " ", "{", "0", "}", " ", "({", "1", "})", " ", "values", " ", "({", "2", "})'_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "table_", ",_", "',", " ", "'_", "._", "join_", "(_", "columns_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "(_", "'?'_", ",_", ")_", "*_", "len_", "(_", "columns_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "row", "\\u", "gen_", "(_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "t_", ",_", "idx_", "in_", "cold", "ata_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "idx_", "<_", "len_", "(_", "row_", ")_", "and_", "row_", "[_", "idx_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "yield_", "FIX", "\\u", "TYPE", "\\u", "MAP_", "[_", "t_", "]_", "(_", "row_", "[_", "idx_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "yield_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "self_", "._", "feed", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cur_", "._", "executemany", "_", "(_", "stmt_", ",_", "(_", "row", "\\u", "gen_", "(_", "row_", ")_", "for_", "row_", "in_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cur_", "._", "execute_", "(_", "'", "commit", " ", "transaction", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cur_", "._", "execute_", "(_", "'", "begin", " ", "transaction", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "select", " ", "trip", "\\u", "id", " ", "from", " ", "trips", " ", "where", " ", "\\u", "feed", "=?", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "feed", "\\u", "id_", ",_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inner", "cur_", "=_", "self_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trip", "\\u", "id_", "=_", "row_", "[_", "'", "trip", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "interpolat", "e", " ", "missi", "ng", " ", "stop", " ", "times_", "\\u\\u\\uNL\\u\\u\\u_", "know", "n", "\\u", "times_", "=_", "{_", "r_", "[_", "'", "seq", "'_", "]_", ":_", "dict_", "(_", "r_", ")_", "for_", "r_", "in_", "inner", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "select", " ", "arrival", "\\u", "time", " ", "as", " ", "a", ",", " ", "departure", "\\u", "time", " ", "as", " ", "d", ",", "\\", "10", ";", " ", " ", "stop", "\\u", "sequence", " ", "as", " ", "seq", " ", "from", " ", "stop", "\\u", "times", " ", "where", " ", "trip", "\\u", "id", "=", ":", "trip", "\\u", "id", "\\", "10", ";", " ", " ", "and", " ", "\\u", "feed", "=", ":\\u", "feed", " ", "and", " ", "arrival", "\\u", "time", " ", "is", " ", "not", " ", "null", "\\", "10", ";", " ", " ", "order", " ", "by", " ", "stop", "\\u", "sequence", " ", "asc", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "trip", "\\u", "id", "'_", ":_", "trip", "\\u", "id_", ",_", "'\\u", "feed", "'_", ":_", "self_", "._", "feed", "\\u", "id_", "}_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "know", "n", "\\u", "times_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "trip", " ", "is", " ", "head", "way", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "unknown", "\\u", "times_", "=_", "[_", "r_", "[_", "'", "stop", "\\u", "sequence", "'_", "]_", "for_", "r_", "in_", "inner", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "select", " ", "stop", "\\u", "sequence", " ", "from", " ", "stop", "\\u", "times", " ", "where", "\\", "10", ";", " ", " ", "trip", "\\u", "id", "=", ":", "trip", "\\u", "id", " ", "and", " ", "\\u", "feed", "=", ":\\u", "feed", " ", "and", "\\", "10", ";", " ", " ", "arrival", "\\u", "time", " ", "is", " ", "null", " ", "order", " ", "by", " ", "stop", "\\u", "sequence", " ", "asc", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "trip", "\\u", "id", "'_", ":_", "trip", "\\u", "id_", ",_", "'\\u", "feed", "'_", ":_", "self_", "._", "feed", "\\u", "id_", "}_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "seq_", "in_", "enumerate_", "(_", "unknown", "\\u", "times_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "left_", "=_", "max_", "(_", "filter_", "(_", "lambda_", "k_", ":_", "k_", "<_", "seq_", ",_", "know", "n", "\\u", "times_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right_", "=_", "min_", "(_", "filter_", "(_", "lambda_", "k_", ":_", "k_", ">_", "seq_", ",_", "know", "n", "\\u", "times_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "know", "n", "\\u", "times_", "[_", "left_", "]_", "._", "get_", "(_", "'", "d", "'_", ",_", "know", "n", "\\u", "times_", "[_", "left_", "]_", "[_", "'", "a", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gap_", "=_", "know", "n", "\\u", "times_", "[_", "right_", "]_", "[_", "'", "a", "'_", "]_", "-_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "list_", "(_", "filter_", "(_", "lambda_", "k_", ":_", "left_", "<_", "k_", "<_", "right_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unknown", "\\u", "times_", ")_", ")_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "(_", "(_", "gap_", "._", "total", "\\u", "seconds_", "(_", ")_", "*_", "(_", "i_", "+_", "1_", ")_", "/_", "count_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "._", "total", "\\u", "seconds_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inner", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "update", " ", "stop", "\\u", "times", " ", "set", " ", "\\u", "arrival", "\\u", "interpolat", "e", "=", ":", "a", " ", "where", "\\", "10", ";", " ", " ", "trip", "\\u", "id", "=", ":", "trip", "\\u", "id", " ", "and", " ", "\\u", "feed", "=", ":\\u", "feed", " ", "and", "\\", "10", ";", " ", " ", "stop", "\\u", "sequence", "=", ":", "seq", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "trip", "\\u", "id", "'_", ":_", "trip", "\\u", "id_", ",_", "'\\u", "feed", "'_", ":_", "self_", "._", "feed", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a", "'_", ":_", "time_", ",_", "'", "seq", "'_", ":_", "seq_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fill", " ", "in", " ", "\\u", "min", "\\u", "arrival", "\\u", "time_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "min", "\\u", "time_", "=_", "inner", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "select", " ", "min", "(", "coalesce", "(", "arrival", "\\u", "time", ",", " ", "\\u", "arrival", "\\u", "interpolat", "e", "))\\", "10", ";", " ", " ", "as", " ", "min", "\\u", "time", " ", "from", " ", "stop", "\\u", "times", " ", "where", " ", "trip", "\\u", "id", "=?", " ", "and", " ", "\\u", "feed", "=?", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "trip", "\\u", "id_", ",_", "self_", "._", "feed", "\\u", "id_", ")_", ")_", "._", "fetchone_", "(_", ")_", "[_", "'", "min", "\\u", "time", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inner", "cur_", "._", "execute_", "(_", "'''", "update", " ", "trips", " ", "set", " ", "\\u", "min", "\\u", "arrival", "\\u", "time", "=?", "\\", "10", ";", " ", " ", " ", " ", " ", " ", " ", "where", " ", "trip", "\\u", "id", "=?", " ", "and", " ", "\\u", "feed", "=?", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "min", "\\u", "time_", ",_", "trip", "\\u", "id_", ",_", "self_", "._", "feed", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cur_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "insert", " ", "int", "o", " ", "\\u", "stop", "s", "\\u", "route", "s", " ", "(", "stop", "\\u", "id", ",", " ", "route", "\\u", "id", ",", " ", "\\u", "feed", ")", "\\", "10", ";", " ", " ", " ", " ", "select", " ", "distinct", " ", "st", ".", "stop", "\\u", "id", ",", " ", "t", ".", "route", "\\u", "id", ",", " ", "t", ".\\u", "feed", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "(", "select", " ", "trip", "\\u", "id", ",", " ", "stop", "\\u", "id", " ", "from", " ", "stop", "\\u", "times", " ", "where", " ", "\\u", "feed", "=", ":\\u", "feed", ")", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "st", " ", "join", "\\", "10", ";", " ", " ", " ", " ", "(", "select", " ", "trip", "\\u", "id", ",", " ", "route", "\\u", "id", ",", " ", "\\u", "feed", " ", "from", " ", "trips", " ", "where", " ", "\\u", "feed", "=", ":\\u", "feed", ")", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "t", " ", "on", " ", "st", ".", "trip", "\\u", "id", "=", "t", ".", "trip", "\\u", "id", "'''_", ",_", "{_", "'\\u", "feed", "'_", ":_", "self_", "._", "feed", "\\u", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "._", "execute_", "(_", "'", "commit", " ", "transaction", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "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", "query_", "(_", "self_", ",_", "cls_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'\\u", "feed", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'\\u", "feed", "'_", "]_", "=_", "self_", "._", "feed", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cur_", "=_", "self_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cur_", "._", "execute_", "(_", "cls_", "._", "\\u", "build", "\\u", "select_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "._", "keys_", "(_", ")_", ",_", "named", "\\u", "params_", "=_", "True_", ")_", ",_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "entity", "\\u", "builder_", "(_", "self_", ",_", "cls_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "self_", "._", "\\u", "query_", "(_", "cls_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Query", "able_", "(_", "cls_", "(_", "self_", ",_", "**_", "row_", ")_", "for_", "row_", "in_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "cls_", ",_", "id_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type", "map_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "bus", "bus_", "._", "Agency", "_", ":_", "GT", "FS", "Agency", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bus", "bus_", "._", "Stop_", ":_", "GT", "FS", "Stop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bus", "bus_", "._", "Route_", ":_", "GT", "FS", "Route_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "=_", "util_", "._", "entity", "\\u", "type_", "(_", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cls_", "in_", "type", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "type", "map_", "[_", "cls_", "]_", "._", "from", "\\u", "id_", "(_", "self_", ",_", "id_", ",_", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "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_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "timezone_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "agency", "_", "in_", "self_", "._", "agen", "cies", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "agency", "_", "._", "timezone_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "agency", "_", "._", "timezone_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "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_", "agen", "cies", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "entity", "\\u", "builder_", "(_", "GT", "FS", "Agency", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "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_", "stops_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "entity", "\\u", "builder_", "(_", "GT", "FS", "Stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "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_", "routes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "entity", "\\u", "builder_", "(_", "GT", "FS", "Route_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GT", "FSM", "ix", "in_", "(_", "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_", "arrival", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Arriv", "al", "Query", "able_", "(_", "self_", ",_", "GT", "FS", "Arriv", "al", "Generator_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
codysoyland/surlex/doc/conf.py
[ { "content": "# -*- coding: utf-8 -*-\n#\n# surlex documentation build configuration file, created by\n# sphinx-quickstart on Sun Nov 15 09:07:51 2009.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys, os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.append(os.path.abspath('.'))\n\n# -- General configuration -----------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = []\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'surlex'\ncopyright = '2009, Cody Soyland'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '0.1'\n# The full version, including alpha/beta/rc tags.\nrelease = '0.1.2'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of documents that shouldn't be included in the build.\n#unused_docs = []\n\n# List of directories, relative to source directory, that shouldn't be searched\n# for source files.\nexclude_trees = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. Major themes that come with\n# Sphinx are currently 'default' and 'sphinxdoc'.\nhtml_theme = 'default'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_use_modindex = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# If nonempty, this is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = ''\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'surlexdoc'\n\n\n# -- Options for LaTeX output --------------------------------------------------\n\n# The paper size ('letter' or 'a4').\n#latex_paper_size = 'letter'\n\n# The font size ('10pt', '11pt' or '12pt').\n#latex_font_size = '10pt'\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title, author, documentclass [howto/manual]).\nlatex_documents = [\n ('index', 'surlex.tex', 'surlex Documentation',\n 'Cody Soyland', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# Additional stuff for the LaTeX preamble.\n#latex_preamble = ''\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_use_modindex = True\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sys, os", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sur", "lex", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "Sun", " ", "Nov", " ", "15", " ", "09", ":", "0", "7", ":", "5", "1", " ", "200", "9._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "execfile", "()", "d", " ", "with", " ", "the", " ", "current", " ", "director", "y", " ", "set", " ", "to", " ", "its", " ", "contain", "ing", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "not", " ", "all", " ", "possib", "le", " ", "configura", "tion", " ", "values", " ", "are", " ", "presen", "t", " ", "in", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autogen", "erate", "d", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "configura", "tion", " ", "values", " ", "have", " ", "a", " ", "default", ";", " ", "values", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serve", " ", "to", " ", "show", " ", "the", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "append", "(", "os", ".", "path", ".", "abs", "path", "('.", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "-----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be", " ", "extensions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "'.", "rst", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "encoding", " ", "of", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "source", "\\u", "encoding", " ", "=", " ", "'", "utf", "-", "8", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "master", " ", "toc", "tree", " ", "document", "._", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "doc_", "=_", "'", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "project", "._", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "'", "sur", "lex", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "'", "200", "9", ",", " ", "Cod", "y", " ", "So", "yla", "nd", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "version", " ", "info", " ", "for", " ", "the", " ", "project", " ", "you", "'", "re", " ", "document", "ing", ",", " ", "acts", " ", "as", " ", "replace", "ment", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "|", "version", "|", " ", "and", " ", "|", "release", "|", ",", " ", "als", "o", " ", "used", " ", "in", " ", "vari", "ous", " ", "other", " ", "place", "s", " ", "through", "out", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "short", " ", "X", ".", "Y", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "0.", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "release_", "=_", "'", "0.", "1.2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "language", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "document", "s", " ", "tha", "t", " ", "shou", "ld", "n", "'", "t", " ", "be", " ", "include", "d", " ", "in", " ", "the", " ", "build", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "unu", "sed", "\\u", "docs", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "director", "ies", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "shou", "ld", "n", "'", "t", " ", "be", " ", "searche", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "trees_", "=_", "[_", "'\\u", "build", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "re", "ST", " ", "default", " ", "role", " ", "(", "used", " ", "for", " ", "this", " ", "markup", ":", " ", "`", "text", "`)", " ", "to", " ", "use", " ", "for", " ", "all", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "\\u", "role", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "'(", ")'", " ", "will", " ", "be", " ", "append", "ed", " ", "to", " ", ":", "func", ":", " ", "etc", ".", " ", "cross", "-", "reference", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "function", "\\u", "parenthes", "es", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "current", " ", "module", " ", "name", " ", "will", " ", "be", " ", "prepend", "ed", " ", "to", " ", "all", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unit", " ", "titles", " ", "(", "suc", "h", " ", "as", " ", "..", " ", "function", "::", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "module", "\\u", "names", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "section", "author", " ", "and", " ", "module", "author", " ", "directive", "s", " ", "will", " ", "be", " ", "shown", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ".", " ", "The", "y", " ", "are", " ", "ignore", "d", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "\\u", "author", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "Pyg", "ment", "s", " ", "(", "synta", "x", " ", "highlight", "ing", ")", " ", "style", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "pyg", "ment", "s", "\\u", "style_", "=_", "'", "sphinx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "ignore", "d", " ", "prefix", "es", " ", "for", " ", "module", " ", "index", " ", "sorting", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "modi", "nde", "x", "\\u", "common", "\\u", "prefix", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "Maj", "or", " ", "themes", " ", "tha", "t", " ", "come", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sph", "inx", " ", "are", " ", "currentl", "y", " ", "'", "default", "'", " ", "and", " ", "'", "sphinx", "doc", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Them", "e", " ", "options", " ", "are", " ", "them", "e-", "specific", " ", "and", " ", "customize", " ", "the", " ", "look", " ", "and", " ", "feel", " ", "of", " ", "a", " ", "theme_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "ther", ".", " ", " ", "For", " ", "a", " ", "list", " ", "of", " ", "options", " ", "avail", "able", " ", "for", " ", "each", " ", "them", "e", ",", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "options", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "themes", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "for", " ", "this", " ", "set", " ", "of", " ", "Sph", "inx", " ", "document", "s", ".", " ", " ", "If", " ", "Non", "e", ",", " ", "it", " ", "default", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"<", "project", ">", " ", "v", "<", "release", ">", " ", "documentation", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "shorter", " ", "title", " ", "for", " ", "the", " ", "navigation", " ", "bar", ".", " ", " ", "Default", " ", "is", " ", "the", " ", "same", " ", "as", " ", "html", "\\u", "title", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "short", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "sidebar", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "within", " ", "the", " ", "static", " ", "path", ")", " ", "to", " ", "use", " ", "as", " ", "fav", "icon", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", ".", " ", " ", "Thi", "s", " ", "file", " ", "shou", "ld", " ", "be", " ", "a", " ", "Window", "s", " ", "icon", " ", "file", " ", "(.", "ico", ")", " ", "bei", "ng", " ", "16", "x1", "6", " ", "or", " ", "32", "x3", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pixel", "s", " ", "large", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "fav", "icon", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "static", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "style", " ", "sheet", "s", ")", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "y", " ", "are", " ", "copie", "d", " ", "after", " ", "the", " ", "bui", "lti", "n", " ", "static", " ", "files", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "a", " ", "file", " ", "named", " ", "\"", "default", ".", "css", "\"", " ", "will", " ", "overwrit", "e", " ", "the", " ", "bui", "lti", "n", " ", "\"", "default", ".", "css", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "static", "\\u", "path_", "=_", "[_", "'\\u", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "smart", "ypa", "nts", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "modi", "nde", "x", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "index", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "index", " ", "is", " ", "split", " ", "int", "o", " ", "individual", " ", "page", "s", " ", "for", " ", "each", " ", "letter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "split", "\\u", "index", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "link", "s", " ", "to", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "the", " ", "page", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "source", "link", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "none", "mpty", ",", " ", "this", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "sur", "lex", "doc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "'", " ", "or", " ", "'", "a4", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "pape", "r", "\\u", "size", " ", "=", " ", "'", "letter", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "font", " ", "size", " ", "('", "10", "pt", "',", " ", "'", "11", "pt", "'", " ", "or", " ", "'", "1", "2p", "t", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "font", "\\u", "size", " ", "=", " ", "'", "10", "pt", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", "/", "manu", "al", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "sur", "lex", ".", "tex", "'_", ",_", "'", "sur", "lex", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Cod", "y", " ", "So", "yla", "nd", "'_", ",_", "'", "manu", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "title", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "\"", "manu", "al", "\"", " ", "document", "s", ",", " ", "if", " ", "this", " ", "is", " ", "true", ",", " ", "then", " ", "toplevel", " ", "heading", "s", " ", "are", " ", "part", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "chapters", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "part", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "stu", "ff", " ", "for", " ", "the", " ", "La", "Te", "X", " ", "preamble", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "preamble", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\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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 ]
Imprecise assert
google/simian/src/tests/simian/auth/util_test.py
[ { "content": " def testCaIdRe(self):\n \"\"\"Test the CA_ID_RE regex.\"\"\"\n self.assertTrue(util.CA_ID_RE.search('FOO') is not None)\n self.assertTrue(util.CA_ID_RE.search('Y2012') is not None)\n\n self.assertTrue(util.CA_ID_RE.search('') is None)\n self.assertTrue(util.CA_ID_RE.search('2222') is None)\n self.assertTrue(util.CA_ID_RE.search('2FOO') is None)", "metadata": "root.SettingsModuleTest.testCaIdRe", "header": "['class', 'SettingsModuleTest', '(', 'mox', '.', 'MoxTestBase', ')', ':', '___EOS___']", "index": 50 }, { "content": " def testGetCaIdWhenNone(self):\n \"\"\"Test GetCaId().\"\"\"\n self.settings.CA_ID = None\n\n self.mox.ReplayAll()\n ca_id = util.GetCaId(self.settings)\n self.assertTrue(ca_id is None)\n self.mox.VerifyAll()", "metadata": "root.SettingsModuleTest.testGetCaIdWhenNone", "header": "['class', 'SettingsModuleTest', '(', 'mox', '.', 'MoxTestBase', ')', ':', '___EOS___']", "index": 59 }, { "content": " def testGetCaParametersWithOmitServerPrivateKey(self):\n \"\"\"Test GetCaParameters().\"\"\"\n self.settings.CA_ID = None\n\n self.mox.StubOutWithMock(util, 'GetCaId')\n util.GetCaId(self.settings).AndReturn(None) # CA_ID=None\n\n self.mox.ReplayAll()\n p = util.GetCaParameters(self.settings, omit_server_private_key=True)\n self.assertEqual(p.ca_public_cert_pem, self.settings.CA_PUBLIC_CERT_PEM)\n self.assertEqual(\n p.server_public_cert_pem, self.settings.SERVER_PUBLIC_CERT_PEM)\n self.assertEqual(p.required_issuer, self.settings.REQUIRED_ISSUER)\n self.assertEqual(p.server_private_key_pem, None)\n self.assertTrue(p.ca_id is None)\n self.mox.VerifyAll()", "metadata": "root.SettingsModuleTest.testGetCaParametersWithOmitServerPrivateKey", "header": "['class', 'SettingsModuleTest', '(', 'mox', '.', 'MoxTestBase', ')', ':', '___EOS___']", "index": 77 }, { "content": " def testGetCaParametersWhenFollowCaIdValueNone(self):\n \"\"\"Test GetCaParameters().\"\"\"\n self.settings.CA_ID = None\n\n self.mox.StubOutWithMock(util, 'GetCaId')\n util.GetCaId(self.settings).AndReturn(None) # CA_ID=None\n\n self.mox.ReplayAll()\n p = util.GetCaParameters(self.settings)\n self.assertEqual(p.ca_public_cert_pem, self.settings.CA_PUBLIC_CERT_PEM)\n self.assertEqual(\n p.server_public_cert_pem, self.settings.SERVER_PUBLIC_CERT_PEM)\n self.assertEqual(p.server_private_key_pem, 'foo_server_private_pem')\n self.assertEqual(p.required_issuer, self.settings.REQUIRED_ISSUER)\n self.assertTrue(p.ca_id is None)\n self.mox.VerifyAll()", "metadata": "root.SettingsModuleTest.testGetCaParametersWhenFollowCaIdValueNone", "header": "['class', 'SettingsModuleTest', '(', 'mox', '.', 'MoxTestBase', ')', ':', '___EOS___']", "index": 94 }, { "content": " def testGetCaParametersWhenForcePrimaryCaSettings(self):\n \"\"\"Test GetCaParameters().\"\"\"\n # Mock to detect that it was NOT called:\n self.mox.StubOutWithMock(util, 'GetCaId')\n\n self.mox.ReplayAll()\n p = util.GetCaParameters(self.settings, None) # Force primary CA settings\n self.assertEqual(p.ca_public_cert_pem, self.settings.CA_PUBLIC_CERT_PEM)\n self.assertEqual(\n p.server_public_cert_pem, self.settings.SERVER_PUBLIC_CERT_PEM)\n self.assertEqual(p.server_private_key_pem, 'foo_server_private_pem')\n self.assertEqual(p.required_issuer, self.settings.REQUIRED_ISSUER)\n self.assertTrue(p.ca_id is None)\n self.mox.VerifyAll()", "metadata": "root.SettingsModuleTest.testGetCaParametersWhenForcePrimaryCaSettings", "header": "['class', 'SettingsModuleTest', '(', 'mox', '.', 'MoxTestBase', ')', ':', '___EOS___']", "index": 111 } ]
[ { "span": "self.assertTrue(util.CA_ID_RE.search('FOO') is not None)", "start_line": 52, "start_column": 4, "end_line": 52, "end_column": 60 }, { "span": "self.assertTrue(util.CA_ID_RE.search('Y2012') is not None)", "start_line": 53, "start_column": 4, "end_line": 53, "end_column": 62 }, { "span": "self.assertTrue(util.CA_ID_RE.search('') is None)", "start_line": 55, "start_column": 4, "end_line": 55, "end_column": 53 }, { "span": "self.assertTrue(util.CA_ID_RE.search('2222') is None)", "start_line": 56, "start_column": 4, "end_line": 56, "end_column": 57 }, { "span": "self.assertTrue(util.CA_ID_RE.search('2FOO') is None)", "start_line": 57, "start_column": 4, "end_line": 57, "end_column": 57 }, { "span": "self.assertTrue(ca_id is None)", "start_line": 65, "start_column": 4, "end_line": 65, "end_column": 34 }, { "span": "self.assertTrue(p.ca_id is None)", "start_line": 91, "start_column": 4, "end_line": 91, "end_column": 36 }, { "span": "self.assertTrue(p.ca_id is None)", "start_line": 108, "start_column": 4, "end_line": 108, "end_column": 36 }, { "span": "self.assertTrue(p.ca_id is None)", "start_line": 123, "start_column": 4, "end_line": 123, "end_column": 36 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Sett", "ings", "Modul", "e", "Test_", "(_", "mox_", "._", "Mo", "x", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Ca", "Id", "Re_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "the", " ", "CA", "\\u", "ID", "\\u", "RE", " ", "regex", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "util_", "._", "CA", "\\u", "ID", "\\u", "RE_", "._", "search_", "(_", "'", "FOO", "'_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "util_", "._", "CA", "\\u", "ID", "\\u", "RE_", "._", "search_", "(_", "'", "Y", "2012", "'_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "util_", "._", "CA", "\\u", "ID", "\\u", "RE_", "._", "search_", "(_", "''_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "util_", "._", "CA", "\\u", "ID", "\\u", "RE_", "._", "search_", "(_", "'", "2222", "'_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "util_", "._", "CA", "\\u", "ID", "\\u", "RE_", "._", "search_", "(_", "'", "2", "FOO", "'_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sett", "ings", "Modul", "e", "Test_", "(_", "mox_", "._", "Mo", "x", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Get", "Ca", "Id", "Whe", "n", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "Get", "Ca", "Id", "().\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "settings_", "._", "CA", "\\u", "ID_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ca", "\\u", "id_", "=_", "util_", "._", "Get", "Ca", "Id_", "(_", "self_", "._", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ca", "\\u", "id_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sett", "ings", "Modul", "e", "Test_", "(_", "mox_", "._", "Mo", "x", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Get", "Ca", "Parameter", "s", "With", "Om", "it", "Server", "Priva", "te", "Key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "Get", "Ca", "Parameter", "s", "().\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "settings_", "._", "CA", "\\u", "ID_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "util_", ",_", "'", "Get", "Ca", "Id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "util_", "._", "Get", "Ca", "Id_", "(_", "self_", "._", "settings_", ")_", "._", "And", "Return_", "(_", "None_", ")_", "#", " ", "CA", "\\u", "ID", "=", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "util_", "._", "Get", "Ca", "Parameters_", "(_", "self_", "._", "settings_", ",_", "omit", "\\u", "server", "\\u", "private", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "ca", "\\u", "public", "\\u", "cert", "\\u", "pem_", ",_", "self_", "._", "settings_", "._", "CA", "\\u", "PUBLIC", "\\u", "CERT", "\\u", "PEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "server", "\\u", "public", "\\u", "cert", "\\u", "pem_", ",_", "self_", "._", "settings_", "._", "SERVER", "\\u", "PUBLIC", "\\u", "CERT", "\\u", "PEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "require", "d\\u", "issuer_", ",_", "self_", "._", "settings_", "._", "REQUIRE", "D", "\\u", "ISSUE", "R_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "server", "\\u", "private", "\\u", "key", "\\u", "pem_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "ca", "\\u", "id_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sett", "ings", "Modul", "e", "Test_", "(_", "mox_", "._", "Mo", "x", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Get", "Ca", "Parameter", "s", "Whe", "n", "Follow", "Ca", "Id", "Value", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "Get", "Ca", "Parameter", "s", "().\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "settings_", "._", "CA", "\\u", "ID_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "util_", ",_", "'", "Get", "Ca", "Id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "util_", "._", "Get", "Ca", "Id_", "(_", "self_", "._", "settings_", ")_", "._", "And", "Return_", "(_", "None_", ")_", "#", " ", "CA", "\\u", "ID", "=", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "util_", "._", "Get", "Ca", "Parameters_", "(_", "self_", "._", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "ca", "\\u", "public", "\\u", "cert", "\\u", "pem_", ",_", "self_", "._", "settings_", "._", "CA", "\\u", "PUBLIC", "\\u", "CERT", "\\u", "PEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "server", "\\u", "public", "\\u", "cert", "\\u", "pem_", ",_", "self_", "._", "settings_", "._", "SERVER", "\\u", "PUBLIC", "\\u", "CERT", "\\u", "PEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "server", "\\u", "private", "\\u", "key", "\\u", "pem_", ",_", "'", "foo", "\\u", "server", "\\u", "private", "\\u", "pe", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "require", "d\\u", "issuer_", ",_", "self_", "._", "settings_", "._", "REQUIRE", "D", "\\u", "ISSUE", "R_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "ca", "\\u", "id_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sett", "ings", "Modul", "e", "Test_", "(_", "mox_", "._", "Mo", "x", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Get", "Ca", "Parameter", "s", "Whe", "n", "Force", "Prim", "ary", "Ca", "Settings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "Get", "Ca", "Parameter", "s", "().\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Moc", "k", " ", "to", " ", "detect", " ", "tha", "t", " ", "it", " ", "was", " ", "NOT", " ", "call", "ed", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "util_", ",_", "'", "Get", "Ca", "Id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "util_", "._", "Get", "Ca", "Parameters_", "(_", "self_", "._", "settings_", ",_", "None_", ")_", "#", " ", "Force", " ", "primary", " ", "CA", " ", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "ca", "\\u", "public", "\\u", "cert", "\\u", "pem_", ",_", "self_", "._", "settings_", "._", "CA", "\\u", "PUBLIC", "\\u", "CERT", "\\u", "PEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "server", "\\u", "public", "\\u", "cert", "\\u", "pem_", ",_", "self_", "._", "settings_", "._", "SERVER", "\\u", "PUBLIC", "\\u", "CERT", "\\u", "PEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "server", "\\u", "private", "\\u", "key", "\\u", "pem_", ",_", "'", "foo", "\\u", "server", "\\u", "private", "\\u", "pe", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "require", "d\\u", "issuer_", ",_", "self_", "._", "settings_", "._", "REQUIRE", "D", "\\u", "ISSUE", "R_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "ca", "\\u", "id_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Verify", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Module is imported with 'import' and 'import from'
DummyDivision/Tsune/upload/views.py
[ { "content": "from django.core.urlresolvers import reverse\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nimport os\nimport tempfile\nimport uuid\nimport shutil\nfrom forms import UploadFileForm\nfrom cardimporter.importer import AnkiImporter\nfrom os import path,removedirs\nfrom tsune.settings.base import PROJECT_DIR\n\nTEMP_DIR = PROJECT_DIR + \"/temp\"\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import os", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Respons", "e", "Redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render", "\\u", "to", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "forms_", "import_", "Upload", "File", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cardi", "mpor", "ter_", "._", "importer_", "import_", "An", "ki", "Importer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "import_", "path_", ",_", "remove", "dirs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tsu", "ne_", "._", "settings_", "._", "base_", "import_", "PROJECT", "\\u", "DIR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TEMP", "\\u", "DIR_", "=_", "PROJECT", "\\u", "DIR_", "+_", "\"/", "temp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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, 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 ]
Except block handles 'BaseException'
emccode/heliosburn/heliosburn/django/hbproject/webui/templatetags/tags.py
[ { "content": "@register.simple_tag\ndef active(request, name):\n try:\n url = reverse(name)\n if request.path == url:\n return 'active'\n except:\n None\n return ''", "metadata": "root.active", "header": "['module', '___EOS___']", "index": 5 }, { "content": "@register.filter(name='bool_to_icon')\ndef bool_to_icon(value):\n try:\n if type(value) is bool:\n style = 'glyphicon-ok green' if value else 'glyphicon-remove red'\n return '<span class=\"glyphicon glyphicon-2x %s\" aria-hidden=\"true\"></span>' % (style, )\n else:\n return 'N/A'\n except:\n return 'N/A'", "metadata": "root.bool_to_icon", "header": "['module', '___EOS___']", "index": 15 }, { "content": "@register.filter(name='enabler')\ndef enabler(value):\n try:\n if type(value) is bool:\n return 'Enabled' if value else 'Disabled'\n else:\n return 'Disabled'\n except:\n return 'Disabled'", "metadata": "root.enabler", "header": "['module', '___EOS___']", "index": 26 }, { "content": "@register.filter(name='bool_to_int')\ndef bool_to_int(value):\n try:\n if type(value) is bool:\n return 1 if value else 0\n else:\n return 0\n except:\n return 0", "metadata": "root.bool_to_int", "header": "['module', '___EOS___']", "index": 36 } ]
[ { "span": "except:", "start_line": 11, "start_column": 4, "end_line": 11, "end_column": 11 }, { "span": "except:", "start_line": 23, "start_column": 4, "end_line": 23, "end_column": 11 }, { "span": "except:", "start_line": 33, "start_column": 4, "end_line": 33, "end_column": 11 }, { "span": "except:", "start_line": 43, "start_column": 4, "end_line": 43, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "register_", "._", "simple", "\\u", "tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "active_", "(_", "request_", ",_", "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 ", " _", "url_", "=_", "reverse_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "path_", "==_", "url_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "active", "'_", "\\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 ", " _", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "filter_", "(_", "name_", "=_", "'", "bool\\u", "to", "\\u", "icon", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "bool\\u", "to", "\\u", "icon_", "(_", "value_", ")_", ":_", "\\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_", "type_", "(_", "value_", ")_", "is_", "bool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "style_", "=_", "'", "glyph", "icon", "-", "ok", " ", "green", "'_", "if_", "value_", "else_", "'", "glyph", "icon", "-", "remove", " ", "red", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'<", "span", " ", "class", "=\"", "glyph", "icon", " ", "glyph", "icon", "-", "2x", " ", "%", "s", "\"", " ", "aria", "-", "hidden", "=\"", "true", "\">", "</", "span", ">'_", "%_", "(_", "style_", ",_", ")_", "\\u\\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_", "'", "N", "/", "A", "'_", "\\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 ", " _", "return_", "'", "N", "/", "A", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "filter_", "(_", "name_", "=_", "'", "enable", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "enable", "r_", "(_", "value_", ")_", ":_", "\\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_", "type_", "(_", "value_", ")_", "is_", "bool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "Enable", "d", "'_", "if_", "value_", "else_", "'", "Disa", "ble", "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 ", " _", "return_", "'", "Disa", "ble", "d", "'_", "\\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 ", " _", "return_", "'", "Disa", "ble", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "filter_", "(_", "name_", "=_", "'", "bool\\u", "to", "\\u", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "bool\\u", "to", "\\u", "int_", "(_", "value_", ")_", ":_", "\\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_", "type_", "(_", "value_", ")_", "is_", "bool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "if_", "value_", "else_", "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 ", " _", "return_", "0_", "\\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 ", " _", "return_", "0_" ]
[ 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, 0, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
qe-team/marmot/marmot/representations/tests/test_wmt_representation_generator.py
[ { "content": " def test_save_files(self):\n generator = WMTRepresentationGenerator(self.wmt_target, self.wmt_source, tmp_dir=self.tmp_dir, persist=True)\n data_obj = generator.generate()\n target = os.path.join(self.tmp_dir, 'EN_ES.tgt_ann.train.target')\n tags = os.path.join(self.tmp_dir, 'EN_ES.tgt_ann.train.tags')\n source = os.path.join(self.tmp_dir, 'EN_ES.source.train.txt')\n self.assertTrue(os.path.exists(self.tmp_dir) and os.path.isdir(self.tmp_dir))\n self.assertTrue(os.path.exists(target) and os.path.isfile(target))\n self.assertTrue(os.path.exists(tags) and os.path.isfile(tags))\n self.assertTrue(os.path.exists(source) and os.path.isfile(source))", "metadata": "root.WMTRepresentationGeneratorTests.test_save_files", "header": "['class', 'WMTRepresentationGeneratorTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 58 } ]
[ { "span": "data_obj ", "start_line": 60, "start_column": 8, "end_line": 60, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "WM", "TR", "epr", "ese", "nta", "tion", "Generat", "or", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "save", "\\u", "files_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "generator_", "=_", "WM", "TR", "epr", "ese", "nta", "tion", "Generator_", "(_", "self_", "._", "wm", "t", "\\u", "target_", ",_", "self_", "._", "wm", "t", "\\u", "source_", ",_", "tmp", "\\u", "dir_", "=_", "self_", "._", "tmp", "\\u", "dir_", ",_", "persist_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "obj_", "=_", "generator_", "._", "generate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tmp", "\\u", "dir_", ",_", "'", "EN", "\\u", "ES", ".", "tgt", "\\u", "ann", ".", "train", ".", "target", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tags_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tmp", "\\u", "dir_", ",_", "'", "EN", "\\u", "ES", ".", "tgt", "\\u", "ann", ".", "train", ".", "tags", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tmp", "\\u", "dir_", ",_", "'", "EN", "\\u", "ES", ".", "source", ".", "train", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "tmp", "\\u", "dir_", ")_", "and_", "os_", "._", "path_", "._", "isdir_", "(_", "self_", "._", "tmp", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "target_", ")_", "and_", "os_", "._", "path_", "._", "isfile_", "(_", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "tags_", ")_", "and_", "os_", "._", "path_", "._", "isfile_", "(_", "tags_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "source_", ")_", "and_", "os_", "._", "path_", "._", "isfile_", "(_", "source_", ")_", ")_", "\\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, 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 ]
Unused import
azoft-dev-team/imagrium/env/Lib/test/test_dictproxy_jy.py
[ { "content": "\"\"\"Test the readonly dict wrapper dictproxy\n\nMade for Jython.\n\"\"\"\nimport sys\nimport unittest\nfrom test import test_support\n\n\n\n\n\nif __name__ == '__main__':\n test_main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class DictproxyTestCase(unittest.TestCase):\n\n", "metadata": "root.DictproxyTestCase", "header": "['module', '___EOS___']", "index": 8 }, { "content": " def test_dictproxy(self):\n proxy = type.__dict__\n first_key = iter(proxy).next()\n\n self.assert_(isinstance(first_key, str))\n self.assert_(first_key in proxy)\n self.assert_(proxy.has_key(first_key))\n self.assertEqual(proxy[first_key], proxy.get(first_key))\n self.assertEqual(proxy.get('NOT A KEY', 'foo'), 'foo')\n\n proxy_len = len(proxy)\n self.assert_(isinstance(proxy_len, int) and proxy_len > 2)\n self.assert_(proxy_len == len(proxy.keys()) == len(proxy.items()) ==\n len(proxy.values()) == len(list(proxy.iterkeys())) ==\n len(list(proxy.iteritems())) ==\n len(list(proxy.itervalues())))\n self.assert_(isinstance(proxy.items()[0], tuple))\n self.assert_(isinstance(proxy.iteritems().next(), tuple))\n\n copy = proxy.copy()\n self.assert_(proxy is not copy)\n self.assertEqual(len(proxy), len(copy))", "metadata": "root.DictproxyTestCase.test_dictproxy", "header": "['class', 'DictproxyTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 10 }, { "content": " def test_dictproxy_equality(self):\n self.assertEqual(type.__dict__, type.__dict__)\n self.assertEqual(type.__dict__, type.__dict__.copy())\n self.assertEqual(type.__dict__, dict(type.__dict__))\n self.assertEqual(cmp(type.__dict__, type.__dict__), 0)\n self.assertEqual(cmp(type.__dict__, type.__dict__.copy()), 0)\n self.assertEqual(cmp(type.__dict__, dict(type.__dict__)), 0)", "metadata": "root.DictproxyTestCase.test_dictproxy_equality", "header": "['class', 'DictproxyTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 33 }, { "content": "def test_main():\n test_support.run_unittest(DictproxyTestCase)", "metadata": "root.test_main", "header": "['module', '___EOS___']", "index": 42 } ]
[ { "span": "import sys", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Test", " ", "the", " ", "read", "only", " ", "dict", " ", "wrapp", "er", " ", "dict", "proxy", "\\", "10", ";", "\\", "10", ";", "Made", " ", "for", " ", "Jy", "tho", "n", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "import_", "test\\u", "support_", "\\u\\u\\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_", "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", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Dict", "proxy", "Test", "Case_", "(_", "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_", "Dict", "proxy", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "dict", "proxy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proxy_", "=_", "type_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "key_", "=_", "iter_", "(_", "proxy_", ")_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "first", "\\u", "key_", ",_", "str_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "first", "\\u", "key_", "in_", "proxy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "proxy_", "._", "has", "\\u", "key_", "(_", "first", "\\u", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "proxy_", "[_", "first", "\\u", "key_", "]_", ",_", "proxy_", "._", "get_", "(_", "first", "\\u", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "proxy_", "._", "get_", "(_", "'", "NOT", " ", "A", " ", "KEY", "'_", ",_", "'", "foo", "'_", ")_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "proxy", "\\u", "len_", "=_", "len_", "(_", "proxy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "proxy", "\\u", "len_", ",_", "int_", ")_", "and_", "proxy", "\\u", "len_", ">_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "proxy", "\\u", "len_", "==_", "len_", "(_", "proxy_", "._", "keys_", "(_", ")_", ")_", "==_", "len_", "(_", "proxy_", "._", "items_", "(_", ")_", ")_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "proxy_", "._", "values_", "(_", ")_", ")_", "==_", "len_", "(_", "list_", "(_", "proxy_", "._", "iterkeys_", "(_", ")_", ")_", ")_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "list_", "(_", "proxy_", "._", "iteritems_", "(_", ")_", ")_", ")_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "list_", "(_", "proxy_", "._", "itervalues_", "(_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "proxy_", "._", "items_", "(_", ")_", "[_", "0_", "]_", ",_", "tuple_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "proxy_", "._", "iteritems_", "(_", ")_", "._", "next_", "(_", ")_", ",_", "tuple_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "=_", "proxy_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "proxy_", "is_", "not_", "copy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "proxy_", ")_", ",_", "len_", "(_", "copy_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "proxy", "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", "dict", "proxy", "\\u", "equality", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "type_", "._", "\\u\\u", "dict\\u\\u_", ",_", "type_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "type_", "._", "\\u\\u", "dict\\u\\u_", ",_", "type_", "._", "\\u\\u", "dict\\u\\u_", "._", "copy_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "type_", "._", "\\u\\u", "dict\\u\\u_", ",_", "dict_", "(_", "type_", "._", "\\u\\u", "dict\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "cmp_", "(_", "type_", "._", "\\u\\u", "dict\\u\\u_", ",_", "type_", "._", "\\u\\u", "dict\\u\\u_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "cmp_", "(_", "type_", "._", "\\u\\u", "dict\\u\\u_", ",_", "type_", "._", "\\u\\u", "dict\\u\\u_", "._", "copy_", "(_", ")_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "cmp_", "(_", "type_", "._", "\\u\\u", "dict\\u\\u_", ",_", "dict_", "(_", "type_", "._", "\\u\\u", "dict\\u\\u_", ")_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "support_", "._", "run", "\\u", "unittest_", "(_", "Dict", "proxy", "Test", "Case_", ")_", "\\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, 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, 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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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 ]
Unused import
glennyonemitsu/MarkupHiveSDK/pyjade/ext/django/__init__.py
[ { "content": "from compiler import Compiler\nfrom loader import Loader\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from compiler import Compiler", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 29 }, { "span": "from loader import Loader", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 25 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "compiler_", "import_", "Compiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "loader_", "import_", "Loader_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1 ]
Unused import
davebshow/gremlinclient/gremlinclient/tornado_client/__init__.py
[ { "content": "from gremlinclient.tornado_client.client import (\n Response, GraphDatabase, Pool, submit, create_connection)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from gremlinclient.tornado_client.client import (\n Response, GraphDatabase, Pool, submit, create_connection)", "start_line": 0, "start_column": 0, "end_line": 1, "end_column": 61 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "gre", "mlin", "client_", "._", "torn", "ado", "\\u", "client_", "._", "client_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Response_", ",_", "Graph", "Database_", ",_", "Pool_", ",_", "submit_", ",_", "create", "\\u", "connection_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused import
sassoftware/conary/conary/build/redirectrecipe.py
[ { "content": "#\n# Copyright (c) SAS Institute 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\nfrom conary import trove, versions\nfrom conary.deps import deps\nfrom conary.build import errors as builderrors\nfrom conary.build import defaultrecipes\nfrom conary.build import macros\nfrom conary.build import use\nfrom conary.build.recipe import Recipe, RECIPE_TYPE_REDIRECT\nfrom conary.build.packagerecipe import BaseRequiresRecipe\nfrom conary.lib import log\n\n\n\n\n\n\n\nexec defaultrecipes.RedirectRecipe\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class _Redirect(object):\n\n __slots__ = [ 'components', 'isRemove' ]\n\n", "metadata": "root._Redirect", "header": "['module', '___EOS___']", "index": 27 }, { "content": " def __init__(self):\n self.components = []", "metadata": "root._Redirect.__init__", "header": "['class', '_Redirect', '(', 'object', ')', ':', '___EOS___']", "index": 31 }, { "content": " def addComponents(self, nameList):\n self.components += nameList", "metadata": "root._Redirect.addComponents", "header": "['class', '_Redirect', '(', 'object', ')', ':', '___EOS___']", "index": 34 }, { "content": "class _RemoveRedirect(_Redirect):\n\n isRemove = True", "metadata": "root._RemoveRedirect", "header": "['module', '___EOS___']", "index": 37 }, { "content": "class _RedirectInfo(_Redirect):\n\n __slots__ = [ 'targetName', 'targetBranch', 'targetFlavor', 'components' ]\n isRemove = False\n", "metadata": "root._RedirectInfo", "header": "['module', '___EOS___']", "index": 41 }, { "content": " def __init__(self, targetName, targetBranch, targetFlavor):\n assert(targetName is not None)\n _Redirect.__init__(self)\n self.targetName = targetName\n self.targetBranch = targetBranch\n self.targetFlavor = targetFlavor", "metadata": "root._RedirectInfo.__init__", "header": "['class', '_RedirectInfo', '(', '_Redirect', ')', ':', '___EOS___']", "index": 46 }, { "content": "class _Redirections(dict):\n", "metadata": "root._Redirections", "header": "['module', '___EOS___']", "index": 53 }, { "content": " def add(self, sourceName, sourceFlavor, redir):\n l = self.setdefault((sourceName, sourceFlavor), [])\n l.append(redir)", "metadata": "root._Redirections.add", "header": "['class', '_Redirections', '(', 'dict', ')', ':', '___EOS___']", "index": 55 }, { "content": "class _RedirectRule(object):\n __slots__ = [ 'destName', 'branchStr', 'sourceFlavor', 'targetFlavor',\n 'skipTargetMatching', 'sourceName', 'allowMultipleTargets' ]\n\n\n", "metadata": "root._RedirectRule", "header": "['module', '___EOS___']", "index": 59 }, { "content": " def findAvailableTargetFlavors(self, repos):\n if self.branchStr is None:\n # redirect to nothing\n return set()\n\n if self.branchStr[0] == '/':\n branch = versions.VersionFromString(self.branchStr)\n if not isinstance(branch, versions.Branch):\n raise builderrors.RecipeFileError, \\\n \"Redirects must specify branches or labels, \" \\\n \"not versions\"\n\n log.info('redirecting to branches is deprecated; redirects must '\n 'be to labels')\n\n matches = repos.getTroveLeavesByBranch(\n { self.destName : { branch : None } })\n else:\n label = versions.Label(self.branchStr)\n matches = repos.getTroveLatestByLabel(\n { self.destName : { label : None } })\n\n targetFlavors = set()\n # Get the flavors and branch available on the target\n for version, flavorList in matches.get(self.destName, {}).iteritems():\n targetFlavors.update((version, x) for x in flavorList)\n\n return targetFlavors", "metadata": "root._RedirectRule.findAvailableTargetFlavors", "header": "['class', '_RedirectRule', '(', 'object', ')', ':', '___EOS___']", "index": 63 }, { "content": " def __str__(self):\n return \"%s[%s] -> %s=%s[%s]\" % (self.sourceName, self.sourceFlavor,\n self.destName, self.branchStr, self.targetFlavor)", "metadata": "root._RedirectRule.__str__", "header": "['class', '_RedirectRule', '(', 'object', ')', ':', '___EOS___']", "index": 92 }, { "content": " def __init__(self, sourceName = None, destName = None, branchStr = None,\n sourceFlavor = None, targetFlavor = None,\n skipTargetMatching = None, allowMultipleTargets = False):\n self.sourceName = sourceName\n self.destName = destName\n self.branchStr = branchStr\n self.sourceFlavor = sourceFlavor\n self.targetFlavor = targetFlavor\n self.skipTargetMatching = skipTargetMatching\n self.allowMultipleTargets = allowMultipleTargets", "metadata": "root._RedirectRule.__init__", "header": "['class', '_RedirectRule', '(', 'object', ')', ':', '___EOS___']", "index": 96 }, { "content": "class _RedirectRecipe(Recipe):\n Flags = use.LocalFlags\n _recipeType = RECIPE_TYPE_REDIRECT\n internalAbstractBaseClass = 1\n\n\n\n\n\n\n\n\n\n", "metadata": "root._RedirectRecipe", "header": "['module', '___EOS___']", "index": 107 }, { "content": " def _addRule(self, rule):\n l = self.rules.setdefault(rule.sourceName, list())\n if rule.sourceFlavor is None:\n l.append(rule)\n else:\n # the default (with no sourceFlavor) has to be at the end to\n # make sure it matches last\n l.insert(0, rule)", "metadata": "root._RedirectRecipe._addRule", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 112 }, { "content": " def addRedirect(self, toTrove, branchStr = None, sourceFlavor = None,\n targetFlavor = None, fromTrove = None,\n skipTargetMatching = False, allowMultipleTargets = False):\n if ((sourceFlavor is not None) and (targetFlavor is None)) or \\\n ((targetFlavor is not None) and (sourceFlavor is None)):\n raise builderrors.RecipeFileError, \\\n \"sourceFlavor and targetFlavor must be specified jointly\"\n\n if sourceFlavor is not None:\n f = deps.parseFlavor(sourceFlavor)\n if f is None:\n raise ValueError, 'invalid flavor %s' % sourceFlavor\n sourceFlavor = f\n\n if targetFlavor is not None:\n f = deps.parseFlavor(targetFlavor)\n if f is None:\n raise ValueError, 'invalid flavor %s' % targetFlavor\n targetFlavor = f\n\n if fromTrove is None:\n fromTrove = self.name\n elif fromTrove.find(\":\") != -1:\n raise ValueError, 'components cannot be individually redirected'\n\n rule = _RedirectRule(sourceName = fromTrove, destName = toTrove,\n branchStr = branchStr, sourceFlavor = sourceFlavor,\n targetFlavor = targetFlavor,\n skipTargetMatching = skipTargetMatching,\n allowMultipleTargets = allowMultipleTargets)\n self._addRule(rule)", "metadata": "root._RedirectRecipe.addRedirect", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 121 }, { "content": " def addRemoveRedirect(self, fromTrove = None):\n # We don't allow flavor-specificty for remove rules. You could write\n # redirect rules for everything which ought to be redirected and have\n # a catch-all remove redirect for everything else.\n if fromTrove is None:\n fromTrove = self.name\n elif fromTrove.find(\":\") != -1:\n raise ValueError, 'components cannot be individually redirected'\n\n rule = _RedirectRule(sourceName = fromTrove)\n self._addRule(rule)", "metadata": "root._RedirectRecipe.addRemoveRedirect", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 153 }, { "content": " def _findSourceTroves(self):\n sourceSearch = {}\n for fromTrove in self.rules.iterkeys():\n sourceSearch.setdefault(fromTrove, { self.branch : None })\n\n # this treats previously-built redirects as flavors we need to\n # redirect from, which seems a bit weird\n sourceTroveMatches = self.repos.getTroveLeavesByBranch(sourceSearch)\n\n if len(sourceTroveMatches) != len(sourceSearch):\n missing = set(sourceSearch) - set(sourceTroveMatches)\n raise builderrors.RecipeFileError, \\\n \"No troves found with name(s) %s\" % \" \".join(missing)\n\n return sourceTroveMatches", "metadata": "root._RedirectRecipe._findSourceTroves", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 165 }, { "content": " def _getSourceTroves(self, searchResult):\n l = []\n for name, d in searchResult.iteritems():\n for version, flavorList in d.iteritems():\n l += [ (name, (None, None), (version, x), True)\n for x in flavorList ]\n\n trvCsDict = {}\n # We don't need to recurse here since we only support package\n # redirects\n cs = self.repos.createChangeSet(l, recurse = False,\n withFiles = False)\n for trvCs in cs.iterNewTroveList():\n info = (trvCs.getName(), trvCs.getNewVersion(),\n trvCs.getNewFlavor())\n trvCsDict[info] = trvCs\n\n return trvCsDict", "metadata": "root._RedirectRecipe._getSourceTroves", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 181 }, { "content": " @staticmethod\n def _getTargetRules(rules, name):\n # return the rules for troves with this name; if it's a component of\n # a package we alrady built reuse the rule which we used for that\n # package\n targetRules = rules.get(name, None)\n if targetRules is None:\n raise builderrors.RecipeFileError, \\\n \"Cannot find redirection for trove %s\" % name\n\n return targetRules", "metadata": "root._RedirectRecipe._getTargetRules", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 200 }, { "content": " def _buildRedirect(self, trvCsDict, sourceFlavor,\n sourceVersion, rule, target):\n if target[0] is not None:\n redirInfo = _RedirectInfo(target[0], target[1].branch(), rule.targetFlavor)\n else:\n redirInfo = _RemoveRedirect()\n\n self.redirections.add(rule.sourceName, sourceFlavor, redirInfo)\n\n # Groups don't include any additional redirections, and\n # neither do items which aren't collections\n if (trove.troveIsGroup(rule.sourceName) or\n not trove.troveIsCollection(rule.sourceName)):\n return\n\n if target[0] is not None:\n targetTrove = self.repos.getTrove(withFiles = False, *target)\n targetComponents = set([ x[0].split(':')[1]\n for x in\n targetTrove.iterTroveList(strongRefs = True) ])\n else:\n targetComponents = set()\n\n # we can't integrity check here because we got\n # the trove w/o files\n trvCs = trvCsDict[(rule.sourceName, sourceVersion, sourceFlavor)]\n trv = trove.Trove(trvCs)\n\n # assemble a set of all of the components included\n # in this trove\n currentComponents = set([ x[0].split(':')[1] for x in\n trv.iterTroveList(strongRefs = True) ])\n\n # components shared between the current trove and\n # the target should be redirected to the target\n # components\n for compName in currentComponents & targetComponents:\n sourceCompName = rule.sourceName + ':' + compName\n targetCompName = redirInfo.targetName + ':' + compName\n self.redirections.add(sourceCompName, sourceFlavor,\n _RedirectInfo(targetCompName, redirInfo.targetBranch,\n redirInfo.targetFlavor))\n\n # now get all of the components which have been\n # included in this trove anywhere on the branch; those\n # components need to generate erase redirects\n allVersions = self.repos.getTroveVersionsByBranch(\n { trv.getName() :\n { trv.getVersion().branch() : None } } )\n l = []\n for subVersion, subFlavorList in \\\n allVersions[trv.getName()].iteritems():\n l += [ ( trv.getName(), subVersion, flavor)\n for flavor in subFlavorList ]\n\n allTroves = self.repos.getTroves(l, withFiles = False)\n allComponents = set()\n for otherTrv in allTroves:\n allComponents.update(\n [ x[0].split(':')[1] for x in\n otherTrv.iterTroveList(strongRefs = True) ] )\n\n # components which existed at any point for this\n # trove but don't have a component in the redirect\n # target need to be erased\n for subName in allComponents - targetComponents:\n newName = rule.sourceName + ':' + subName\n self.redirections.add(newName, sourceFlavor, _RemoveRedirect())\n\n # the package redirect includes references to the\n # component redirects to let the update code know\n # how to redirect the components; this tracks the\n # components of this redirect\n redirInfo.addComponents(\n [ rule.sourceName + ':' + x for x in allComponents ])", "metadata": "root._RedirectRecipe._buildRedirect", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 212 }, { "content": " def findTroves(self):\n sourceTroveMatches = self._findSourceTroves()\n trvCsDict = self._getSourceTroves(sourceTroveMatches)\n\n redirRuleMap = {}\n\n # sourceTroveVersions is all of the versions/flavors which\n # currently exist for this trove\n for sourceName, sourceTroveVersions in sourceTroveMatches.iteritems():\n # set of rules for where this trove should redirect to\n targetRules = self._getTargetRules(self.rules, sourceName)\n\n # XXX the repository operations should be pulled out of all of\n # these loops\n additionalNames = set()\n for rule in targetRules:\n # get all of the flavors this rule specifies redirecting to\n targetFlavors = rule.findAvailableTargetFlavors(self.repos)\n\n if rule.branchStr and not targetFlavors:\n # We're redirecting to something which doesn't\n # exist.\n raise builderrors.RecipeFileError, \\\n \"Trove %s does not exist\" % (rule.destName)\n\n # This lets us catch where we haven't found any matches for\n # this rule. If we have found any matches for this rule, no\n # error results, even if some of the troves on that label\n # cannot be redirected due to flavor conflicts\n foundMatch = False\n\n # Try to create redirects for each version/flavor combination\n for sourceVersion, flavorList in sourceTroveVersions.items():\n for sourceFlavor in flavorList:\n if rule.sourceFlavor is not None and \\\n sourceFlavor != rule.sourceFlavor:\n continue\n\n match = None\n for targetVersion, targetFlavor in targetFlavors:\n if (not rule.skipTargetMatching and\n rule.targetFlavor is not None and\n targetFlavor != rule.targetFlavor):\n continue\n\n if ((rule.sourceFlavor is not None)\n or rule.skipTargetMatching\n or sourceFlavor.score(targetFlavor) is not False):\n match = (targetVersion, targetFlavor)\n break\n\n if match is not None:\n # found a compatible trove to redirect to\n if (sourceName, sourceFlavor) in self.redirections:\n # a default-flavor rule doesn't cause a\n # conflict with a flavor-specifying rule\n # because the later is more specific (and\n # we know we've already processed the\n # flavor-specifying rule because self.rules\n # is sorted with flavor-specifying rules\n # at the front)\n previousRule = redirRuleMap[(sourceName,\n sourceFlavor)]\n if (previousRule.sourceFlavor\n is not None and\n rule.sourceFlavor is None):\n # the default rule should be skipped\n # rather than causing a conflict\n continue\n\n if not rule.allowMultipleTargets:\n raise builderrors.RecipeFileError, \\\n \"Multiple redirect targets specified \" \\\n \"from trove %s[%s]\" \\\n % (sourceName, sourceFlavor)\n\n targetTroveInfo = (rule.destName, match[0],\n match[1])\n elif not targetFlavors:\n # redirect to nothing\n targetTroveInfo = (None, None, None)\n elif rule.targetFlavor is not None:\n raise builderrors.RecipeFileError, \\\n \"Trove %s does not exist for flavor [%s]\" \\\n % (sourceName, targetFlavor)\n else:\n continue\n\n # we created a redirect!\n foundMatch = True\n redirRuleMap[(sourceName, sourceFlavor)] = rule\n\n self._buildRedirect(trvCsDict, sourceFlavor,\n sourceVersion, rule,\n targetTroveInfo)\n\n\n if not foundMatch:\n raise builderrors.CookError(\n \"Could not find target with satisfying flavor\"\n \" for redirect %s - either create a redirect\"\n \" with targetFlavor and sourceFlavor set, or\"\n \" create a redirect with skipTargetMatching = True\" % sourceName)", "metadata": "root._RedirectRecipe.findTroves", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 288 }, { "content": " def getRedirections(self):\n return self.redirections", "metadata": "root._RedirectRecipe.getRedirections", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 392 }, { "content": " def __init__(self, repos, cfg, branch, flavor, extraMacros={}):\n Recipe.__init__(self, cfg)\n self.repos = repos\n self.redirections = _Redirections()\n self.flavor = flavor\n if branch is not None:\n self.macros.binarybranch = str(branch)\n self.macros.update(extraMacros)\n # this allows override of binarybranch externally (used by rMake)\n self.branch = versions.VersionFromString(self.macros.binarybranch)\n else:\n self.branch = None\n self.rules = {}", "metadata": "root._RedirectRecipe.__init__", "header": "['class', '_RedirectRecipe', '(', 'Recipe', ')', ':', '___EOS___']", "index": 395 } ]
[ { "span": "from conary.build import macros", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 31 }, { "span": "from conary.build.packagerecipe import BaseRequiresRecipe", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 57 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "SAS", " ", "Institut", "e", " ", "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_", "from_", "cona", "ry_", "import_", "trove_", ",_", "versions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cona", "ry_", "._", "deps_", "import_", "deps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cona", "ry_", "._", "build_", "import_", "errors_", "as_", "builde", "rror", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cona", "ry_", "._", "build_", "import_", "default", "recipes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cona", "ry_", "._", "build_", "import_", "macros_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cona", "ry_", "._", "build_", "import_", "use_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cona", "ry_", "._", "build_", "._", "recipe_", "import_", "Recipe_", ",_", "RECIP", "E", "\\u", "TYPE", "\\u", "REDIRECT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cona", "ry_", "._", "build_", "._", "package", "recipe_", "import_", "Base", "Requ", "ires", "Recipe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cona", "ry_", "._", "lib_", "import_", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "exec_", "default", "recipes_", "._", "Redirect", "Recipe_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "\\u", "Redirect_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "slots\\u\\u_", "=_", "[_", "'", "component", "s", "'_", ",_", "'", "is", "Remove", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "components_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Components_", "(_", "self_", ",_", "name", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "components_", "+=_", "name", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Remove", "Redirect_", "(_", "\\u", "Redirect_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "Remove_", "=_", "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_", "\\u", "Redirect", "Info_", "(_", "\\u", "Redirect_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "slots\\u\\u_", "=_", "[_", "'", "target", "Name", "'_", ",_", "'", "target", "Branc", "h", "'_", ",_", "'", "target", "Fla", "vor", "'_", ",_", "'", "component", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "Remove_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Info_", "(_", "\\u", "Redirect_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "target", "Name_", ",_", "target", "Branch_", ",_", "target", "Flavor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "target", "Name_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Redirect_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "Name_", "=_", "target", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "Branch_", "=_", "target", "Branch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "Flavor_", "=_", "target", "Flavor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Redirect", "ions_", "(_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "ions_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "add_", "(_", "self_", ",_", "source", "Name_", ",_", "source", "Flavor_", ",_", "redir", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "self_", "._", "setdefault_", "(_", "(_", "source", "Name_", ",_", "source", "Flavor_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "._", "append_", "(_", "redir", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Redirect", "Rule_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "slots\\u\\u_", "=_", "[_", "'", "dest", "Name", "'_", ",_", "'", "branch", "Str", "'_", ",_", "'", "source", "Fla", "vor", "'_", ",_", "'", "target", "Fla", "vor", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "skip", "Target", "Match", "ing", "'_", ",_", "'", "source", "Name", "'_", ",_", "'", "allow", "Multipl", "e", "Target", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Rule_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "find", "Avail", "able", "Target", "Fla", "vor", "s_", "(_", "self_", ",_", "repos_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "branch", "Str_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "redirec", "t", " ", "to", " ", "nothing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "branch", "Str_", "[_", "0_", "]_", "==_", "'/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "branch_", "=_", "versions_", "._", "Version", "Fro", "m", "String_", "(_", "self_", "._", "branch", "Str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "branch_", ",_", "versions_", "._", "Branch_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "builde", "rror", "s_", "._", "Recip", "e", "File", "Error_", ",_", "\"", "Redirect", "s", " ", "must", " ", "speci", "fy", " ", "branch", "es", " ", "or", " ", "labels", ",", " ", "\"_", "\"", "not", " ", "version", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "redirec", "ting", " ", "to", " ", "branch", "es", " ", "is", " ", "depre", "cated", ";", " ", "redirec", "ts", " ", "must", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "be", " ", "to", " ", "labels", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "matches_", "=_", "repos_", "._", "get", "Trove", "Leav", "es", "By", "Branch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "self_", "._", "dest", "Name_", ":_", "{_", "branch_", ":_", "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 ", " _", "label_", "=_", "versions_", "._", "Label_", "(_", "self_", "._", "branch", "Str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matches_", "=_", "repos_", "._", "get", "Trove", "Late", "st", "By", "Label_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "self_", "._", "dest", "Name_", ":_", "{_", "label_", ":_", "None_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "target", "Fla", "vor", "s_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "flavor", "s", " ", "and", " ", "branch", " ", "avail", "able", " ", "on", " ", "the", " ", "target_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "version_", ",_", "flavor", "List_", "in_", "matches_", "._", "get_", "(_", "self_", "._", "dest", "Name_", ",_", "{_", "}_", ")_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "Fla", "vor", "s_", "._", "update_", "(_", "(_", "version_", ",_", "x_", ")_", "for_", "x_", "in_", "flavor", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "target", "Fla", "vor", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Rule_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", "[", "%", "s", "]", " ", "->", " ", "%", "s", "=", "%", "s", "[", "%", "s", "]\"_", "%_", "(_", "self_", "._", "source", "Name_", ",_", "self_", "._", "source", "Flavor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dest", "Name_", ",_", "self_", "._", "branch", "Str_", ",_", "self_", "._", "target", "Flavor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Rule_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "source", "Name_", "=_", "None_", ",_", "dest", "Name_", "=_", "None_", ",_", "branch", "Str_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source", "Flavor_", "=_", "None_", ",_", "target", "Flavor_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "skip", "Target", "Match", "ing_", "=_", "None_", ",_", "allow", "Multipl", "e", "Targets_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source", "Name_", "=_", "source", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dest", "Name_", "=_", "dest", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "branch", "Str_", "=_", "branch", "Str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source", "Flavor_", "=_", "source", "Flavor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "Flavor_", "=_", "target", "Flavor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "skip", "Target", "Match", "ing_", "=_", "skip", "Target", "Match", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "allow", "Multipl", "e", "Targets_", "=_", "allow", "Multipl", "e", "Targets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Flags_", "=_", "use_", "._", "Local", "Flags_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "recip", "e", "Type_", "=_", "RECIP", "E", "\\u", "TYPE", "\\u", "REDIRECT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "internal", "Abstract", "Base", "Class_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "add", "Rule_", "(_", "self_", ",_", "rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "self_", "._", "rules_", "._", "setdefault_", "(_", "rule_", "._", "source", "Name_", ",_", "list_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rule_", "._", "source", "Flavor_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "._", "append_", "(_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "default", " ", "(", "with", " ", "no", " ", "source", "Fla", "vor", ")", " ", "has", " ", "to", " ", "be", " ", "at", " ", "the", " ", "end", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "it", " ", "matche", "s", " ", "last_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "._", "insert_", "(_", "0_", ",_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Redirect_", "(_", "self_", ",_", "to", "Trove", "_", ",_", "branch", "Str_", "=_", "None_", ",_", "source", "Flavor_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Flavor_", "=_", "None_", ",_", "from", "Trove", "_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "skip", "Target", "Match", "ing_", "=_", "False_", ",_", "allow", "Multipl", "e", "Targets_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "(_", "source", "Flavor_", "is_", "not_", "None_", ")_", "and_", "(_", "target", "Flavor_", "is_", "None_", ")_", ")_", "or_", "(_", "(_", "target", "Flavor_", "is_", "not_", "None_", ")_", "and_", "(_", "source", "Flavor_", "is_", "None_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "builde", "rror", "s_", "._", "Recip", "e", "File", "Error_", ",_", "\"", "source", "Fla", "vor", " ", "and", " ", "target", "Fla", "vor", " ", "must", " ", "be", " ", "specified", " ", "joint", "ly", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "source", "Flavor_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "deps_", "._", "parse", "Flavor_", "(_", "source", "Flavor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "'", "invalid", " ", "flavor", " ", "%", "s", "'_", "%_", "source", "Flavor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "source", "Flavor_", "=_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "target", "Flavor_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "deps_", "._", "parse", "Flavor_", "(_", "target", "Flavor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "'", "invalid", " ", "flavor", " ", "%", "s", "'_", "%_", "target", "Flavor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "target", "Flavor_", "=_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "from", "Trove", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from", "Trove", "_", "=_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "from", "Trove", "_", "._", "find_", "(_", "\":\"_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "'", "component", "s", " ", "cann", "ot", " ", "be", " ", "individual", "ly", " ", "redirected", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rule_", "=_", "\\u", "Redirect", "Rule_", "(_", "source", "Name_", "=_", "from", "Trove", "_", ",_", "dest", "Name_", "=_", "to", "Trove", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "branch", "Str_", "=_", "branch", "Str_", ",_", "source", "Flavor_", "=_", "source", "Flavor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Flavor_", "=_", "target", "Flavor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "skip", "Target", "Match", "ing_", "=_", "skip", "Target", "Match", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "Multipl", "e", "Targets_", "=_", "allow", "Multipl", "e", "Targets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "add", "Rule_", "(_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Remove", "Redirect_", "(_", "self_", ",_", "from", "Trove", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "allow", " ", "flavor", "-", "specific", "ty", " ", "for", " ", "remove", " ", "rule", "s", ".", " ", "You", " ", "coul", "d", " ", "write_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "redirec", "t", " ", "rule", "s", " ", "for", " ", "every", "thing", " ", "whi", "ch", " ", "ou", "ght", " ", "to", " ", "be", " ", "redirected", " ", "and", " ", "have_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "catch", "-", "all", " ", "remove", " ", "redirec", "t", " ", "for", " ", "every", "thing", " ", "else", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "from", "Trove", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from", "Trove", "_", "=_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "from", "Trove", "_", "._", "find_", "(_", "\":\"_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "'", "component", "s", " ", "cann", "ot", " ", "be", " ", "individual", "ly", " ", "redirected", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rule_", "=_", "\\u", "Redirect", "Rule_", "(_", "source", "Name_", "=_", "from", "Trove", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "add", "Rule_", "(_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "find", "Sou", "rce", "Trove", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "Search_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "from", "Trove", "_", "in_", "self_", "._", "rules_", "._", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "Search_", "._", "setdefault_", "(_", "from", "Trove", "_", ",_", "{_", "self_", "._", "branch_", ":_", "None_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "treat", "s", " ", "previ", "ously", "-", "bui", "lt", " ", "redirec", "ts", " ", "as", " ", "flavor", "s", " ", "we", " ", "need", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "redirec", "t", " ", "from", ",", " ", "whi", "ch", " ", "see", "ms", " ", "a", " ", "bit", " ", "weird", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "source", "Trove", "Matches_", "=_", "self_", "._", "repos_", "._", "get", "Trove", "Leav", "es", "By", "Branch_", "(_", "source", "Search_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "source", "Trove", "Matches_", ")_", "!=_", "len_", "(_", "source", "Search_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "missing_", "=_", "set_", "(_", "source", "Search_", ")_", "-_", "set_", "(_", "source", "Trove", "Matches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "builde", "rror", "s_", "._", "Recip", "e", "File", "Error_", ",_", "\"", "No", " ", "trove", "s", " ", "found", " ", "with", " ", "name", "(", "s", ")", " ", "%", "s", "\"_", "%_", "\"", " ", "\"_", "._", "join_", "(_", "missing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "source", "Trove", "Matches_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "Sou", "rce", "Trove", "s_", "(_", "self_", ",_", "search", "Result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", ",_", "d_", "in_", "search", "Result_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "version_", ",_", "flavor", "List_", "in_", "d_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "+=_", "[_", "(_", "name_", ",_", "(_", "None_", ",_", "None_", ")_", ",_", "(_", "version_", ",_", "x_", ")_", ",_", "True_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "flavor", "List_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tr", "v", "Cs", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "need", " ", "to", " ", "recurse", " ", "here", " ", "sinc", "e", " ", "we", " ", "only", " ", "support", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "redirects_", "\\u\\u\\uNL\\u\\u\\u_", "cs_", "=_", "self_", "._", "repos_", "._", "create", "Change", "Set_", "(_", "l_", ",_", "recurse_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "with", "Files_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tr", "v", "Cs_", "in_", "cs_", "._", "iter", "New", "Trove", "List_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info_", "=_", "(_", "tr", "v", "Cs_", "._", "get", "Name_", "(_", ")_", ",_", "tr", "v", "Cs_", "._", "get", "New", "Version_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tr", "v", "Cs_", "._", "get", "New", "Flavor_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr", "v", "Cs", "Dict_", "[_", "info_", "]_", "=_", "tr", "v", "Cs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tr", "v", "Cs", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "get", "Target", "Rules_", "(_", "rules_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "the", " ", "rule", "s", " ", "for", " ", "trove", "s", " ", "with", " ", "this", " ", "name", ";", " ", "if", " ", "it", "'", "s", " ", "a", " ", "component", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "package", " ", "we", " ", "alr", "ad", "y", " ", "bui", "lt", " ", "reus", "e", " ", "the", " ", "rule", " ", "whi", "ch", " ", "we", " ", "used", " ", "for", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "Rules_", "=_", "rules_", "._", "get_", "(_", "name_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "target", "Rules_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "builde", "rror", "s_", "._", "Recip", "e", "File", "Error_", ",_", "\"", "Cann", "ot", " ", "find", " ", "redirection", " ", "for", " ", "trove", " ", "%", "s", "\"_", "%_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "target", "Rules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "build", "Redirect_", "(_", "self_", ",_", "tr", "v", "Cs", "Dict_", ",_", "source", "Flavor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source", "Version_", ",_", "rule_", ",_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "target_", "[_", "0_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redir", "Info_", "=_", "\\u", "Redirect", "Info_", "(_", "target_", "[_", "0_", "]_", ",_", "target_", "[_", "1_", "]_", "._", "branch_", "(_", ")_", ",_", "rule_", "._", "target", "Flavor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redir", "Info_", "=_", "\\u", "Remove", "Redirect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "redirection", "s_", "._", "add_", "(_", "rule_", "._", "source", "Name_", ",_", "source", "Flavor_", ",_", "redir", "Info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "s", " ", "don", "'", "t", " ", "include", " ", "any", " ", "addition", "al", " ", "redirection", "s", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nei", "ther", " ", "do", " ", "items", " ", "whi", "ch", " ", "are", "n", "'", "t", " ", "collections_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "trove_", "._", "trove", "Is", "Group_", "(_", "rule_", "._", "source", "Name_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "trove_", "._", "trove", "Is", "Collection_", "(_", "rule_", "._", "source", "Name_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "target_", "[_", "0_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "Trove", "_", "=_", "self_", "._", "repos_", "._", "get", "Trove", "_", "(_", "with", "Files_", "=_", "False_", ",_", "*_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Components_", "=_", "set_", "(_", "[_", "x_", "[_", "0_", "]_", "._", "split_", "(_", "':'_", ")_", "[_", "1_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Trove", "_", "._", "iter", "Trove", "List_", "(_", "strong", "Refs", "_", "=_", "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 ", " _", "target", "Components_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "can", "'", "t", " ", "integrity", " ", "check", " ", "here", " ", "bec", "aus", "e", " ", "we", " ", "got_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "trove", " ", "w", "/", "o", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tr", "v", "Cs_", "=_", "tr", "v", "Cs", "Dict_", "[_", "(_", "rule_", "._", "source", "Name_", ",_", "source", "Version_", ",_", "source", "Flavor_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr", "v_", "=_", "trove_", "._", "Trove", "_", "(_", "tr", "v", "Cs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "assemble", " ", "a", " ", "set", " ", "of", " ", "all", " ", "of", " ", "the", " ", "component", "s", " ", "included_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "this", " ", "trove_", "\\u\\u\\uNL\\u\\u\\u_", "current", "Components_", "=_", "set_", "(_", "[_", "x_", "[_", "0_", "]_", "._", "split_", "(_", "':'_", ")_", "[_", "1_", "]_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "tr", "v_", "._", "iter", "Trove", "List_", "(_", "strong", "Refs", "_", "=_", "True_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "component", "s", " ", "shared", " ", "bet", "ween", " ", "the", " ", "current", " ", "trove", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "target", " ", "shou", "ld", " ", "be", " ", "redirected", " ", "to", " ", "the", " ", "target_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "components_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "comp", "Name_", "in_", "current", "Components_", "&_", "target", "Components_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "Comp", "Name_", "=_", "rule_", "._", "source", "Name_", "+_", "':'_", "+_", "comp", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Comp", "Name_", "=_", "redir", "Info_", "._", "target", "Name_", "+_", "':'_", "+_", "comp", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "redirection", "s_", "._", "add_", "(_", "source", "Comp", "Name_", ",_", "source", "Flavor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Redirect", "Info_", "(_", "target", "Comp", "Name_", ",_", "redir", "Info_", "._", "target", "Branch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "redir", "Info_", "._", "target", "Flavor_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "get", " ", "all", " ", "of", " ", "the", " ", "component", "s", " ", "whi", "ch", " ", "have", " ", "bee", "n_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "include", "d", " ", "in", " ", "this", " ", "trove", " ", "any", "where", " ", "on", " ", "the", " ", "branch", ";", " ", "tho", "se_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "component", "s", " ", "need", " ", "to", " ", "generat", "e", " ", "erase", " ", "redirects_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "Version", "s_", "=_", "self_", "._", "repos_", "._", "get", "Trove", "Version", "s", "By", "Branch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "tr", "v_", "._", "get", "Name_", "(_", ")_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "tr", "v_", "._", "get", "Version_", "(_", ")_", "._", "branch_", "(_", ")_", ":_", "None_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sub", "Version_", ",_", "sub", "Fla", "vor", "List_", "in_", "all", "Version", "s_", "[_", "tr", "v_", "._", "get", "Name_", "(_", ")_", "]_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "+=_", "[_", "(_", "tr", "v_", "._", "get", "Name_", "(_", ")_", ",_", "sub", "Version_", ",_", "flavor_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "flavor_", "in_", "sub", "Fla", "vor", "List_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "Trove", "s_", "=_", "self_", "._", "repos_", "._", "get", "Trove", "s_", "(_", "l_", ",_", "with", "Files_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "Components_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "other", "Tr", "v_", "in_", "all", "Trove", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "Components_", "._", "update_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "x_", "[_", "0_", "]_", "._", "split_", "(_", "':'_", ")_", "[_", "1_", "]_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "other", "Tr", "v_", "._", "iter", "Trove", "List_", "(_", "strong", "Refs", "_", "=_", "True_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "component", "s", " ", "whi", "ch", " ", "existed", " ", "at", " ", "any", " ", "point", " ", "for", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "trove", " ", "but", " ", "don", "'", "t", " ", "have", " ", "a", " ", "component", " ", "in", " ", "the", " ", "redirect_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "target", " ", "need", " ", "to", " ", "be", " ", "erase", "d_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "sub", "Name_", "in_", "all", "Components_", "-_", "target", "Components_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "Name_", "=_", "rule_", "._", "source", "Name_", "+_", "':'_", "+_", "sub", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "redirection", "s_", "._", "add_", "(_", "new", "Name_", ",_", "source", "Flavor_", ",_", "\\u", "Remove", "Redirect_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "package", " ", "redirec", "t", " ", "include", "s", " ", "reference", "s", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "component", " ", "redirec", "ts", " ", "to", " ", "let", " ", "the", " ", "update", " ", "code", " ", "know", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "how", " ", "to", " ", "redirec", "t", " ", "the", " ", "component", "s", ";", " ", "this", " ", "tracks", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "component", "s", " ", "of", " ", "this", " ", "redirect_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "redir", "Info_", "._", "add", "Components_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "rule_", "._", "source", "Name_", "+_", "':'_", "+_", "x_", "for_", "x_", "in_", "all", "Components_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "Trove", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "Trove", "Matches_", "=_", "self_", "._", "\\u", "find", "Sou", "rce", "Trove", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr", "v", "Cs", "Dict_", "=_", "self_", "._", "\\u", "get", "Sou", "rce", "Trove", "s_", "(_", "source", "Trove", "Matches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "redir", "Rule", "Map_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "source", "Trove", "Version", "s", " ", "is", " ", "all", " ", "of", " ", "the", " ", "version", "s", "/", "flavor", "s", " ", "which_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "currentl", "y", " ", "exist", " ", "for", " ", "this", " ", "trove_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "source", "Name_", ",_", "source", "Trove", "Version", "s_", "in_", "source", "Trove", "Matches_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "of", " ", "rule", "s", " ", "for", " ", "where", " ", "this", " ", "trove", " ", "shou", "ld", " ", "redirec", "t", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "Rules_", "=_", "self_", "._", "\\u", "get", "Target", "Rules_", "(_", "self_", "._", "rules_", ",_", "source", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "the", " ", "repos", "itor", "y", " ", "operati", "ons", " ", "shou", "ld", " ", "be", " ", "pull", "ed", " ", "out", " ", "of", " ", "all", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "these", " ", "loops_", "\\u\\u\\uNL\\u\\u\\u_", "addition", "al", "Names_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rule_", "in_", "target", "Rules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "all", " ", "of", " ", "the", " ", "flavor", "s", " ", "this", " ", "rule", " ", "speci", "fie", "s", " ", "redirec", "ting", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "Fla", "vor", "s_", "=_", "rule_", "._", "find", "Avail", "able", "Target", "Fla", "vor", "s_", "(_", "self_", "._", "repos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rule_", "._", "branch", "Str_", "and_", "not_", "target", "Fla", "vor", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", "'", "re", " ", "redirec", "ting", " ", "to", " ", "somet", "hing", " ", "whi", "ch", " ", "doe", "sn", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exist", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "builde", "rror", "s_", "._", "Recip", "e", "File", "Error_", ",_", "\"", "Trove", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "exist", "\"_", "%_", "(_", "rule_", "._", "dest", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "lets", " ", "us", " ", "catch", " ", "where", " ", "we", " ", "have", "n", "'", "t", " ", "found", " ", "any", " ", "matche", "s", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "rule", ".", " ", "If", " ", "we", " ", "have", " ", "found", " ", "any", " ", "matche", "s", " ", "for", " ", "this", " ", "rule", ",", " ", "no_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "error", " ", "results", ",", " ", "even", " ", "if", " ", "some", " ", "of", " ", "the", " ", "trove", "s", " ", "on", " ", "tha", "t", " ", "label_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cann", "ot", " ", "be", " ", "redirected", " ", "due", " ", "to", " ", "flavor", " ", "conflicts_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "found", "Match_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "create", " ", "redirec", "ts", " ", "for", " ", "each", " ", "version", "/", "flavor", " ", "combination_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "source", "Version_", ",_", "flavor", "List_", "in_", "source", "Trove", "Version", "s_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "source", "Flavor_", "in_", "flavor", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "rule_", "._", "source", "Flavor_", "is_", "not_", "None_", "and_", "source", "Flavor_", "!=_", "rule_", "._", "source", "Flavor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "match_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "target", "Version_", ",_", "target", "Flavor_", "in_", "target", "Fla", "vor", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "(_", "not_", "rule_", "._", "skip", "Target", "Match", "ing_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "rule_", "._", "target", "Flavor_", "is_", "not_", "None_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Flavor_", "!=_", "rule_", "._", "target", "Flavor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "(_", "rule_", "._", "source", "Flavor_", "is_", "not_", "None_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "rule_", "._", "skip", "Target", "Match", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "source", "Flavor_", "._", "score_", "(_", "target", "Flavor_", ")_", "is_", "not_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "match_", "=_", "(_", "target", "Version_", ",_", "target", "Flavor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "found", " ", "a", " ", "compatible", " ", "trove", " ", "to", " ", "redirec", "t", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "(_", "source", "Name_", ",_", "source", "Flavor_", ")_", "in_", "self_", "._", "redirection", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "a", " ", "default", "-", "flavor", " ", "rule", " ", "doe", "sn", "'", "t", " ", "caus", "e", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "confl", "ict", " ", "with", " ", "a", " ", "flavor", "-", "speci", "fy", "ing", " ", "rule_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "the", " ", "late", "r", " ", "is", " ", "more", " ", "specific", " ", "(", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "know", " ", "we", "'", "ve", " ", "alr", "ead", "y", " ", "process", "ed", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flavor", "-", "speci", "fy", "ing", " ", "rule", " ", "bec", "aus", "e", " ", "self", ".", "rules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "sorte", "d", " ", "with", " ", "flavor", "-", "speci", "fy", "ing", " ", "rules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "at", " ", "the", " ", "front", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "previ", "ous", "Rule_", "=_", "redir", "Rule", "Map_", "[_", "(_", "source", "Name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source", "Flavor_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "previ", "ous", "Rule_", "._", "source", "Flavor_", "\\u\\u\\uNL\\u\\u\\u_", "is_", "not_", "None_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "rule_", "._", "source", "Flavor_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "default", " ", "rule", " ", "shou", "ld", " ", "be", " ", "skipped_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rat", "her", " ", "than", " ", "caus", "ing", " ", "a", " ", "conflict_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "rule_", "._", "allow", "Multipl", "e", "Targets_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "builde", "rror", "s_", "._", "Recip", "e", "File", "Error_", ",_", "\"", "Multipl", "e", " ", "redirec", "t", " ", "target", "s", " ", "specified", " ", "\"_", "\"", "from", " ", "trove", " ", "%", "s", "[", "%", "s", "]\"_", "%_", "(_", "source", "Name_", ",_", "source", "Flavor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "target", "Trove", "Info_", "=_", "(_", "rule_", "._", "dest", "Name_", ",_", "match_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "match_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "target", "Fla", "vor", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "redirec", "t", " ", "to", " ", "nothing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "target", "Trove", "Info_", "=_", "(_", "None_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "rule_", "._", "target", "Flavor_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "builde", "rror", "s_", "._", "Recip", "e", "File", "Error_", ",_", "\"", "Trove", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "exist", " ", "for", " ", "flavor", " ", "[", "%", "s", "]\"_", "%_", "(_", "source", "Name_", ",_", "target", "Flavor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "created", " ", "a", " ", "redirec", "t", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "found", "Match_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redir", "Rule", "Map_", "[_", "(_", "source", "Name_", ",_", "source", "Flavor_", ")_", "]_", "=_", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "build", "Redirect_", "(_", "tr", "v", "Cs", "Dict_", ",_", "source", "Flavor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source", "Version_", ",_", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Trove", "Info_", ")_", "\\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_", "not_", "found", "Match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "builde", "rror", "s_", "._", "Coo", "k", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cou", "ld", " ", "not", " ", "find", " ", "target", " ", "with", " ", "satisfy", "ing", " ", "flavor", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "for", " ", "redirec", "t", " ", "%", "s", " ", "-", " ", "eit", "her", " ", "create", " ", "a", " ", "redirec", "t", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "with", " ", "target", "Fla", "vor", " ", "and", " ", "source", "Fla", "vor", " ", "set", ",", " ", "or", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "create", " ", "a", " ", "redirec", "t", " ", "with", " ", "skip", "Target", "Match", "ing", " ", "=", " ", "Tru", "e", "\"_", "%_", "source", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\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_", "get", "Redirect", "ions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "redirection", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Redirect", "Recipe_", "(_", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "repos_", ",_", "cfg_", ",_", "branch_", ",_", "flavor_", ",_", "extra", "Macro", "s_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Recipe_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repos_", "=_", "repos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "redirection", "s_", "=_", "\\u", "Redirect", "ions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flavor_", "=_", "flavor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "branch_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "macros_", "._", "binar", "yb", "ranch", "_", "=_", "str_", "(_", "branch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "macros_", "._", "update_", "(_", "extra", "Macro", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "allow", "s", " ", "override", " ", "of", " ", "binar", "yb", "ranch", " ", "external", "ly", " ", "(", "used", " ", "by", " ", "r", "Make", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "branch_", "=_", "versions_", "._", "Version", "Fro", "m", "String_", "(_", "self_",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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
securitykiss-com/rfw/rfw/iptables.py
[ { "content": " @staticmethod\n def _iptables_list():\n \"\"\"List and parse iptables rules. Do not call directly. Use Iptables.load().rules instead\n return list of rules of type Rule.\n \"\"\"\n rules = []\n out = Iptables.exe(['-n', '-L', '-v', '-x', '--line-numbers'])\n #out = subprocess.check_output([Iptables.ipt_path, '-n', '-L', '-v', '-x', '--line-numbers'], stderr=subprocess.STDOUT)\n chain = None\n header = None\n for line in out.split('\\n'):\n line = line.strip()\n if not line:\n chain = None #on blank line reset current chain\n continue\n m = re.match(r\"Chain (\\w+) .*\", line)\n if m and m.group(1) in RULE_CHAINS:\n chain = m.group(1)\n continue\n if \"source\" in line and \"destination\" in line:\n # check if iptables output headers make sense \n assert line.split() == IPTABLES_HEADERS\n continue\n if chain:\n columns = line.split()\n if columns and columns[0].isdigit():\n # join all extra columns into one extra field\n extra = \" \".join(columns[10:])\n columns = columns[:10]\n columns.append(extra)\n columns.insert(0, chain)\n rule = Rule(columns)\n rules.append(rule)\n return rules", "metadata": "root.Iptables._iptables_list", "header": "['class', 'Iptables', ':', '___NEWLINE___', '___NL___', '___NL___', '# global lock for system iptables access', '___NL___', '___EOS___']", "index": 134 } ]
[ { "span": "header ", "start_line": 143, "start_column": 8, "end_line": 143, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Ip", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "global", " ", "lock", " ", "for", " ", "system", " ", "iptables", " ", "access_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "iptables", "\\u", "list_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "List", " ", "and", " ", "parse", " ", "iptables", " ", "rule", "s", ".", " ", "Do", " ", "not", " ", "call", " ", "direct", "ly", ".", " ", "Us", "e", " ", "Ip", "tables", ".", "load", "()", ".", "rule", "s", " ", "inst", "ead", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "list", " ", "of", " ", "rule", "s", " ", "of", " ", "type", " ", "Rule", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rules_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "Ip", "tables_", "._", "exe_", "(_", "[_", "'-", "n", "'_", ",_", "'-", "L", "'_", ",_", "'-", "v", "'_", ",_", "'-", "x", "'_", ",_", "'--", "line", "-", "numbers", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "out", " ", "=", " ", "subproc", "ess", ".", "check", "\\u", "output", "([", "Ip", "tables", ".", "ipt", "\\u", "path", ",", " ", "'-", "n", "',", " ", "'-", "L", "',", " ", "'-", "v", "',", " ", "'-", "x", "',", " ", "'--", "line", "-", "numbers", "']", ",", " ", "std", "err", "=", "subproc", "ess", ".", "STD", "OUT", ")_", "\\u\\u\\uNL\\u\\u\\u_", "chain_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "out_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "line_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chain_", "=_", "None_", "#", "on", " ", "blank", " ", "line", " ", "reset", " ", "current", " ", "chain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "re_", "._", "match_", "(_", "r", "\"", "Chain", " ", "(\\\\", "w", "+)", " ", ".*\"_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", "and_", "m_", "._", "group_", "(_", "1_", ")_", "in_", "RULE", "\\u", "CHAIN", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chain_", "=_", "m_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "source", "\"_", "in_", "line_", "and_", "\"", "destinat", "ion", "\"_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "iptables", " ", "output", " ", "header", "s", " ", "make", " ", "sense", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "line_", "._", "split_", "(_", ")_", "==_", "IP", "TABLES", "\\u", "HEADERS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "chain_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "columns_", "=_", "line_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "columns_", "and_", "columns_", "[_", "0_", "]_", "._", "isdigit_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "join", " ", "all", " ", "extra", " ", "column", "s", " ", "int", "o", " ", "one", " ", "extra", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "extra_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "columns_", "[_", "10_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "columns_", "=_", "columns_", "[_", ":_", "10_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "columns_", "._", "append_", "(_", "extra_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "columns_", "._", "insert_", "(_", "0_", ",_", "chain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule_", "=_", "Rule_", "(_", "columns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rules_", "._", "append_", "(_", "rule_", ")_", "\\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_", "rules_", "\\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, 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n self.symbolsused = set()\n all_interptext_props = []\n all_code_props = []\n for (key, propval) in self.props.items():\n if keyword.iskeyword(key):\n print('Warning: prop \"%s\" in %s is a keyword' % (key, None))\n if is_interp_text(propval):\n all_interptext_props.append( (propval['text'], None) )\n if is_code(propval):\n all_code_props.append( (key, propval['text'], None) )\n if is_move(propval):\n if propval['loc'] not in self.locations:\n print('Warning: move prop \"%s\" in %s goes to undefined loc: %s' % (key, None, propval['loc']))\n for (lockey, loc) in self.locations.items():\n for (key, propval) in loc.props.items():\n if keyword.iskeyword(key):\n print('Warning: prop \"%s\" in %s is a keyword' % (key, lockey))\n if is_interp_text(propval):\n all_interptext_props.append( (propval['text'], lockey) )\n if is_code(propval):\n all_code_props.append( (key, propval['text'], lockey) )\n if is_move(propval):\n if propval['loc'] not in self.locations:\n print('Warning: move prop \"%s\" in %s goes to undefined loc: %s' %(key, lockey, propval['loc']))\n \n for (key, text, lockey) in all_code_props:\n try:\n ast.parse(text, filename='%s.%s' % (lockey, key,))\n except Exception as ex:\n print('Warning: code prop \"%s\" in %s does not parse: %s' % (key, lockey, ex))\n\n for (text, lockey) in all_interptext_props:\n for nod in twcommon.interp.parse(text):\n if isinstance(nod, twcommon.interp.Link):\n self.symbolsused.add( (nod.target, lockey) )\n if isinstance(nod, twcommon.interp.Interpolate):\n self.symbolsused.add( (nod.expr, lockey) )\n\n for (symbol, lockey) in self.symbolsused:\n if not symbol.isidentifier():\n try:\n ast.parse(symbol)\n except:\n print('Warning: code snippet \"%s\" in %s does not parse.' % (symbol, lockey,)) \n continue\n if lockey is None:\n loc = None\n else:\n loc = self.locations[lockey]\n if loc and symbol in loc.props:\n continue\n if symbol in self.props:\n continue\n print('Warning: symbol \"%s\" in %s is not defined.' % (symbol, lockey,))", "metadata": "root.World.check_symbols_used", "header": "['class', 'World', '(', 'object', ')', ':', '___EOS___']", "index": 106 }, { "content": "def parse_prop(prop):\n if prop.startswith('*'):\n key, dummy, val = prop[1:].partition(' ')\n \n if not val and key not in ('code', 'gentext'):\n error('%s must be followed by a value' % (key,))\n return None\n \n if key == 'portlist':\n plistkey, dummy, val = val.partition(' ')\n res = {'type':'portlist', 'plistkey':plistkey,\n '_templist':[]}\n if 'single' in val.split():\n res['focus'] = True\n return res\n \n if key == 'move':\n val = sluggify(val.strip())\n return {'type':'move', 'loc':val}\n elif key == 'focus':\n val = sluggify(val.strip())\n return {'type':'focus', 'key':val}\n elif key == 'event':\n return {'type':'event', 'text':val}\n elif key == 'panic':\n return {'type':'panic', 'text':val} # theoretically the text is optional\n elif key == 'text':\n return {'type':'text', 'text':val}\n elif key == 'gentext':\n return {'type':'gentext', 'text':val}\n elif key == 'code':\n return {'type':'code', 'text':val}\n elif key == 'selfdesc':\n return {'type':'selfdesc', 'text':val}\n elif key == 'editstr':\n return {'type':'editstr', 'key':val}\n elif key == 'datetime':\n val = datetime.datetime.strptime(val, '%Y-%m-%d')\n return datetime.datetime(year=val.year, month=val.month, day=val.day, tzinfo=datetime.timezone.utc)\n else:\n error('Unknown special property type: *%s' % (key,))\n return None\n\n try:\n propval = ast.literal_eval(prop)\n # We test-encode the new value to bson, so that we can be strict\n # and catch errors.\n dummy = bson.BSON.encode({'val':propval}, check_keys=True)\n return propval\n except:\n pass\n \n return {'type':'text', 'text':prop}", "metadata": "root.parse_prop", "header": "['module', '___EOS___']", "index": 283 } ]
[ { "span": "except:", "start_line": 149, "start_column": 16, "end_line": 149, "end_column": 23 }, { "span": "except:", "start_line": 332, "start_column": 4, "end_line": 332, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "World_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "symbols", "\\u", "used_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "symbols", "used_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "interp", "text", "\\u", "props_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "code", "\\u", "props_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "key_", ",_", "prop", "val_", ")_", "in_", "self_", "._", "props_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "keyword_", "._", "isk", "ey", "word_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Warn", "ing", ":", " ", "prop", " ", "\"%", "s", "\"", " ", "in", " ", "%", "s", " ", "is", " ", "a", " ", "keyw", "ord", "'_", "%_", "(_", "key_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "interp", "\\u", "text_", "(_", "prop", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "interp", "text", "\\u", "props_", "._", "append_", "(_", "(_", "prop", "val_", "[_", "'", "text", "'_", "]_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "code_", "(_", "prop", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "code", "\\u", "props_", "._", "append_", "(_", "(_", "key_", ",_", "prop", "val_", "[_", "'", "text", "'_", "]_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "move_", "(_", "prop", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "prop", "val_", "[_", "'", "loc", "'_", "]_", "not_", "in_", "self_", "._", "locations_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "'", "Warn", "ing", ":", " ", "move", " ", "prop", " ", "\"%", "s", "\"", " ", "in", " ", "%", "s", " ", "go", "es", " ", "to", " ", "undefined", " ", "loc", ":", " ", "%", "s", "'_", "%_", "(_", "key_", ",_", "None_", ",_", "prop", "val_", "[_", "'", "loc", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "(_", "lock", "ey_", ",_", "loc_", ")_", "in_", "self_", "._", "locations_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "key_", ",_", "prop", "val_", ")_", "in_", "loc_", "._", "props_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "keyword_", "._", "isk", "ey", "word_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "'", "Warn", "ing", ":", " ", "prop", " ", "\"%", "s", "\"", " ", "in", " ", "%", "s", " ", "is", " ", "a", " ", "keyw", "ord", "'_", "%_", "(_", "key_", ",_", "lock", "ey_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "interp", "\\u", "text_", "(_", "prop", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "all", "\\u", "interp", "text", "\\u", "props_", "._", "append_", "(_", "(_", "prop", "val_", "[_", "'", "text", "'_", "]_", ",_", "lock", "ey_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "code_", "(_", "prop", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "all", "\\u", "code", "\\u", "props_", "._", "append_", "(_", "(_", "key_", ",_", "prop", "val_", "[_", "'", "text", "'_", "]_", ",_", "lock", "ey_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "move_", "(_", "prop", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "prop", "val_", "[_", "'", "loc", "'_", "]_", "not_", "in_", "self_", "._", "locations_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "(_", "'", "Warn", "ing", ":", " ", "move", " ", "prop", " ", "\"%", "s", "\"", " ", "in", " ", "%", "s", " ", "go", "es", " ", "to", " ", "undefined", " ", "loc", ":", " ", "%", "s", "'_", "%_", "(_", "key_", ",_", "lock", "ey_", ",_", "prop", "val_", "[_", "'", "loc", "'_", "]_", ")_", ")_", "\\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_", "for_", "(_", "key_", ",_", "text_", ",_", "lock", "ey_", ")_", "in_", "all", "\\u", "code", "\\u", "props_", ":_", "\\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 ", " _", "ast_", "._", "parse_", "(_", "text_", ",_", "filename_", "=_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "lock", "ey_", ",_", "key_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Warn", "ing", ":", " ", "code", " ", "prop", " ", "\"%", "s", "\"", " ", "in", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "parse", ":", " ", "%", "s", "'_", "%_", "(_", "key_", ",_", "lock", "ey_", ",_", "ex_", ")_", ")_", "\\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_", "(_", "text_", ",_", "lock", "ey_", ")_", "in_", "all", "\\u", "interp", "text", "\\u", "props_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "nod", "_", "in_", "tw", "common_", "._", "interp_", "._", "parse_", "(_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "nod", "_", ",_", "tw", "common_", "._", "interp_", "._", "Link_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "symbols", "used_", "._", "add_", "(_", "(_", "nod", "_", "._", "target_", ",_", "lock", "ey_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "nod", "_", ",_", "tw", "common_", "._", "interp_", "._", "Interpolate", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "symbols", "used_", "._", "add_", "(_", "(_", "nod", "_", "._", "expr_", ",_", "lock", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "(_", "symbol_", ",_", "lock", "ey_", ")_", "in_", "self_", "._", "symbols", "used_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "symbol_", "._", "isi", "denti", "fier", "_", "(_", ")_", ":_", "\\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 ", " ", "_", "ast_", "._", "parse_", "(_", "symbol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "'", "Warn", "ing", ":", " ", "code", " ", "snippet", " ", "\"%", "s", "\"", " ", "in", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "parse", ".'_", "%_", "(_", "symbol_", ",_", "lock", "ey_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "lock", "ey_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loc_", "=_", "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 ", " _", "loc_", "=_", "self_", "._", "locations_", "[_", "lock", "ey_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "loc_", "and_", "symbol_", "in_", "loc_", "._", "props_", ":_", "\\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_", "symbol_", "in_", "self_", "._", "props_", ":_", "\\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_", "print_", "(_", "'", "Warn", "ing", ":", " ", "symbol", " ", "\"%", "s", "\"", " ", "in", " ", "%", "s", " ", "is", " ", "not", " ", "defin", "ed", ".'_", "%_", "(_", "symbol_", ",_", "lock", "ey_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "prop_", "(_", "prop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "prop_", "._", "startswith_", "(_", "'*'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", ",_", "dummy_", ",_", "val_", "=_", "prop_", "[_", "1_", ":_", "]_", "._", "partition_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "val_", "and_", "key_", "not_", "in_", "(_", "'", "code", "'_", ",_", "'", "gent", "ext", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error_", "(_", "'%", "s", " ", "must", " ", "be", " ", "followe", "d", " ", "by", " ", "a", " ", "value", "'_", "%_", "(_", "key_", ",_", ")_", ")_", "\\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_", "if_", "key_", "==_", "'", "port", "list", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plist", "key_", ",_", "dummy_", ",_", "val_", "=_", "val_", "._", "partition_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "{_", "'", "type", "'_", ":_", "'", "port", "list", "'_", ",_", "'", "plist", "key", "'_", ":_", "plist", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "templ", "ist", "'_", ":_", "[_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "single", "'_", "in_", "val_", "._", "split_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "[_", "'", "foc", "us", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key_", "==_", "'", "move", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "slug", "gif", "y_", "(_", "val_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "type", "'_", ":_", "'", "move", "'_", ",_", "'", "loc", "'_", ":_", "val_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "foc", "us", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "slug", "gif", "y_", "(_", "val_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "type", "'_", ":_", "'", "foc", "us", "'_", ",_", "'", "key", "'_", ":_", "val_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "event", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "type", "'_", ":_", "'", "event", "'_", ",_", "'", "text", "'_", ":_", "val_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "pani", "c", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "type", "'_", ":_", "'", "pani", "c", "'_", ",_", "'", "text", "'_", ":_", "val_", "}_", "#", " ", "theore", "tica", "ll", "y", " ", "the", " ", "text", " ", "is", " ", "optional_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "text", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "type", "'_", ":_", "'", "text", "'_", ",_", "'", "text", "'_", ":_", "val_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "gent", "ext", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "type", "'_", ":_", "'", "gent", "ext", "'_", ",_", "'", "text", "'_", ":_", "val_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "code", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "type", "'_", ":_", "'", "code", "'_", ",_", "'", "text", "'_", ":_", "val_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "self", "desc", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "type", "'_", ":_", "'", "self", "desc", "'_", ",_", "'", "text", "'_", ":_", "val_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "edits", "tr", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "type", "'_", ":_", "'", "edits", "tr", "'_", ",_", "'", "key", "'_", ":_", "val_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "key_", "==_", "'", "datetime", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "val_", ",_", "'%", "Y", "-%", "m", "-%", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "datetime_", "._", "datetime_", "(_", "year_", "=_", "val_", "._", "year_", ",_", "month_", "=_", "val_", "._", "month_", ",_", "day_", "=_", "val_", "._", "day_", ",_", "tzinfo_", "=_", "datetime_", "._", "timezone_", "._", "utc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error_", "(_", "'", "Un", "know", "n", " ", "special", " ", "property", " ", "type", ":", " ", "*", "%", "s", "'_", "%_", "(_", "key_", ",_", ")_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prop", "val_", "=_", "ast_", "._", "literal", "\\u", "eval_", "(_", "prop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "test", "-", "encode", " ", "the", " ", "new", " ", "value", " ", "to", " ", "bso", "n", ",", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "be", " ", "strict_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "catch", " ", "error", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "dummy_", "=_", "bson_", "._", "BS", "ON_", "._", "encode_", "(_", "{_", "'", "val", "'_", ":_", "prop", "val_", "}_", ",_", "check", "\\u", "keys_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "prop", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "{_", "'", "type", "'_", ":_", "'", "text", "'_", ",_", "'", "text", "'_", ":_", "prop_", "}_", "\\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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 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 ]
Unused import
HumanDynamics/openPDS/openpds/visualization/views.py
[ { "content": "from django.shortcuts import render_to_response\nfrom django.template import RequestContext\nimport pdb\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.shortcuts import render_to_response", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 47 }, { "span": "from django.template import RequestContext", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 42 }, { "span": "import pdb", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render", "\\u", "to", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pdb_" ]
[ 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, 2, 0, 1 ]
Unused import
CollabQ/CollabQ/vendor/epydoc/checker.py
[ { "content": "#\n# objdoc: epydoc documentation completeness checker\n# Edward Loper\n#\n# Created [01/30/01 05:18 PM]\n# $Id: checker.py 1366 2006-09-07 15:54:59Z edloper $\n#\n\n\"\"\"\nDocumentation completeness checker. This module defines a single\nclass, C{DocChecker}, which can be used to check the that specified\nclasses of objects are documented.\n\"\"\"\n__docformat__ = 'epytext en'\n\n##################################################\n## Imports\n##################################################\n\nimport re, sys, os.path, string\nfrom xml.dom.minidom import Text as _Text\nfrom epydoc.apidoc import *\n\n# The following methods may be undocumented:\n_NO_DOCS = ['__hash__', '__repr__', '__str__', '__cmp__']\n\n# The following methods never need descriptions, authors, or\n# versions:\n_NO_BASIC = ['__hash__', '__repr__', '__str__', '__cmp__']\n\n# The following methods never need return value descriptions.\n_NO_RETURN = ['__init__', '__hash__', '__repr__', '__str__', '__cmp__']\n\n# The following methods don't need parameters documented:\n_NO_PARAM = ['__cmp__']\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class DocChecker:\n \"\"\"\n Documentation completeness checker. C{DocChecker} can be used to\n check that specified classes of objects are documented. To check\n the documentation for a group of objects, you should create a\n C{DocChecker} from a L{DocIndex<apidoc.DocIndex>} that documents\n those objects; and then use the L{check} method to run specified\n checks on the objects' documentation.\n\n What checks are run, and what objects they are run on, are\n specified by the constants defined by C{DocChecker}. These\n constants are divided into three groups. \n\n - Type specifiers indicate what type of objects should be\n checked: L{MODULE}; L{CLASS}; L{FUNC}; L{VAR}; L{IVAR};\n L{CVAR}; L{PARAM}; and L{RETURN}.\n - Public/private specifiers indicate whether public or private\n objects should be checked: L{PRIVATE}.\n - Check specifiers indicate what checks should be run on the\n objects: L{TYPE}; L{DESCR}; L{AUTHOR};\n and L{VERSION}.\n\n The L{check} method is used to perform a check on the\n documentation. Its parameter is formed by or-ing together at\n least one value from each specifier group:\n\n >>> checker.check(DocChecker.MODULE | DocChecker.DESCR)\n \n To specify multiple values from a single group, simply or their\n values together:\n \n >>> checker.check(DocChecker.MODULE | DocChecker.CLASS |\n ... DocChecker.FUNC )\n\n @group Types: MODULE, CLASS, FUNC, VAR, IVAR, CVAR, PARAM,\n RETURN, ALL_T\n @type MODULE: C{int}\n @cvar MODULE: Type specifier that indicates that the documentation\n of modules should be checked.\n @type CLASS: C{int}\n @cvar CLASS: Type specifier that indicates that the documentation\n of classes should be checked.\n @type FUNC: C{int}\n @cvar FUNC: Type specifier that indicates that the documentation\n of functions should be checked.\n @type VAR: C{int}\n @cvar VAR: Type specifier that indicates that the documentation\n of module variables should be checked.\n @type IVAR: C{int}\n @cvar IVAR: Type specifier that indicates that the documentation\n of instance variables should be checked.\n @type CVAR: C{int}\n @cvar CVAR: Type specifier that indicates that the documentation\n of class variables should be checked.\n @type PARAM: C{int}\n @cvar PARAM: Type specifier that indicates that the documentation\n of function and method parameters should be checked.\n @type RETURN: C{int}\n @cvar RETURN: Type specifier that indicates that the documentation\n of return values should be checked.\n @type ALL_T: C{int}\n @cvar ALL_T: Type specifier that indicates that the documentation\n of all objects should be checked.\n\n @group Checks: TYPE, AUTHOR, VERSION, DESCR, ALL_C\n @type TYPE: C{int}\n @cvar TYPE: Check specifier that indicates that every variable and\n parameter should have a C{@type} field.\n @type AUTHOR: C{int}\n @cvar AUTHOR: Check specifier that indicates that every object\n should have an C{author} field.\n @type VERSION: C{int}\n @cvar VERSION: Check specifier that indicates that every object\n should have a C{version} field.\n @type DESCR: C{int}\n @cvar DESCR: Check specifier that indicates that every object\n should have a description. \n @type ALL_C: C{int}\n @cvar ALL_C: Check specifier that indicates that all checks\n should be run.\n\n @group Publicity: PRIVATE\n @type PRIVATE: C{int}\n @cvar PRIVATE: Specifier that indicates that private objects should\n be checked.\n \"\"\"\n # Types\n MODULE = 1\n CLASS = 2\n FUNC = 4\n VAR = 8\n #IVAR = 16\n #CVAR = 32\n PARAM = 64\n RETURN = 128\n PROPERTY = 256\n ALL_T = 1+2+4+8+16+32+64+128+256\n\n # Checks\n TYPE = 256\n AUTHOR = 1024\n VERSION = 2048\n DESCR = 4096\n ALL_C = 256+512+1024+2048+4096\n\n # Private/public\n PRIVATE = 16384\n\n ALL = ALL_T + ALL_C + PRIVATE\n\n\n\n\n\n \n \n\n\n \n", "metadata": "root.DocChecker", "header": "['module', '___EOS___']", "index": 36 }, { "content": " def __init__(self, docindex):\n \"\"\"\n Create a new C{DocChecker} that can be used to run checks on\n the documentation of the objects documented by C{docindex}\n\n @param docindex: A documentation map containing the\n documentation for the objects to be checked.\n @type docindex: L{Docindex<apidoc.DocIndex>}\n \"\"\"\n self._docindex = docindex\n\n # Initialize instance variables\n self._checks = 0\n self._last_warn = None\n self._out = sys.stdout\n self._num_warnings = 0", "metadata": "root.DocChecker.__init__", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 146 }, { "content": " def check(self, *check_sets):\n \"\"\"\n Run the specified checks on the documentation of the objects\n contained by this C{DocChecker}'s C{DocIndex}. Any errors found\n are printed to standard out.\n\n @param check_sets: The checks that should be run on the\n documentation. This value is constructed by or-ing\n together the specifiers that indicate which objects should\n be checked, and which checks should be run. See the\n L{module description<checker>} for more information.\n If no checks are specified, then a default set of checks\n will be run.\n @type check_sets: C{int}\n @return: True if no problems were found.\n @rtype: C{boolean}\n \"\"\"\n if not check_sets:\n check_sets = (DocChecker.MODULE | DocChecker.CLASS |\n DocChecker.FUNC | DocChecker.VAR | \n DocChecker.DESCR,)\n \n self._warnings = {}\n log.start_progress('Checking docs')\n for j, checks in enumerate(check_sets):\n self._check(checks)\n log.end_progress()\n\n for (warning, docs) in self._warnings.items():\n docs = sorted(docs)\n docnames = '\\n'.join([' - %s' % self._name(d) for d in docs])\n log.warning('%s:\\n%s' % (warning, docnames))", "metadata": "root.DocChecker.check", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 163 }, { "content": " def _check(self, checks):\n self._checks = checks\n \n # Get the list of objects to check.\n valdocs = sorted(self._docindex.reachable_valdocs(\n imports=False, packages=False, bases=False, submodules=False, \n subclasses=False, private = (checks & DocChecker.PRIVATE)))\n docs = set()\n for d in valdocs:\n if not isinstance(d, GenericValueDoc): docs.add(d)\n for doc in valdocs:\n if isinstance(doc, NamespaceDoc):\n for d in doc.variables.values():\n if isinstance(d.value, GenericValueDoc): docs.add(d)\n\n for i, doc in enumerate(sorted(docs)):\n if isinstance(doc, ModuleDoc):\n self._check_module(doc)\n elif isinstance(doc, ClassDoc):\n self._check_class(doc)\n elif isinstance(doc, RoutineDoc):\n self._check_func(doc)\n elif isinstance(doc, PropertyDoc):\n self._check_property(doc)\n elif isinstance(doc, VariableDoc):\n self._check_var(doc)\n else:\n log.error(\"Don't know how to check %r\" % doc)", "metadata": "root.DocChecker._check", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 196 }, { "content": " def _name(self, doc):\n name = str(doc.canonical_name)\n if isinstance(doc, RoutineDoc): name += '()'\n return name", "metadata": "root.DocChecker._name", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 225 }, { "content": " def _check_basic(self, doc):\n \"\"\"\n Check the description, author, version, and see-also fields of\n C{doc}. This is used as a helper function by L{_check_module},\n L{_check_class}, and L{_check_func}.\n\n @param doc: The documentation that should be checked.\n @type doc: L{APIDoc}\n @rtype: C{None}\n \"\"\"\n if ((self._checks & DocChecker.DESCR) and\n (doc.descr in (None, UNKNOWN))):\n if doc.docstring in (None, UNKNOWN):\n self.warning('Undocumented', doc)\n else:\n self.warning('No description', doc)\n if self._checks & DocChecker.AUTHOR:\n for tag, arg, descr in doc.metadata:\n if 'author' == tag: break\n else:\n self.warning('No authors', doc)\n if self._checks & DocChecker.VERSION:\n for tag, arg, descr in doc.metadata:\n if 'version' == tag: break\n else:\n self.warning('No version', doc)", "metadata": "root.DocChecker._check_basic", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 230 }, { "content": " def _check_module(self, doc):\n \"\"\"\n Run checks on the module whose APIDoc is C{doc}.\n \n @param doc: The APIDoc of the module to check.\n @type doc: L{APIDoc}\n @rtype: C{None}\n \"\"\"\n if self._checks & DocChecker.MODULE:\n self._check_basic(doc)", "metadata": "root.DocChecker._check_module", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 257 }, { "content": " def _check_class(self, doc):\n \"\"\"\n Run checks on the class whose APIDoc is C{doc}.\n \n @param doc: The APIDoc of the class to check.\n @type doc: L{APIDoc}\n @rtype: C{None}\n \"\"\"\n if self._checks & DocChecker.CLASS:\n self._check_basic(doc)", "metadata": "root.DocChecker._check_class", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 268 }, { "content": " def _check_property(self, doc):\n if self._checks & DocChecker.PROPERTY:\n self._check_basic(doc)", "metadata": "root.DocChecker._check_property", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 279 }, { "content": " def _check_var(self, doc):\n \"\"\"\n Run checks on the variable whose documentation is C{var} and\n whose name is C{name}.\n \n @param doc: The documentation for the variable to check.\n @type doc: L{APIDoc}\n @rtype: C{None}\n \"\"\"\n if self._checks & DocChecker.VAR:\n if (self._checks & (DocChecker.DESCR|DocChecker.TYPE) and\n doc.descr in (None, UNKNOWN) and\n doc.type_descr in (None, UNKNOWN) and\n doc.docstring in (None, UNKNOWN)):\n self.warning('Undocumented', doc)\n else:\n if (self._checks & DocChecker.DESCR and\n doc.descr in (None, UNKNOWN)):\n self.warning('No description', doc)\n if (self._checks & DocChecker.TYPE and\n doc.type_descr in (None, UNKNOWN)):\n self.warning('No type information', doc)", "metadata": "root.DocChecker._check_var", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 283 }, { "content": " def _check_func(self, doc):\n \"\"\"\n Run checks on the function whose APIDoc is C{doc}.\n \n @param doc: The APIDoc of the function to check.\n @type doc: L{APIDoc}\n @rtype: C{None}\n \"\"\"\n name = doc.canonical_name\n if (self._checks & DocChecker.FUNC and\n doc.docstring in (None, UNKNOWN) and\n doc.canonical_name[-1] not in _NO_DOCS):\n self.warning('Undocumented', doc)\n return\n if (self._checks & DocChecker.FUNC and\n doc.canonical_name[-1] not in _NO_BASIC):\n self._check_basic(doc)\n if (self._checks & DocChecker.RETURN and\n doc.canonical_name[-1] not in _NO_RETURN):\n if (doc.return_type in (None, UNKNOWN) and\n doc.return_descr in (None, UNKNOWN)):\n self.warning('No return descr', doc)\n if (self._checks & DocChecker.PARAM and\n doc.canonical_name[-1] not in _NO_PARAM):\n if doc.arg_descrs in (None, UNKNOWN):\n self.warning('No argument info', doc)\n else:\n args_with_descr = []\n for arg, descr in doc.arg_descrs:\n if isinstance(arg, basestring):\n args_with_descr.append(arg)\n else:\n args_with_descr += arg\n for posarg in doc.posargs:\n if (self._checks & DocChecker.DESCR and\n posarg not in args_with_descr):\n self.warning('Argument(s) not described', doc)\n if (self._checks & DocChecker.TYPE and\n posarg not in doc.arg_types):\n self.warning('Argument type(s) not described', doc)", "metadata": "root.DocChecker._check_func", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 306 }, { "content": " def warning(self, msg, doc):\n self._warnings.setdefault(msg,set()).add(doc)", "metadata": "root.DocChecker.warning", "header": "['class', 'DocChecker', ':', '___EOS___']", "index": 347 } ]
[ { "span": "import re, sys, os.path, string", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 31 }, { "span": "from xml.dom.minidom import Text as _Text", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "objd", "oc", ":", " ", "ep", "ydo", "c", " ", "documentation", " ", "complete", "ness", " ", "checker_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ed", "ward", " ", "Lo", "per_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "ed", " ", "[", "01", "/", "30", "/", "01", " ", "05", ":", "1", "8", " ", "PM", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "$", "Id", ":", " ", "checke", "r", ".", "py", " ", "136", "6", " ", "2006", "-0", "9", "-0", "7", " ", "15", ":", "5", "4", ":", "5", "9", "Z", " ", "edl", "oper", " ", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Document", "ation", " ", "complete", "ness", " ", "checke", "r", ".", " ", " ", "Thi", "s", " ", "module", " ", "defin", "es", " ", "a", " ", "single", "\\", "10", ";", "class", ",", " ", "C", "{", "Doc", "Check", "er", "},", " ", "whi", "ch", " ", "can", " ", "be", " ", "used", " ", "to", " ", "check", " ", "the", " ", "tha", "t", " ", "specified", "\\", "10", ";", "classe", "s", " ", "of", " ", "object", "s", " ", "are", " ", "documente", "d", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "docformat", "\\u\\u_", "=_", "'", "ep", "yte", "xt", " ", "en", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Imports", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", ",_", "sys_", ",_", "os_", "._", "path_", ",_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xml_", "._", "dom_", "._", "minidom_", "import_", "Text_", "as_", "\\u", "Text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ep", "ydo", "c_", "._", "apid", "oc_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "method", "s", " ", "may", " ", "be", " ", "undo", "cum", "ente", "d", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "NO", "\\u", "DOCS", "_", "=_", "[_", "'\\u", "\\u", "hash", "\\u\\u'_", ",_", "'\\u", "\\u", "repr", "\\u\\u'_", ",_", "'\\u", "\\u", "str", "\\u\\u'_", ",_", "'\\u", "\\u", "cmp", "\\u\\u'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "method", "s", " ", "neve", "r", " ", "need", " ", "description", "s", ",", " ", "author", "s", ",", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "version", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "NO", "\\u", "BASIC", "_", "=_", "[_", "'\\u", "\\u", "hash", "\\u\\u'_", ",_", "'\\u", "\\u", "repr", "\\u\\u'_", ",_", "'\\u", "\\u", "str", "\\u\\u'_", ",_", "'\\u", "\\u", "cmp", "\\u\\u'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "method", "s", " ", "neve", "r", " ", "need", " ", "return", " ", "value", " ", "description", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "NO", "\\u", "RETURN_", "=_", "[_", "'\\u", "\\u", "init", "\\u\\u'_", ",_", "'\\u", "\\u", "hash", "\\u\\u'_", ",_", "'\\u", "\\u", "repr", "\\u\\u'_", ",_", "'\\u", "\\u", "str", "\\u\\u'_", ",_", "'\\u", "\\u", "cmp", "\\u\\u'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "method", "s", " ", "don", "'", "t", " ", "need", " ", "parameter", "s", " ", "documente", "d", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "NO", "\\u", "PARAM_", "=_", "[_", "'\\u", "\\u", "cmp", "\\u\\u'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Doc", "Checker_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Document", "ation", " ", "complete", "ness", " ", "checke", "r", ".", " ", " ", "C", "{", "Doc", "Check", "er", "}", " ", "can", " ", "be", " ", "used", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "check", " ", "tha", "t", " ", "specified", " ", "classe", "s", " ", "of", " ", "object", "s", " ", "are", " ", "documente", "d", ".", " ", " ", "To", " ", "check", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "documentation", " ", "for", " ", "a", " ", "group", " ", "of", " ", "object", "s", ",", " ", "you", " ", "shou", "ld", " ", "create", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "Doc", "Check", "er", "}", " ", "from", " ", "a", " ", "L", "{", "Doc", "Index", "<", "apid", "oc", ".", "Doc", "Index", ">}", " ", "tha", "t", " ", "document", "s", "\\", "10", ";", " ", " ", " ", " ", "tho", "se", " ", "object", "s", ";", " ", "and", " ", "then", " ", "use", " ", "the", " ", "L", "{", "check", "}", " ", "method", " ", "to", " ", "run", " ", "specified", "\\", "10", ";", " ", " ", " ", " ", "checks", " ", "on", " ", "the", " ", "object", "s", "'", " ", "documentation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "What", " ", "checks", " ", "are", " ", "run", ",", " ", "and", " ", "what", " ", "object", "s", " ", "the", "y", " ", "are", " ", "run", " ", "on", ",", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "specified", " ", "by", " ", "the", " ", "constant", "s", " ", "defin", "ed", " ", "by", " ", "C", "{", "Doc", "Check", "er", "}.", " ", " ", "The", "se", "\\", "10", ";", " ", " ", " ", " ", "constant", "s", " ", "are", " ", "divide", "d", " ", "int", "o", " ", "three", " ", "group", "s", ".", " ", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", "-", " ", "Type", " ", "specifier", "s", " ", "indicat", "e", " ", "what", " ", "type", " ", "of", " ", "object", "s", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "checke", "d", ":", " ", "L", "{", "MODUL", "E", "};", " ", "L", "{", "CLASS", "};", " ", "L", "{", "FUNC", "};", " ", "L", "{", "VAR", "};", " ", "L", "{", "IV", "AR", "};", "\\", "10", ";", " ", " ", " ", " ", "L", "{", "CV", "AR", "};", " ", "L", "{", "PARAM", "};", " ", "and", " ", "L", "{", "RETURN", "}.", "\\", "10", ";", " ", " ", "-", " ", "Public", "/", "private", " ", "specifier", "s", " ", "indicat", "e", " ", "whe", "ther", " ", "public", " ", "or", " ", "private", "\\", "10", ";", " ", " ", " ", " ", "object", "s", " ", "shou", "ld", " ", "be", " ", "checke", "d", ":", " ", "L", "{", "PRIVATE", "}.", "\\", "10", ";", " ", " ", "-", " ", "Check", " ", "specifier", "s", " ", "indicat", "e", " ", "what", " ", "checks", " ", "shou", "ld", " ", "be", " ", "run", " ", "on", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "object", "s", ":", " ", "L", "{", "TYPE", "};", " ", "L", "{", "DESC", "R", "};", " ", "L", "{", "AUTHOR", "};", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "L", "{", "VERSI", "ON", "}.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "L", "{", "check", "}", " ", "method", " ", "is", " ", "used", " ", "to", " ", "perform", " ", "a", " ", "check", " ", "on", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "documentation", ".", " ", " ", "It", "s", " ", "parameter", " ", "is", " ", "formed", " ", "by", " ", "or", "-", "ing", " ", "tog", "ether", " ", "at", "\\", "10", ";", " ", " ", " ", " ", "leas", "t", " ", "one", " ", "value", " ", "from", " ", "each", " ", "specifier", " ", "group", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "checke", "r", ".", "check", "(", "Doc", "Check", "er", ".", "MODUL", "E", " ", "|", " ", "Doc", "Check", "er", ".", "DESC", "R", ")", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "To", " ", "speci", "fy", " ", "multiple", " ", "values", " ", "from", " ", "a", " ", "single", " ", "group", ",", " ", "simp", "ly", " ", "or", " ", "thei", "r", "\\", "10", ";", " ", " ", " ", " ", "values", " ", "tog", "ether", ":", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "checke", "r", ".", "check", "(", "Doc", "Check", "er", ".", "MODUL", "E", " ", "|", " ", "Doc", "Check", "er", ".", "CLASS", " ", "|", "\\", "10", ";", " ", " ", " ", " ", "...", " ", " ", " ", "Doc", "Check", "er", ".", "FUNC", " ", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "group", " ", "Type", "s", ":", " ", "MODUL", "E", ",", " ", "CLASS", ",", " ", "FUNC", ",", " ", "VAR", ",", " ", "IV", "AR", ",", " ", "CV", "AR", ",", " ", "PARAM", ",", "\\", "10", ";", " ", " ", " ", " ", "RETURN", ",", " ", "ALL", "\\u", "T", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "MODUL", "E", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "MODUL", "E", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "module", "s", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "CLASS", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "CLASS", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "classe", "s", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "FUNC", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "FUNC", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "function", "s", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "VAR", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "VAR", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "module", " ", "variab", "les", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "IV", "AR", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "IV", "AR", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "instance", " ", "variab", "les", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "CV", "AR", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "CV", "AR", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "class", " ", "variab", "les", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "PARAM", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "PARAM", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "function", " ", "and", " ", "method", " ", "parameter", "s", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "RETURN", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "RETURN", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "return", " ", "values", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ALL", "\\u", "T", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "ALL", "\\u", "T", ":", " ", "Type", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "all", " ", "object", "s", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "group", " ", "Check", "s", ":", " ", "TYPE", ",", " ", "AUTHOR", ",", " ", "VERSI", "ON", ",", " ", "DESC", "R", ",", " ", "ALL", "\\u", "C", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "TYPE", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "TYPE", ":", " ", "Check", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "every", " ", "variab", "le", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "parameter", " ", "shou", "ld", " ", "have", " ", "a", " ", "C", "{", "@", "type", "}", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "AUTHOR", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "AUTHOR", ":", " ", "Check", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "every", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "have", " ", "an", " ", "C", "{", "author", "}", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "VERSI", "ON", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "VERSI", "ON", ":", " ", "Check", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "every", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "have", " ", "a", " ", "C", "{", "version", "}", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "DESC", "R", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "DESC", "R", ":", " ", "Check", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "every", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "have", " ", "a", " ", "description", ".", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ALL", "\\u", "C", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "ALL", "\\u", "C", ":", " ", "Check", " ", "specifier", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", " ", "all", " ", "checks", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "be", " ", "run", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "group", " ", "Public", "it", "y", ":", " ", "PRIVATE", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "PRIVATE", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "PRIVATE", ":", " ", "Specifie", "r", " ", "tha", "t", " ", "indicat", "es", " ", "tha", "t", " ", "private", " ", "object", "s", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Types_", "\\u\\u\\uNL\\u\\u\\u_", "MODULE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CLASS_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FUNC", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "VAR_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "IV", "AR", " ", " ", " ", "=", " ", "16_", "\\u\\u\\uNL\\u\\u\\u_", "#", "CV", "AR", " ", " ", " ", "=", " ", "32_", "\\u\\u\\uNL\\u\\u\\u_", "PARAM_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RETURN_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROPERTY", "_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ALL", "\\u", "T_", "=_", "1_", "+_", "2_", "+_", "4_", "+_", "8_", "+_", "16_", "+_", "32_", "+_", "64_", "+_", "128_", "+_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", "s_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AUTHOR", "_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "VERSION_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DESC", "R_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ALL", "\\u", "C_", "=_", "256_", "+_", "512_", "+_", "1024_", "+_", "2048_", "+_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Priva", "te", "/", "public_", "\\u\\u\\uNL\\u\\u\\u_", "PRIVATE", "_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ALL_", "=_", "ALL", "\\u", "T_", "+_", "ALL", "\\u", "C_", "+_", "PRIVATE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Doc", "Checker_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "doc", "index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "new", " ", "C", "{", "Doc", "Check", "er", "}", " ", "tha", "t", " ", "can", " ", "be", " ", "used", " ", "to", " ", "run", " ", "checks", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "documentation", " ", "of", " ", "the", " ", "object", "s", " ", "documente", "d", " ", "by", " ", "C", "{", "doc", "index", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "doc", "index", ":", " ", "A", " ", "documentation", " ", "map", " ", "contain", "ing", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "documentation", " ", "for", " ", "the", " ", "object", "s", " ", "to", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "doc", "index", ":", " ", "L", "{", "Doc", "index", "<", "apid", "oc", ".", "Doc", "Index", ">}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "doc", "index_", "=_", "doc", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "instance", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "checks_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "last", "\\u", "warn_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "out_", "=_", "sys_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "num", "\\u", "warnings_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check_", "(_", "self_", ",_", "*_", "check", "\\u", "sets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "the", " ", "specified", " ", "checks", " ", "on", " ", "the", " ", "documentation", " ", "of", " ", "the", " ", "object", "s", "\\", "10", ";", " ", " ", " ", " ", "contain", "ed", " ", "by", " ", "this", " ", "C", "{", "Doc", "Check", "er", "}'", "s", " ", "C", "{", "Doc", "Index", "}.", " ", " ", "Any", " ", "error", "s", " ", "found", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "printed", " ", "to", " ", "standard", " ", "out", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "check", "\\u", "sets", ":", " ", "The", " ", "checks", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "run", " ", "on", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "documentation", ".", " ", " ", "Thi", "s", " ", "value", " ", "is", " ", "construct", "ed", " ", "by", " ", "or", "-", "ing", "\\", "10", ";", " ", " ", " ", " ", "tog", "ether", " ", "the", " ", "specifier", "s", " ", "tha", "t", " ", "indicat", "e", " ", "whi", "ch", " ", "object", "s", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "checke", "d", ",", " ", "and", " ", "whi", "ch", " ", "checks", " ", "shou", "ld", " ", "be", " ", "run", ".", " ", " ", "See", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "L", "{", "module", " ", "description", "<", "checke", "r", ">}", " ", "for", " ", "more", " ", "informati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "no", " ", "checks", " ", "are", " ", "specified", ",", " ", "then", " ", "a", " ", "default", " ", "set", " ", "of", " ", "checks", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "be", " ", "run", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "check", "\\u", "sets", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "Tru", "e", " ", "if", " ", "no", " ", "problem", "s", " ", "wer", "e", " ", "found", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "boolean", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "check", "\\u", "sets_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "sets_", "=_", "(_", "Doc", "Checker_", "._", "MODULE_", "|_", "Doc", "Checker_", "._", "CLASS_", "|_", "\\u\\u\\uNL\\u\\u\\u_", "Doc", "Checker_", "._", "FUNC", "_", "|_", "Doc", "Checker_", "._", "VAR_", "|_", "\\u\\u\\uNL\\u\\u\\u_", "Doc", "Checker_", "._", "DESC", "R_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "warnings_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "start", "\\u", "progress_", "(_", "'", "Check", "ing", " ", "docs", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", ",_", "checks_", "in_", "enumerate_", "(_", "check", "\\u", "sets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check_", "(_", "checks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "end", "\\u", "progress_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "warning_", ",_", "docs_", ")_", "in_", "self_", "._", "\\u", "warnings_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "docs_", "=_", "sorted_", "(_", "docs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "names_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "[_", "'", " ", " ", "-", " ", "%", "s", "'_", "%_", "self_", "._", "\\u", "name_", "(_", "d_", ")_", "for_", "d_", "in_", "docs_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "warning_", "(_", "'%", "s", ":\\\\", "n", "%", "s", "'_", "%_", "(_", "warning_", ",_", "doc", "names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\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", "check_", "(_", "self_", ",_", "checks_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "checks_", "=_", "checks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "list", " ", "of", " ", "object", "s", " ", "to", " ", "check", "._", "\\u\\u\\uNL\\u\\u\\u_", "val", "docs_", "=_", "sorted_", "(_", "self_", "._", "\\u", "doc", "index_", "._", "reachable", "\\u", "val", "docs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "imports_", "=_", "False_", ",_", "packages_", "=_", "False_", ",_", "bases_", "=_", "False_", ",_", "submodules", "_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subclasses", "_", "=_", "False_", ",_", "private_", "=_", "(_", "checks_", "&_", "Doc", "Checker_", "._", "PRIVATE", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docs_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "val", "docs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "d_", ",_", "Gene", "ric", "Value", "Doc_", ")_", ":_", "docs_", "._", "add_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "doc_", "in_", "val", "docs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "doc_", ",_", "Names", "pace", "Doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "d_", "in_", "doc_", "._", "variables_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "d_", "._", "value_", ",_", "Gene", "ric", "Value", "Doc_", ")_", ":_", "docs_", "._", "add_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", ",_", "doc_", "in_", "enumerate_", "(_", "sorted_", "(_", "docs_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "doc_", ",_", "Modul", "e", "Doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "module_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "doc_", ",_", "Class", "Doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "class_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "doc_", ",_", "Routine", "Doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "func_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "doc_", ",_", "Proper", "ty", "Doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "property_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "doc_", ",_", "Varia", "ble", "Doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "var_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "\"", "Don", "'", "t", " ", "know", " ", "how", " ", "to", " ", "check", " ", "%", "r", "\"_", "%_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\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", "name_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "str_", "(_", "doc_", "._", "canonical", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "doc_", ",_", "Routine", "Doc_", ")_", ":_", "name_", "+=_", "'()'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "basic_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "the", " ", "description", ",", " ", "author", ",", " ", "version", ",", " ", "and", " ", "see", "-", "als", "o", " ", "fields", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "doc", "}.", " ", " ", "Thi", "s", " ", "is", " ", "used", " ", "as", " ", "a", " ", "help", "er", " ", "function", " ", "by", " ", "L", "{\\u", "check", "\\u", "module", "},", "\\", "10", ";", " ", " ", " ", " ", "L", "{\\u", "check", "\\u", "class", "},", " ", "and", " ", "L", "{\\u", "check", "\\u", "func", "}.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "doc", ":", " ", "The", " ", "documentation", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "doc", ":", " ", "L", "{", "API", "Doc", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "Non", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "DESC", "R_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "doc_", "._", "descr_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "doc_", "._", "docstring_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "warning_", "(_", "'", "Und", "ocu", "mented", "'_", ",_", "doc_", ")_", "\\u\\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_", "._", "warning_", "(_", "'", "No", " ", "description", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "AUTHOR", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tag_", ",_", "arg_", ",_", "descr_", "in_", "doc_", "._", "metadata_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "author", "'_", "==_", "tag_", ":_", "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_", "._", "warning_", "(_", "'", "No", " ", "author", "s", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "VERSION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tag_", ",_", "arg_", ",_", "descr_", "in_", "doc_", "._", "metadata_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "version", "'_", "==_", "tag_", ":_", "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_", "._", "warning_", "(_", "'", "No", " ", "version", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\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", "check", "\\u", "module_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "checks", " ", "on", " ", "the", " ", "module", " ", "who", "se", " ", "API", "Doc", " ", "is", " ", "C", "{", "doc", "}.", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "doc", ":", " ", "The", " ", "API", "Doc", " ", "of", " ", "the", " ", "module", " ", "to", " ", "check", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "doc", ":", " ", "L", "{", "API", "Doc", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "Non", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "MODULE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "basic_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\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", "check", "\\u", "class_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "checks", " ", "on", " ", "the", " ", "class", " ", "who", "se", " ", "API", "Doc", " ", "is", " ", "C", "{", "doc", "}.", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "doc", ":", " ", "The", " ", "API", "Doc", " ", "of", " ", "the", " ", "class", " ", "to", " ", "check", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "doc", ":", " ", "L", "{", "API", "Doc", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "Non", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "CLASS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "basic_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\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", "check", "\\u", "property_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "PROPERTY", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "basic_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\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", "check", "\\u", "var_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "checks", " ", "on", " ", "the", " ", "variab", "le", " ", "who", "se", " ", "documentation", " ", "is", " ", "C", "{", "var", "}", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "who", "se", " ", "name", " ", "is", " ", "C", "{", "name", "}.", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "doc", ":", " ", "The", " ", "documentation", " ", "for", " ", "the", " ", "variab", "le", " ", "to", " ", "check", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "doc", ":", " ", "L", "{", "API", "Doc", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "Non", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "VAR_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "\\u", "checks_", "&_", "(_", "Doc", "Checker_", "._", "DESC", "R_", "|_", "Doc", "Checker_", "._", "TYPE_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "descr_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "type", "\\u", "descr_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "docstring_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "warning_", "(_", "'", "Und", "ocu", "mented", "'_", ",_", "doc_", ")_", "\\u\\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_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "DESC", "R_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "descr_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "warning_", "(_", "'", "No", " ", "description", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "TYPE_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "type", "\\u", "descr_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "warning_", "(_", "'", "No", " ", "type", " ", "informati", "on", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\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", "check", "\\u", "func_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "checks", " ", "on", " ", "the", " ", "function", " ", "who", "se", " ", "API", "Doc", " ", "is", " ", "C", "{", "doc", "}.", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "doc", ":", " ", "The", " ", "API", "Doc", " ", "of", " ", "the", " ", "function", " ", "to", " ", "check", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "doc", ":", " ", "L", "{", "API", "Doc", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "Non", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "doc_", "._", "canonical", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "FUNC", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "docstring_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "canonical", "\\u", "name_", "[_", "-_", "1_", "]_", "not_", "in_", "\\u", "NO", "\\u", "DOCS", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "warning_", "(_", "'", "Und", "ocu", "mented", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "FUNC", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "canonical", "\\u", "name_", "[_", "-_", "1_", "]_", "not_", "in_", "\\u", "NO", "\\u", "BASIC", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "basic_", "(_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "RETURN_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "canonical", "\\u", "name_", "[_", "-_", "1_", "]_", "not_", "in_", "\\u", "NO", "\\u", "RETURN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "doc_", "._", "return", "\\u", "type_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "return", "\\u", "descr_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "warning_", "(_", "'", "No", " ", "return", " ", "descr", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "PARAM_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "canonical", "\\u", "name_", "[_", "-_", "1_", "]_", "not_", "in_", "\\u", "NO", "\\u", "PARAM_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "doc_", "._", "arg", "\\u", "descr", "s_", "in_", "(_", "None_", ",_", "UNKNOWN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "warning_", "(_", "'", "No", " ", "argu", "ment", " ", "info", "'_", ",_", "doc_", ")_", "\\u\\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", "\\u", "with", "\\u", "descr_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "arg_", ",_", "descr_", "in_", "doc_", "._", "arg", "\\u", "descr", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "arg_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "args", "\\u", "with", "\\u", "descr_", "._", "append_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "args", "\\u", "with", "\\u", "descr_", "+=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "pos", "arg_", "in_", "doc_", "._", "pos", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "(_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "DESC", "R_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "arg_", "not_", "in_", "args", "\\u", "with", "\\u", "descr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "warning_", "(_", "'", "Arg", "ument", "(", "s", ")", " ", "not", " ", "descri", "bed", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "\\u", "checks_", "&_", "Doc", "Checker_", "._", "TYPE_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "arg_", "not_", "in_", "doc_", "._", "arg", "\\u", "types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "warning_", "(_", "'", "Arg", "ument", " ", "type", "(", "s", ")", " ", "not", " ", "descri", "bed", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "Checker_", ":_", "\\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_", "warning_", "(_", "self_", ",_", "msg_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "warnings_", "._", "setdefault_", "(_", "msg_", ",_", "set_", "(_", ")_", ")_", "._", "add_", "(_", "doc_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
azoft-dev-team/imagrium/env/Lib/test/test_descr_jy.py
[ { "content": " def test_class_dict_is_copy(self):\n class FooMeta(type):\n def __new__(meta, name, bases, class_dict):\n cls = type.__new__(meta, name, bases, class_dict)\n self.assert_('foo' not in class_dict)\n cls.foo = 'bar'\n self.assert_('foo' not in class_dict)\n return cls\n\n class Foo(object):\n __metaclass__ = FooMeta", "metadata": "root.TestDescrTestCase.test_class_dict_is_copy", "header": "['class', 'TestDescrTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 22 }, { "content": " def test_ints(self):\n class C(int):\n pass\n try:\n foo = int(None)\n except TypeError:\n pass\n else:\n self.assert_(False, \"should have raised TypeError\")\n try:\n foo = C(None)\n except TypeError:\n pass\n else:\n self.assert_(False, \"should have raised TypeError\")", "metadata": "root.TestDescrTestCase.test_ints", "header": "['class', 'TestDescrTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 60 } ]
[ { "span": "Foo(", "start_line": 31, "start_column": 14, "end_line": 31, "end_column": 17 }, { "span": "foo ", "start_line": 70, "start_column": 12, "end_line": 70, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Descr", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "class", "\\u", "dict", "\\u", "is", "\\u", "copy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo", "Meta_", "(_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "new\\u\\u_", "(_", "meta_", ",_", "name_", ",_", "bases_", ",_", "class", "\\u", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "=_", "type_", "._", "\\u\\u", "new\\u\\u_", "(_", "meta_", ",_", "name_", ",_", "bases_", ",_", "class", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "foo", "'_", "not_", "in_", "class", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "foo", "'_", "not_", "in_", "class", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Foo_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "metaclass\\u\\u_", "=_", "Foo", "Meta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Descr", "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", "ints_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "C_", "(_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "int_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert\\u_", "(_", "False_", ",_", "\"", "shou", "ld", " ", "have", " ", "raise", "d", " ", "Type", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "C_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert\\u_", "(_", "False_", ",_", "\"", "shou", "ld", " ", "have", " ", "raise", "d", " ", "Type", "Error", "\"_", ")_", "\\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, 0, 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, 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 ]
Should use a 'with' statement
tobspr/RenderPipeline/toolkit/render_service/service.py
[ { "content": " def listener_thread(self):\n \"\"\" Thread which listens to incoming updates \"\"\"\n sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n print(\"Listening on 127.0.0.1:\" + str(self.ICOMING_PORT))\n try:\n sock.bind((\"127.0.0.1\", self.ICOMING_PORT))\n while True:\n data, addr = sock.recvfrom(8192)\n self.handle_data(data)\n except Exception as msg:\n print(\"Failed to bind to address! Reason:\", msg)\n finally:\n sock.close()", "metadata": "root.Application.listener_thread", "header": "['class', 'Application', '(', 'ShowBase', ')', ':', '___EOS___']", "index": 113 } ]
[ { "span": "sock.close()", "start_line": 126, "start_column": 12, "end_line": 126, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Sho", "ul", "d_", "use_", "a_", "'", "with", "'_", "statement_", "[SEP]_", "class_", "Application_", "(_", "Show", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "listen", "er", "\\u", "thread_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Thread", " ", "whi", "ch", " ", "listen", "s", " ", "to", " ", "inco", "ming", " ", "update", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sock_", "=_", "socket_", "._", "socket_", "(_", "socket_", "._", "AF", "\\u", "INET_", ",_", "socket_", "._", "SOCK", "\\u", "DGRAM_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sock_", "._", "setsockopt_", "(_", "socket_", "._", "SOL", "\\u", "SOCKET_", ",_", "socket_", "._", "SO", "\\u", "REUSE", "ADDR_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Listen", "ing", " ", "on", " ", "127", ".0", ".0", ".1", ":\"_", "+_", "str_", "(_", "self_", "._", "IC", "OM", "ING", "\\u", "PORT_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sock_", "._", "bind_", "(_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "self_", "._", "IC", "OM", "ING", "\\u", "PORT_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", ",_", "addr_", "=_", "sock_", "._", "recv", "from_", "(_", "8192_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "handle", "\\u", "data_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "msg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Fail", "ed", " ", "to", " ", "bind", " ", "to", " ", "address", "!", " ", "Rea", "son", ":\"_", ",_", "msg_", ")_", "\\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 ", " _", "sock_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2 ]
Unused import
crowdresearch/crowdsource-platform/crowdsourcing/tests/test_api.py
[ { "content": "from django.test import TestCase\nimport unittest\n\n# Create your tests here.\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.test import TestCase", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 32 }, { "span": "import unittest", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "your", " ", "tests", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
simpeg/simpeg/tests/base/test_optimizers.py
[ { "content": "import unittest\nfrom SimPEG import Solver\nfrom SimPEG.Mesh import TensorMesh\nfrom SimPEG.Utils import sdiag\nimport numpy as np\nimport scipy.sparse as sp\nfrom SimPEG import Optimization\nfrom SimPEG.Tests import getQuadratic, Rosenbrock\n\nTOL = 1e-2\n\n\nif __name__ == '__main__':\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestOptimizers(unittest.TestCase):\n\n\n\n\n\n", "metadata": "root.TestOptimizers", "header": "['module', '___EOS___']", "index": 11 }, { "content": " def setUp(self):\n self.A = sp.identity(2).tocsr()\n self.b = np.array([-5,-5])", "metadata": "root.TestOptimizers.setUp", "header": "['class', 'TestOptimizers', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 13 }, { "content": " def test_GN_Rosenbrock(self):\n GN = Optimization.GaussNewton()\n xopt = GN.minimize(Rosenbrock,np.array([0,0]))\n x_true = np.array([1.,1.])\n print 'xopt: ', xopt\n print 'x_true: ', x_true\n self.assertTrue(np.linalg.norm(xopt-x_true,2) < TOL, True)", "metadata": "root.TestOptimizers.test_GN_Rosenbrock", "header": "['class', 'TestOptimizers', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_GN_quadratic(self):\n GN = Optimization.GaussNewton()\n xopt = GN.minimize(getQuadratic(self.A,self.b),np.array([0,0]))\n x_true = np.array([5.,5.])\n print 'xopt: ', xopt\n print 'x_true: ', x_true\n self.assertTrue(np.linalg.norm(xopt-x_true,2) < TOL, True)", "metadata": "root.TestOptimizers.test_GN_quadratic", "header": "['class', 'TestOptimizers', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 25 }, { "content": " def test_ProjGradient_quadraticBounded(self):\n PG = Optimization.ProjectedGradient(debug=True)\n PG.lower, PG.upper = -2, 2\n xopt = PG.minimize(getQuadratic(self.A,self.b),np.array([0,0]))\n x_true = np.array([2.,2.])\n print 'xopt: ', xopt\n print 'x_true: ', x_true\n self.assertTrue(np.linalg.norm(xopt-x_true,2) < TOL, True)", "metadata": "root.TestOptimizers.test_ProjGradient_quadraticBounded", "header": "['class', 'TestOptimizers', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 33 }, { "content": " def test_ProjGradient_quadratic1Bound(self):\n myB = np.array([-5,1])\n PG = Optimization.ProjectedGradient()\n PG.lower, PG.upper = -2, 2\n xopt = PG.minimize(getQuadratic(self.A,myB),np.array([0,0]))\n x_true = np.array([2.,-1.])\n print 'xopt: ', xopt\n print 'x_true: ', x_true\n self.assertTrue(np.linalg.norm(xopt-x_true,2) < TOL, True)", "metadata": "root.TestOptimizers.test_ProjGradient_quadratic1Bound", "header": "['class', 'TestOptimizers', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 42 }, { "content": " def test_NewtonRoot(self):\n fun = lambda x, return_g=True: np.sin(x) if not return_g else ( np.sin(x), sdiag( np.cos(x) ) )\n x = np.array([np.pi-0.3, np.pi+0.1, 0])\n xopt = Optimization.NewtonRoot(comments=False).root(fun,x)\n x_true = np.array([np.pi,np.pi,0])\n print 'Newton Root Finding'\n print 'xopt: ', xopt\n print 'x_true: ', x_true\n self.assertTrue(np.linalg.norm(xopt-x_true,2) < TOL, True)", "metadata": "root.TestOptimizers.test_NewtonRoot", "header": "['class', 'TestOptimizers', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 } ]
[ { "span": "from SimPEG import Solver", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 25 }, { "span": "from SimPEG.Mesh import TensorMesh", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 34 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Sim", "PE", "G_", "import_", "Solver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Sim", "PE", "G_", "._", "Mesh_", "import_", "Tensor", "Mesh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Sim", "PE", "G_", "._", "Utils_", "import_", "sdi", "ag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "sparse_", "as_", "sp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Sim", "PE", "G_", "import_", "Optim", "ization_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Sim", "PE", "G_", "._", "Tests_", "import_", "get", "Quadra", "tic_", ",_", "Rose", "nbr", "ock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TOL", "_", "=_", "1e-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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Optimize", "rs_", "(_", "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_", "[SEP]_", "class_", "Test", "Optimize", "rs_", "(_", "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_", "._", "A_", "=_", "sp_", "._", "identity_", "(_", "2_", ")_", "._", "toc", "sr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "b_", "=_", "np_", "._", "array_", "(_", "[_", "-_", "5_", ",_", "-_", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Optimize", "rs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "GN", "\\u", "Rose", "nbr", "ock_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "GN", "_", "=_", "Optim", "ization_", "._", "Gau", "ss", "New", "ton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xo", "pt_", "=_", "GN", "_", "._", "minimize_", "(_", "Rose", "nbr", "ock_", ",_", "np_", "._", "array_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "true_", "=_", "np_", "._", "array_", "(_", "[_", "1._", ",_", "1._", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "xo", "pt", ":", " ", "'_", ",_", "xo", "pt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "x", "\\u", "true", ":", " ", "'_", ",_", "x", "\\u", "true_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "np_", "._", "linalg_", "._", "norm_", "(_", "xo", "pt_", "-_", "x", "\\u", "true_", ",_", "2_", ")_", "<_", "TOL", "_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Optimize", "rs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "GN", "\\u", "quadratic", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "GN", "_", "=_", "Optim", "ization_", "._", "Gau", "ss", "New", "ton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xo", "pt_", "=_", "GN", "_", "._", "minimize_", "(_", "get", "Quadra", "tic_", "(_", "self_", "._", "A_", ",_", "self_", "._", "b_", ")_", ",_", "np_", "._", "array_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "true_", "=_", "np_", "._", "array_", "(_", "[_", "5._", ",_", "5._", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "xo", "pt", ":", " ", "'_", ",_", "xo", "pt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "x", "\\u", "true", ":", " ", "'_", ",_", "x", "\\u", "true_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "np_", "._", "linalg_", "._", "norm_", "(_", "xo", "pt_", "-_", "x", "\\u", "true_", ",_", "2_", ")_", "<_", "TOL", "_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Optimize", "rs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Proj", "Grad", "ient", "\\u", "quadratic", "Bound", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PG", "_", "=_", "Optim", "ization_", "._", "Project", "ed", "Gradient_", "(_", "debug_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PG", "_", "._", "lower_", ",_", "PG", "_", "._", "upper_", "=_", "-_", "2_", ",_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xo", "pt_", "=_", "PG", "_", "._", "minimize_", "(_", "get", "Quadra", "tic_", "(_", "self_", "._", "A_", ",_", "self_", "._", "b_", ")_", ",_", "np_", "._", "array_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "true_", "=_", "np_", "._", "array_", "(_", "[_", "2._", ",_", "2._", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "xo", "pt", ":", " ", "'_", ",_", "xo", "pt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "x", "\\u", "true", ":", " ", "'_", ",_", "x", "\\u", "true_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "np_", "._", "linalg_", "._", "norm_", "(_", "xo", "pt_", "-_", "x", "\\u", "true_", ",_", "2_", ")_", "<_", "TOL", "_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Optimize", "rs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Proj", "Grad", "ient", "\\u", "quadratic", "1", "Bound_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "B_", "=_", "np_", "._", "array_", "(_", "[_", "-_", "5_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PG", "_", "=_", "Optim", "ization_", "._", "Project", "ed", "Gradient_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PG", "_", "._", "lower_", ",_", "PG", "_", "._", "upper_", "=_", "-_", "2_", ",_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xo", "pt_", "=_", "PG", "_", "._", "minimize_", "(_", "get", "Quadra", "tic_", "(_", "self_", "._", "A_", ",_", "my", "B_", ")_", ",_", "np_", "._", "array_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "true_", "=_", "np_", "._", "array_", "(_", "[_", "2._", ",_", "-_", "1._", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "xo", "pt", ":", " ", "'_", ",_", "xo", "pt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "x", "\\u", "true", ":", " ", "'_", ",_", "x", "\\u", "true_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "np_", "._", "linalg_", "._", "norm_", "(_", "xo", "pt_", "-_", "x", "\\u", "true_", ",_", "2_", ")_", "<_", "TOL", "_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Optimize", "rs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "New", "ton", "Root_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fun_", "=_", "lambda_", "x_", ",_", "return", "\\u", "g_", "=_", "True_", ":_", "np_", "._", "sin_", "(_", "x_", ")_", "if_", "not_", "return", "\\u", "g_", "else_", "(_", "np_", "._", "sin_", "(_", "x_", ")_", ",_", "sdi", "ag_", "(_", "np_", "._", "cos_", "(_", "x_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "np_", "._", "array_", "(_", "[_", "np_", "._", "pi_", "-_", "0.3_", ",_", "np_", "._", "pi_", "+_", "0.1_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xo", "pt_", "=_", "Optim", "ization_", "._", "New", "ton", "Root_", "(_", "comments_", "=_", "False_", ")_", "._", "root_", "(_", "fun_", ",_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "true_", "=_", "np_", "._", "array_", "(_", "[_", "np_", "._", "pi_", ",_", "np_", "._", "pi_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "New", "ton", " ", "Roo", "t", " ", "Finding", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "xo", "pt", ":", " ", "'_", ",_", "xo", "pt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "x", "\\u", "true", ":", " ", "'_", ",_", "x", "\\u", "true_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "np_", "._", "linalg_", "._", "norm_", "(_", "xo", "pt_", "-_", "x", "\\u", "true_", ",_", "2_", ")_", "<_", "TOL", "_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
scipy/scipy/scipy/weave/platform_info.py
[ { "content": "def gcc_exists(name='gcc'):\n \"\"\" Test to make sure gcc is found\n\n Does this return correct value on win98???\n \"\"\"\n result = 0\n cmd = '%s -v' % name\n try:\n p = subprocess.Popen([str(name), '-v'], shell=True,\n stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\n str_result = p.stdout.read()\n if 'Reading specs' in str_result:\n result = 1\n except:\n # This was needed because the msvc compiler messes with\n # the path variable. and will occasionlly mess things up\n # so much that gcc is lost in the path. (Occurs in test\n # scripts)\n result = not os.system(cmd)\n return result", "metadata": "root.gcc_exists", "header": "['module', '___EOS___']", "index": 179 }, { "content": "def msvc_exists():\n \"\"\" Determine whether MSVC is available on the machine.\n \"\"\"\n result = 0\n try:\n p = subprocess.Popen(['cl'], shell=True,\n stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\n str_result = p.stdout.read()\n if 'Microsoft' in str_result:\n result = 1\n except:\n #assume we're ok if devstudio exists\n import distutils.msvccompiler\n\n # There was a change to 'distutils.msvccompiler' between Python 2.2\n # and Python 2.3.\n #\n # In Python 2.2 the function is 'get_devstudio_versions'\n # In Python 2.3 the function is 'get_build_version'\n try:\n version = distutils.msvccompiler.get_devstudio_versions()\n\n except:\n version = distutils.msvccompiler.get_build_version()\n\n if version:\n result = 1\n return result", "metadata": "root.msvc_exists", "header": "['module', '___EOS___']", "index": 201 } ]
[ { "span": "except:", "start_line": 192, "start_column": 4, "end_line": 192, "end_column": 11 }, { "span": "except:", "start_line": 211, "start_column": 4, "end_line": 211, "end_column": 11 }, { "span": "except:", "start_line": 223, "start_column": 8, "end_line": 223, "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_", "gcc", "\\u", "exists_", "(_", "name_", "=_", "'", "gcc", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Test", " ", "to", " ", "make", " ", "sure", " ", "gcc", " ", "is", " ", "found", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Do", "es", " ", "this", " ", "return", " ", "correct", " ", "value", " ", "on", " ", "win", "98", "???", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "'%", "s", " ", "-", "v", "'_", "%_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "subprocess_", "._", "Popen_", "(_", "[_", "str_", "(_", "name_", ")_", ",_", "'-", "v", "'_", "]_", ",_", "shell_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "stderr_", "=_", "subprocess_", "._", "STDOUT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str", "\\u", "result_", "=_", "p_", "._", "stdout_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "Reading", " ", "spec", "s", "'_", "in_", "str", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "was", " ", "need", "ed", " ", "bec", "aus", "e", " ", "the", " ", "msvc", " ", "compiler", " ", "mess", "es", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "path", " ", "variab", "le", ".", " ", "and", " ", "will", " ", "occ", "asi", "onl", "ly", " ", "mess", " ", "thing", "s", " ", "up_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "muc", "h", " ", "tha", "t", " ", "gcc", " ", "is", " ", "lost", " ", "in", " ", "the", " ", "path", ".", " ", "(", "Occur", "s", " ", "in", " ", "test_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scripts", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "not_", "os_", "._", "system_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "def_", "msvc", "\\u", "exists_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Det", "erm", "ine", " ", "whe", "ther", " ", "MS", "VC", " ", "is", " ", "avail", "able", " ", "on", " ", "the", " ", "machine", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "subprocess_", "._", "Popen_", "(_", "[_", "'", "cl", "'_", "]_", ",_", "shell_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "stderr_", "=_", "subprocess_", "._", "STDOUT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str", "\\u", "result_", "=_", "p_", "._", "stdout_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "Micro", "soft", "'_", "in_", "str", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "assume", " ", "we", "'", "re", " ", "ok", " ", "if", " ", "devs", "tud", "io", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "distutils_", "._", "msvc", "compiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "was", " ", "a", " ", "change", " ", "to", " ", "'", "distutils", ".", "msvc", "compiler", "'", " ", "bet", "ween", " ", "Pyth", "on", " ", "2.2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "Pyth", "on", " ", "2.3", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "Pyth", "on", " ", "2.2", " ", "the", " ", "function", " ", "is", " ", "'", "get", "\\u", "devs", "tud", "io", "\\u", "version", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "Pyth", "on", " ", "2.3", " ", "the", " ", "function", " ", "is", " ", "'", "get", "\\u", "build", "\\u", "version", "'_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "distutils_", "._", "msvc", "compiler_", "._", "get", "\\u", "devs", "tud", "io", "\\u", "versions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "distutils_", "._", "msvc", "compiler_", "._", "get", "\\u", "build", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\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,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Implicit string concatenation in a list
perseas/Pyrseas/tests/dbobject/test_function.py
[ { "content": " def test_map_setof_row_function(self):\n \"Map a function returning a set of rows\"\n stmts = [\"CREATE TABLE t1 (c1 integer, c2 text)\",\n \"CREATE FUNCTION f1() RETURNS SETOF t1 LANGUAGE sql AS \"\n \"$_$SELECT * FROM t1$_$\"]\n dbmap = self.to_map(stmts)\n expmap = {'language': 'sql', 'returns': 'SETOF t1',\n 'source': \"SELECT * FROM t1\"}\n assert dbmap['schema public']['function f1()'] == expmap", "metadata": "root.FunctionToMapTestCase.test_map_setof_row_function", "header": "['class', 'FunctionToMapTestCase', '(', 'DatabaseToMapTestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": " def test_map_aggregate_init_final(self):\n \"Map an aggregate with an INITCOND and a FINALFUNC\"\n stmts = [CREATE_STMT2,\n \"CREATE FUNCTION f2(integer) RETURNS float \"\n \"LANGUAGE sql AS $_$SELECT $1::float$_$ IMMUTABLE\",\n \"CREATE AGGREGATE a1 (integer) (SFUNC = f1, STYPE = integer, \"\n \"FINALFUNC = f2, INITCOND = '-1')\"]\n dbmap = self.to_map(stmts)\n expmap = {'sfunc': 'f1', 'stype': 'integer',\n 'initcond': '-1', 'finalfunc': 'f2'}\n assert dbmap['schema public']['function f1(integer, integer)'] == \\\n {'language': 'sql', 'returns': 'integer', 'source': SOURCE2,\n 'volatility': 'immutable'}\n assert dbmap['schema public']['function f2(integer)'] == \\\n {'language': 'sql', 'returns': 'double precision',\n 'source': \"SELECT $1::float\", 'volatility': 'immutable'}\n assert dbmap['schema public']['aggregate a1(integer)'] == expmap", "metadata": "root.AggregateToMapTestCase.test_map_aggregate_init_final", "header": "['class', 'AggregateToMapTestCase', '(', 'DatabaseToMapTestCase', ')', ':', '___EOS___']", "index": 334 } ]
[ { "span": "\"CREATE FUNCTION f1() RETURNS SETOF t1 LANGUAGE sql AS \"\n \"$_$SELECT * FROM t1$_$\"]", "start_line": 67, "start_column": 17, "end_line": 68, "end_column": 41 }, { "span": "\"CREATE FUNCTION f2(integer) RETURNS float \"\n \"LANGUAGE sql AS $_$SELECT $1::float$_$ IMMUTABLE\",", "start_line": 337, "start_column": 17, "end_line": 338, "end_column": 67 }, { "span": "\"CREATE AGGREGATE a1 (integer) (SFUNC = f1, STYPE = integer, \"\n \"FINALFUNC = f2, INITCOND = '-1')\"]", "start_line": 339, "start_column": 17, "end_line": 340, "end_column": 51 } ]
[]
1
true
[ "[CLS]_", "Implicit", "_", "string_", "concate", "nation_", "in_", "a_", "list_", "[SEP]_", "class_", "Function", "To", "Map", "Test", "Case_", "(_", "Databa", "se", "To", "Map", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "map", "\\u", "seto", "f", "\\u", "row", "\\u", "function_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Map", " ", "a", " ", "function", " ", "return", "ing", " ", "a", " ", "set", " ", "of", " ", "rows", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stmts_", "=_", "[_", "\"", "CREATE", " ", "TAB", "LE", " ", "t1", " ", "(", "c1", " ", "integ", "er", ",", " ", "c2", " ", "text", ")\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CREATE", " ", "FUNC", "TIO", "N", " ", "f1", "()", " ", "RETURN", "S", " ", "SET", "OF", " ", "t1", " ", "LANGUAGE", " ", "sql", " ", "AS", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"$", "\\u$", "SELECT", " ", "*", " ", "FROM", " ", "t1", "$\\u", "$\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbm", "ap_", "=_", "self_", "._", "to", "\\u", "map_", "(_", "stmts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp", "map_", "=_", "{_", "'", "language", "'_", ":_", "'", "sql", "'_", ",_", "'", "return", "s", "'_", ":_", "'", "SET", "OF", " ", "t1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "t1", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "dbm", "ap_", "[_", "'", "schema", " ", "public", "'_", "]_", "[_", "'", "function", " ", "f1", "()'_", "]_", "==_", "exp", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aggregate", "To", "Map", "Test", "Case_", "(_", "Databa", "se", "To", "Map", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "map", "\\u", "aggre", "gate", "\\u", "init", "\\u", "final_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Map", " ", "an", " ", "aggre", "gate", " ", "with", " ", "an", " ", "INIT", "COND", " ", "and", " ", "a", " ", "FINAL", "FUNC", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stmts_", "=_", "[_", "CREATE", "\\u", "STM", "T2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CREATE", " ", "FUNC", "TIO", "N", " ", "f2", "(", "integ", "er", ")", " ", "RETURN", "S", " ", "float", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LANGUAGE", " ", "sql", " ", "AS", " ", "$\\u", "$", "SELECT", " ", "$", "1", "::", "float", "$\\u", "$", " ", "IMM", "UT", "AB", "LE", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CREATE", " ", "AGG", "REG", "ATE", " ", "a1", " ", "(", "integ", "er", ")", " ", "(", "SF", "UNC", " ", "=", " ", "f1", ",", " ", "ST", "YP", "E", " ", "=", " ", "integ", "er", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "FINAL", "FUNC", " ", "=", " ", "f2", ",", " ", "INIT", "COND", " ", "=", " ", "'-", "1", "')\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbm", "ap_", "=_", "self_", "._", "to", "\\u", "map_", "(_", "stmts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp", "map_", "=_", "{_", "'", "sfu", "nc", "'_", ":_", "'", "f1", "'_", ",_", "'", "sty", "pe", "'_", ":_", "'", "integ", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "init", "cond", "'_", ":_", "'-", "1", "'_", ",_", "'", "final", "func", "'_", ":_", "'", "f2", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "dbm", "ap_", "[_", "'", "schema", " ", "public", "'_", "]_", "[_", "'", "function", " ", "f1", "(", "integ", "er", ",", " ", "integ", "er", ")'_", "]_", "==_", "{_", "'", "language", "'_", ":_", "'", "sql", "'_", ",_", "'", "return", "s", "'_", ":_", "'", "integ", "er", "'_", ",_", "'", "source", "'_", ":_", "SOU", "RC", "E2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "volatility", "'_", ":_", "'", "immutable", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "dbm", "ap_", "[_", "'", "schema", " ", "public", "'_", "]_", "[_", "'", "function", " ", "f2", "(", "integ", "er", ")'_", "]_", "==_", "{_", "'", "language", "'_", ":_", "'", "sql", "'_", ",_", "'", "return", "s", "'_", ":_", "'", "double", " ", "preci", "sion", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "\"", "SELECT", " ", "$", "1", "::", "float", "\"_", ",_", "'", "volatility", "'_", ":_", "'", "immutable", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "dbm", "ap_", "[_", "'", "schema", " ", "public", "'_", "]_", "[_", "'", "aggre", "gate", " ", "a1", "(", "integ", "er", ")'_", "]_", "==_", "exp", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ProgVal/Limnoria/src/log.py
[ { "content": "###\n# Copyright (c) 2002-2005, Jeremiah Fincher\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain the above copyright notice,\n# this list of conditions, and the following disclaimer.\n# * Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions, and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n# * Neither the name of the author of this software nor the name of\n# contributors to this software may be used to endorse or promote products\n# derived from this software without specific prior written consent.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n# POSSIBILITY OF SUCH DAMAGE.\n###\n\nimport os\nimport sys\nimport time\nimport types\nimport atexit\nimport logging\nimport operator\nimport textwrap\nimport traceback\n\nfrom . import ansi, conf, ircutils, registry, utils\nfrom .utils import minisix\n\ndeadlyExceptions = [KeyboardInterrupt, SystemExit]\n\n###\n# This is for testing, of course. Mostly it just disables the firewall code\n# so exceptions can propagate.\n###\ntesting = False\n\n\n\n\n\n\n\n\n\n\n\n\nconf.registerGlobalValue(conf.supybot.directories, 'log',\n conf.Directory('logs', \"\"\"Determines what directory the bot will store its\n logfiles in.\"\"\"))\n\n_logDir = conf.supybot.directories.log()\nif not os.path.exists(_logDir):\n os.mkdir(_logDir, 0o755)\n\npluginLogDir = os.path.join(_logDir, 'plugins')\n\nif not os.path.exists(pluginLogDir):\n os.mkdir(pluginLogDir, 0o755)\n\ntry:\n messagesLogFilename = os.path.join(_logDir, 'messages.log')\n _handler = BetterFileHandler(messagesLogFilename)\nexcept EnvironmentError as e:\n raise SystemExit('Error opening messages logfile (%s). ' \\\n 'Generally, this is because you are running Supybot in a directory ' \\\n 'you don\\'t have permissions to add files in, or you\\'re running ' \\\n 'Supybot as a different user than you normal do. The original ' \\\n 'error was: %s' % (messagesLogFilename, utils.gen.exnToString(e)))\n\n# These are public.\nformatter = Formatter('NEVER SEEN; IF YOU SEE THIS, FILE A BUG!')\npluginFormatter = PluginFormatter('NEVER SEEN; IF YOU SEE THIS, FILE A BUG!')\n\n# These are not.\nlogging.setLoggerClass(Logger)\n_logger = logging.getLogger('supybot')\n_stdoutHandler = StdoutStreamHandler(sys.stdout)\n\n\n\n\nconf.registerGroup(conf.supybot, 'log')\nconf.registerGlobalValue(conf.supybot.log, 'format',\n registry.String('%(levelname)s %(asctime)s %(name)s %(message)s',\n \"\"\"Determines what the bot's logging format will be. The relevant\n documentation on the available formattings is Python's documentation on\n its logging module.\"\"\"))\nconf.registerGlobalValue(conf.supybot.log, 'level',\n LogLevel(logging.INFO, \"\"\"Determines what the minimum priority level logged\n to file will be. Do note that this value does not affect the level logged\n to stdout; for that, you should set the value of supybot.log.stdout.level.\n Valid values are DEBUG, INFO, WARNING, ERROR, and CRITICAL, in order of\n increasing priority.\"\"\"))\nconf.registerGlobalValue(conf.supybot.log, 'timestampFormat',\n registry.String('%Y-%m-%dT%H:%M:%S', \"\"\"Determines the format string for\n timestamps in logfiles. Refer to the Python documentation for the time\n module to see what formats are accepted. If you set this variable to the\n empty string, times will be logged in a simple seconds-since-epoch\n format.\"\"\"))\n\n\nconf.registerGlobalValue(conf.supybot.log, 'stdout',\n registry.Boolean(True, \"\"\"Determines whether the bot will log to\n stdout.\"\"\"))\nconf.registerGlobalValue(conf.supybot.log.stdout, 'colorized',\n BooleanRequiredFalseOnWindows(False, \"\"\"Determines whether the bot's logs\n to stdout (if enabled) will be colorized with ANSI color.\"\"\"))\nconf.registerGlobalValue(conf.supybot.log.stdout, 'wrap',\n registry.Boolean(False, \"\"\"Determines whether the bot will wrap its logs\n when they're output to stdout.\"\"\"))\nconf.registerGlobalValue(conf.supybot.log.stdout, 'format',\n registry.String('%(levelname)s %(asctime)s %(message)s',\n \"\"\"Determines what the bot's logging format will be. The relevant\n documentation on the available formattings is Python's documentation on\n its logging module.\"\"\"))\nconf.registerGlobalValue(conf.supybot.log.stdout, 'level',\n StdoutLogLevel(logging.INFO, \"\"\"Determines what the minimum priority level\n logged will be. Valid values are DEBUG, INFO, WARNING, ERROR, and\n CRITICAL, in order of increasing priority.\"\"\"))\n\nconf.registerGroup(conf.supybot.log, 'plugins')\nconf.registerGlobalValue(conf.supybot.log.plugins, 'individualLogfiles',\n registry.Boolean(False, \"\"\"Determines whether the bot will separate plugin\n logs into their own individual logfiles.\"\"\"))\nconf.registerGlobalValue(conf.supybot.log.plugins, 'format',\n registry.String('%(levelname)s %(asctime)s %(message)s',\n \"\"\"Determines what the bot's logging format will be. The relevant\n documentation on the available formattings is Python's documentation on\n its logging module.\"\"\"))\n\n\n# These just make things easier.\ndebug = _logger.debug\ninfo = _logger.info\nwarning = _logger.warning\nerror = _logger.error\ncritical = _logger.critical\nexception = _logger.exception\n\n# These were just begging to be replaced.\nregistry.error = error\nregistry.exception = exception\n\nsetLevel = _logger.setLevel\n\natexit.register(logging.shutdown)\n\n# ircutils will work without this, but it's useful.\nircutils.debug = debug\n\n\n\n\nFirewalled = MetaFirewall('Firewalled', (), {})\n\n\n\n_handler.setFormatter(formatter)\n_handler.addFilter(PluginLogFilter())\n\n_handler.setLevel(conf.supybot.log.level())\n_logger.addHandler(_handler)\n_logger.setLevel(-1)\n\n_stdoutFormatter = ColorizedFormatter('IF YOU SEE THIS, FILE A BUG!')\n_stdoutHandler.setFormatter(_stdoutFormatter)\n_stdoutHandler.setLevel(conf.supybot.log.stdout.level())\nif not conf.daemonized:\n _logger.addHandler(_stdoutHandler)\n\n\n# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Formatter(logging.Formatter):\n _fmtConf = staticmethod(lambda : conf.supybot.log.format())\n\n", "metadata": "root.Formatter", "header": "['module', '___EOS___']", "index": 50 }, { "content": " def formatTime(self, record, datefmt=None):\n return timestamp(record.created)", "metadata": "root.Formatter.formatTime", "header": "['class', 'Formatter', '(', 'logging', '.', 'Formatter', ')', ':', '___EOS___']", "index": 52 }, { "content": " def formatException(self, exc_info):\n (E, e, tb) = exc_info\n for exn in deadlyExceptions:\n if issubclass(e.__class__, exn):\n raise\n return logging.Formatter.formatException(self, (E, e, tb))", "metadata": "root.Formatter.formatException", "header": "['class', 'Formatter', '(', 'logging', '.', 'Formatter', ')', ':', '___EOS___']", "index": 55 }, { "content": " def format(self, record):\n self._fmt = self._fmtConf()\n if hasattr(self, '_style'): # Python 3\n self._style._fmt = self._fmtConf()\n return logging.Formatter.format(self, record)", "metadata": "root.Formatter.format", "header": "['class', 'Formatter', '(', 'logging', '.', 'Formatter', ')', ':', '___EOS___']", "index": 62 }, { "content": "class PluginFormatter(Formatter):\n _fmtConf = staticmethod(lambda : conf.supybot.log.plugins.format())", "metadata": "root.PluginFormatter", "header": "['module', '___EOS___']", "index": 69 }, { "content": "class Logger(logging.Logger):\n", "metadata": "root.Logger", "header": "['module', '___EOS___']", "index": 73 }, { "content": " def exception(self, *args):\n (E, e, tb) = sys.exc_info()\n tbinfo = traceback.extract_tb(tb)\n path = '[%s]' % '|'.join(map(operator.itemgetter(2), tbinfo))\n eStrId = '%s:%s' % (E, path)\n eId = hex(hash(eStrId) & 0xFFFFF)\n logging.Logger.exception(self, *args)\n self.error('Exception id: %s', eId)\n self.debug('%s', utils.python.collect_extra_debug_data())\n # The traceback should be sufficient if we want it.\n # self.error('Exception string: %s', eStrId)", "metadata": "root.Logger.exception", "header": "['class', 'Logger', '(', 'logging', '.', 'Logger', ')', ':', '___EOS___']", "index": 74 }, { "content": " def _log(self, level, msg, args, exc_info=None, extra=None):\n msg = format(msg, *args)\n logging.Logger._log(self, level, msg, (), exc_info=exc_info, \n extra=extra)", "metadata": "root.Logger._log", "header": "['class', 'Logger', '(', 'logging', '.', 'Logger', ')', ':', '___EOS___']", "index": 86 }, { "content": "class StdoutStreamHandler(logging.StreamHandler):\n\n", "metadata": "root.StdoutStreamHandler", "header": "['module', '___EOS___']", "index": 92 }, { "content": " def format(self, record):\n s = logging.StreamHandler.format(self, record)\n if record.levelname != 'ERROR' and conf.supybot.log.stdout.wrap():\n # We check for ERROR there because otherwise, tracebacks (which are\n # already wrapped by Python itself) wrap oddly.\n if not isinstance(record.levelname, minisix.string_types):\n print(record)\n print(record.levelname)\n print(utils.stackTrace())\n prefixLen = len(record.levelname) + 1 # ' '\n s = textwrap.fill(s, width=78, subsequent_indent=' '*prefixLen)\n s.rstrip('\\r\\n')\n return s", "metadata": "root.StdoutStreamHandler.format", "header": "['class', 'StdoutStreamHandler', '(', 'logging', '.', 'StreamHandler', ')', ':', '___EOS___']", "index": 93 }, { "content": " def emit(self, record):\n if conf.supybot.log.stdout() and not conf.daemonized:\n try:\n logging.StreamHandler.emit(self, record)\n except ValueError: # Raised if sys.stdout is closed.\n self.disable()\n error('Error logging to stdout. Removing stdout handler.')\n exception('Uncaught exception in StdoutStreamHandler:')", "metadata": "root.StdoutStreamHandler.emit", "header": "['class', 'StdoutStreamHandler', '(', 'logging', '.', 'StreamHandler', ')', ':', '___EOS___']", "index": 107 }, { "content": " def disable(self):\n self.setLevel(sys.maxsize) # Just in case.\n _logger.removeHandler(self)\n logging._acquireLock()\n try:\n del logging._handlers[self]\n finally:\n logging._releaseLock()", "metadata": "root.StdoutStreamHandler.disable", "header": "['class', 'StdoutStreamHandler', '(', 'logging', '.', 'StreamHandler', ')', ':', '___EOS___']", "index": 116 }, { "content": "class BetterFileHandler(logging.FileHandler):", "metadata": "root.BetterFileHandler", "header": "['module', '___EOS___']", "index": 126 }, { "content": " def emit(self, record):\n msg = self.format(record)\n try:\n self.stream.write(msg)\n except (UnicodeError, TypeError):\n try:\n self.stream.write(msg.encode(\"utf8\"))\n except (UnicodeError, TypeError):\n try:\n self.stream.write(msg.encode(\"utf8\").decode('ascii', 'replace'))\n except (UnicodeError, TypeError):\n self.stream.write(repr(msg))\n self.stream.write(os.linesep)\n try:\n self.flush()\n except OSError as e:\n if e.args[0] == 28:\n print('No space left on device, cannot flush log.')\n else:\n raise", "metadata": "root.BetterFileHandler.emit", "header": "['class', 'BetterFileHandler', '(', 'logging', '.', 'FileHandler', ')', ':', '___EOS___']", "index": 127 }, { "content": "class ColorizedFormatter(Formatter):\n # This was necessary because these variables aren't defined until later.\n # The staticmethod is necessary because they get treated like methods.\n _fmtConf = staticmethod(lambda : conf.supybot.log.stdout.format())\n", "metadata": "root.ColorizedFormatter", "header": "['module', '___EOS___']", "index": 149 }, { "content": " def formatException(self, exc_info):\n (E, e, tb) = exc_info\n if conf.supybot.log.stdout.colorized():\n return ''.join([ansi.RED,\n Formatter.formatException(self, (E, e, tb)),\n ansi.RESET])\n else:\n return Formatter.formatException(self, (E, e, tb))", "metadata": "root.ColorizedFormatter.formatException", "header": "['class', 'ColorizedFormatter', '(', 'Formatter', ')', ':', '___NEWLINE___', \"# This was necessary because these variables aren't defined until later.\", '___NL___', '# The staticmethod is necessary because they get treated like methods.', '___NL___', '___EOS___']", "index": 153 }, { "content": " def format(self, record, *args, **kwargs):\n if conf.supybot.log.stdout.colorized():\n color = ''\n if record.levelno == logging.CRITICAL:\n color = ansi.WHITE + ansi.BOLD\n elif record.levelno == logging.ERROR:\n color = ansi.RED\n elif record.levelno == logging.WARNING:\n color = ansi.YELLOW\n if color:\n return ''.join([color,\n Formatter.format(self, record, *args, **kwargs),\n ansi.RESET])\n else:\n return Formatter.format(self, record, *args, **kwargs)\n else:\n return Formatter.format(self, record, *args, **kwargs)", "metadata": "root.ColorizedFormatter.format", "header": "['class', 'ColorizedFormatter', '(', 'Formatter', ')', ':', '___NEWLINE___', \"# This was necessary because these variables aren't defined until later.\", '___NL___', '# The staticmethod is necessary because they get treated like methods.', '___NL___', '___EOS___']", "index": 162 }, { "content": "class ValidLogLevel(registry.String):\n \"\"\"Invalid log level.\"\"\"\n handler = None\n minimumLevel = -1\n", "metadata": "root.ValidLogLevel", "header": "['module', '___EOS___']", "index": 212 }, { "content": " def set(self, s):\n s = s.upper()\n try:\n try:\n level = logging._levelNames[s]\n except AttributeError:\n level = logging._nameToLevel[s]\n except KeyError:\n try:\n level = int(s)\n except ValueError:\n self.error()\n if level < self.minimumLevel:\n self.error()\n if self.handler is not None:\n self.handler.setLevel(level)\n self.setValue(level)", "metadata": "root.ValidLogLevel.set", "header": "['class', 'ValidLogLevel', '(', 'registry', '.', 'String', ')', ':', '___EOS___']", "index": 216 }, { "content": " def __str__(self):\n # The str() is necessary here; apparently getLevelName returns an\n # integer on occasion. logging--\n level = str(logging.getLevelName(self.value))\n if level.startswith('Level'):\n level = level.split()[-1]\n return level", "metadata": "root.ValidLogLevel.__str__", "header": "['class', 'ValidLogLevel', '(', 'registry', '.', 'String', ')', ':', '___EOS___']", "index": 234 }, { "content": "class LogLevel(ValidLogLevel):\n \"\"\"Invalid log level. Value must be either DEBUG, INFO, WARNING,\n ERROR, or CRITICAL.\"\"\"\n handler = _handler", "metadata": "root.LogLevel", "header": "['module', '___EOS___']", "index": 242 }, { "content": "class StdoutLogLevel(ValidLogLevel):\n \"\"\"Invalid log level. Value must be either DEBUG, INFO, WARNING,\n ERROR, or CRITICAL.\"\"\"\n handler = _stdoutHandler", "metadata": "root.StdoutLogLevel", "header": "['module', '___EOS___']", "index": 247 }, { "content": "class BooleanRequiredFalseOnWindows(registry.Boolean):\n \"\"\"Value cannot be true on Windows\"\"\"", "metadata": "root.BooleanRequiredFalseOnWindows", "header": "['module', '___EOS___']", "index": 271 }, { "content": " def set(self, s):\n registry.Boolean.set(self, s)\n if self.value and os.name == 'nt':\n self.error()", "metadata": "root.BooleanRequiredFalseOnWindows.set", "header": "['class', 'BooleanRequiredFalseOnWindows', '(', 'registry', '.', 'Boolean', ')', ':', '___EOS___']", "index": 273 }, { "content": "def getPluginLogger(name):\n if not conf.supybot.log.plugins.individualLogfiles():\n return _logger\n log = logging.getLogger('supybot.plugins.%s' % name)\n if not log.handlers:\n filename = os.path.join(pluginLogDir, '%s.log' % name)\n handler = BetterFileHandler(filename)\n handler.setLevel(-1)\n handler.setFormatter(pluginFormatter)\n log.addHandler(handler)\n if name in sys.modules:\n log.info('Starting log for %s.', name)\n return log", "metadata": "root.getPluginLogger", "header": "['module', '___EOS___']", "index": 327 }, { "content": "def timestamp(when=None):\n if when is None:\n when = time.time()\n format = conf.supybot.log.timestampFormat()\n t = time.localtime(when)\n if format:\n return time.strftime(format, t)\n else:\n return str(int(time.mktime(t)))", "metadata": "root.timestamp", "header": "['module', '___EOS___']", "index": 341 }, { "content": "def firewall(f, errorHandler=None):\n def logException(self, s=None):\n if s is None:\n s = 'Uncaught exception'\n if hasattr(self, 'log'):\n logging_function = self.log.exception\n else:\n logging_function = exception\n logging_function('%s in %s.%s:', s, self.__class__.__name__, f.__name__)\n def m(self, *args, **kwargs):\n try:\n return f(self, *args, **kwargs)\n except Exception:\n if testing:\n raise\n logException(self)\n if errorHandler is not None:\n try:\n return errorHandler(self, *args, **kwargs)\n except Exception:\n logException(self, 'Uncaught exception in errorHandler')\n m = utils.python.changeFunctionName(m, f.__name__, f.__doc__)\n return m", "metadata": "root.firewall", "header": "['module', '___EOS___']", "index": 351 }, { "content": "class MetaFirewall(type):\n\n getErrorHandler = classmethod(getErrorHandler)\n\n updateFirewalled = classmethod(updateFirewalled)", "metadata": "root.MetaFirewall", "header": "['module', '___EOS___']", "index": 375 }, { "content": " def __new__(cls, name, bases, classdict):\n firewalled = {}\n for base in bases:\n if hasattr(base, '__firewalled__'):\n cls.updateFirewalled(firewalled, base.__firewalled__)\n cls.updateFirewalled(firewalled, classdict.get('__firewalled__', []))\n for (attr, errorHandler) in firewalled.items():\n if attr in classdict:\n classdict[attr] = firewall(classdict[attr], errorHandler)\n return super(MetaFirewall, cls).__new__(cls, name, bases, classdict)", "metadata": "root.MetaFirewall.__new__", "header": "['class', 'MetaFirewall', '(', 'type', ')', ':', '___EOS___']", "index": 376 }, { "content": " def getErrorHandler(cls, dictOrTuple, name):\n if isinstance(dictOrTuple, dict):\n return dictOrTuple[name]\n else:\n return None", "metadata": "root.MetaFirewall.getErrorHandler", "header": "['class', 'MetaFirewall', '(', 'type', ')', ':', '___EOS___']", "index": 387 }, { "content": " def updateFirewalled(cls, firewalled, __firewalled__):\n for attr in __firewalled__:\n firewalled[attr] = cls.getErrorHandler(__firewalled__, attr)", "metadata": "root.MetaFirewall.updateFirewalled", "header": "['class', 'MetaFirewall', '(', 'type', ')', ':', '___EOS___']", "index": 394 }, { "content": "class PluginLogFilter(logging.Filter):", "metadata": "root.PluginLogFilter", "header": "['module', '___EOS___']", "index": 401 }, { "content": " def filter(self, record):\n if conf.supybot.log.plugins.individualLogfiles():\n if record.name.startswith('supybot.plugins'):\n return False\n return True", "metadata": "root.PluginLogFilter.filter", "header": "['class', 'PluginLogFilter', '(', 'logging', '.', 'Filter', ')', ':', '___EOS___']", "index": 402 } ]
[ { "span": "import types", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2002", "-", "2005", ",", " ", "Jer", "emi", "ah", " ", "Fin", "cher", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", ",", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", ",", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "the", " ", "author", " ", "of", " ", "this", " ", "software", " ", "nor", " ", "the", " ", "name", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contributor", "s", " ", "to", " ", "this", " ", "software", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "consent", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "OWNER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "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_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "atexit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "textwrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "import_", "ansi", "_", ",_", "conf_", ",_", "irc", "utils_", ",_", "registry_", ",_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "utils_", "import_", "mini", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "deadl", "y", "Exceptions_", "=_", "[_", "Key", "board", "Interrupt_", ",_", "System", "Exit_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "for", " ", "testi", "ng", ",", " ", "of", " ", "course", ".", " ", " ", "Mos", "tl", "y", " ", "it", " ", "just", " ", "disable", "s", " ", "the", " ", "firew", "all", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "exception", "s", " ", "can", " ", "propagate", "._", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "testing_", "=_", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "directories_", ",_", "'", "log", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "conf_", "._", "Directory_", "(_", "'", "logs", "'_", ",_", "\"\"\"", "Det", "erm", "ine", "s", " ", "what", " ", "director", "y", " ", "the", " ", "bot", " ", "will", " ", "store", " ", "its", "\\", "10", ";", " ", " ", " ", " ", "logfile", "s", " ", "in", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "log", "Dir_", "=_", "conf_", "._", "sup", "ybo", "t_", "._", "directories_", "._", "log_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "\\u", "log", "Dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "\\u", "log", "Dir_", ",_", "0o7", "55_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plugin", "Log", "Dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "\\u", "log", "Dir_", ",_", "'", "plugin", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "plugin", "Log", "Dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "plugin", "Log", "Dir_", ",_", "0o7", "55_", ")_", "\\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 ", " _", "message", "s", "Log", "Filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "\\u", "log", "Dir_", ",_", "'", "message", "s", ".", "log", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "handler_", "=_", "Bet", "ter", "File", "Handler_", "(_", "message", "s", "Log", "Filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Environ", "ment", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "System", "Exit_", "(_", "'", "Error", " ", "opening", " ", "message", "s", " ", "logfile", " ", "(%", "s", ").", " ", " ", "'_", "'", "General", "ly", ",", " ", "this", " ", "is", " ", "bec", "aus", "e", " ", "you", " ", "are", " ", "runn", "ing", " ", "Sup", "ybo", "t", " ", "in", " ", "a", " ", "director", "y", " ", "'_", "'", "you", " ", "don", "\\\\'", "t", " ", "have", " ", "permissi", "ons", " ", "to", " ", "add", " ", "files", " ", "in", ",", " ", "or", " ", "you", "\\\\'", "re", " ", "runn", "ing", " ", "'_", "'", "Sup", "ybo", "t", " ", "as", " ", "a", " ", "different", " ", "user", " ", "than", " ", "you", " ", "normal", " ", "do", ".", " ", " ", "The", " ", "original", " ", "'_", "'", "error", " ", "was", ":", " ", "%", "s", "'_", "%_", "(_", "message", "s", "Log", "Filename_", ",_", "utils_", "._", "gen_", "._", "ex", "n", "To", "String_", "(_", "e_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "are", " ", "public", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "formatter_", "=_", "Formatter_", "(_", "'", "NE", "VER", " ", "SEE", "N", ";", " ", "IF", " ", "YOU", " ", "SEE", " ", "THIS", ",", " ", "FILE", " ", "A", " ", "BUG", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plugin", "Formatter_", "=_", "Plug", "in", "Formatter_", "(_", "'", "NE", "VER", " ", "SEE", "N", ";", " ", "IF", " ", "YOU", " ", "SEE", " ", "THIS", ",", " ", "FILE", " ", "A", " ", "BUG", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "are", " ", "not", "._", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "set", "Log", "ger", "Class_", "(_", "Logger_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "sup", "ybo", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "stdout", "Handler_", "=_", "Stdout", "Stream", "Handler_", "(_", "sys_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "conf_", "._", "register", "Group_", "(_", "conf_", "._", "sup", "ybo", "t_", ",_", "'", "log", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", ",_", "'", "format", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "registry_", "._", "String_", "(_", "'%", "(", "level", "name", ")", "s", " ", "%", "(", "asc", "time", ")", "s", " ", "%", "(", "name", ")", "s", " ", "%", "(", "message", ")", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Det", "erm", "ine", "s", " ", "what", " ", "the", " ", "bot", "'", "s", " ", "logg", "ing", " ", "format", " ", "will", " ", "be", ".", " ", " ", "The", " ", "rele", "van", "t", "\\", "10", ";", " ", " ", " ", " ", "documentation", " ", "on", " ", "the", " ", "avail", "able", " ", "format", "ting", "s", " ", "is", " ", "Pyth", "on", "'", "s", " ", "documentation", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "its", " ", "logg", "ing", " ", "module", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", ",_", "'", "level", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Log", "Level_", "(_", "logging_", "._", "INFO_", ",_", "\"\"\"", "Det", "erm", "ine", "s", " ", "what", " ", "the", " ", "minim", "um", " ", "priorit", "y", " ", "level", " ", "logged", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "file", " ", "will", " ", "be", ".", " ", " ", "Do", " ", "note", " ", "tha", "t", " ", "this", " ", "value", " ", "doe", "s", " ", "not", " ", "affect", " ", "the", " ", "level", " ", "logged", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "stdout", ";", " ", "for", " ", "tha", "t", ",", " ", "you", " ", "shou", "ld", " ", "set", " ", "the", " ", "value", " ", "of", " ", "sup", "ybo", "t", ".", "log", ".", "stdout", ".", "level", ".", "\\", "10", ";", " ", " ", " ", " ", "Valid", " ", "values", " ", "are", " ", "DEBU", "G", ",", " ", "INFO", ",", " ", "WARN", "ING", ",", " ", "ERROR", ",", " ", "and", " ", "CRIT", "ICAL", ",", " ", "in", " ", "order", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "incr", "easi", "ng", " ", "priorit", "y", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", ",_", "'", "timestamp", "Format", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "registry_", "._", "String_", "(_", "'%", "Y", "-%", "m", "-%", "d", "T", "%", "H", ":", "%", "M", ":", "%", "S", "'_", ",_", "\"\"\"", "Det", "erm", "ine", "s", " ", "the", " ", "format", " ", "string", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "timestamp", "s", " ", "in", " ", "logfile", "s", ".", " ", " ", "Refer", " ", "to", " ", "the", " ", "Pyth", "on", " ", "documentation", " ", "for", " ", "the", " ", "time", "\\", "10", ";", " ", " ", " ", " ", "module", " ", "to", " ", "see", " ", "what", " ", "formats", " ", "are", " ", "accept", "ed", ".", " ", "If", " ", "you", " ", "set", " ", "this", " ", "variab", "le", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "empty", " ", "string", ",", " ", "times", " ", "will", " ", "be", " ", "logged", " ", "in", " ", "a", " ", "simple", " ", "second", "s", "-", "sinc", "e-", "epoch", "\\", "10", ";", " ", " ", " ", " ", "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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", ",_", "'", "stdout", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "registry_", "._", "Boolean_", "(_", "True_", ",_", "\"\"\"", "Det", "erm", "ine", "s", " ", "whe", "ther", " ", "the", " ", "bot", " ", "will", " ", "log", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "stdout", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", ",_", "'", "coloriz", "ed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Boo", "lean", "Requ", "ired", "Fal", "se", "On", "Windows_", "(_", "False_", ",_", "\"\"\"", "Det", "erm", "ine", "s", " ", "whe", "ther", " ", "the", " ", "bot", "'", "s", " ", "logs", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "stdout", " ", "(", "if", " ", "enable", "d", ")", " ", "will", " ", "be", " ", "coloriz", "ed", " ", "with", " ", "ANSI", " ", "color", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", ",_", "'", "wrap", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "registry_", "._", "Boolean_", "(_", "False_", ",_", "\"\"\"", "Det", "erm", "ine", "s", " ", "whe", "ther", " ", "the", " ", "bot", " ", "will", " ", "wrap", " ", "its", " ", "logs", "\\", "10", ";", " ", " ", " ", " ", "whe", "n", " ", "the", "y", "'", "re", " ", "output", " ", "to", " ", "stdout", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", ",_", "'", "format", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "registry_", "._", "String_", "(_", "'%", "(", "level", "name", ")", "s", " ", "%", "(", "asc", "time", ")", "s", " ", "%", "(", "message", ")", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Det", "erm", "ine", "s", " ", "what", " ", "the", " ", "bot", "'", "s", " ", "logg", "ing", " ", "format", " ", "will", " ", "be", ".", " ", " ", "The", " ", "rele", "van", "t", "\\", "10", ";", " ", " ", " ", " ", "documentation", " ", "on", " ", "the", " ", "avail", "able", " ", "format", "ting", "s", " ", "is", " ", "Pyth", "on", "'", "s", " ", "documentation", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "its", " ", "logg", "ing", " ", "module", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", ",_", "'", "level", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Stdout", "Log", "Level_", "(_", "logging_", "._", "INFO_", ",_", "\"\"\"", "Det", "erm", "ine", "s", " ", "what", " ", "the", " ", "minim", "um", " ", "priorit", "y", " ", "level", "\\", "10", ";", " ", " ", " ", " ", "logged", " ", "will", " ", "be", ".", " ", " ", "Valid", " ", "values", " ", "are", " ", "DEBU", "G", ",", " ", "INFO", ",", " ", "WARN", "ING", ",", " ", "ERROR", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "CRIT", "ICAL", ",", " ", "in", " ", "order", " ", "of", " ", "incr", "easi", "ng", " ", "priorit", "y", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conf_", "._", "register", "Group_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", ",_", "'", "plugin", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "plugins_", ",_", "'", "individual", "Log", "files", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "registry_", "._", "Boolean_", "(_", "False_", ",_", "\"\"\"", "Det", "erm", "ine", "s", " ", "whe", "ther", " ", "the", " ", "bot", " ", "will", " ", "separate", " ", "plugin", "\\", "10", ";", " ", " ", " ", " ", "logs", " ", "int", "o", " ", "thei", "r", " ", "own", " ", "individual", " ", "logfile", "s", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Global", "Value_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "plugins_", ",_", "'", "format", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "registry_", "._", "String_", "(_", "'%", "(", "level", "name", ")", "s", " ", "%", "(", "asc", "time", ")", "s", " ", "%", "(", "message", ")", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Det", "erm", "ine", "s", " ", "what", " ", "the", " ", "bot", "'", "s", " ", "logg", "ing", " ", "format", " ", "will", " ", "be", ".", " ", " ", "The", " ", "rele", "van", "t", "\\", "10", ";", " ", " ", " ", " ", "documentation", " ", "on", " ", "the", " ", "avail", "able", " ", "format", "ting", "s", " ", "is", " ", "Pyth", "on", "'", "s", " ", "documentation", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "its", " ", "logg", "ing", " ", "module", ".\"\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "just", " ", "make", " ", "thing", "s", " ", "easi", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "\\u", "logger_", "._", "debug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "\\u", "logger_", "._", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warning_", "=_", "\\u", "logger_", "._", "warning_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "\\u", "logger_", "._", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "critical_", "=_", "\\u", "logger_", "._", "critical_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exception_", "=_", "\\u", "logger_", "._", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "wer", "e", " ", "just", " ", "beg", "ging", " ", "to", " ", "be", " ", "replaced", "._", "\\u\\u\\uNL\\u\\u\\u_", "registry_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "registry_", "._", "exception_", "=_", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "set", "Level_", "=_", "\\u", "logger_", "._", "set", "Level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "atexit_", "._", "register_", "(_", "logging_", "._", "shutdown_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "irc", "util", "s", " ", "will", " ", "work", " ", "with", "out", " ", "this", ",", " ", "but", " ", "it", "'", "s", " ", "usef", "ul", "._", "\\u\\u\\uNL\\u\\u\\u_", "irc", "utils_", "._", "debug_", "=_", "debug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "Fire", "walle", "d_", "=_", "Meta", "Fire", "wall_", "(_", "'", "Fire", "walle", "d", "'_", ",_", "(_", ")_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "handler_", "._", "set", "Formatter_", "(_", "formatter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "handler_", "._", "add", "Filter_", "(_", "Plug", "in", "Log", "Filter_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "handler_", "._", "set", "Level_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "level_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "logger_", "._", "add", "Handler_", "(_", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "logger_", "._", "set", "Level_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "stdout", "Formatter_", "=_", "Color", "ize", "d", "Formatter_", "(_", "'", "IF", " ", "YOU", " ", "SEE", " ", "THIS", ",", " ", "FILE", " ", "A", " ", "BUG", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "stdout", "Handler_", "._", "set", "Formatter_", "(_", "\\u", "stdout", "Formatter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "stdout", "Handler_", "._", "set", "Level_", "(_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", "._", "level_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "conf_", "._", "daemon", "ized_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "add", "Handler_", "(_", "\\u", "stdout", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", "set", " ", "shift", "widt", "h", "=", "4", " ", "soft", "tabs", "top", "=", "4", " ", "expand", "tab", " ", "text", "widt", "h", "=", "7", "9", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Formatter_", "(_", "logging_", "._", "Formatter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "fmt", "Conf_", "=_", "staticmethod_", "(_", "lambda_", ":_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "format_", "(_", ")_", ")_", "\\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_", "Formatter_", "(_", "logging_", "._", "Formatter_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "format", "Time_", "(_", "self_", ",_", "record_", ",_", "datefmt_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "timestamp_", "(_", "record_", "._", "created_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Formatter_", "(_", "logging_", "._", "Formatter_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format", "Exception_", "(_", "self_", ",_", "exc", "\\u", "info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "E_", ",_", "e_", ",_", "tb_", ")_", "=_", "exc", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ex", "n_", "in_", "deadl", "y", "Exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issubclass_", "(_", "e_", "._", "\\u\\u", "class\\u\\u_", ",_", "ex", "n_", ")_", ":_", "\\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_", "return_", "logging_", "._", "Formatter_", "._", "format", "Exception_", "(_", "self_", ",_", "(_", "E_", ",_", "e_", ",_", "tb_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Formatter_", "(_", "logging_", "._", "Formatter_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format_", "(_", "self_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fmt_", "=_", "self_", "._", "\\u", "fmt", "Conf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "'\\u", "style", "'_", ")_", ":_", "#", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "style_", "._", "\\u", "fmt_", "=_", "self_", "._", "\\u", "fmt", "Conf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "logging_", "._", "Formatter_", "._", "format_", "(_", "self_", ",_", "record_", ")_", "\\u\\u\\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_", "Plug", "in", "Formatter_", "(_", "Formatter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "fmt", "Conf_", "=_", "staticmethod_", "(_", "lambda_", ":_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "plugins_", "._", "format_", "(_", ")_", ")_", "\\u\\u\\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_", "Logger_", "(_", "logging_", "._", "Logger_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Logger_", "(_", "logging_", "._", "Logger_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "exception_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "E_", ",_", "e_", ",_", "tb_", ")_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tb", "info_", "=_", "traceback_", "._", "extract", "\\u", "tb_", "(_", "tb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "'[", "%", "s", "]'_", "%_", "'|'_", "._", "join_", "(_", "map_", "(_", "operator_", "._", "itemgetter_", "(_", "2_", ")_", ",_", "tb", "info_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e", "Str", "Id_", "=_", "'%", "s", ":", "%", "s", "'_", "%_", "(_", "E_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e", "Id_", "=_", "hex_", "(_", "hash_", "(_", "e", "Str", "Id_", ")_", "&_", "0xFFFF", "F_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "Logger_", "._", "exception_", "(_", "self_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "(_", "'", "Except", "ion", " ", "id", ":", " ", "%", "s", "'_", ",_", "e", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "debug_", "(_", "'%", "s", "'_", ",_", "utils_", "._", "python_", "._", "collect", "\\u", "extra", "\\u", "debug", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "traceback", " ", "shou", "ld", " ", "be", " ", "sufficient", " ", "if", " ", "we", " ", "want", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "error", "('", "Except", "ion", " ", "string", ":", " ", "%", "s", "',", " ", "e", "Str", "Id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Logger_", "(_", "logging_", "._", "Logger_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "log_", "(_", "self_", ",_", "level_", ",_", "msg_", ",_", "args_", ",_", "exc", "\\u", "info_", "=_", "None_", ",_", "extra_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "format_", "(_", "msg_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "Logger_", "._", "\\u", "log_", "(_", "self_", ",_", "level_", ",_", "msg_", ",_", "(_", ")_", ",_", "exc", "\\u", "info_", "=_", "exc", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra_", "=_", "extra_", ")_", "\\u\\u\\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_", "Stdout", "Stream", "Handler_", "(_", "logging_", "._", "Stream", "Handler_", ")_", ":_", "\\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_", "Stdout", "Stream", "Handler_", "(_", "logging_", "._", "Stream", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "format_", "(_", "self_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "logging_", "._", "Stream", "Handler_", "._", "format_", "(_", "self_", ",_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record_", "._", "level", "name_", "!=_", "'", "ERROR", "'_", "and_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", "._", "wrap_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "check", " ", "for", " ", "ERROR", " ", "there", " ", "bec", "aus", "e", " ", "other", "wis", "e", ",", " ", "traceback", "s", " ", "(", "whi", "ch", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "alr", "ead", "y", " ", "wrapp", "ed", " ", "by", " ", "Pyth", "on", " ", "its", "elf", ")", " ", "wrap", " ", "odd", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "record_", "._", "level", "name_", ",_", "mini", "six_", "._", "string", "\\u", "types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "record_", "._", "level", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "utils_", "._", "stack", "Trace_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prefix", "Len_", "=_", "len_", "(_", "record_", "._", "level", "name_", ")_", "+_", "1_", "#", " ", "'", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "textwrap_", "._", "fill_", "(_", "s_", ",_", "width_", "=_", "78_", ",_", "subsequen", "t", "\\u", "indent_", "=_", "'", " ", "'_", "*_", "prefix", "Len_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "rstrip_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stdout", "Stream", "Handler_", "(_", "logging_", "._", "Stream", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "emit_", "(_", "self_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", "(_", ")_", "and_", "not_", "conf_", "._", "daemon", "ized_", ":_", "\\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 ", " _", "logging_", "._", "Stream", "Handler_", "._", "emit_", "(_", "self_", ",_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "#", " ", "Rai", "sed", " ", "if", " ", "sys", ".", "stdout", " ", "is", " ", "close", "d", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "disable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "(_", "'", "Error", " ", "logg", "ing", " ", "to", " ", "stdout", ".", " ", " ", "Remo", "ving", " ", "stdout", " ", "handler", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exception_", "(_", "'", "Unc", "aug", "ht", " ", "exception", " ", "in", " ", "Stdout", "Stream", "Handle", "r", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stdout", "Stream", "Handler_", "(_", "logging_", "._", "Stream", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "disable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Level_", "(_", "sys_", "._", "maxsize_", ")_", "#", " ", "Ju", "st", " ", "in", " ", "case", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "logger_", "._", "remove", "Handler_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "\\u", "acquir", "e", "Lock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "logging_", "._", "\\u", "handlers_", "[_", "self_", "]_", "\\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 ", " _", "logging_", "._", "\\u", "release", "Lock_", "(_", ")_", "\\u\\u\\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_", "Bet", "ter", "File", "Handler_", "(_", "logging_", "._", "File", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bet", "ter", "File", "Handler_", "(_", "logging_", "._", "File", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "emit_", "(_", "self_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "self_", "._", "format_", "(_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stream_", "._", "write_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Unic", "ode", "Error_", ",_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stream_", "._", "write_", "(_", "msg_", "._", "encode_", "(_", "\"", "utf", "8", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Unic", "ode", "Error_", ",_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "stream_", "._", "write_", "(_", "msg_", "._", "encode_", "(_", "\"", "utf", "8", "\"_", ")_", "._", "decode_", "(_", "'", "ascii", "'_", ",_", "'", "replace", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Unic", "ode", "Error_", ",_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "stream_", "._", "write_", "(_", "repr_", "(_", "msg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stream_", "._", "write_", "(_", "os_", "._", "linesep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flush_", "(_", ")_", "\\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 ", " _", "if_", "e_", "._", "args_", "[_", "0_", "]_", "==_", "28_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "No", " ", "space", " ", "left", " ", "on", " ", "device", ",", " ", "cann", "ot", " ", "flush", " ", "log", ".'_", ")_", "\\u\\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_", "[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_", "Color", "ize", "d", "Formatter_", "(_", "Formatter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "was", " ", "necessar", "y", " ", "bec", "aus", "e", " ", "these", " ", "variab", "les", " ", "are", "n", "'", "t", " ", "defin", "ed", " ", "unti", "l", " ", "late", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "static", "method", " ", "is", " ", "necessar", "y", " ", "bec", "aus", "e", " ", "the", "y", " ", "get", " ", "treat", "ed", " ", "like", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "fmt", "Conf_", "=_", "staticmethod_", "(_", "lambda_", ":_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", "._", "format_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Color", "ize", "d", "Formatter_", "(_", "Formatter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "was", " ", "necessar", "y", " ", "bec", "aus", "e", " ", "these", " ", "variab", "les", " ", "are", "n", "'", "t", " ", "defin", "ed", " ", "unti", "l", " ", "late", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "static", "method", " ", "is", " ", "necessar", "y", " ", "bec", "aus", "e", " ", "the", "y", " ", "get", " ", "treat", "ed", " ", "like", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "format", "Exception_", "(_", "self_", ",_", "exc", "\\u", "info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "E_", ",_", "e_", ",_", "tb_", ")_", "=_", "exc", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", "._", "coloriz", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "._", "join_", "(_", "[_", "ansi", "_", "._", "RED_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Formatter_", "._", "format", "Exception_", "(_", "self_", ",_", "(_", "E_", ",_", "e_", ",_", "tb_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ansi", "_", "._", "RESET_", "]_", ")_", "\\u\\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_", "Formatter_", "._", "format", "Exception_", "(_", "self_", ",_", "(_", "E_", ",_", "e_", ",_", "tb_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ize", "d", "Formatter_", "(_", "Formatter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "was", " ", "necessar", "y", " ", "bec", "aus", "e", " ", "these", " ", "variab", "les", " ", "are", "n", "'", "t", " ", "defin", "ed", " ", "unti", "l", " ", "late", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "static", "method", " ", "is", " ", "necessar", "y", " ", "bec", "aus", "e", " ", "the", "y", " ", "get", " ", "treat", "ed", " ", "like", " ", "method", "s", "._", "\\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_", "format_", "(_", "self_", ",_", "record_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "stdout_", "._", "coloriz", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "color_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record_", "._", "level", "no_", "==_", "logging_", "._", "CRITICAL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "color_", "=_", "ansi", "_", "._", "WHITE_", "+_", "ansi", "_", "._", "BOLD_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "record_", "._", "level", "no_", "==_", "logging_", "._", "ERROR_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "color_", "=_", "ansi", "_", "._", "RED_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "record_", "._", "level", "no_", "==_", "logging_", "._", "WARNING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "color_", "=_", "ansi", "_", "._", "YELLOW_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "color_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "._", "join_", "(_", "[_", "color_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Formatter_", "._", "format_", "(_", "self_", ",_", "record_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ansi", "_", "._", "RESET_", "]_", ")_", "\\u\\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_", "Formatter_", "._", "format_", "(_", "self_", ",_", "record_", ",_", "*_", "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 ", " _", "return_", "Formatter_", "._", "format_", "(_", "self_", ",_", "record_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Valid", "Log", "Level_", "(_", "registry_", "._", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Inva", "lid", " ", "log", " ", "level", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minim", "um", "Level_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Valid", "Log", "Level_", "(_", "registry_", "._", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "s_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "logging_", "._", "\\u", "level", "Names_", "[_", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "logging_", "._", "\\u", "name", "To", "Level_", "[_", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "int_", "(_", "s_", ")_", "\\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 ", " _", "self_", "._", "error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "level_", "<_", "self_", "._", "minim", "um", "Level_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "handler_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "handler_", "._", "set", "Level_", "(_", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set", "Value_", "(_", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Valid", "Log", "Level_", "(_", "registry_", "._", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "str", "()", " ", "is", " ", "necessar", "y", " ", "here", ";", " ", "appare", "ntl", "y", " ", "get", "Leve", "l", "Name", " ", "return", "s", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "integ", "er", " ", "on", " ", "occ", "asi", "on", ".", " ", " ", "logg", "ing", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "str_", "(_", "logging_", "._", "get", "Leve", "l", "Name_", "(_", "self_", "._", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "level_", "._", "startswith_", "(_", "'", "Leve", "l", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "level_", "._", "split_", "(_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "level_", "\\u\\u\\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_", "Log", "Level_", "(_", "Valid", "Log", "Level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Inva", "lid", " ", "log", " ", "level", ".", " ", " ", "Value", " ", "must", " ", "be", " ", "eit", "her", " ", "DEBU", "G", ",", " ", "INFO", ",", " ", "WARN", "ING", ",", "\\", "10", ";", " ", " ", " ", " ", "ERROR", ",", " ", "or", " ", "CRIT", "ICAL", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "\\u", "handler_", "\\u\\u\\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_", "Stdout", "Log", "Level_", "(_", "Valid", "Log", "Level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Inva", "lid", " ", "log", " ", "level", ".", " ", " ", "Value", " ", "must", " ", "be", " ", "eit", "her", " ", "DEBU", "G", ",", " ", "INFO", ",", " ", "WARN", "ING", ",", "\\", "10", ";", " ", " ", " ", " ", "ERROR", ",", " ", "or", " ", "CRIT", "ICAL", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "\\u", "stdout", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Boo", "lean", "Requ", "ired", "Fal", "se", "On", "Windows_", "(_", "registry_", "._", "Boolean_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Value", " ", "cann", "ot", " ", "be", " ", "true", " ", "on", " ", "Window", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "lean", "Requ", "ired", "Fal", "se", "On", "Windows_", "(_", "registry_", "._", "Boolean_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "registry_", "._", "Boolean_", "._", "set_", "(_", "self_", ",_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "value_", "and_", "os_", "._", "name_", "==_", "'", "nt", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "Plug", "in", "Logger_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "plugins_", "._", "individual", "Log", "files_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "sup", "ybo", "t", ".", "plugin", "s", ".", "%", "s", "'_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "log_", "._", "handlers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "plugin", "Log", "Dir_", ",_", "'%", "s", ".", "log", "'_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "Bet", "ter", "File", "Handler_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "set", "Level_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "set", "Formatter_", "(_", "plugin", "Formatter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "add", "Handler_", "(_", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "name_", "in_", "sys_", "._", "modules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "'", "Start", "ing", " ", "log", " ", "for", " ", "%", "s", ".'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "log_", "\\u\\u\\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_", "timestamp_", "(_", "when_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "when_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "when_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "format_", "=_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "timestamp", "Format_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "time_", "._", "localtime_", "(_", "when_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "time_", "._", "strftime_", "(_", "format_", ",_", "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 ", " _", "return_", "str_", "(_", "int_", "(_", "time_", "._", "mktime_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "firewall_", "(_", "f_", ",_", "error", "Handler_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "log", "Exception_", "(_", "self_", ",_", "s_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "'", "Unc", "aug", "ht", " ", "exception", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "'", "log", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logg", "ing", "\\u", "function_", "=_", "self_", "._", "log_", "._", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logg", "ing", "\\u", "function_", "=_", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logg", "ing", "\\u", "function_", "(_", "'%", "s", " ", "in", " ", "%", "s", ".", "%", "s", ":'_", ",_", "s_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "f_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "m_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\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_", "f_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\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 ", " _", "if_", "testing_", ":_", "\\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_", "log", "Exception_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "error", "Handler_", "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 ", " ", "_", "return_", "error", "Handler_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\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 ", " ", "_", "log", "Exception_", "(_", "self_", ",_", "'", "Unc", "aug", "ht", " ", "exception", " ", "in", " ", "error", "Handle", "r", "'_", ")_", "\\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_", "m_", "=_", "utils_", "._", "python_", "._", "change", "Function", "Name_", "(_", "m_", ",_", "f_", "._", "\\u\\u", "name\\u\\u_", ",_", "f_", "._", "\\u\\u", "doc\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "m_", "\\u\\u\\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_", "Meta", "Fire", "wall_", "(_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "get", "Error", "Handler_", "=_", "classmethod_", "(_", "get", "Error", "Handler_", ")_", "\\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_", "update", "Fire", "walle", "d_", "=_", "classmethod_", "(_", "update", "Fire", "walle", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meta", "Fire", "wall_", "(_", "type_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "new\\u\\u_", "(_", "cls_", ",_", "name_", ",_", "bases_", ",_", "classd", "ict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "firew", "alle", "d_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "base_", "in_", "bases_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "base_", ",_", "'\\u", "\\u", "firew", "alle", "d\\u", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "update", "Fire", "walle", "d_", "(_", "firew", "alle", "d_", ",_", "base_", "._", "\\u\\u", "firew", "alle", "d\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cls_", "._", "update", "Fire", "walle", "d_", "(_", "firew", "alle", "d_", ",_", "classd", "ict_", "._", "get_", "(_", "'\\u", "\\u", "firew", "alle", "d\\u", "\\u'_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "attr_", ",_", "error", "Handler_", ")_", "in_", "firew", "alle", "d_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "attr_", "in_", "classd", "ict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "classd", "ict_", "[_", "attr_", "]_", "=_", "firewall_", "(_", "classd", "ict_", "[_", "attr_", "]_", ",_", "error", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Meta", "Fire", "wall_", ",_", "cls_", ")_", "._", "\\u\\u", "new\\u\\u_", "(_", "cls_", ",_", "name_", ",_", "bases_", ",_", "classd", "ict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meta", "Fire", "wall_", "(_", "type_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Error", "Handler_", "(_", "cls_", ",_", "dict", "Or", "Tuple_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "dict", "Or", "Tuple_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dict", "Or", "Tuple_", "[_", "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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meta", "Fire", "wall_", "(_", "type_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "update", "Fire", "walle", "d_", "(_", "cls_", ",_", "firew", "alle", "d_", ",_", "\\u\\u", "firew", "alle", "d\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "attr_", "in_", "\\u\\u", "firew", "alle", "d\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "firew", "alle", "d_", "[_", "attr_", "]_", "=_", "cls_", "._", "get", "Error", "Handler_", "(_", "\\u\\u", "firew", "alle", "d\\u\\u_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Plug", "in", "Log", "Filter_", "(_", "logging_", "._", "Filter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Plug", "in", "Log", "Filter_", "(_", "logging_", "._", "Filter_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "filter_", "(_", "self_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "conf_", "._", "sup", "ybo", "t_", "._", "log_", "._", "plugins_", "._", "individual", "Log", "files_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "record_", "._", "name_", "._", "startswith_", "(_", "'", "sup", "ybo", "t", ".", "plugin", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 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, 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image_unittesting/run_image_tests.py
[ { "content": "def main():\n \"\"\"entry point.\"\"\"\n (options, unused_args) = ParseCLIArgs()\n dmg = options.dmg\n verbosity = options.verbosity\n tests_dir = options.testdir\n config_dir = options.configdir\n root = options.root\n if not dmg and not root:\n print \"Use --dmg to specify a dmg file or --root to specify a directory.\"\n sys.exit(1)\n if dmg:\n print \"Mounting disk image... (this may take some time)\"\n mountpoint = AttachDiskImage(dmg)\n if not mountpoint:\n print \"Unable to mount %s\" % dmg\n sys.exit(2)\n elif root:\n if not os.path.isdir(root):\n print \"%s not a directory\" % root\n sys.exit(2)\n mountpoint = root\n print \"Checking %s\" % mountpoint\n print\n\n dirname = os.path.dirname(sys.argv[0])\n os.chdir(dirname)\n tests = ListTests(tests_dir)\n test_results = {}\n combo_suite = unittest.TestSuite()\n for test in tests:\n test_path = os.path.join(tests_dir, test)\n combo_suite.addTests(GetTestSuite(test_path, mountpoint, options))\n\n test_results = unittest.TextTestRunner(verbosity=verbosity).run(combo_suite)\n\n if dmg:\n DetachDiskImage(mountpoint)\n\n if test_results.wasSuccessful():\n sys.exit(0)\n else:\n SummarizeResults(test_results)\n bad = len(test_results.errors) + len(test_results.failures)\n sys.exit(bad)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 159 } ]
[ { "span": "config_dir ", "start_line": 165, "start_column": 2, "end_line": 165, "end_column": 12 } ]
[]
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_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "entry", " ", "point", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "options_", ",_", "unu", "sed", "\\u", "args_", ")_", "=_", "Pars", "e", "CLI", "Args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dmg", "_", "=_", "options_", "._", "dmg", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verbosity_", "=_", "options_", "._", "verbosity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests", "\\u", "dir_", "=_", "options_", "._", "testdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config", "\\u", "dir_", "=_", "options_", "._", "configd", "ir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "options_", "._", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "dmg", "_", "and_", "not_", "root_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Us", "e", " ", "--", "dmg", " ", "to", " ", "speci", "fy", " ", "a", " ", "dmg", " ", "file", " ", "or", " ", "--", "root", " ", "to", " ", "speci", "fy", " ", "a", " ", "director", "y", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dmg", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Mount", "ing", " ", "disk", " ", "image", "...", " ", "(", "this", " ", "may", " ", "take", " ", "some", " ", "time", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mountpoint_", "=_", "Attach", "Disk", "Image_", "(_", "dmg", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "mountpoint_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Una", "ble", " ", "to", " ", "mount", " ", "%", "s", "\"_", "%_", "dmg", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "root_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "root_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"%", "s", " ", "not", " ", "a", " ", "director", "y", "\"_", "%_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mountpoint_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Check", "ing", " ", "%", "s", "\"_", "%_", "mountpoint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dirname_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "sys_", "._", "argv_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests_", "=_", "List", "Tests_", "(_", "tests", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "results_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "combo", "\\u", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "test_", "in_", "tests_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "tests", "\\u", "dir_", ",_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "combo", "\\u", "suite_", "._", "add", "Tests_", "(_", "Get", "Test", "Suite_", "(_", "test\\u", "path_", ",_", "mountpoint_", ",_", "options_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "test\\u", "results_", "=_", "unittest_", "._", "Text", "Test", "Runner_", "(_", "verbosity_", "=_", "verbosity_", ")_", "._", "run_", "(_", "combo", "\\u", "suite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dmg", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Detach", "Disk", "Image_", "(_", "mountpoint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "test\\u", "results_", "._", "was", "Success", "ful_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "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 ", " _", "Summari", "ze", "Results_", "(_", "test\\u", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad_", "=_", "len_", "(_", "test\\u", "results_", "._", "errors_", ")_", "+_", "len_", "(_", "test\\u", "results_", "._", "failures_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "bad_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
taoliu/MACS/MACS2/randsample_cmd.py
[ { "content": "# Time-stamp: <2015-06-02 23:55:02 Tao Liu>\n\n\"\"\"Description: Random sample certain number/percentage of tags.\n\nCopyright (c) 2011 Tao Liu <[email protected]>\n\nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the BSD License (see the file COPYING included\nwith the distribution).\n\n@status: release candidate\n@version: $Id$\n@author: Yong Zhang, Tao Liu\n@contact: [email protected]\n\"\"\"\n\n# ------------------------------------\n# python modules\n# ------------------------------------\n\nimport os\nimport sys\nimport logging\n\n# ------------------------------------\n# own python modules\n# ------------------------------------\nfrom MACS2.OptValidator import opt_validate_randsample as opt_validate\nfrom MACS2.Constants import *\n\n# ------------------------------------\n# Main function\n# ------------------------------------\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def run( options0 ):\n options = opt_validate( options0 )\n # end of parsing commandline options\n info = options.info\n warn = options.warn\n debug = options.debug\n error = options.error\n #0 check output file\n if options.outputfile:\n outfhd = open( os.path.join( options.outdir, options.outputfile ), \"w\" )\n else:\n outfhd = sys.stdout\n \n #1 Read tag files\n info(\"read tag files...\")\n fwtrack = load_tag_files_options (options)\n \n info(\"tag size = %d\" % options.tsize)\n fwtrack.fw = options.tsize\n\n t0 = fwtrack.total\n info(\" total tags in alignment file: %d\" % (t0))\n if options.number:\n if options.number > t0:\n error(\" Number you want is bigger than total number of tags in alignment file! Please specify a smaller number and try again!\")\n error(\" %.2e > %.2e\" % (options.number, t0))\n sys.exit(1)\n info(\" Number of tags you want to keep: %.2e\" % (options.number))\n options.percentage = float(options.number)/t0*100\n info(\" Percentage of tags you want to keep: %.2f%%\" % (options.percentage))\n\n if options.seed >= 0:\n info(\" Random seed has been set as: %d\" % options.seed )\n\n fwtrack.sample_percent(options.percentage/100.0, options.seed )\n\n info(\" tags after random sampling in alignment file: %d\" % (fwtrack.total))\n\n info(\"Write to BED file\")\n fwtrack.print_to_bed(fhd=outfhd)\n info(\"finished! Check %s.\" % options.outputfile)", "metadata": "root.run", "header": "['module', '___EOS___']", "index": 33 }, { "content": "def load_tag_files_options ( options ):\n \"\"\"From the options, load alignment tags.\n\n \"\"\"\n options.info(\"# read treatment tags...\")\n tp = options.parser(options.tfile[0])\n if not options.tsize: # override tsize if user specified --tsize\n ttsize = tp.tsize()\n options.tsize = ttsize\n treat = tp.build_fwtrack()\n #treat.sort()\n if len(options.tfile) > 1:\n # multiple input\n for tfile in options.tfile[1:]:\n tp = options.parser(tfile)\n treat = tp.append_fwtrack( treat )\n #treat.sort()\n treat.finalize()\n\n options.info(\"tag size is determined as %d bps\" % options.tsize)\n return treat", "metadata": "root.load_tag_files_options", "header": "['module', '___EOS___']", "index": 75 } ]
[ { "span": "import logging", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Time", "-", "stamp", ":", " ", "<", "201", "5", "-0", "6", "-0", "2", " ", "23", ":", "5", "5", ":", "02", " ", "Ta", "o", " ", "Li", "u", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Descripti", "on", ":", " ", "Random", " ", "sample", " ", "cert", "ain", " ", "number", "/", "percentage", " ", "of", " ", "tags", ".", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2011", " ", "Ta", "o", " ", "Li", "u", " ", "<", "ta", "oli", "u", "@", "jim", "my", ".", "har", "vard", ".", "edu", ">", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "code", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modif", "y", " ", "it", "\\", "10", ";", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "BS", "D", " ", "License", " ", "(", "see", " ", "the", " ", "file", " ", "COPY", "ING", " ", "include", "d", "\\", "10", ";", "with", " ", "the", " ", "distribu", "tion", ").", "\\", "10", ";", "\\", "10", ";", "@", "status", ":", " ", "release", " ", "candidate", "\\", "10", ";", "@", "version", ":", " ", "$", "Id", "$", "\\", "10", ";", "@", "author", ":", " ", " ", "Yo", "ng", " ", "Zha", "ng", ",", " ", "Ta", "o", " ", "Li", "u", "\\", "10", ";", "@", "contact", ":", " ", "ta", "oli", "u", "@", "jim", "my", ".", "har", "vard", ".", "edu", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "python", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "own", " ", "python", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "MAC", "S2_", "._", "Opt", "Validator_", "import_", "opt", "\\u", "validat", "e\\u", "rand", "sample_", "as_", "opt", "\\u", "validate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "MAC", "S2_", "._", "Constants_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Main", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "options", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "=_", "opt", "\\u", "validate_", "(_", "options", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "end", " ", "of", " ", "pars", "ing", " ", "commandline", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "info_", "=_", "options_", "._", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn_", "=_", "options_", "._", "warn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "=_", "options_", "._", "debug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "options_", "._", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "0", " ", "check", " ", "output", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "outputfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outf", "hd_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "options_", "._", "outdir_", ",_", "options_", "._", "outputfile_", ")_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outf", "hd_", "=_", "sys_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "1", " ", "Read", " ", "tag", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "info_", "(_", "\"", "read", " ", "tag", " ", "files", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fw", "track_", "=_", "load", "\\u", "tag", "\\u", "files", "\\u", "options_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "info_", "(_", "\"", "tag", " ", "size", " ", "=", " ", "%", "d", "\"_", "%_", "options_", "._", "tsi", "ze_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fw", "track_", "._", "fw_", "=_", "options_", "._", "tsi", "ze_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t0_", "=_", "fw", "track_", "._", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "(_", "\"", " ", "total", " ", "tags", " ", "in", " ", "alignme", "nt", " ", "file", ":", " ", "%", "d", "\"_", "%_", "(_", "t0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "number_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "number_", ">_", "t0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error_", "(_", "\"", " ", "Number", " ", "you", " ", "want", " ", "is", " ", "bigger", " ", "than", " ", "total", " ", "number", " ", "of", " ", "tags", " ", "in", " ", "alignme", "nt", " ", "file", "!", " ", "Ple", "ase", " ", "speci", "fy", " ", "a", " ", "small", "er", " ", "number", " ", "and", " ", "try", " ", "again", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "(_", "\"", " ", "%", ".2", "e", " ", ">", " ", "%", ".2", "e", "\"_", "%_", "(_", "options_", "._", "number_", ",_", "t0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "info_", "(_", "\"", " ", "Number", " ", "of", " ", "tags", " ", "you", " ", "want", " ", "to", " ", "keep", ":", " ", "%", ".2", "e", "\"_", "%_", "(_", "options_", "._", "number_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "percentage_", "=_", "float_", "(_", "options_", "._", "number_", ")_", "/_", "t0_", "*_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "info_", "(_", "\"", " ", "Perce", "nta", "ge", " ", "of", " ", "tags", " ", "you", " ", "want", " ", "to", " ", "keep", ":", " ", "%", ".2", "f", "%%\"_", "%_", "(_", "options_", "._", "percentage_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "seed_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info_", "(_", "\"", " ", "Random", " ", "seed", " ", "has", " ", "bee", "n", " ", "set", " ", "as", ":", " ", "%", "d", "\"_", "%_", "options_", "._", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fw", "track_", "._", "sample", "\\u", "percent_", "(_", "options_", "._", "percentage_", "/_", "100.0_", ",_", "options_", "._", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "info_", "(_", "\"", " ", "tags", " ", "after", " ", "random", " ", "samp", "ling", " ", "in", " ", "alignme", "nt", " ", "file", ":", " ", "%", "d", "\"_", "%_", "(_", "fw", "track_", "._", "total_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "info_", "(_", "\"", "Write", " ", "to", " ", "BED", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fw", "track_", "._", "print", "\\u", "to", "\\u", "bed_", "(_", "fh", "d_", "=_", "outf", "hd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "(_", "\"", "finish", "ed", "!", " ", "Check", " ", "%", "s", ".\"_", "%_", "options_", "._", "outputfile_", ")_", "\\u\\u\\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_", "load", "\\u", "tag", "\\u", "files", "\\u", "options_", "(_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fro", "m", " ", "the", " ", "options", ",", " ", "load", " ", "alignme", "nt", " ", "tags", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "info_", "(_", "\"#", " ", "read", " ", "treatment", " ", "tags", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tp_", "=_", "options_", "._", "parser_", "(_", "options_", "._", "tfile_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "options_", "._", "tsi", "ze_", ":_", "#", " ", "override", " ", "tsi", "ze", " ", "if", " ", "user", " ", "specified", " ", "--", "tsi", "ze_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tts", "ize_", "=_", "tp_", "._", "tsi", "ze_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "tsi", "ze_", "=_", "tts", "ize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "treat", "_", "=_", "tp_", "._", "build", "\\u", "fw", "track_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "treat", ".", "sort", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "options_", "._", "tfile_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "multiple", " ", "input_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tfile_", "in_", "options_", "._", "tfile_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tp_", "=_", "options_", "._", "parser_", "(_", "tfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "treat", "_", "=_", "tp_", "._", "append", "\\u", "fw", "track_", "(_", "treat", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "treat", ".", "sort", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "treat", "_", "._", "finalize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "info_", "(_", "\"", "tag", " ", "size", " ", "is", " ", "dete", "rmin", "ed", " ", "as", " ", "%", "d", " ",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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
fp7-ofelia/ocf/expedient/src/python/expedient/common/utils/plugins/plugincommunicator.py
[ { "content": "\"\"\"\nIntermediary for the AM resources, so each plugin may access the resources\ncorresponding to another AM. Data needed: plugin name, class name, search filter.\n\n@date: Mar 13, 2013\n@author: [email protected]\n\"\"\"\n\n#from django.conf import settings \nfrom django.db.models import Q\nfrom utils import join_paths, Singleton\nimport os\nfrom urls import PLUGIN_LOADER\n\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PluginCommunicator():\n\n \"\"\"\n Allows different pluggins in the same Expedient to ask resources to each other.\n Basic requirement is so that a plugin can ask to some other plugin the id of a resource (node)\n it has to build the links between resources.\n \"\"\"\n # Allows only one instance of this class\n __metaclass__ = Singleton\n\n\n", "metadata": "root.PluginCommunicator", "header": "['module', '___EOS___']", "index": 14 }, { "content": " @staticmethod\n def get_objects(slice, plugin_type, klass, **kwargs):\n \"\"\"\n Retrieves the id of a model belonging to another plugin\n and which is contained in the same slice than the \n AM corresponding to the other plugin that invokes this.\n\n E.g. Slice \"test\" with \"VT test AM\" and \"OF test AM\"\n VT plugin will ask for OF resources whose AM (\"OF\n AM test\") was previously added to slice \"tests\".\n \"\"\"\n try:\n# plugins_modules = settings.PLUGIN_LOADER.plugin_settings.get(plugin_type).get(\"general\").get(\"aggregate_plugins\")[0]\n plugins_modules = PLUGIN_LOADER.plugin_settings.get(plugin_type).get(\"general\").get(\"aggregate_plugins\")[0]\n p_agg = plugins_modules.split('.')[-1]\n p_models_path = '.'.join(plugins_modules.split('.')[:-1])\n try:\n model = getattr(__import__(p_models_path,fromlist=[klass]), klass)\n except: \n try: \n model = getattr(__import__(p_models_path+'.'+klass,fromlist=[klass]), klass)\n except:\n pass \n # Filters resources by slice (will not return any aggregate's resource from another slice)\n objects = model.objects.filter(**kwargs)\n #print \"objects: %s\" % str(objects)\n for obj in objects:\n if not (obj != None and obj.aggregate in slice._get_aggregates()):\n raise Exception\n return objects\n except Exception,e:\n print \"[ERROR] PluginCommunicator could not obtain object. Details: %s \" % str(e)\n return None", "metadata": "root.PluginCommunicator.get_objects", "header": "['class', 'PluginCommunicator', '(', ')', ':', '___EOS___']", "index": 24 }, { "content": " @staticmethod\n def get_object(slice, plugin_type, klass, **kwargs):\n objects = PluginCommunicator.get_objects(slice, plugin_type, klass, **kwargs)\n try:\n return objects[0]\n except Exception,e:\n print \"[ERROR] PluginCommunicator could not obtain object. Details: %s \" % str(e)\n return None", "metadata": "root.PluginCommunicator.get_object", "header": "['class', 'PluginCommunicator', '(', ')', ':', '___EOS___']", "index": 58 }, { "content": " @staticmethod\n def get_object_id(slice, plugin_type, klass, **kwargs): \n try:\n return PluginCommunicator.get_object(slice, plugin_type, klass, **kwargs).id\n except:\n return None", "metadata": "root.PluginCommunicator.get_object_id", "header": "['class', 'PluginCommunicator', '(', ')', ':', '___EOS___']", "index": 67 } ]
[ { "span": "from django.db.models import Q", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 30 }, { "span": "from utils import join_paths, Singleton", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 39 }, { "span": "import os", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Inter", "media", "ry", " ", "for", " ", "the", " ", "AM", " ", "resource", "s", ",", " ", "so", " ", "each", " ", "plugin", " ", "may", " ", "access", " ", "the", " ", "resource", "s", "\\", "10", ";", "correspond", "ing", " ", "to", " ", "anot", "her", " ", "AM", ".", " ", "Data", " ", "need", "ed", ":", " ", "plugin", " ", "name", ",", " ", "class", " ", "name", ",", " ", "search", " ", "filter", ".", "\\", "10", ";", "\\", "10", ";", "@", "date", ":", " ", "Mar", " ", "13", ",", " ", "2013", "\\", "10", ";", "@", "author", ":", " ", "leo", "nar", "do", ".", "ber", "ges", "io", "@", "i2", "cat", ".", "net", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "django", ".", "conf", " ", "import", " ", "settings", " _", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "Q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "import_", "join", "\\u", "paths_", ",_", "Singleton_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urls_", "import_", "PLUGIN", "\\u", "LOADER", "_", "\\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_", "Plug", "in", "Communi", "cator", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "All", "ow", "s", " ", "different", " ", "plug", "gin", "s", " ", "in", " ", "the", " ", "same", " ", "Expe", "die", "nt", " ", "to", " ", "ask", " ", "resource", "s", " ", "to", " ", "each", " ", "other", ".", "\\", "10", ";", " ", " ", " ", " ", "Basic", " ", "require", "ment", " ", "is", " ", "so", " ", "tha", "t", " ", "a", " ", "plugin", " ", "can", " ", "ask", " ", "to", " ", "some", " ", "other", " ", "plugin", " ", "the", " ", "id", " ", "of", " ", "a", " ", "resource", " ", "(", "node", ")", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "has", " ", "to", " ", "build", " ", "the", " ", "link", "s", " ", "bet", "ween", " ", "resource", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", "ow", "s", " ", "only", " ", "one", " ", "instance", " ", "of", " ", "this", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "metaclass\\u\\u_", "=_", "Singleton_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Plug", "in", "Communi", "cator", "_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "objects_", "(_", "slice_", ",_", "plugin", "\\u", "type_", ",_", "klass_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Retrieve", "s", " ", "the", " ", "id", " ", "of", " ", "a", " ", "model", " ", "belonging", " ", "to", " ", "anot", "her", " ", "plugin", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "whi", "ch", " ", "is", " ", "contain", "ed", " ", "in", " ", "the", " ", "same", " ", "slice", " ", "than", " ", "the", " ", "\\", "10", ";", " ", " ", " ", " ", "AM", " ", "correspond", "ing", " ", "to", " ", "the", " ", "other", " ", "plugin", " ", "tha", "t", " ", "invoke", "s", " ", "this", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "E", ".", "g", ".", " ", "Slice", " ", "\"", "test", "\"", " ", "with", " ", "\"", "VT", " ", "test", " ", "AM", "\"", " ", "and", " ", "\"", "OF", " ", "test", " ", "AM", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", "VT", " ", "plugin", " ", "will", " ", "ask", " ", "for", " ", "OF", " ", "resource", "s", " ", "who", "se", " ", "AM", " ", "(\"", "OF", "\\", "10", ";", " ", " ", " ", " ", " ", "AM", " ", "test", "\")", " ", "was", " ", "previ", "ously", " ", "adde", "d", " ", "to", " ", "slice", " ", "\"", "tests", "\".\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "plugin", "s", "\\u", "module", "s", " ", "=", " ", "settings", ".", "PLUGIN", "\\u", "LOADER", ".", "plugin", "\\u", "settings", ".", "get", "(", "plugin", "\\u", "type", ").", "get", "(\"", "genera", "l", "\")", ".", "get", "(\"", "aggre", "gate", "\\u", "plugin", "s", "\")", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plugin", "s", "\\u", "modules_", "=_", "PLUGIN", "\\u", "LOADER", "_", "._", "plugin", "\\u", "settings_", "._", "get_", "(_", "plugin", "\\u", "type_", ")_", "._", "get_", "(_", "\"", "genera", "l", "\"_", ")_", "._", "get_", "(_", "\"", "aggre", "gate", "\\u", "plugin", "s", "\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p", "\\u", "agg_", "=_", "plugin", "s", "\\u", "modules_", "._", "split_", "(_", "'.'_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p", "\\u", "model", "s", "\\u", "path_", "=_", "'.'_", "._", "join_", "(_", "plugin", "s", "\\u", "modules_", "._", "split_", "(_", "'.'_", ")_", "[_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "getattr_", "(_", "\\u\\u", "import\\u\\u_", "(_", "p", "\\u", "model", "s", "\\u", "path_", ",_", "froml", "ist_", "=_", "[_", "klass_", "]_", ")_", ",_", "klass_", ")_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "model_", "=_", "getattr_", "(_", "\\u\\u", "import\\u\\u_", "(_", "p", "\\u", "model", "s", "\\u", "path_", "+_", "'.'_", "+_", "klass_", ",_", "froml", "ist_", "=_", "[_", "klass_", "]_", ")_", ",_", "klass_", ")_", "\\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_", "#", " ", "Filter", "s", " ", "resource", "s", " ", "by", " ", "slice", " ", "(", "will", " ", "not", " ", "return", " ", "any", " ", "aggre", "gate", "'", "s", " ", "resource", " ", "from", " ", "anot", "her", " ", "slice", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "objects_", "=_", "model_", "._", "objects_", "._", "filter_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "object", "s", ":", " ", "%", "s", "\"", " ", "%", " ", "str", "(", "object", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "obj_", "in_", "objects_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "(_", "obj_", "!=_", "None_", "and_", "obj_", "._", "aggregate_", "in_", "slice_", "._", "\\u", "get", "\\u", "aggregates", "_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "objects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "ERROR", "]", " ", "Plug", "in", "Communi", "cator", " ", "coul", "d", " ", "not", " ", "obtain", " ", "object", ".", " ", "Det", "ail", "s", ":", " ", "%", "s", " ", "\"_", "%_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Plug", "in", "Communi", "cator", "_", "(_", ")_", ":_", "\\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_", "get", "\\u", "object_", "(_", "slice_", ",_", "plugin", "\\u", "type_", ",_", "klass_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "objects_", "=_", "Plug", "in", "Communi", "cator", "_", "._", "get", "\\u", "objects_", "(_", "slice_", ",_", "plugin", "\\u", "type_", ",_", "klass_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "objects_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"[", "ERROR", "]", " ", "Plug", "in", "Communi", "cator", " ", "coul", "d", " ", "not", " ", "obtain", " ", "object", ".", " ", "Det", "ail", "s", ":", " ", "%", "s", " ", "\"_", "%_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Plug", "in", "Communi", "cator", "_", "(_", ")_", ":_", "\\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_", "get", "\\u", "object\\u", "id_", "(_", "slice_", ",_", "plugin", "\\u", "type_", ",_", "klass_", ",_", "**_", "kwargs_", ")_", ":_", "\\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_", "Plug", "in", "Communi", "cator", "_", "._", "get", "\\u", "object_", "(_", "slice_", ",_", "plugin", "\\u", "type_", ",_", "klass_", ",_", "**_", "kwargs_", ")_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
ofri/Open-Knesset/polyorg/migrations/0003_add_social_links.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 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'ordering': \"('content_type__app_label', 'content_type__model', 'codename')\", 'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n 'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n 'mks.member': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'Member'},\n 'area_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'average_monthly_committee_presence': ('django.db.models.fields.FloatField', [], {'null': 'True'}),\n 'average_weekly_presence_hours': ('django.db.models.fields.FloatField', [], {'null': 'True'}),\n 'backlinks_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'bills_stats_approved': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_first': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_pre': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_proposed': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'blog': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['planet.Blog']\", 'unique': 'True', 'null': 'True', 'blank': 'True'}),\n 'current_party': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'members'\", 'null': 'True', 'to': \"orm['mks.Party']\"}),\n 'current_role_descriptions': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'date_of_death': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'family_status': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),\n 'fax': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'gender': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'img_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),\n 'is_current': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_children': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'parties': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': \"'all_members'\", 'symmetrical': 'False', 'through': \"orm['mks.Membership']\", 'to': \"orm['mks.Party']\"}),\n 'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'place_of_birth': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lat': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lon': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'residence_centrality': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'residence_economy': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\", 'null': 'True', 'blank': 'True'}),\n 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'year_of_aliyah': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n },\n 'mks.membership': {\n 'Meta': {'object_name': 'Membership'},\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'member': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['mks.Member']\"}),\n 'party': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['mks.Party']\"}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})\n },\n 'mks.party': {\n 'Meta': {'ordering': \"('-number_of_seats',)\", 'object_name': 'Party'},\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_coalition': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_members': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'number_of_seats': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})\n },\n 'persons.person': {\n 'Meta': {'ordering': \"('name',)\", 'object_name': 'Person'},\n 'area_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'date_of_death': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),\n 'family_status': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),\n 'fax': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'gender': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'img_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),\n 'mk': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'person'\", 'null': 'True', 'to': \"orm['mks.Member']\"}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_children': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'place_of_birth': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lat': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lon': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'residence_centrality': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'residence_economy': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'titles': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'persons'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['persons.Title']\"}),\n 'year_of_aliyah': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n },\n 'persons.title': {\n 'Meta': {'object_name': 'Title'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'})\n },\n 'planet.blog': {\n 'Meta': {'ordering': \"('title', 'url')\", 'object_name': 'Blog'},\n 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),\n 'url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '1024', 'db_index': 'True'})\n },\n 'polyorg.candidate': {\n 'Meta': {'ordering': \"('ordinal',)\", 'object_name': 'Candidate'},\n 'candidates_list': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['polyorg.CandidateList']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'ordinal': ('django.db.models.fields.IntegerField', [], {}),\n 'party': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['polyorg.Party']\", 'null': 'True', 'blank': 'True'}),\n 'person': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['persons.Person']\"}),\n 'votes': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n },\n 'polyorg.candidatelist': {\n 'Meta': {'object_name': 'CandidateList'},\n 'ballot': ('django.db.models.fields.CharField', [], {'max_length': '4'}),\n 'candidates': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': \"orm['persons.Person']\", 'null': 'True', 'through': \"orm['polyorg.Candidate']\", 'blank': 'True'}),\n 'facebook_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'img_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),\n 'mpg_html_report': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),\n 'number_of_seats': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'surplus_partner': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['polyorg.CandidateList']\", 'null': 'True', 'blank': 'True'}),\n 'twitter_account': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),\n 'wikipedia_page': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),\n 'youtube_user': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'})\n },\n 'polyorg.party': {\n 'Meta': {'object_name': 'Party'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_seats': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n }\n }\n\n complete_apps = ['polyorg']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Adding field 'CandidateList.youtube_user'\n db.add_column('polyorg_candidatelist', 'youtube_user',\n self.gf('django.db.models.fields.CharField')(max_length=80, null=True),\n keep_default=False)\n\n # Adding field 'CandidateList.wikipedia_page'\n db.add_column('polyorg_candidatelist', 'wikipedia_page',\n self.gf('django.db.models.fields.CharField')(max_length=80, null=True),\n keep_default=False)\n\n # Adding field 'CandidateList.twitter_account'\n db.add_column('polyorg_candidatelist', 'twitter_account',\n self.gf('django.db.models.fields.CharField')(max_length=80, null=True),\n keep_default=False)\n\n # Adding field 'CandidateList.facebook_url'\n db.add_column('polyorg_candidatelist', 'facebook_url',\n self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True),\n keep_default=False)", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Deleting field 'CandidateList.youtube_user'\n db.delete_column('polyorg_candidatelist', 'youtube_user')\n\n # Deleting field 'CandidateList.wikipedia_page'\n db.delete_column('polyorg_candidatelist', 'wikipedia_page')\n\n # Deleting field 'CandidateList.twitter_account'\n db.delete_column('polyorg_candidatelist', 'twitter_account')\n\n # Deleting field 'CandidateList.facebook_url'\n db.delete_column('polyorg_candidatelist', 'facebook_url')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 31 } ]
[ { "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_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", ".", "member", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Mem", "ber", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "area", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "averag", "e\\u", "month", "ly", "\\u", "committee", "\\u", "presen", "ce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "averag", "e\\u", "week", "ly", "\\u", "presen", "ce", "\\u", "hour", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backli", "nks", "\\u", "enable", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "approved", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "first", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "pre", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "proposed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blog", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Blog", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "member", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "role", "\\u", "description", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "death", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fax", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gender", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1", "'_", ",_", "'", "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_", "'", "img", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "current", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "child", "ren", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parties", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "all", "\\u", "member", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "through", "'_", ":_", "\"", "orm", "['", "mks", ".", "Membership", "']\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lat", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lon", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "centrali", "ty", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "econom", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "webs", "ite", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "\\u", "of", "\\u", "ali", "ya", "h", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", ".", "member", "ship", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Membership", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "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_", "'", "member", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", ".", "part", "y", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'-", "number", "\\u", "of", "\\u", "seats", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Part", "y", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "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_", "'", "is", "\\u", "coal", "ition", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "member", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "seats", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "person", "s", ".", "person", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Person", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "area", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "death", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fax", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gender", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1", "'_", ",_", "'", "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_", "'", "img", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mk", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "person", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "child", "ren", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lat", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lon", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "centrali", "ty", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "econom", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "titles", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "person", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "person", "s", ".", "Tit", "le", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "\\u", "of", "\\u", "ali", "ya", "h", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "person", "s", ".", "title", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Tit", "le", "'_", "}_", ",_", "\\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", "'_", ":_", "'", "64", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "blog", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "title", "',", " ", "'", "url", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Blog", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "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_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "poly", "org", ".", "candidate", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "ordinal", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Candidate", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "candidate", "s", "\\u", "list", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "poly", "org", ".", "Candidate", "List", "']\"_", "}_", ")_", ",_", "\\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_", "'", "ordinal", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "poly", "org", ".", "Part", "y", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "person", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "person", "s", ".", "Person", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "poly", "org", ".", "candidate", "list", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Candidate", "List", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ballot", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "4", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "candidate", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "person", "s", ".", "Person", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "through", "'_", ":_", "\"", "orm", "['", "poly", "org", ".", "Candidate", "']\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "facebook", "\\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_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "img", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mpg", "\\u", "html", "\\u", "report", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "seats", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sur", "plus", "\\u", "part", "ner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "poly", "org", ".", "Candidate", "List", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "twit", "ter", "\\u", "account", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wikip", "edia", "\\u", "page", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "youtu", "be", "\\u", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "poly", "org", ".", "part", "y", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Part", "y", "'_", "}_", ",_", "\\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", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "seats", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\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_", "=_", "[_", "'", "poly", "org", "'_", "]_", "[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", " ", "'", "Candidate", "List", ".", "youtu", "be", "\\u", "user", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "add", "\\u", "column_", "(_", "'", "poly", "org", "\\u", "candidate", "list", "'_", ",_", "'", "youtu", "be", "\\u", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "80_", ",_", "null_", "=_", "True_", ")_", ",_", "\\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", " ", "'", "Candidate", "List", ".", "wikip", "edia", "\\u", "page", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "add", "\\u", "column_", "(_", "'", "poly", "org", "\\u", "candidate", "list", "'_", ",_", "'", "wikip", "edia", "\\u", "page", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "80_", ",_", "null_", "=_", "True_", ")_", ",_", "\\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", " ", "'", "Candidate", "List", ".", "twit", "ter", "\\u", "account", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "add", "\\u", "column_", "(_", "'", "poly", "org", "\\u", "candidate", "list", "'_", ",_", "'", "twit", "ter", "\\u", "account", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "80_", ",_", "null_", "=_", "True_", ")_", ",_", "\\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", " ", "'", "Candidate", "List", ".", "facebook", "\\u", "url", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "add", "\\u", "column_", "(_", "'", "poly", "org", "\\u", "candidate", "list", "'_", ",_", "'", "facebook", "\\u", "url", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "200_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ",_", "\\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", " ", "'", "Candidate", "List", ".", "youtu", "be", "\\u", "user", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "column_", "(_", "'", "poly", "org", "\\u", "candidate", "list", "'_", ",_", "'", "youtu", "be", "\\u", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Candidate", "List", ".", "wikip", "edia", "\\u", "page", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "column_", "(_", "'", "poly", "org", "\\u", "candidate", "list", "'_", ",_", "'", "wikip", "edia", "\\u", "page", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Candidate", "List", ".", "twit", "ter", "\\u", "account", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "column_", "(_", "'", "poly", "org", "\\u", "candidate", "list", "'_", ",_", "'", "twit", "ter", "\\u", "account", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Candidate", "List", ".", "facebook", "\\u", "url", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "column_", "(_", "'", "poly", "org", "\\u", "candidate", "list", "'_", ",_", "'", "facebook", "\\u", "url", "'_", ")_", "\\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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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
mrknow/filmkodi/plugin.video.specto/resources/lib/test1.py
[ { "content": "\nimport re,urllib,urlparse\n\n\nfrom libraries import cleantitle\nfrom libraries import client\n\nresult = \"\"\"\n<li><a class=\"search-for zme-autocomplete-activeItem\" href=\"search/mad max\">Search \"mad max</a></li><br><li><a href=\"http://watch1080p.com/watch/mad-max-fury-road_ieo7a/\"><img width=\"35\" height=\"45\" class=\"search-img\" alt=\"\" src=\"https://lh3.googleusercontent.com/-h_jfa8GsOvs/Vi1cle3xPkI/AAAAAAAAA9U/Qb60eTDlcKw/s317/image.jpg\"><strong>Mad Max: Fury Road</strong><br><br class=\"clr\"></a></li>\n\"\"\"\n#print(\">>>Result - 1<<<\",result)\n\nresult = client.parseDOM(result, 'li')\nt1 =client.parseDOM(result[1], 'a' ,ret='href')\nprint(\">>>Result - 2<<<\",t1)\nprint(\">>>\",client.parseDOM(result[1], 'a' ,ret='href'))\nprint(\">>>\",re.sub('<.+?>|</.+?>','', client.parseDOM(result[1], 'a')[0]))\n\nt2 = re.compile('//.+?(/.+)').findall(t1[0])\nprint(\"s\",t2)", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import re,urllib,urlparse", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 25 }, { "span": "from libraries import cleantitle", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", ",_", "urllib_", ",_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "libraries_", "import_", "clean", "title_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "libraries_", "import_", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "\"\"\"", "\\", "10", ";<", "li", "><", "a", " ", "class", "=\"", "search", "-", "for", " ", "zm", "e-", "autocomplete", "-", "active", "Item", "\"", " ", "href", "=\"", "search", "/", "mad", " ", "max", "\">", "Sear", "ch", " ", "\"", "mad", " ", "max", "</", "a", "><", "/", "li", "><", "br", "><", "li", "><", "a", " ", "href", "=\"", "http", "://", "watch", "1080", "p", ".", "com", "/", "watch", "/", "mad", "-", "max", "-", "fur", "y", "-", "road", "\\u", "ie", "o", "7a", "/\"", "><", "img", " ", "widt", "h", "=\"", "3", "5", "\"", " ", "height", "=\"", "4", "5", "\"", " ", "class", "=\"", "search", "-", "img", "\"", " ", "alt", "=\"\"", " ", "src", "=\"", "https", "://", "lh", "3", ".", "google", "userco", "ntent", ".", "com", "/-", "h", "\\u", "jf", "a8", "Gs", "Ov", "s", "/", "Vi", "1c", "le", "3x", "Pk", "I", "/", "AAAAAAAA", "A9", "U", "/", "Qb", "60", "e", "TD", "lc", "Kw", "/", "s3", "1", "7", "/", "image", ".", "jp", "g", "\">", "<", "strong", ">", "Mad", " ", "Max", ":", " ", "Fur", "y", " ", "Roa", "d", "</", "strong", "><", "br", "><", "br", " ", "class", "=\"", "clr", "\">", "</", "a", "><", "/", "li", ">", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", "(\"", ">>>", "Result", " ", "-", " ", "1", "<<", "<", "\",", "result", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "li", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", "[_", "1_", "]_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\">>>", "Result", " ", "-", " ", "2", "<<", "<\"_", ",_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\">>>", "\"_", ",_", "client_", "._", "parse", "DOM_", "(_", "result_", "[_", "1_", "]_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\">>>", "\"_", ",_", "re_", "._", "sub_", "(_", "'<", ".+?", ">", "|<", "/.", "+?", ">'_", ",_", "''_", ",_", "client_", "._", "parse", "DOM_", "(_", "result_", "[_", "1_", "]_", ",_", "'", "a", "'_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t2_", "=_", "re_", "._", "compile_", "(_", "'//", ".+?", "(/", ".+)", "'_", ")_", "._", "findall_", "(_", "t1_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "s", "\"_", ",_", "t2_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ejeschke/ginga/ginga/AstroImage.py
[ { "content": "#\n# AstroImage.py -- Abstraction of an astronomical data image.\n#\n# This is open-source software licensed under a BSD license.\n# Please see the file LICENSE.txt for details.\n#\nimport sys, os\nimport re\nimport math\nimport logging\nimport time\nimport traceback\n\nimport numpy, numpy.ma\n\nfrom ginga.util import wcsmod, io_fits, iohelper\nfrom ginga.util import wcs, iqcalc\nfrom ginga.BaseImage import BaseImage, ImageError, Header\nfrom ginga.misc import Bunch\nfrom ginga import trcalc\nimport ginga.util.six as six\nfrom ginga.util.six.moves import map, zip\n\n\n\n\n#END\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class AstroHeader(Header):\n pass", "metadata": "root.AstroHeader", "header": "['module', '___EOS___']", "index": 24 }, { "content": "class AstroImage(BaseImage):\n \"\"\"\n Abstraction of an astronomical data (image).\n\n NOTE: this module is NOT thread-safe!\n \"\"\"\n # class variables for WCS and IO can be set\n wcsClass = None\n ioClass = None\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 #-----> TODO: merge into wcs.py ?\n #\n\n\n\n\n\n\n\n\n #\n #<----- TODO: merge this into wcs.py ?\n\n\n\n", "metadata": "root.AstroImage", "header": "['module', '___EOS___']", "index": 27 }, { "content": " @classmethod\n def set_wcsClass(cls, klass):\n cls.wcsClass = klass", "metadata": "root.AstroImage.set_wcsClass", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 37 }, { "content": " @classmethod\n def set_ioClass(cls, klass):\n cls.ioClass = klass", "metadata": "root.AstroImage.set_ioClass", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 41 }, { "content": " def __init__(self, data_np=None, metadata=None, logger=None,\n name=None, wcsclass=wcsClass, ioclass=ioClass,\n inherit_primary_header=False):\n\n BaseImage.__init__(self, data_np=data_np, metadata=metadata,\n logger=logger, name=name)\n\n # wcsclass specifies a pluggable WCS module\n if wcsclass is None:\n wcsclass = wcsmod.WCS\n self.wcs = wcsclass(self.logger)\n\n # wcsclass specifies a pluggable IO module\n if ioclass is None:\n ioclass = io_fits.fitsLoaderClass\n self.io = ioclass(self.logger)\n\n self.inherit_primary_header = inherit_primary_header\n if self.inherit_primary_header:\n # User wants to inherit from primary header--this will hold it\n self._primary_hdr = AstroHeader()\n else:\n self._primary_hdr = None\n\n if metadata is not None:\n header = self.get_header()\n self.wcs.load_header(header)\n\n # For navigating multidimensional data\n self.naxispath = []\n self.revnaxis = []\n self._md_data = None", "metadata": "root.AstroImage.__init__", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 46 }, { "content": " def load_hdu(self, hdu, fobj=None, naxispath=None):\n self.clear_metadata()\n\n ahdr = self.get_header()\n\n loader = io_fits.PyFitsFileHandler(self.logger)\n _data, naxispath = loader.load_hdu(hdu, ahdr, naxispath=naxispath)\n # this is a handle to the full data array\n self._md_data = _data\n\n if naxispath is None:\n naxispath = []\n\n # Drill down to 2D data slice\n if len(naxispath) == 0:\n naxispath = ([0] * (len(_data.shape)-2))\n\n self.set_naxispath(naxispath)\n\n # Set PRIMARY header\n if self.inherit_primary_header and fobj is not None:\n self.io.fromHDU(fobj[0], self._primary_hdr)\n\n # Try to make a wcs object on the header\n self.wcs.load_header(hdu.header, fobj=fobj)", "metadata": "root.AstroImage.load_hdu", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 79 }, { "content": " def load_file(self, filepath, numhdu=None, naxispath=None,\n allow_numhdu_override=True):\n self.logger.debug(\"Loading file '%s' ...\" % (filepath))\n self.clear_metadata()\n\n ahdr = self.get_header()\n\n info = iohelper.get_fileinfo(filepath)\n if numhdu is None:\n numhdu = info.numhdu\n\n _data, numhdu_, naxispath = self.io.load_file(info.filepath, ahdr,\n numhdu=numhdu,\n naxispath=naxispath,\n phdr=self._primary_hdr)\n # this is a handle to the full data array\n self._md_data = _data\n\n if naxispath is None:\n naxispath = []\n\n # Drill down to 2D data slice\n if len(naxispath) == 0:\n naxispath = ([0] * (len(_data.shape)-2))\n\n # Set the image name if no name currently exists for this image\n # TODO: should this *change* the existing name, if any?\n if not (self.name is None):\n self.set(name=self.name)\n else:\n name = self.get('name', None)\n if name is None:\n name = info.name\n if ('[' not in name):\n if (numhdu is None) or allow_numhdu_override:\n numhdu = numhdu_\n name += iohelper.get_hdu_suffix(numhdu)\n self.set(name=name)\n\n self.set(path=filepath, idx=numhdu)\n\n self.set_naxispath(naxispath)\n\n # Try to make a wcs object on the header\n # TODO: in order to do more sophisticated WCS (e.g. distortion\n # correction) that requires info in additional headers we need\n # to pass additional information to the wcs class\n #self.wcs.load_header(hdu.header, fobj=fobj)\n self.wcs.load_header(ahdr)", "metadata": "root.AstroImage.load_file", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 105 }, { "content": " def load_buffer(self, data, dims, dtype, byteswap=False,\n metadata=None):\n data = numpy.fromstring(data, dtype=dtype)\n if byteswap:\n data.byteswap(True)\n data = data.reshape(dims)\n self.set_data(data, metadata=metadata)", "metadata": "root.AstroImage.load_buffer", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 156 }, { "content": " def get_mddata(self):\n return self._md_data", "metadata": "root.AstroImage.get_mddata", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 164 }, { "content": " def set_naxispath(self, naxispath):\n \"\"\"Choose a slice out of multidimensional data.\n \"\"\"\n revnaxis = list(naxispath)\n revnaxis.reverse()\n\n # construct slice view and extract it\n view = revnaxis + [slice(None), slice(None)]\n data = self.get_mddata()[view]\n\n assert len(data.shape) == 2, \\\n ImageError(\"naxispath does not lead to a 2D slice: %s\" % (\n str(naxispath)))\n\n self.naxispath = naxispath\n self.revnaxis = revnaxis\n\n self.set_data(data)", "metadata": "root.AstroImage.set_naxispath", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 167 }, { "content": " def set_wcs(self, wcs):\n self.wcs = wcs", "metadata": "root.AstroImage.set_wcs", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 186 }, { "content": " def set_io(self, io):\n self.io = io", "metadata": "root.AstroImage.set_io", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 189 }, { "content": " def get_data_size(self):\n return self.get_size()", "metadata": "root.AstroImage.get_data_size", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 192 }, { "content": " def get_header(self, create=True):\n try:\n # By convention, the fits header is stored in a dictionary\n # under the metadata keyword 'header'\n hdr = self.metadata['header']\n\n if self.inherit_primary_header and self._primary_hdr is not None:\n # Inherit PRIMARY header for display but keep metadata intact\n displayhdr = AstroHeader()\n for key in hdr.keyorder:\n card = hdr.get_card(key)\n bnch = displayhdr.__setitem__(card.key, card.value)\n bnch.comment = card.comment\n for key in self._primary_hdr.keyorder:\n if key not in hdr:\n card = self._primary_hdr.get_card(key)\n bnch = displayhdr.__setitem__(card.key, card.value)\n bnch.comment = card.comment\n else:\n # Normal, separate header\n displayhdr = hdr\n\n except KeyError as e:\n if not create:\n raise e\n #hdr = {}\n hdr = AstroHeader()\n self.metadata['header'] = hdr\n displayhdr = hdr\n\n return displayhdr", "metadata": "root.AstroImage.get_header", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 195 }, { "content": " def get_keyword(self, kwd, *args):\n \"\"\"Get an item from the fits header, if any.\"\"\"\n try:\n kwds = self.get_header()\n return kwds[kwd]\n except KeyError:\n # return a default if there is one\n if len(args) > 0:\n return args[0]\n raise KeyError(kwd)", "metadata": "root.AstroImage.get_keyword", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 227 }, { "content": " def get_keywords_list(self, *args):\n return list(map(self.get_keyword, args))", "metadata": "root.AstroImage.get_keywords_list", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 238 }, { "content": " def set_keyword(self, kwd, value, create=True):\n kwds = self.get_header(create=create)\n kwd = kwd.upper()\n if not create:\n prev = kwds[kwd]\n kwds[kwd] = value", "metadata": "root.AstroImage.set_keyword", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 241 }, { "content": " def update_keywords(self, keyDict):\n hdr = self.get_header()\n # Upcase all keywords\n for kwd, val in keyDict.items():\n hdr[kwd.upper()] = val\n\n # Try to make a wcs object on the header\n if hasattr(self, 'wcs'):\n self.wcs.load_header(hdr)", "metadata": "root.AstroImage.update_keywords", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 248 }, { "content": " def set_keywords(self, **kwds):\n \"\"\"Set an item in the fits header, if any.\"\"\"\n return self.update_keywords(kwds)", "metadata": "root.AstroImage.set_keywords", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 258 }, { "content": " def update_data(self, data_np, metadata=None, astype=None):\n \"\"\"DO NOT USE: this method will be deprecated!\n \"\"\"\n self.set_data(data_np.copy(), metadata=metadata,\n astype=astype)", "metadata": "root.AstroImage.update_data", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 262 }, { "content": " def update_metadata(self, keyDict):\n for key, val in keyDict.items():\n self.metadata[key] = val\n\n # refresh the WCS\n if hasattr(self, 'wcs'):\n header = self.get_header()\n self.wcs.load_header(header)", "metadata": "root.AstroImage.update_metadata", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 268 }, { "content": " def clear_metadata(self):\n self.metadata = {}", "metadata": "root.AstroImage.clear_metadata", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 277 }, { "content": " def transfer(self, other, astype=None):\n data = self._get_data()\n other.update_data(data, astype=astype)\n other.update_metadata(self.metadata)", "metadata": "root.AstroImage.transfer", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 280 }, { "content": " def copy(self, astype=None):\n data = self._get_data()\n other = AstroImage(data, logger=self.logger)\n self.transfer(other, astype=astype)\n return other", "metadata": "root.AstroImage.copy", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 285 }, { "content": " def save_as_file(self, filepath, **kwdargs):\n data = self._get_data()\n header = self.get_header()\n self.io.save_as_file(filepath, data, header, **kwdargs)", "metadata": "root.AstroImage.save_as_file", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 291 }, { "content": " def pixtocoords(self, x, y, system=None, coords='data'):\n args = [x, y] + self.revnaxis\n return self.wcs.pixtocoords(args, system=system, coords=coords)", "metadata": "root.AstroImage.pixtocoords", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 296 }, { "content": " def spectral_coord(self, coords='data'):\n args = [0, 0] + self.revnaxis\n return self.wcs.spectral_coord(args, coords=coords)", "metadata": "root.AstroImage.spectral_coord", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 300 }, { "content": " def pixtoradec(self, x, y, format='deg', coords='data'):\n args = [x, y] + self.revnaxis\n ra_deg, dec_deg = self.wcs.pixtoradec(args, coords=coords)\n\n if format == 'deg':\n return ra_deg, dec_deg\n return wcs.deg2fmt(ra_deg, dec_deg, format)", "metadata": "root.AstroImage.pixtoradec", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 304 }, { "content": " def radectopix(self, ra_deg, dec_deg, format='deg', coords='data'):\n if format != 'deg':\n # convert coordinates to degrees\n ra_deg = wcs.lon_to_deg(ra_deg)\n dec_deg = wcs.lat_to_deg(dec_deg)\n return self.wcs.radectopix(ra_deg, dec_deg, coords=coords,\n naxispath=self.revnaxis)", "metadata": "root.AstroImage.radectopix", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 312 }, { "content": " def get_starsep_XY(self, x1, y1, x2, y2):\n # source point\n ra_org, dec_org = self.pixtoradec(x1, y1)\n\n # destination point\n ra_dst, dec_dst = self.pixtoradec(x2, y2)\n\n return wcs.get_starsep_RaDecDeg(ra_org, dec_org, ra_dst, dec_dst)", "metadata": "root.AstroImage.get_starsep_XY", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 322 }, { "content": " def calc_radius_xy(self, x, y, radius_deg):\n \"\"\"Calculate a radius (in pixels) from the point (x, y) to a circle\n defined by radius in degrees.\n \"\"\"\n # calculate ra/dec of x,y pixel\n ra_deg, dec_deg = self.pixtoradec(x, y)\n\n # Calculate position 1 degree from the given one\n # NOTE: this needs to add in DEC, not RA\n ra2_deg, dec2_deg = wcs.add_offset_radec(ra_deg, dec_deg,\n 0.0, 1.0)\n\n # Calculate the length of this segment--it is pixels/deg\n x2, y2 = self.radectopix(ra2_deg, dec2_deg)\n px_per_deg_e = math.sqrt(math.fabs(x2-x)**2 + math.fabs(y2-y)**2)\n\n # calculate radius based on desired radius_deg\n radius_px = px_per_deg_e * radius_deg\n return radius_px", "metadata": "root.AstroImage.calc_radius_xy", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 331 }, { "content": " def calc_radius_deg2pix(self, ra_deg, dec_deg, delta_deg,\n equinox=None):\n x, y = self.radectopix(ra_deg, dec_deg, equinox=equinox)\n return self.calc_radius_xy(x, y, delta_deg)", "metadata": "root.AstroImage.calc_radius_deg2pix", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 351 }, { "content": " def add_offset_xy(self, x, y, delta_deg_x, delta_deg_y):\n # calculate ra/dec of x,y pixel\n ra_deg, dec_deg = self.pixtoradec(x, y)\n\n # add offsets\n ra2_deg, dec2_deg = wcs.add_offset_radec(ra_deg, dec_deg,\n delta_deg_x, delta_deg_y)\n\n # then back to new pixel coords\n x2, y2 = self.radectopix(ra2_deg, dec2_deg)\n\n return (x2, y2)", "metadata": "root.AstroImage.add_offset_xy", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 356 }, { "content": " def calc_radius_center(self, delta_deg):\n return self.calc_radius_xy(float(self.width / 2.0),\n float(self.height / 2.0),\n delta_deg)", "metadata": "root.AstroImage.calc_radius_center", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 369 }, { "content": " def calc_compass(self, x, y, len_deg_e, len_deg_n):\n\n # Get east and north coordinates\n xe, ye = self.add_offset_xy(x, y, len_deg_e, 0.0)\n xe = int(round(xe))\n ye = int(round(ye))\n xn, yn = self.add_offset_xy(x, y, 0.0, len_deg_n)\n xn = int(round(xn))\n yn = int(round(yn))\n\n return (x, y, xn, yn, xe, ye)", "metadata": "root.AstroImage.calc_compass", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 375 }, { "content": " def calc_compass_radius(self, x, y, radius_px):\n xe, ye = self.add_offset_xy(x, y, 1.0, 0.0)\n xn, yn = self.add_offset_xy(x, y, 0.0, 1.0)\n\n # now calculate the length in pixels of those arcs\n # (planar geometry is good enough here)\n px_per_deg_e = math.sqrt(math.fabs(ye - y)**2 + math.fabs(xe - x)**2)\n px_per_deg_n = math.sqrt(math.fabs(yn - y)**2 + math.fabs(xn - x)**2)\n\n # now calculate the arm length in degrees for each arm\n # (this produces same-length arms)\n len_deg_e = radius_px / px_per_deg_e\n len_deg_n = radius_px / px_per_deg_n\n\n return self.calc_compass(x, y, len_deg_e, len_deg_n)", "metadata": "root.AstroImage.calc_compass_radius", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 387 }, { "content": " def calc_compass_center(self):\n # calculate center of data\n x = float(self.width) / 2.0\n y = float(self.height) / 2.0\n\n # radius we want the arms to be (approx 1/4 the smallest dimension)\n radius_px = float(min(self.width, self.height)) / 4.0\n\n return self.calc_compass_radius(x, y, radius_px)", "metadata": "root.AstroImage.calc_compass_center", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 403 }, { "content": " def get_wcs_rotation_deg(self):\n header = self.get_header()\n (rot, cdelt1, cdelt2) = wcs.get_rotation_and_scale(header)\n return rot", "metadata": "root.AstroImage.get_wcs_rotation_deg", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 415 }, { "content": " def rotate(self, deg, update_wcs=False):\n #old_deg = self.get_wcs_rotation_deg()\n\n super(AstroImage, self).rotate(deg)\n\n # TODO: currently this is not working!\n ## if update_wcs:\n ## self.wcs.rotate(deg)", "metadata": "root.AstroImage.rotate", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 420 }, { "content": " def mosaic_inline(self, imagelist, bg_ref=None, trim_px=None,\n merge=False, allow_expand=True, expand_pad_deg=0.01,\n max_expand_pct=None,\n update_minmax=True, suppress_callback=False):\n \"\"\"Drops new images into the current image (if there is room),\n relocating them according the WCS between the two images.\n \"\"\"\n # Get our own (mosaic) rotation and scale\n header = self.get_header()\n ((xrot_ref, yrot_ref),\n (cdelt1_ref, cdelt2_ref)) = wcs.get_xy_rotation_and_scale(header)\n ref_rot = yrot_ref\n\n scale_x, scale_y = math.fabs(cdelt1_ref), math.fabs(cdelt2_ref)\n\n # drop each image in the right place in the new data array\n mydata = self._get_data()\n\n count = 1\n for image in imagelist:\n name = image.get('name', 'image%d' % (count))\n count += 1\n\n data_np = image._get_data()\n\n # Calculate sky position at the center of the piece\n ctr_x, ctr_y = trcalc.get_center(data_np)\n ra, dec = image.pixtoradec(ctr_x, ctr_y)\n\n # User specified a trim? If so, trim edge pixels from each\n # side of the array\n ht, wd = data_np.shape[:2]\n if trim_px:\n xlo, xhi = trim_px, wd - trim_px\n ylo, yhi = trim_px, ht - trim_px\n data_np = data_np[ylo:yhi, xlo:xhi, ...]\n ht, wd = data_np.shape[:2]\n\n # If caller asked us to match background of pieces then\n # get the median of this piece\n if bg_ref is not None:\n bg = iqcalc.get_median(data_np)\n bg_inc = bg_ref - bg\n #print \"bg=%f inc=%f\" % (bg, bg_inc)\n data_np = data_np + bg_inc\n\n # Determine max/min to update our values\n if update_minmax:\n maxval = numpy.nanmax(data_np)\n minval = numpy.nanmin(data_np)\n self.maxval = max(self.maxval, maxval)\n self.minval = min(self.minval, minval)\n\n # Get rotation and scale of piece\n header = image.get_header()\n ((xrot, yrot),\n (cdelt1, cdelt2)) = wcs.get_xy_rotation_and_scale(header)\n self.logger.debug(\"image(%s) xrot=%f yrot=%f cdelt1=%f cdelt2=%f\" % (\n name, xrot, yrot, cdelt1, cdelt2))\n\n # scale if necessary\n # TODO: combine with rotation?\n if (not numpy.isclose(math.fabs(cdelt1), scale_x) or\n not numpy.isclose(math.fabs(cdelt2), scale_y)):\n nscale_x = math.fabs(cdelt1) / scale_x\n nscale_y = math.fabs(cdelt2) / scale_y\n self.logger.debug(\"scaling piece by x(%f), y(%f)\" % (\n nscale_x, nscale_y))\n data_np, (ascale_x, ascale_y) = trcalc.get_scaled_cutout_basic(\n data_np, 0, 0, wd-1, ht-1, nscale_x, nscale_y)\n\n # Rotate piece into our orientation, according to wcs\n rot_dx, rot_dy = xrot - xrot_ref, yrot - yrot_ref\n\n flip_x = False\n flip_y = False\n\n ## # Flip X due to negative CDELT1\n ## if numpy.sign(cdelt1) < 0:\n ## flip_x = True\n\n ## # Flip Y due to negative CDELT2\n ## if numpy.sign(cdelt2) < 0:\n ## flip_y = True\n\n # Optomization for 180 rotations\n if numpy.isclose(math.fabs(rot_dx), 180.0):\n flip_x = not flip_x\n rot_dx = 0.0\n if numpy.isclose(math.fabs(rot_dy), 180.0):\n flip_y = not flip_y\n rot_dy = 0.0\n\n self.logger.debug(\"flip_x=%s flip_y=%s\" % (flip_x, flip_y))\n if flip_x or flip_y:\n rotdata = trcalc.transform(data_np,\n flip_x=flip_x, flip_y=flip_y)\n else:\n rotdata = data_np\n\n # Finish with any necessary rotation of piece\n if not numpy.isclose(rot_dy, 0.0):\n rot_deg = rot_dy\n self.logger.debug(\"rotating %s by %f deg\" % (name, rot_deg))\n rotdata = trcalc.rotate(rotdata, rot_deg,\n #rotctr_x=ctr_x, rotctr_y=ctr_y\n )\n\n # Get size and data of new image\n ht, wd = rotdata.shape[:2]\n ctr_x, ctr_y = trcalc.get_center(rotdata)\n\n # Find location of image piece (center) in our array\n x0, y0 = self.radectopix(ra, dec)\n\n # Merge piece as closely as possible into our array\n # Unfortunately we lose a little precision rounding to the\n # nearest pixel--can't be helped with this approach\n x0, y0 = int(round(x0)), int(round(y0))\n self.logger.debug(\"Fitting image '%s' into mosaic at %d,%d\" % (\n name, x0, y0))\n\n # This is for useful debugging info only\n my_ctr_x, my_ctr_y = trcalc.get_center(mydata)\n off_x, off_y = x0 - my_ctr_x, y0 - my_ctr_y\n self.logger.debug(\"centering offsets: %d,%d\" % (off_x, off_y))\n\n # Sanity check piece placement\n xlo, xhi = x0 - ctr_x, x0 + wd - ctr_x\n ylo, yhi = y0 - ctr_y, y0 + ht - ctr_y\n assert (xhi - xlo == wd), \\\n Exception(\"Width differential %d != %d\" % (xhi - xlo, wd))\n assert (yhi - ylo == ht), \\\n Exception(\"Height differential %d != %d\" % (yhi - ylo, ht))\n\n mywd, myht = self.get_size()\n if xlo < 0 or xhi > mywd or ylo < 0 or yhi > myht:\n if not allow_expand:\n raise Exception(\"New piece doesn't fit on image and allow_expand=False\")\n\n #<-- Resize our data array to allow the new image\n\n # determine amount to pad expansion by\n expand_x = max(int(expand_pad_deg / scale_x), 0)\n expand_y = max(int(expand_pad_deg / scale_y), 0)\n\n nx1_off, nx2_off = 0, 0\n if xlo < 0:\n nx1_off = abs(xlo) + expand_x\n if xhi > mywd:\n nx2_off = (xhi - mywd) + expand_x\n xlo, xhi = xlo + nx1_off, xhi + nx1_off\n\n ny1_off, ny2_off = 0, 0\n if ylo < 0:\n ny1_off = abs(ylo) + expand_y\n if yhi > myht:\n ny2_off = (yhi - myht) + expand_y\n ylo, yhi = ylo + ny1_off, yhi + ny1_off\n\n new_wd = mywd + nx1_off + nx2_off\n new_ht = myht + ny1_off + ny2_off\n\n # sanity check on new mosaic size\n old_area = mywd * myht\n new_area = new_wd * new_ht\n expand_pct = new_area / old_area\n if ((max_expand_pct is not None) and\n (expand_pct > max_expand_pct)):\n raise Exception(\"New area exceeds current one by %.2f %%;\"\n \"increase max_expand_pct (%.2f) to allow\" %\n (expand_pct*100, max_expand_pct))\n\n # go for it!\n new_data = numpy.zeros((new_ht, new_wd))\n # place current data into new data\n new_data[ny1_off:ny1_off+myht, nx1_off:nx1_off+mywd] = \\\n mydata\n self._data = new_data\n mydata = new_data\n\n if (nx1_off > 0) or (ny1_off > 0):\n # Adjust our WCS for relocation of the reference pixel\n crpix1, crpix2 = self.get_keywords_list('CRPIX1', 'CRPIX2')\n kwds = dict(CRPIX1=crpix1 + nx1_off,\n CRPIX2=crpix2 + ny1_off)\n self.update_keywords(kwds)\n\n # fit image piece into our array\n try:\n if merge:\n mydata[ylo:yhi, xlo:xhi, ...] += rotdata[0:ht, 0:wd, ...]\n else:\n idx = (mydata[ylo:yhi, xlo:xhi, ...] == 0.0)\n mydata[ylo:yhi, xlo:xhi, ...][idx] = \\\n rotdata[0:ht, 0:wd, ...][idx]\n\n except Exception as e:\n self.logger.error(\"Error fitting tile: %s\" % (str(e)))\n raise\n\n # TODO: recalculate min and max values\n # Can't use usual techniques because it adds too much time to the\n # mosacing\n #self._set_minmax()\n\n # Notify watchers that our data has changed\n if not suppress_callback:\n self.make_callback('modified')\n\n return (xlo, ylo, xhi, yhi)", "metadata": "root.AstroImage.mosaic_inline", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 429 }, { "content": " def info_xy(self, data_x, data_y, settings):\n # Get the value under the data coordinates\n try:\n # We report the value across the pixel, even though the coords\n # change halfway across the pixel\n value = self.get_data_xy(int(data_x+0.5), int(data_y+0.5))\n\n except Exception as e:\n value = None\n\n system = settings.get('wcs_coords', None)\n format = settings.get('wcs_display', 'sexagesimal')\n ra_lbl, dec_lbl = six.unichr(945), six.unichr(948)\n\n # Calculate WCS coords, if available\n ts = time.time()\n try:\n if self.wcs is None:\n self.logger.debug(\"No WCS for this image\")\n ra_txt = dec_txt = 'NO WCS'\n\n elif self.wcs.coordsys == 'raw':\n self.logger.debug(\"No coordinate system determined\")\n ra_txt = dec_txt = 'NO WCS'\n\n elif self.wcs.coordsys == 'pixel':\n args = [data_x, data_y] + self.revnaxis\n x, y = self.wcs.pixtosystem(#(data_x, data_y),\n args, system=system, coords='data')\n ra_txt = \"%+.3f\" % (x)\n dec_txt = \"%+.3f\" % (y)\n ra_lbl, dec_lbl = \"X\", \"Y\"\n\n else:\n args = [data_x, data_y] + self.revnaxis\n\n lon_deg, lat_deg = self.wcs.pixtosystem(#(data_x, data_y),\n args, system=system, coords='data')\n\n if format == 'sexagesimal':\n if system in ('galactic', 'ecliptic'):\n sign, deg, min, sec = wcs.degToDms(lon_deg,\n isLatitude=False)\n ra_txt = '+%03d:%02d:%06.3f' % (deg, min, sec)\n else:\n deg, min, sec = wcs.degToHms(lon_deg)\n ra_txt = '%02d:%02d:%06.3f' % (deg, min, sec)\n\n sign, deg, min, sec = wcs.degToDms(lat_deg)\n if sign < 0:\n sign = '-'\n else:\n sign = '+'\n dec_txt = '%s%02d:%02d:%06.3f' % (sign, deg, min, sec)\n\n else:\n ra_txt = '%+10.7f' % (lon_deg)\n dec_txt = '%+10.7f' % (lat_deg)\n\n if system == 'galactic':\n ra_lbl, dec_lbl = \"l\", \"b\"\n elif system == 'ecliptic':\n ra_lbl, dec_lbl = six.unichr(0x03BB), six.unichr(0x03B2)\n elif system == 'helioprojective':\n ra_txt = \"%+5.3f\" % (lon_deg*3600)\n dec_txt = \"%+5.3f\" % (lat_deg*3600)\n ra_lbl, dec_lbl = \"x-Solar\", \"y-Solar\"\n\n except Exception as e:\n self.logger.warning(\"Bad coordinate conversion: %s\" % (\n str(e)))\n ra_txt = 'BAD WCS'\n dec_txt = 'BAD WCS'\n try:\n # log traceback, if possible\n (type_, value_, tb) = sys.exc_info()\n tb_str = \"\".join(traceback.format_tb(tb))\n self.logger.error(\"Traceback:\\n%s\" % (tb_str))\n except Exception:\n tb_str = \"Traceback information unavailable.\"\n self.logger.error(tb_str)\n\n te = time.time() - ts\n #print \"time elapsed: %.4f\" % te\n info = Bunch.Bunch(itype='astro', data_x=data_x, data_y=data_y,\n x=data_x, y=data_y,\n ra_txt=ra_txt, dec_txt=dec_txt,\n ra_lbl=ra_lbl, dec_lbl=dec_lbl,\n value=value)\n return info", "metadata": "root.AstroImage.info_xy", "header": "['class', 'AstroImage', '(', 'BaseImage', ')', ':', '___EOS___']", "index": 641 } ]
[ { "span": "import sys, os", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 14 }, { "span": "import re", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 9 }, { "span": "import logging", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 14 }, { "span": "from ginga.util.six.moves import map, zip", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Astro", "Image", ".", "py", " ", "--", " ", "Abstract", "ion", " ", "of", " ", "an", " ", "astro", "nomi", "cal", " ", "data", " ", "image", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "open", "-", "source", " ", "software", " ", "license", "d", " ", "under", " ", "a", " ", "BS", "D", " ", "license", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ple", "ase", " ", "see", " ", "the", " ", "file", " ", "LICENSE", ".", "txt", " ", "for", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", ",_", "numpy_", "._", "ma_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ging", "a_", "._", "util_", "import_", "wcs", "mod_", ",_", "io", "\\u", "fits_", ",_", "io", "helper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ging", "a_", "._", "util_", "import_", "wcs_", ",_", "iq", "calc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ging", "a_", "._", "Base", "Image_", "import_", "Base", "Image_", ",_", "Image", "Error_", ",_", "Header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ging", "a_", "._", "misc_", "import_", "Bun", "ch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ging", "a_", "import_", "trc", "alc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ging", "a_", "._", "util_", "._", "six_", "as_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ging", "a_", "._", "util_", "._", "six_", "._", "moves_", "import_", "map_", ",_", "zip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "#", "END_", "\\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_", "Astro", "Header_", "(_", "Header_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Abstract", "ion", " ", "of", " ", "an", " ", "astro", "nomi", "cal", " ", "data", " ", "(", "image", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "NOTE", ":", " ", "this", " ", "module", " ", "is", " ", "NOT", " ", "thread", "-", "safe", "!", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "class", " ", "variab", "les", " ", "for", " ", "WC", "S", " ", "and", " ", "IO", " ", "can", " ", "be", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "wcs", "Class_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "io", "Class_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "----", ">", " ", "TOD", "O", ":", " ", "merge", " ", "int", "o", " ", "wcs", ".", "py", " ", "?", "_", "\\u\\u\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "<-", "----", " ", "TOD", "O", ":", " ", "merge", " ", "this", " ", "int", "o", " ", "wcs", ".", "py", " ", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set\\u", "wcs", "Class_", "(_", "cls_", ",_", "klass_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "wcs", "Class_", "=_", "klass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\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_", "set\\u", "io", "Class_", "(_", "cls_", ",_", "klass_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "io", "Class_", "=_", "klass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "data\\u", "np_", "=_", "None_", ",_", "metadata_", "=_", "None_", ",_", "logger_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "None_", ",_", "wcs", "class_", "=_", "wcs", "Class_", ",_", "ioc", "lass_", "=_", "io", "Class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inherit", "\\u", "primary", "\\u", "header_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "Image_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "data\\u", "np_", "=_", "data\\u", "np_", ",_", "metadata_", "=_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logger_", ",_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wcs", "class", " ", "speci", "fie", "s", " ", "a", " ", "plug", "gab", "le", " ", "WC", "S", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "wcs", "class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wcs", "class_", "=_", "wcs", "mod_", "._", "WC", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wcs_", "=_", "wcs", "class_", "(_", "self_", "._", "logger_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wcs", "class", " ", "speci", "fie", "s", " ", "a", " ", "plug", "gab", "le", " ", "IO", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ioc", "lass_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ioc", "lass_", "=_", "io", "\\u", "fits_", "._", "fits", "Load", "er", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "io_", "=_", "ioc", "lass_", "(_", "self_", "._", "logger_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "inherit", "\\u", "primary", "\\u", "header_", "=_", "inherit", "\\u", "primary", "\\u", "header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "inherit", "\\u", "primary", "\\u", "header_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "User", " ", "want", "s", " ", "to", " ", "inherit", " ", "from", " ", "primary", " ", "header", "--", "this", " ", "will", " ", "hold", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "primary", "\\u", "hdr_", "=_", "Astro", "Header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "primary", "\\u", "hdr_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "metadata_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wcs_", "._", "load", "\\u", "header_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "navi", "gati", "ng", " ", "multid", "ime", "nsion", "al", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "na", "xis", "path_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rev", "na", "xis_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "md", "\\u", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "hdu_", "(_", "self_", ",_", "hdu_", ",_", "fobj_", "=_", "None_", ",_", "na", "xis", "path_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "\\u", "metadata_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ah", "dr_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "io", "\\u", "fits_", "._", "Py", "Fit", "s", "File", "Handler_", "(_", "self_", "._", "logger_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "data_", ",_", "na", "xis", "path_", "=_", "loader_", "._", "load", "\\u", "hdu_", "(_", "hdu_", ",_", "ah", "dr_", ",_", "na", "xis", "path_", "=_", "na", "xis", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "a", " ", "handle", " ", "to", " ", "the", " ", "full", " ", "data", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "md", "\\u", "data_", "=_", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "na", "xis", "path_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "na", "xis", "path_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dri", "ll", " ", "down", " ", "to", " ", "2", "D", " ", "data", " ", "slice_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "na", "xis", "path_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "na", "xis", "path_", "=_", "(_", "[_", "0_", "]_", "*_", "(_", "len_", "(_", "\\u", "data_", "._", "shape_", ")_", "-_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set\\u", "na", "xis", "path_", "(_", "na", "xis", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "PRIMA", "RY", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "inherit", "\\u", "primary", "\\u", "header_", "and_", "fobj_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "io_", "._", "from", "HDU", "_", "(_", "fobj_", "[_", "0_", "]_", ",_", "self_", "._", "\\u", "primary", "\\u", "hdr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "make", " ", "a", " ", "wcs", " ", "object", " ", "on", " ", "the", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wcs_", "._", "load", "\\u", "header_", "(_", "hdu_", "._", "header_", ",_", "fobj_", "=_", "fobj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "file_", "(_", "self_", ",_", "filepath_", ",_", "num", "hdu_", "=_", "None_", ",_", "na", "xis", "path_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "\\u", "num", "hdu", "\\u", "override_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "Load", "ing", " ", "file", " ", "'%", "s", "'", " ", "...\"_", "%_", "(_", "filepath_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "metadata_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ah", "dr_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "info_", "=_", "io", "helper_", "._", "get", "\\u", "filein", "fo_", "(_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "num", "hdu_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "num", "hdu_", "=_", "info_", "._", "num", "hdu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "data_", ",_", "num", "hdu", "\\u_", ",_", "na", "xis", "path_", "=_", "self_", "._", "io_", "._", "load", "\\u", "file_", "(_", "info_", "._", "filepath_", ",_", "ah", "dr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "hdu_", "=_", "num", "hdu_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "na", "xis", "path_", "=_", "na", "xis", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ph", "dr_", "=_", "self_", "._", "\\u", "primary", "\\u", "hdr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "a", " ", "handle", " ", "to", " ", "the", " ", "full", " ", "data", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "md", "\\u", "data_", "=_", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "na", "xis", "path_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "na", "xis", "path_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dri", "ll", " ", "down", " ", "to", " ", "2", "D", " ", "data", " ", "slice_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "na", "xis", "path_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "na", "xis", "path_", "=_", "(_", "[_", "0_", "]_", "*_", "(_", "len_", "(_", "\\u", "data_", "._", "shape_", ")_", "-_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "image", " ", "name", " ", "if", " ", "no", " ", "name", " ", "currentl", "y", " ", "exist", "s", " ", "for", " ", "this", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "shou", "ld", " ", "this", " ", "*", "change", "*", " ", "the", " ", "exist", "ing", " ", "name", ",", " ", "if", " ", "any", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "(_", "self_", "._", "name_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set_", "(_", "name_", "=_", "self_", "._", "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 ", " _", "name_", "=_", "self_", "._", "get_", "(_", "'", "name", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "info_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "'['_", "not_", "in_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "(_", "num", "hdu_", "is_", "None_", ")_", "or_", "allow", "\\u", "num", "hdu", "\\u", "override_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "num", "hdu_", "=_", "num", "hdu", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "+=_", "io", "helper_", "._", "get", "\\u", "hdu", "\\u", "suffix_", "(_", "num", "hdu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set_", "(_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set_", "(_", "path_", "=_", "filepath_", ",_", "idx_", "=_", "num", "hdu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "na", "xis", "path_", "(_", "na", "xis", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "make", " ", "a", " ", "wcs", " ", "object", " ", "on", " ", "the", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "in", " ", "order", " ", "to", " ", "do", " ", "more", " ", "sop", "hist", "icat", "ed", " ", "WC", "S", " ", "(", "e", ".", "g", ".", " ", "distort", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "correcti", "on", ")", " ", "tha", "t", " ", "require", "s", " ", "info", " ", "in", " ", "addition", "al", " ", "header", "s", " ", "we", " ", "need", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "to", " ", "pass", " ", "addition", "al", " ", "informati", "on", " ", "to", " ", "the", " ", "wcs", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "wcs", ".", "load", "\\u", "header", "(", "hdu", ".", "header", ",", " ", "fo", "bj", "=", "fo", "bj", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "wcs_", "._", "load", "\\u", "header_", "(_", "ah", "dr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "buffer_", "(_", "self_", ",_", "data_", ",_", "dims_", ",_", "dtype_", ",_", "bytes", "wap", "_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "numpy_", "._", "fromstring_", "(_", "data_", ",_", "dtype_", "=_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "bytes", "wap", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "._", "bytes", "wap", "_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "data_", "._", "reshape_", "(_", "dims_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "data_", "(_", "data_", ",_", "metadata_", "=_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "md", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "md", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "na", "xis", "path_", "(_", "self_", ",_", "na", "xis", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Choose", " ", "a", " ", "slice", " ", "out", " ", "of", " ", "multid", "ime", "nsion", "al", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rev", "na", "xis_", "=_", "list_", "(_", "na", "xis", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rev", "na", "xis_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "construct", " ", "slice", " ", "view", " ", "and", " ", "extract", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "view_", "=_", "rev", "na", "xis_", "+_", "[_", "slice_", "(_", "None_", ")_", ",_", "slice_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "self_", "._", "get", "\\u", "md", "data_", "(_", ")_", "[_", "view_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "data_", "._", "shape_", ")_", "==_", "2_", ",_", "Image", "Error_", "(_", "\"", "na", "xis", "path", " ", "doe", "s", " ", "not", " ", "lead", " ", "to", " ", "a", " ", "2", "D", " ", "slice", ":", " ", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "na", "xis", "path_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "na", "xis", "path_", "=_", "na", "xis", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rev", "na", "xis_", "=_", "rev", "na", "xis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "data_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "wcs_", "(_", "self_", ",_", "wcs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wcs_", "=_", "wcs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "io_", "(_", "self_", ",_", "io_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "io_", "=_", "io_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "data\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "header_", "(_", "self_", ",_", "create_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "By", " ", "convention", ",", " ", "the", " ", "fits", " ", "header", " ", "is", " ", "store", "d", " ", "in", " ", "a", " ", "dictionary_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "under", " ", "the", " ", "metadata", " ", "keyw", "ord", " ", "'", "header", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hdr_", "=_", "self_", "._", "metadata_", "[_", "'", "header", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "inherit", "\\u", "primary", "\\u", "header_", "and_", "self_", "._", "\\u", "primary", "\\u", "hdr_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Inherit", " ", "PRIMA", "RY", " ", "header", " ", "for", " ", "display", " ", "but", " ", "keep", " ", "metadata", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "display", "hdr_", "=_", "Astro", "Header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "hdr_", "._", "key", "order_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "card_", "=_", "hdr_", "._", "get", "\\u", "card_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bn", "ch_", "=_", "display", "hdr_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "card_", "._", "key_", ",_", "card_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bn", "ch_", "._", "comment_", "=_", "card_", "._", "comment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "self_", "._", "\\u", "primary", "\\u", "hdr_", "._", "key", "order_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "key_", "not_", "in_", "hdr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "card_", "=_", "self_", "._", "\\u", "primary", "\\u", "hdr_", "._", "get", "\\u", "card_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bn", "ch_", "=_", "display", "hdr_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "card_", "._", "key_", ",_", "card_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bn", "ch_", "._", "comment_", "=_", "card_", "._", "comment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Normal", ",", " ", "separate", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "display", "hdr_", "=_", "hdr_", "\\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_", "Key", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "create_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "hdr", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hdr_", "=_", "Astro", "Header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "metadata_", "[_", "'", "header", "'_", "]_", "=_", "hdr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "display", "hdr_", "=_", "hdr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "display", "hdr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "keyword_", "(_", "self_", ",_", "kwd", "_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "an", " ", "item", " ", "from", " ", "the", " ", "fits", " ", "header", ",", " ", "if", " ", "any", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwds_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "kwds_", "[_", "kwd", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "a", " ", "default", " ", "if", " ", "there", " ", "is", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Key", "Error_", "(_", "kwd", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "keywords", "\\u", "list_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "list_", "(_", "map_", "(_", "self_", "._", "get", "\\u", "keyword_", ",_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "keyword_", "(_", "self_", ",_", "kwd", "_", ",_", "value_", ",_", "create_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwds_", "=_", "self_", "._", "get", "\\u", "header_", "(_", "create_", "=_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwd", "_", "=_", "kwd", "_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "create_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prev_", "=_", "kwds_", "[_", "kwd", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwds_", "[_", "kwd", "_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "keywords_", "(_", "self_", ",_", "key", "Dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hdr_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Up", "case", " ", "all", " ", "keywords_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "kwd", "_", ",_", "val_", "in_", "key", "Dict_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hdr_", "[_", "kwd", "_", "._", "upper_", "(_", ")_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "make", " ", "a", " ", "wcs", " ", "object", " ", "on", " ", "the", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "'", "wcs", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wcs_", "._", "load", "\\u", "header_", "(_", "hdr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "keywords_", "(_", "self_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "an", " ", "item", " ", "in", " ", "the", " ", "fits", " ", "header", ",", " ", "if", " ", "any", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "update", "\\u", "keywords_", "(_", "kwds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "data_", "(_", "self_", ",_", "data\\u", "np_", ",_", "metadata_", "=_", "None_", ",_", "astype_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "DO", " ", "NOT", " ", "USE", ":", " ", "this", " ", "method", " ", "will", " ", "be", " ", "depre", "cated", "!", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "data_", "(_", "data\\u", "np_", "._", "copy_", "(_", ")_", ",_", "metadata_", "=_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "astype_", "=_", "astype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "metadata_", "(_", "self_", ",_", "key", "Dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "val_", "in_", "key", "Dict_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "metadata_", "[_", "key_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "refre", "sh", " ", "the", " ", "WC", "S_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "'", "wcs", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wcs_", "._", "load", "\\u", "header_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\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_", "clear", "\\u", "metadata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "metadata_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "transfer_", "(_", "self_", ",_", "other_", ",_", "astype_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "self_", "._", "\\u", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other_", "._", "update", "\\u", "data_", "(_", "data_", ",_", "astype_", "=_", "astype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other_", "._", "update", "\\u", "metadata_", "(_", "self_", "._", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "copy_", "(_", "self_", ",_", "astype_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "self_", "._", "\\u", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other_", "=_", "Astro", "Image_", "(_", "data_", ",_", "logger_", "=_", "self_", "._", "logger_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "transfer_", "(_", "other_", ",_", "astype_", "=_", "astype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "other_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "as", "\\u", "file_", "(_", "self_", ",_", "filepath_", ",_", "**_", "kwd", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "self_", "._", "\\u", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "io_", "._", "save", "\\u", "as", "\\u", "file_", "(_", "filepath_", ",_", "data_", ",_", "header_", ",_", "**_", "kwd", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pix", "toco", "ords_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "system_", "=_", "None_", ",_", "coords_", "=_", "'", "data", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "x_", ",_", "y_", "]_", "+_", "self_", "._", "rev", "na", "xis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "wcs_", "._", "pix", "toco", "ords_", "(_", "args_", ",_", "system_", "=_", "system_", ",_", "coords_", "=_", "coords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "spectral", "\\u", "coord_", "(_", "self_", ",_", "coords_", "=_", "'", "data", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "0_", ",_", "0_", "]_", "+_", "self_", "._", "rev", "na", "xis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "wcs_", "._", "spectral", "\\u", "coord_", "(_", "args_", ",_", "coords_", "=_", "coords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pix", "tora", "dec_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "format_", "=_", "'", "deg", "'_", ",_", "coords_", "=_", "'", "data", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "x_", ",_", "y_", "]_", "+_", "self_", "._", "rev", "na", "xis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", "=_", "self_", "._", "wcs_", "._", "pix", "tora", "dec_", "(_", "args_", ",_", "coords_", "=_", "coords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "format_", "==_", "'", "deg", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wcs_", "._", "deg", "2f", "mt_", "(_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", ",_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rade", "cto", "pix_", "(_", "self_", ",_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", ",_", "format_", "=_", "'", "deg", "'_", ",_", "coords_", "=_", "'", "data", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "format_", "!=_", "'", "deg", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "convert", " ", "coordinate", "s", " ", "to", " ", "degrees_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ra", "\\u", "deg_", "=_", "wcs_", "._", "lon", "\\u", "to", "\\u", "deg_", "(_", "ra", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dec", "\\u", "deg_", "=_", "wcs_", "._", "lat", "\\u", "to", "\\u", "deg_", "(_", "dec", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "wcs_", "._", "rade", "cto", "pix_", "(_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", ",_", "coords_", "=_", "coords_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "na", "xis", "path_", "=_", "self_", "._", "rev", "na", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "star", "sep", "\\u", "XY_", "(_", "self_", ",_", "x1_", ",_", "y1_", ",_", "x2_", ",_", "y2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "source", " ", "point_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ra", "\\u", "org_", ",_", "dec", "\\u", "org_", "=_", "self_", "._", "pix", "tora", "dec_", "(_", "x1_", ",_", "y1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "destinat", "ion", " ", "point_", "\\u\\u\\uNL\\u\\u\\u_", "ra", "\\u", "dst_", ",_", "dec", "\\u", "dst_", "=_", "self_", "._", "pix", "tora", "dec_", "(_", "x2_", ",_", "y2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "wcs_", "._", "get", "\\u", "star", "sep", "\\u", "Ra", "De", "c", "Deg", "_", "(_", "ra", "\\u", "org_", ",_", "dec", "\\u", "org_", ",_", "ra", "\\u", "dst_", ",_", "dec", "\\u", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calc", "\\u", "radi", "us", "\\u", "xy_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "radi", "us", "\\u", "deg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Calculat", "e", " ", "a", " ", "radi", "us", " ", "(", "in", " ", "pixel", "s", ")", " ", "from", " ", "the", " ", "point", " ", "(", "x", ",", " ", "y", ")", " ", "to", " ", "a", " ", "circle", "\\", "10", ";", " ", " ", " ", " ", "defin", "ed", " ", "by", " ", "radi", "us", " ", "in", " ", "degr", "ees", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "calcul", "ate", " ", "ra", "/", "dec", " ", "of", " ", "x", ",", "y", " ", "pixel_", "\\u\\u\\uNL\\u\\u\\u_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", "=_", "self_", "._", "pix", "tora", "dec_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "position", " ", "1", " ", "degr", "ee", " ", "from", " ", "the", " ", "give", "n", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "this", " ", "need", "s", " ", "to", " ", "add", " ", "in", " ", "DEC", ",", " ", "not", " ", "RA_", "\\u\\u\\uNL\\u\\u\\u_", "ra", "2", "\\u", "deg_", ",_", "dec", "2", "\\u", "deg_", "=_", "wcs_", "._", "add", "\\u", "offset", "\\u", "rade", "c_", "(_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0.0_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "the", " ", "length", " ", "of", " ", "this", " ", "segment", "--", "it", " ", "is", " ", "pixel", "s", "/", "deg_", "\\u\\u\\uNL\\u\\u\\u_", "x2_", ",_", "y2_", "=_", "self_", "._", "rade", "cto", "pix_", "(_", "ra", "2", "\\u", "deg_", ",_", "dec", "2", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "px", "\\u", "per", "\\u", "deg", "\\u", "e_", "=_", "math_", "._", "sqrt_", "(_", "math_", "._", "fabs_", "(_", "x2_", "-_", "x_", ")_", "**_", "2_", "+_", "math_", "._", "fabs_", "(_", "y2_", "-_", "y_", ")_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "calcul", "ate", " ", "radi", "us", " ", "based", " ", "on", " ", "desi", "red", " ", "radi", "us", "\\u", "deg_", "\\u\\u\\uNL\\u\\u\\u_", "radi", "us", "\\u", "px_", "=_", "px", "\\u", "per", "\\u", "deg", "\\u", "e_", "*_", "radi", "us", "\\u", "deg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "radi", "us", "\\u", "px_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calc", "\\u", "radi", "us", "\\u", "deg", "2p", "ix_", "(_", "self_", ",_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", ",_", "delta", "\\u", "deg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "equi", "nox", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", ",_", "y_", "=_", "self_", "._", "rade", "cto", "pix_", "(_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", ",_", "equi", "nox", "_", "=_", "equi", "nox", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "calc", "\\u", "radi", "us", "\\u", "xy_", "(_", "x_", ",_", "y_", ",_", "delta", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "offset", "\\u", "xy_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "delta", "\\u", "deg", "\\u", "x_", ",_", "delta", "\\u", "deg", "\\u", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "calcul", "ate", " ", "ra", "/", "dec", " ", "of", " ", "x", ",", "y", " ", "pixel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", "=_", "self_", "._", "pix", "tora", "dec_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "offsets_", "\\u\\u\\uNL\\u\\u\\u_", "ra", "2", "\\u", "deg_", ",_", "dec", "2", "\\u", "deg_", "=_", "wcs_", "._", "add", "\\u", "offset", "\\u", "rade", "c_", "(_", "ra", "\\u", "deg_", ",_", "dec", "\\u", "deg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "delta", "\\u", "deg", "\\u", "x_", ",_", "delta", "\\u", "deg", "\\u", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "back", " ", "to", " ", "new", " ", "pixel", " ", "coords_", "\\u\\u\\uNL\\u\\u\\u_", "x2_", ",_", "y2_", "=_", "self_", "._", "rade", "cto", "pix_", "(_", "ra", "2", "\\u", "deg_", ",_", "dec", "2", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "x2_", ",_", "y2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calc", "\\u", "radi", "us", "\\u", "center_", "(_", "self_", ",_", "delta", "\\u", "deg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "calc", "\\u", "radi", "us", "\\u", "xy_", "(_", "float_", "(_", "self_", "._", "width_", "/_", "2.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "float_", "(_", "self_", "._", "height_", "/_", "2.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "delta", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calc", "\\u", "compass", "_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "len", "\\u", "deg", "\\u", "e_", ",_", "len", "\\u", "deg", "\\u", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "east", " ", "and", " ", "north", " ", "coordinates_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xe_", ",_", "ye", "_", "=_", "self_", "._", "add", "\\u", "offset", "\\u", "xy_", "(_", "x_", ",_", "y_", ",_", "len", "\\u", "deg", "\\u", "e_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xe_", "=_", "int_", "(_", "round_", "(_", "xe_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ye", "_", "=_", "int_", "(_", "round_", "(_", "ye", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xn_", ",_", "yn_", "=_", "self_", "._", "add", "\\u", "offset", "\\u", "xy_", "(_", "x_", ",_", "y_", ",_", "0.0_", ",_", "len", "\\u", "deg", "\\u", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xn_", "=_", "int_", "(_", "round_", "(_", "xn_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yn_", "=_", "int_", "(_", "round_", "(_", "yn_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "x_", ",_", "y_", ",_", "xn_", ",_", "yn_", ",_", "xe_", ",_", "ye", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calc", "\\u", "compass", "\\u", "radius_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "radi", "us", "\\u", "px_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xe_", ",_", "ye", "_", "=_", "self_", "._", "add", "\\u", "offset", "\\u", "xy_", "(_", "x_", ",_", "y_", ",_", "1.0_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xn_", ",_", "yn_", "=_", "self_", "._", "add", "\\u", "offset", "\\u", "xy_", "(_", "x_", ",_", "y_", ",_", "0.0_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "calcul", "ate", " ", "the", " ", "length", " ", "in", " ", "pixel", "s", " ", "of", " ", "tho", "se", " ", "arcs", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "plan", "ar", " ", "geom", "etry", " ", "is", " ", "good", " ", "eno", "ugh", " ", "here", ")_", "\\u\\u\\uNL\\u\\u\\u_", "px", "\\u", "per", "\\u", "deg", "\\u", "e_", "=_", "math_", "._", "sqrt_", "(_", "math_", "._", "fabs_", "(_", "ye", "_", "-_", "y_", ")_", "**_", "2_", "+_", "math_", "._", "fabs_", "(_", "xe_", "-_", "x_", ")_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "px", "\\u", "per", "\\u", "deg", "\\u", "n_", "=_", "math_", "._", "sqrt_", "(_", "math_", "._", "fabs_", "(_", "yn_", "-_", "y_", ")_", "**_", "2_", "+_", "math_", "._", "fabs_", "(_", "xn_", "-_", "x_", ")_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "calcul", "ate", " ", "the", " ", "arm", " ", "length", " ", "in", " ", "degr", "ees", " ", "for", " ", "each", " ", "arm_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "this", " ", "produce", "s", " ", "same", "-", "length", " ", "arms", ")_", "\\u\\u\\uNL\\u\\u\\u_", "len", "\\u", "deg", "\\u", "e_", "=_", "radi", "us", "\\u", "px_", "/_", "px", "\\u", "per", "\\u", "deg", "\\u", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "len", "\\u", "deg", "\\u", "n_", "=_", "radi", "us", "\\u", "px_", "/_", "px", "\\u", "per", "\\u", "deg", "\\u", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "calc", "\\u", "compass", "_", "(_", "x_", ",_", "y_", ",_", "len", "\\u", "deg", "\\u", "e_", ",_", "len", "\\u", "deg", "\\u", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calc", "\\u", "compass", "\\u", "center_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "calcul", "ate", " ", "center", " ", "of", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "float_", "(_", "self_", "._", "width_", ")_", "/_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "float_", "(_", "self_", "._", "height_", ")_", "/_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "radi", "us", " ", "we", " ", "want", " ", "the", " ", "arms", " ", "to", " ", "be", " ", "(", "approx", " ", "1", "/", "4", " ", "the", " ", "smallest", " ", "dimension", ")_", "\\u\\u\\uNL\\u\\u\\u_", "radi", "us", "\\u", "px_", "=_", "float_", "(_", "min_", "(_", "self_", "._", "width_", ",_", "self_", "._", "height_", ")_", ")_", "/_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "calc", "\\u", "compass", "\\u", "radius_", "(_", "x_", ",_", "y_", ",_", "radi", "us", "\\u", "px_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "wcs", "\\u", "rotati", "on", "\\u", "deg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "rot_", ",_", "cde", "lt", "1_", ",_", "cde", "lt", "2_", ")_", "=_", "wcs_", "._", "get", "\\u", "rotati", "on", "\\u", "and", "\\u", "scale_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "rot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rotate_", "(_", "self_", ",_", "deg_", ",_", "update", "\\u", "wcs_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "old", "\\u", "deg", " ", "=", " ", "self", ".", "get", "\\u", "wcs", "\\u", "rotati", "on", "\\u", "deg", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Astro", "Image_", ",_", "self_", ")_", "._", "rotate_", "(_", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "currentl", "y", " ", "this", " ", "is", " ", "not", " ", "working", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "if", " ", "update", "\\u", "wcs", ":_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "self", ".", "wcs", ".", "rota", "te", "(", "deg", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mosaic", "\\u", "inline_", "(_", "self_", ",_", "image", "list_", ",_", "bg", "\\u", "ref_", "=_", "None_", ",_", "trim", "\\u", "px_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "merge_", "=_", "False_", ",_", "allow", "\\u", "expand_", "=_", "True_", ",_", "expand", "\\u", "pad", "\\u", "deg_", "=_", "0.01_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "expand", "\\u", "pct_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "minmax", "_", "=_", "True_", ",_", "suppress", "\\u", "callback_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Drop", "s", " ", "new", " ", "images", " ", "int", "o", " ", "the", " ", "current", " ", "image", " ", "(", "if", " ", "there", " ", "is", " ", "room", "),", "\\", "10", ";", " ", " ", " ", " ", "relocat", "ing", " ", "them", " ", "according", " ", "the", " ", "WC", "S", " ", "bet", "ween", " ", "the", " ", "two", " ", "images", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "our", " ", "own", " ", "(", "mosaic", ")", " ", "rotati", "on", " ", "and", " ", "scale_", "\\u\\u\\uNL\\u\\u\\u_", "header_", "=_", "self_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "(_", "xr", "ot", "\\u", "ref_", ",_", "yro", "t", "\\u", "ref_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "cde", "lt", "1", "\\u", "ref_", ",_", "cde", "lt", "2", "\\u", "ref_", ")_", ")_", "=_", "wcs_", "._", "get", "\\u", "xy", "\\u", "rotati", "on", "\\u", "and", "\\u", "scale_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ref", "\\u", "rot_", "=_", "yro", "t", "\\u", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "scale", "\\u", "x_", ",_", "scale", "\\u", "y_", "=_", "math_", "._", "fabs_", "(_", "cde", "lt", "1", "\\u", "ref_", ")_", ",_", "math_", "._", "fabs_", "(_", "cde", "lt", "2", "\\u", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "drop", " ", "each", " ", "image", " ", "in", " ", "the", " ", "right", " ", "place", " ", "in", " ", "the", " ", "new", " ", "data", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "mydat", "a_", "=_", "self_", "._", "\\u", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "image", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "image_", "._", "get_", "(_", "'", "name", "'_", ",_", "'", "image", "%", "d", "'_", "%_", "(_", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "np_", "=_", "image_", "._", "\\u", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "sky", " ", "position", " ", "at", " ", "the", " ", "center", " ", "of", " ", "the", " ", "piece_", "\\u\\u\\uNL\\u\\u\\u_", "ctr", "\\u", "x_", ",_", "ctr", "\\u", "y_", "=_", "trc", "alc", "_", "._", "get", "\\u", "center_", "(_", "data\\u", "np_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra_", ",_", "dec_", "=_", "image_", "._", "pix", "tora", "dec_", "(_", "ctr", "\\u", "x_", ",_", "ctr", "\\u", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "User", " ", "specified", " ", "a", " ", "trim", "?", " ", " ", "If", " ", "so", ",", " ", "trim", " ", "edge", " ", "pixel", "s", " ", "from", " ", "each_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "side", " ", "of", " ", "the", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "ht_", ",_", "wd_", "=_", "data\\u", "np_", "._", "shape_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "trim", "\\u", "px_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xlo", "_", ",_", "xh", "i_", "=_", "trim", "\\u", "px_", ",_", "wd_", "-_", "trim", "\\u", "px_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ylo", "_", ",_", "yh", "i_", "=_", "trim", "\\u", "px_", ",_", "ht_", "-_", "trim", "\\u", "px_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "np_", "=_", "data\\u", "np_", "[_", "ylo", "_", ":_", "yh", "i_", ",_", "xlo", "_", ":_", "xh", "i_", ",_", "..._", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ht_", ",_", "wd_", "=_", "data\\u", "np_", "._", "shape_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "caller", " ", "ask", "ed", " ", "us", " ", "to", " ", "match", " ", "background", " ", "of", " ", "piece", "s", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "median", " ", "of", " ", "this", " ", "piece_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "bg", "\\u", "ref_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bg_", "=_", "iq", "calc_", "._", "get", "\\u", "median_", "(_", "data\\u", "np_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bg", "\\u", "inc_", "=_", "bg", "\\u", "ref_", "-_", "bg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "bg", "=", "%", "f", " ", "inc", "=", "%", "f", "\"", " ", "%", " ", "(", "bg", ",", " ", "bg", "\\u", "inc", ")_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "np_", "=_", "data\\u", "np_", "+_", "bg", "\\u", "inc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Det", "erm", "ine", " ", "max", "/", "min", " ", "to", " ", "update", " ", "our", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "update", "\\u", "minmax", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "maxval_", "=_", "numpy_", "._", "nanm", "ax_", "(_", "data\\u", "np_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minval_", "=_", "numpy_", "._", "nanm", "in_", "(_", "data\\u", "np_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "maxval_", "=_", "max_", "(_", "self_", "._", "maxval_", ",_", "maxval_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "minval_", "=_", "min_", "(_", "self_", "._", "minval_", ",_", "minval_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "rotati", "on", " ", "and", " ", "scale", " ", "of", " ", "piece_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "header_", "=_", "image_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "(_", "xr", "ot_", ",_", "yro", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "cde", "lt", "1_", ",_", "cde", "lt", "2_", ")_", ")_", "=_", "wcs_", "._", "get", "\\u", "xy", "\\u", "rotati", "on", "\\u", "and", "\\u", "scale_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "image", "(%", "s", ")", " ", "xr", "ot", "=", "%", "f", " ", "yro", "t", "=", "%", "f", " ", "cde", "lt", "1", "=", "%", "f", " ", "cde", "lt", "2", "=", "%", "f", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "xr", "ot_", ",_", "yro", "t_", ",_", "cde", "lt", "1_", ",_", "cde", "lt", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scale", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "combin", "e", " ", "with", " ", "rotati", "on", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "not_", "numpy_", "._", "isclose_", "(_", "math_", "._", "fabs_", "(_", "cde", "lt", "1_", ")_", ",_", "scale", "\\u", "x_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "numpy_", "._", "isclose_", "(_", "math_", "._", "fabs_", "(_", "cde", "lt", "2_", ")_", ",_", "scale", "\\u", "y_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nsc", "ale", "\\u", "x_", "=_", "math_", "._", "fabs_", "(_", "cde", "lt", "1_", ")_", "/_", "scale", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nsc", "ale", "\\u", "y_", "=_", "math_", "._", "fabs_", "(_", "cde", "lt", "2_", ")_", "/_", "scale", "\\u", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "scal", "ing", " ", "piece", " ", "by", " ", "x", "(%", "f", "),", " ", "y", "(%", "f", ")\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "nsc", "ale", "\\u", "x_", ",_", "nsc", "ale", "\\u", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "np_", ",_", "(_", "asc", "ale", "\\u", "x_", ",_", "asc", "ale", "\\u", "y_", ")_", "=_", "trc", "alc", "_", "._", "get", "\\u", "scale", "d\\u", "cuto", "ut", "\\u", "basic_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "np_", ",_", "0_", ",_", "0_", ",_", "wd_", "-_", "1_", ",_", "ht_", "-_", "1_", ",_", "nsc", "ale", "\\u", "x_", ",_", "nsc", "ale", "\\u", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rotate", " ", "piece", " ", "int", "o", " ", "our", " ", "orientation", ",", " ", "according", " ", "to", " ", "wcs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rot", "\\u", "dx_", ",_", "rot", "\\u", "dy_", "=_", "xr", "ot_", "-_", "xr", "ot", "\\u", "ref_", ",_", "yro", "t_", "-_", "yro", "t", "\\u", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "flip", "\\u", "x_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flip", "\\u", "y_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "#", " ", "Flip", " ", "X", " ", "due", " ", "to", " ", "negati", "ve", " ", "CD", "EL", "T1_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "if", " ", "nump", "y", ".", "sign", "(", "cde", "lt", "1", ")", " ", "<", " ", "0", ":_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "flip", "\\u", "x", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "#", " ", "Flip", " ", "Y", " ", "due", " ", "to", " ", "negati", "ve", " ", "CD", "EL", "T2_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "if", " ", "nump", "y", ".", "sign", "(", "cde", "lt", "2", ")", " ", "<", " ", "0", ":_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "flip", "\\u", "y", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Opt", "omi", "zatio", "n", " ", "for", " ", "180", " ", "rotations", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "numpy_", "._", "isclose_", "(_", "math_", "._", "fabs_", "(_", "rot", "\\u", "dx_", ")_", ",_", "180.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flip", "\\u", "x_", "=_", "not_", "flip", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rot", "\\u", "dx_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "numpy_", "._", "isclose_", "(_", "math_", "._", "fabs_", "(_", "rot", "\\u", "dy_", ")_", ",_", "180.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flip", "\\u", "y_", "=_", "not_", "flip", "\\u", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rot", "\\u", "dy_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "flip", "\\u", "x", "=", "%", "s", " ", "flip", "\\u", "y", "=", "%", "s", "\"_", "%_", "(_", "flip", "\\u", "x_", ",_", "flip", "\\u", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "flip", "\\u", "x_", "or_", "flip", "\\u", "y_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rot", "data_", "=_", "trc", "alc", "_", "._", "transform_", "(_", "data\\u", "np_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "flip", "\\u", "x_", "=_", "flip", "\\u", "x_", ",_", "flip", "\\u", "y_", "=_", "flip", "\\u", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rot", "data_", "=_", "data\\u", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Finish", " ", "with", " ", "any", " ", "necessar", "y", " ", "rotati", "on", " ", "of", " ", "piece_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "numpy_", "._", "isclose_", "(_", "rot", "\\u", "dy_", ",_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rot", "\\u", "deg_", "=_", "rot", "\\u", "dy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "rotati", "ng", " ", "%", "s", " ", "by", " ", "%", "f", " ", "deg", "\"_", "%_", "(_", "name_", ",_", "rot", "\\u", "deg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rot", "data_", "=_", "trc", "alc", "_", "._", "rotate_", "(_", "rot", "data_", ",_", "rot", "\\u", "deg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "rot", "ctr", "\\u", "x", "=", "ctr", "\\u", "x", ",", " ", "rot", "ctr", "\\u", "y", "=", "ctr", "\\u", "y_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "size", " ", "and", " ", "data", " ", "of", " ", "new", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ht_", ",_", "wd_", "=_", "rot", "data_", "._", "shape_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctr", "\\u", "x_", ",_", "ctr", "\\u", "y_", "=_", "trc", "alc", "_", "._", "get", "\\u", "center_", "(_", "rot", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "location", " ", "of", " ", "image", " ", "piece", " ", "(", "center", ")", " ", "in", " ", "our", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "x0_", ",_", "y0_", "=_", "self_", "._", "rade", "cto", "pix_", "(_", "ra_", ",_", "dec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Merge", " ", "piece", " ", "as", " ", "close", "ly", " ", "as", " ", "possib", "le", " ", "int", "o", " ", "our", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Unf", "ort", "unat", "el", "y", " ", "we", " ", "lose", " ", "a", " ", "litt", "le", " ", "preci", "sion", " ", "rounding", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "near", "est", " ", "pixel", "--", "can", "'", "t", " ", "be", " ", "help", "ed", " ", "with", " ", "this", " ", "appro", "ach", "_", "\\u\\u\\uNL\\u\\u\\u_", "x0_", ",_", "y0_", "=_", "int_", "(_", "round_", "(_", "x0_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "y0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "Fitt", "ing", " ", "image", " ", "'%", "s", "'", " ", "int", "o", " ", "mosaic", " ", "at", " ", "%", "d", ",%", "d", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "x0_", ",_", "y0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "for", " ", "usef", "ul", " ", "debugg", "ing", " ", "info", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "my", "\\u", "ctr", "\\u", "x_", ",_", "my", "\\u", "ctr", "\\u", "y_", "=_", "trc", "alc", "_", "._", "get", "\\u", "center_", "(_", "mydat", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "off", "\\u", "x_", ",_", "off", "\\u", "y_", "=_", "x0_", "-_", "my", "\\u", "ctr", "\\u", "x_", ",_", "y0_", "-_", "my", "\\u", "ctr", "\\u", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "center", "ing", " ", "offset", "s", ":", " ", "%", "d", ",%", "d", "\"_", "%_", "(_", "off", "\\u", "x_", ",_", "off", "\\u", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sanit", "y", " ", "check", " ", "piece", " ", "placement_", "\\u\\u\\uNL\\u\\u\\u_", "xlo", "_", ",_", "xh", "i_", "=_", "x0_", "-_", "ctr", "\\u", "x_", ",_", "x0_", "+_", "wd_", "-_", "ctr", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ylo", "_", ",_", "yh", "i_", "=_", "y0_", "-_", "ctr", "\\u", "y_", ",_", "y0_", "+_", "ht_", "-_", "ctr", "\\u", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "xh", "i_", "-_", "xlo", "_", "==_", "wd_", ")_", ",_", "Exception_", "(_", "\"", "Wid", "th", " ", "differential", " ", "%", "d", " ", "!=", " ", "%", "d", "\"_", "%_", "(_", "xh", "i_", "-_", "xlo", "_", ",_", "wd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "yh", "i_", "-_", "ylo", "_", "==_", "ht_", ")_", ",_", "Exception_", "(_", "\"", "Hei", "ght", " ", "differential", " ", "%", "d", " ", "!=", " ", "%", "d", "\"_", "%_", "(_", "yh", "i_", "-_", "ylo", "_", ",_", "ht_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "my", "wd_", ",_", "myh", "t_", "=_", "self_", "._", "get", "\\u", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "xlo", "_", "<_", "0_", "or_", "xh", "i_", ">_", "my", "wd_", "or_", "ylo", "_", "<_", "0_", "or_", "yh", "i_", ">_", "myh", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "allow", "\\u", "expand_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "(_", "\"", "New", " ", "piece", " ", "doe", "sn", "'", "t", " ", "fit", " ", "on", " ", "image", " ", "and", " ", "allow", "\\u", "expand", "=", "Fal", "se", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "<-", "-", " ", "Resize", " ", "our", " ", "data", " ", "array", " ", "to", " ", "allow", " ", "the", " ", "new", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dete", "rmin", "e", " ", "amo", "unt", " ", "to", " ", "pad", " ", "expansion", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expand", "\\u", "x_", "=_", "max_", "(_", "int_", "(_", "expand", "\\u", "pad", "\\u", "deg_", "/_", "scale", "\\u", "x_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expand", "\\u", "y_", "=_", "max_", "(_", "int_", "(_", "expand", "\\u", "pad", "\\u", "deg_", "/_", "scale", "\\u", "y_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nx", "1", "\\u", "off_", ",_", "nx", "2", "\\u", "off_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "xlo", "_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "nx", "1", "\\u", "off_", "=_", "abs_", "(_", "xlo", "_", ")_", "+_", "expand", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "xh", "i_", ">_", "my", "wd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "nx", "2", "\\u", "off_", "=_", "(_", "xh", "i_", "-_", "my", "wd_", ")_", "+_", "expand", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xlo", "_", ",_", "xh", "i_", "=_", "xlo", "_", "+_", "nx", "1", "\\u", "off_", ",_", "xh", "i_", "+_", "nx", "1", "\\u", "off_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ny", "1", "\\u", "off_", ",_", "ny", "2", "\\u", "off_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ylo", "_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ny", "1", "\\u", "off_", "=_", "abs_", "(_", "ylo", "_", ")_", "+_", "expand", "\\u", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "yh", "i_", ">_", "myh", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ny", "2", "\\u", "off_", "=_", "(_", "yh", "i_", "-_", "myh", "t_", ")_", "+_", "expand", "\\u", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ylo", "_", ",_", "yh", "i_", "=_", "ylo", "_", "+_", "ny", "1", "\\u", "off_", ",_", "yh", "i_", "+_", "ny", "1", "\\u", "off_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "wd_", "=_", "my", "wd_", "+_", "nx", "1", "\\u", "off_", "+_", "nx", "2", "\\u", "off_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "ht_", "=_", "myh", "t_", "+_", "ny", "1", "\\u", "off_", "+_", "ny", "2", "\\u", "off_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sanity", " ", "check", " ", "on", " ", "new", " ", "mosaic", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "area_", "=_", "my", "wd_", "*_", "myh", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "area_", "=_", "new", "\\u", "wd_", "*_", "new", "\\u", "ht_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expand", "\\u", "pct_", "=_", "new", "\\u", "area_", "/_", "old", "\\u", "area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "max", "\\u", "expand", "\\u", "pct_", "is_", "not_", "None_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "expand", "\\u", "pct_", ">_", "max", "\\u", "expand", "\\u", "pct_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "(_", "\"", "New", " ", "area", " ", "exceed", "s", " ", "current", " ", "one", " ", "by", " ", "%", ".2", "f", " ", "%%", ";\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "increase", " ", "max", "\\u", "expand", "\\u", "pct", " ", "(%", ".2", "f", ")", " ", "to", " ", "allow", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "expand", "\\u", "pct_", "*_", "100_", ",_", "max", "\\u", "expand", "\\u", "pct_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "go", " ", "for", " ", "it", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "data_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "new", "\\u", "ht_", ",_", "new", "\\u", "wd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "place", " ", "current", " ", "data", " ", "int", "o", " ", "new", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "data_", "[_", "ny", "1", "\\u", "off_", ":_", "ny", "1", "\\u", "off_", "+_", "myh", "t_", ",_", "nx", "1", "\\u", "off_", ":_", "nx", "1", "\\u", "off_", "+_", "my", "wd_", "]_", "=_", "mydat", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "data_", "=_", "new", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydat", "a_", "=_", "new", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "nx", "1", "\\u", "off_", ">_", "0_", ")_", "or_", "(_", "ny", "1", "\\u", "off_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Adjust", " ", "our", " ", "WC", "S", " ", "for", " ", "relocat", "ion", " ", "of", " ", "the", " ", "reference", " ", "pixel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cr", "pix", "1_", ",_", "cr", "pix", "2_", "=_", "self_", "._", "get", "\\u", "keywords", "\\u", "list_", "(_", "'", "CR", "PIX", "1", "'_", ",_", "'", "CR", "PIX", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwds_", "=_", "dict_", "(_", "CR", "PIX", "1_", "=_", "cr", "pix", "1_", "+_", "nx", "1", "\\u", "off_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "CR", "PIX", "2_", "=_", "cr", "pix", "2_", "+_", "ny", "1", "\\u", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "\\u", "keywords_", "(_", "kwds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fit", " ", "image", " ", "piece", " ", "int", "o", " ", "our", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "merge_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "mydat", "a_", "[_", "ylo", "_", ":_", "yh", "i_", ",_", "xlo", "_", ":_", "xh", "i_", ",_", "..._", "]_", "+=_", "rot", "data_", "[_", "0_", ":_", "ht_", ",_", "0_", ":_", "wd_", ",_", "..._", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "idx_", "=_", "(_", "mydat", "a_", "[_", "ylo", "_", ":_", "yh", "i_", ",_", "xlo", "_", ":_", "xh", "i_", ",_", "..._", "]_", "==_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydat", "a_", "[_", "ylo", "_", ":_", "yh", "i_", ",_", "xlo", "_", ":_", "xh", "i_", ",_", "..._", "]_", "[_", "idx_", "]_", "=_", "rot", "data_", "[_", "0_", ":_", "ht_", ",_", "0_", ":_", "wd_", ",_", "..._", "]_", "[_", "idx_", "]_", "\\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_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "error_", "(_", "\"", "Error", " ", "fitting", " ", "tile", ":", " ", "%", "s", "\"_", "%_", "(_", "str_", "(_", "e_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "recalc", "ulate", " ", "min", " ", "and", " ", "max", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Can", "'", "t", " ", "use", " ", "usual", " ", "technique", "s", " ", "bec", "aus", "e", " ", "it", " ", "adds", " ", "too", " ", "muc", "h", " ", "time", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mos", "acing", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".\\u", "set\\u", "minmax", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Noti", "fy", " ", "watcher", "s", " ", "tha", "t", " ", "our", " ", "data", " ", "has", " ", "changed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "suppress", "\\u", "callback_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "make", "\\u", "callback_", "(_", "'", "modifi", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "xlo", "_", ",_", "ylo", "_", ",_", "xh", "i_", ",_", "yh", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Astro", "Image_", "(_", "Base", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "info", "\\u", "xy_", "(_", "self_", ",_", "data\\u", "x_", ",_", "data\\u", "y_", ",_", "settings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "value", " ", "under", " ", "the", " ", "data", " ", "coordinates_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "report", " ", "the", " ", "value", " ", "acro", "ss", " ", "the", " ", "pixel", ",", " ", "even", " ", "tho", "ugh", " ", "the", " ", "coords_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "change", " ", "half", "way", " ", "acro", "ss", " ", "the", " ", "pixel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "get", "\\u", "data\\u", "xy_", "(_", "int_", "(_", "data\\u", "x_", "+_", "0.5_", ")_", ",_", "int_", "(_", "data\\u", "y_", "+_", "0.5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "system_", "=_", "settings_", "._", "get_", "(_", "'", "wcs", "\\u", "coords", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "format_", "=_", "settings_", "._", "get_", "(_", "'", "wcs", "\\u", "display", "'_", ",_", "'", "sex", "age", "sim", "al", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "lbl_", ",_", "dec", "\\u", "lbl_", "=_", "six_", "._", "unichr_", "(_", "945", "_", ")_", ",_", "six_", "._", "unichr_", "(_", "948", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "WC", "S", " ", "coords", ",", " ", "if", " ", "available_", "\\u\\u\\uNL\\u\\u\\u_", "ts_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "wcs_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "No", " ", "WC", "S", " ", "for", " ", "this", " ", "image", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "txt_", "=_", "dec", "\\u", "txt_", "=_", "'", "NO", " ", "WC", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "wcs_", "._", "coords", "ys_", "==_", "'", "raw", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "No", " ", "coordinate", " ", "system", " ", "dete", "rmin", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "txt_", "=_", "dec", "\\u", "txt_", "=_", "'", "NO", " ", "WC", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "wcs_", "._", "coords", "ys_", "==_", "'", "pixel", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "data\\u", "x_", ",_", "data\\u", "y_", "]_", "+_", "self_", "._", "rev", "na", "xis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", ",_", "y_", "=_", "self_", "._", "wcs_", "._", "pix", "tos", "ystem_", "(_", "#(", "data\\u", "x", ",", " ", "data\\u", "y", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "args_", ",_", "system_", "=_", "system_", ",_", "coords_", "=_", "'", "data", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "txt_", "=_", "\"%", "+.", "3f", "\"_", "%_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dec", "\\u", "txt_", "=_", "\"%", "+.", "3f", "\"_", "%_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "lbl_", ",_", "dec", "\\u", "lbl_", "=_", "\"", "X", "\"_", ",_", "\"", "Y", "\"_", "\\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 ", " _", "args_", "=_", "[_", "data\\u", "x_", ",_", "data\\u", "y_", "]_", "+_", "self_", "._", "rev", "na", "xis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lon", "\\u", "deg_", ",_", "lat", "\\u", "deg_", "=_", "self_", "._", "wcs_", "._", "pix", "tos", "ystem_", "(_", "#(", "data\\u", "x", ",", " ", "data\\u", "y", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "args_", ",_", "system_", "=_", "system_", ",_", "coords_", "=_", "'", "data", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "format_", "==_", "'", "sex", "age", "sim", "al", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "system_", "in_", "(_", "'", "gal", "acti", "c", "'_", ",_", "'", "ecl", "ipti", "c", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sign_", ",_", "deg_", ",_", "min_", ",_", "sec_", "=_", "wcs_", "._", "deg", "To", "Dm", "s_", "(_", "lon", "\\u", "deg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Lat", "itude_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "txt_", "=_", "'+", "%", "03", "d", ":", "%", "02", "d", ":", "%", "0", "6.3", "f", "'_", "%_", "(_", "deg_", ",_", "min_", ",_", "sec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "deg_", ",_", "min_", ",_", "sec_", "=_", "wcs_", "._", "deg", "To", "Hm", "s_", "(_", "lon", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "txt_", "=_", "'%", "02", "d", ":", "%", "02", "d", ":", "%", "0", "6.3", "f", "'_", "%_", "(_", "deg_", ",_", "min_", ",_", "sec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sign_", ",_", "deg_", ",_", "min_", ",_", "sec_", "=_", "wcs_", "._", "deg", "To", "Dm", "s_", "(_", "lat", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sign_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sign_", "=_", "'-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sign_", "=_", "'+'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dec", "\\u", "txt_", "=_", "'%", "s", "%", "02", "d", ":", "%", "02", "d", ":", "%", "0", "6.3", "f", "'_", "%_", "(_", "sign_", ",_", "deg_", ",_", "min_", ",_", "sec_", ")_", "\\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 ", " ", "_", "ra", "\\u", "txt_", "=_", "'%", "+", "10.", "7f", "'_", "%_", "(_", "lon", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dec", "\\u", "txt_", "=_", "'%", "+", "10.", "7f", "'_", "%_", "(_", "lat", "\\u", "deg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "system_", "==_", "'", "gal", "acti", "c", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ra", "\\u", "lbl_", ",_", "dec", "\\u", "lbl_", "=_", "\"", "l", "\"_", ",_", "\"", "b", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "system_", "==_", "'", "ecl", "ipti", "c", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ra", "\\u", "lbl_", ",_", "dec", "\\u", "lbl_", "=_", "six_", "._", "unichr_", "(_", "0x03", "BB_", ")_", ",_", "six_", "._", "unichr_", "(_", "0x03", "B2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "system_", "==_", "'", "heli", "opr", "oj", "ective", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ra", "\\u", "txt_", "=_", "\"%", "+", "5.3", "f", "\"_", "%_", "(_", "lon", "\\u", "deg_", "*_", "3600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dec", "\\u", "txt_", "=_", "\"%", "+", "5.3", "f", "\"_", "%_", "(_", "lat", "\\u", "deg_", "*_", "3600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "lbl_", ",_", "dec", "\\u", "lbl_", "=_", "\"", "x", "-", "Sol", "ar", "\"_", ",_", "\"", "y", "-", "Sol", "ar", "\"_", "\\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_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "warning_", "(_", "\"", "Ba", "d", " ", "coordinate", " ", "conve", "rsi", "on", ":", " ", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "e_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ra", "\\u", "txt_", "=_", "'", "BAD", " ", "WC", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dec", "\\u", "txt_", "=_", "'", "BAD", " ", "WC", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "log", " ", "traceback", ",", " ", "if", " ", "possible_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "type\\u_", ",_", "value\\u_", ",_", "tb_", ")_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tb", "\\u", "str_", "=_", "\"\"_", "._", "join_", "(_", "traceback_", "._", "format\\u", "tb_", "(_", "tb_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "error_", "(_", "\"", "Trace", "back", ":\\\\", "n", "%", "s", "\"_", "%_", "(_", "tb", "\\u", "str_", ")_", ")_", "\\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 ", " _", "tb", "\\u", "str_", "=_", "\"", "Trace", "back", " ", "informati", "on", " ", "unava", "ilab", "le", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "error_", "(_", "tb", "\\u", "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_", "te_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "time", " ", "ela", "pse", "d", ":", " ", "%", ".4", "f", "\"", " ", "%", " ", "te_", "\\u\\u\\uNL\\u\\u\\u_", "info_", "=_", "Bun", "ch_", "._", "Bun", "ch_", "(_", "itype", "_", "=_", "'", "astro", "'_", ",_", "data\\u", "x_", "=_", "data\\u", "x_", ",_", "data\\u", "y_", "=_", "data\\u", "y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "data\\u", "x_", ",_", "y_", "=_", "data\\u", "y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ra", "\\u", "txt_", "=_", "ra", "\\u", "txt_", ",_", "dec", "\\u", "txt_", "=_", "dec", "\\u", "txt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ra", "\\u", "lbl_", "=_", "ra", "\\u", "lbl_", ",_", "dec", "\\u", "lbl_", "=_", "dec", "\\u", "lbl_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "value_", "=_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "info_", "\\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, 0, 1, 1, 1, 2, 0, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
comodit/demos/ceph-cluster/deploy.py
[ { "content": "#!/usr/bin/env python\n\nimport time, sys, os, config\n\nfrom comodit_client.api import Client\nfrom comodit_client.api.exceptions import PythonApiException\nfrom comodit_client.api.collection import EntityNotFoundException\nfrom comodit_client.rest.exceptions import ApiException\nfrom comodit_client.api.host import Host\n\nfrom helper import create_host, get_short_hostname\n\n\n\n\nif __name__ == '__main__':\n try:\n deploy()\n except PythonApiException as e:\n print e\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def deploy():\n # Script\n print \"Deploying Ceph cluster\"\n start_time = time.time()\n\n NUM_OF_MON = 1\n NUM_OF_OSD = 2\n\n # Connect to the ComodIT API\n client = Client(config.endpoint, config.username, config.password)\n env = client.get_environment(config.organization, 'Cluster')\n\n\n # Initialize empty cluster\n for key in (\"monitors\", \"osds\", \"mdss\"):\n try:\n env.settings().create(key, [])\n except:\n pass\n time.sleep(1)\n try:\n env.settings().create(\"admin_key\", config.admin_key)\n except:\n pass\n time.sleep(1)\n\n conf_app = [{\"name\": \"Ceph Configuration\", \"settings\": {}}]\n\n\n # Provision hosts\n mon_hosts = []\n for i in xrange(0, NUM_OF_MON):\n try:\n mon = env.get_host('Monitor ' + str(i))\n except EntityNotFoundException:\n mon = create_host(env, 'Monitor ' + str(i), config.platform, config.distribution, conf_app)\n print \"Deploying Monitor \" + str(i)\n mon.provision()\n mon_hosts.append(mon)\n\n osd_hosts = []\n for i in xrange(0, NUM_OF_OSD):\n try:\n osd = env.get_host('Object Store ' + str(i))\n except EntityNotFoundException:\n osd = create_host(env, 'Object Store ' + str(i), config.platform, config.distribution, conf_app)\n print \"Deploying Object Store \" + str(i)\n osd.provision()\n osd_hosts.append(osd)\n\n print \"Waiting for all hosts to be deployed...\"\n for h in mon_hosts + osd_hosts:\n h.wait_for_state(Host.State.READY, config.time_out)\n\n\n # Configure the cluster as it is now known\n mon_ips = []\n mon_names = []\n mon_addrs = []\n for h in mon_hosts:\n ip = h.get_instance().wait_for_property(\"ip.eth0\", config.time_out)\n mon_ips.append(ip)\n mon_names.append(get_short_hostname(h.get_instance().wait_for_property(\"hostname\", config.time_out)))\n mon_addrs.append(ip + \":6879\")\n\n osd_ips = []\n osd_names = []\n for h in osd_hosts:\n osd_ips.append(h.get_instance().wait_for_property(\"ip.eth0\", config.time_out))\n osd_names.append(get_short_hostname(h.get_instance().wait_for_property(\"hostname\", config.time_out)))\n\n for i in xrange(0, len(mon_addrs)):\n print \"Monitor %i has address %s and hostname %s\" % (i, mon_addrs[i], mon_names[i])\n\n for i in xrange(0, len(osd_ips)):\n print \"OSD %i has IP %s and hostname %s\" % (i, osd_ips[i], osd_names[i])\n\n print\n\n print \"Configure cluster...\"\n monitors = []\n for i in xrange(0, len(mon_addrs)):\n monitors.append({\"id\": str(i), \"host\": mon_names[i], \"addr\": mon_addrs[i]})\n\n osds = []\n for i in xrange(0, len(osd_names)):\n osds.append({\"id\": str(i), \"host\": osd_names[i]})\n\n mdss = []\n for i in xrange(0, len(mon_names)):\n mdss.append({\"id\": str(i), \"host\": mon_names[i]})\n\n env.settings().update(\"monitors\", monitors)\n time.sleep(3)\n env.settings().update(\"osds\", osds)\n time.sleep(3)\n env.settings().update(\"mdss\", mdss)\n time.sleep(3)\n env.settings().update(\"admin_key\", config.admin_key)\n time.sleep(3)\n\n\n # Install Ceph\n print \"Installing first monitor and meta-data service...\"\n mon_hosts[0].install(\"Ceph Monitor\", {\"bootstrap\": True, \"mon_id\": \"0\", \"mon_addr\": mon_addrs[0]})\n time.sleep(3)\n mon_hosts[0].install(\"Ceph Metadata\", {\"mds_id\": \"0\"})\n mon_hosts[0].wait_for_pending_changes()\n\n print \"Installing additional monitors (if any) and meta-data service(s)...\"\n for i in xrange(1, len(mon_hosts)):\n mon_hosts[i].install(\"Ceph Metadata\", {\"mds_id\": str(i)})\n time.sleep(3)\n mon_hosts[i].install(\"Ceph Monitor\", {\"mon_id\": str(i)})\n time.sleep(3)\n\n for h in mon_hosts:\n h.wait_for_pending_changes()\n\n print \"Installing OSD(s)...\"\n for i in xrange(0, len(osd_hosts)):\n osd_hosts[i].install(\"Ceph Object Store\", {\"osd_id\": str(i), \"osd_hostname\": osd_names[i]})\n time.sleep(3)\n\n for h in osd_hosts:\n h.wait_for_pending_changes()\n\n total_time = time.time() - start_time\n print \"Master node's public IP: %s\" % (mon_hosts[0].get_instance().wait_for_address(config.time_out))\n print \"Deployment time: \" + str(total_time)", "metadata": "root.deploy", "header": "['module', '___EOS___']", "index": 13 } ]
[ { "span": "import time, sys, os, config", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 28 }, { "span": "from comodit_client.rest.exceptions import ApiException", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 55 } ]
[]
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_", "time_", ",_", "sys_", ",_", "os_", ",_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "com", "odi", "t", "\\u", "client_", "._", "api_", "import_", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "com", "odi", "t", "\\u", "client_", "._", "api_", "._", "exceptions_", "import_", "Pyth", "on", "Ap", "i", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "com", "odi", "t", "\\u", "client_", "._", "api_", "._", "collection_", "import_", "Entit", "y", "Not", "Foun", "d", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "com", "odi", "t", "\\u", "client_", "._", "rest_", "._", "exceptions_", "import_", "Ap", "i", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "com", "odi", "t", "\\u", "client_", "._", "api_", "._", "host_", "import_", "Host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "helper_", "import_", "create", "\\u", "host_", ",_", "get", "\\u", "short", "\\u", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deploy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Pyth", "on", "Ap", "i", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\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_", "deploy_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Script_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Deploy", "ing", " ", "Ce", "ph", " ", "cluster", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "NUM", "\\u", "OF", "\\u", "MON", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NUM", "\\u", "OF", "\\u", "OS", "D_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Connect", " ", "to", " ", "the", " ", "Com", "od", "IT", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Client_", "(_", "config_", "._", "endpoint_", ",_", "config_", "._", "username_", ",_", "config_", "._", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "=_", "client_", "._", "get", "\\u", "environment_", "(_", "config_", "._", "organization_", ",_", "'", "Cluster", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "empty", " ", "cluster_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", "in_", "(_", "\"", "monit", "ors", "\"_", ",_", "\"", "osd", "s", "\"_", ",_", "\"", "mds", "s", "\"_", ")_", ":_", "\\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 ", " _", "env_", "._", "settings_", "(_", ")_", "._", "create_", "(_", "key_", ",_", "[_", "]_", ")_", "\\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_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "env_", "._", "settings_", "(_", ")_", "._", "create_", "(_", "\"", "admin", "\\u", "key", "\"_", ",_", "config_", "._", "admin", "\\u", "key_", ")_", "\\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_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conf", "\\u", "app_", "=_", "[_", "{_", "\"", "name", "\"_", ":_", "\"", "Ce", "ph", " ", "Configura", "tion", "\"_", ",_", "\"", "settings", "\"_", ":_", "{_", "}_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Provision", " ", "hosts_", "\\u\\u\\uNL\\u\\u\\u_", "mon", "\\u", "hosts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "NUM", "\\u", "OF", "\\u", "MON", "_", ")_", ":_", "\\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 ", " _", "mon_", "=_", "env_", "._", "get", "\\u", "host_", "(_", "'", "Monitor", " ", "'_", "+_", "str_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Entit", "y", "Not", "Foun", "d", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mon_", "=_", "create", "\\u", "host_", "(_", "env_", ",_", "'", "Monitor", " ", "'_", "+_", "str_", "(_", "i_", ")_", ",_", "config_", "._", "platform_", ",_", "config_", "._", "distribution_", ",_", "conf", "\\u", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Deploy", "ing", " ", "Monitor", " ", "\"_", "+_", "str_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon_", "._", "provision", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mon", "\\u", "hosts_", "._", "append_", "(_", "mon_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "osd", "\\u", "hosts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "NUM", "\\u", "OF", "\\u", "OS", "D_", ")_", ":_", "\\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 ", " _", "osd", "_", "=_", "env_", "._", "get", "\\u", "host_", "(_", "'", "Object", " ", "Stor", "e", " ", "'_", "+_", "str_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Entit", "y", "Not", "Foun", "d", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "osd", "_", "=_", "create", "\\u", "host_", "(_", "env_", ",_", "'", "Object", " ", "Stor", "e", " ", "'_", "+_", "str_", "(_", "i_", ")_", ",_", "config_", "._", "platform_", ",_", "config_", "._", "distribution_", ",_", "conf", "\\u", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Deploy", "ing", " ", "Object", " ", "Stor", "e", " ", "\"_", "+_", "str_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "osd", "_", "._", "provision", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "osd", "\\u", "hosts_", "._", "append_", "(_", "osd", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Wait", "ing", " ", "for", " ", "all", " ", "host", "s", " ", "to", " ", "be", " ", "deploye", "d", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "h_", "in_", "mon", "\\u", "hosts_", "+_", "osd", "\\u", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "wait", "\\u", "for", "\\u", "state_", "(_", "Host_", "._", "State_", "._", "READY", "_", ",_", "config_", "._", "time", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Configure", " ", "the", " ", "cluster", " ", "as", " ", "it", " ", "is", " ", "now", " ", "known_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mon", "\\u", "ips_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "addrs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "h_", "in_", "mon", "\\u", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip_", "=_", "h_", "._", "get", "\\u", "instance_", "(_", ")_", "._", "wait", "\\u", "for", "\\u", "property_", "(_", "\"", "ip", ".", "eth", "0", "\"_", ",_", "config_", "._", "time", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "ips_", "._", "append_", "(_", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "names_", "._", "append_", "(_", "get", "\\u", "short", "\\u", "hostname_", "(_", "h_", "._", "get", "\\u", "instance_", "(_", ")_", "._", "wait", "\\u", "for", "\\u", "property_", "(_", "\"", "host", "name", "\"_", ",_", "config_", "._", "time", "\\u", "out_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "addrs_", "._", "append_", "(_", "ip_", "+_", "\":", "687", "9", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "osd", "\\u", "ips_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "osd", "\\u", "names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "h_", "in_", "osd", "\\u", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "osd", "\\u", "ips_", "._", "append_", "(_", "h_", "._", "get", "\\u", "instance_", "(_", ")_", "._", "wait", "\\u", "for", "\\u", "property_", "(_", "\"", "ip", ".", "eth", "0", "\"_", ",_", "config_", "._", "time", "\\u", "out_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "osd", "\\u", "names_", "._", "append_", "(_", "get", "\\u", "short", "\\u", "hostname_", "(_", "h_", "._", "get", "\\u", "instance_", "(_", ")_", "._", "wait", "\\u", "for", "\\u", "property_", "(_", "\"", "host", "name", "\"_", ",_", "config_", "._", "time", "\\u", "out_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "len_", "(_", "mon", "\\u", "addrs_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Monitor", " ", "%", "i", " ", "has", " ", "address", " ", "%", "s", " ", "and", " ", "host", "name", " ", "%", "s", "\"_", "%_", "(_", "i_", ",_", "mon", "\\u", "addrs_", "[_", "i_", "]_", ",_", "mon", "\\u", "names_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "len_", "(_", "osd", "\\u", "ips_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "OS", "D", " ", "%", "i", " ", "has", " ", "IP", " ", "%", "s", " ", "and", " ", "host", "name", " ", "%", "s", "\"_", "%_", "(_", "i_", ",_", "osd", "\\u", "ips_", "[_", "i_", "]_", ",_", "osd", "\\u", "names_", "[_", "i_", "]_", ")_", "\\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_", "print_", "\"", "Configure", " ", "cluster", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "monitors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "len_", "(_", "mon", "\\u", "addrs_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "monitors_", "._", "append_", "(_", "{_", "\"", "id", "\"_", ":_", "str_", "(_", "i_", ")_", ",_", "\"", "host", "\"_", ":_", "mon", "\\u", "names_", "[_", "i_", "]_", ",_", "\"", "addr", "\"_", ":_", "mon", "\\u", "addrs_", "[_", "i_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "osd", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "len_", "(_", "osd", "\\u", "names_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "osd", "s_", "._", "append_", "(_", "{_", "\"", "id", "\"_", ":_", "str_", "(_", "i_", ")_", ",_", "\"", "host", "\"_", ":_", "osd", "\\u", "names_", "[_", "i_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mds", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "len_", "(_", "mon", "\\u", "names_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mds", "s_", "._", "append_", "(_", "{_", "\"", "id", "\"_", ":_", "str_", "(_", "i_", ")_", ",_", "\"", "host", "\"_", ":_", "mon", "\\u", "names_", "[_", "i_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "env_", "._", "settings_", "(_", ")_", "._", "update_", "(_", "\"", "monit", "ors", "\"_", ",_", "monitors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "._", "settings_", "(_", ")_", "._", "update_", "(_", "\"", "osd", "s", "\"_", ",_", "osd", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "._", "settings_", "(_", ")_", "._", "update_", "(_", "\"", "mds", "s", "\"_", ",_", "mds", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "._", "settings_", "(_", ")_", "._", "update_", "(_", "\"", "admin", "\\u", "key", "\"_", ",_", "config_", "._", "admin", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Install", " ", "Ce", "ph_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Install", "ing", " ", "first", " ", "monit", "or", " ", "and", " ", "meta", "-", "data", " ", "service", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "hosts_", "[_", "0_", "]_", "._", "install_", "(_", "\"", "Ce", "ph", " ", "Monitor", "\"_", ",_", "{_", "\"", "boots", "trap", "\"_", ":_", "True_", ",_", "\"", "mon", "\\u", "id", "\"_", ":_", "\"", "0", "\"_", ",_", "\"", "mon", "\\u", "addr", "\"_", ":_", "mon", "\\u", "addrs_", "[_", "0_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "hosts_", "[_", "0_", "]_", "._", "install_", "(_", "\"", "Ce", "ph", " ", "Meta", "data", "\"_", ",_", "{_", "\"", "mds", "\\u", "id", "\"_", ":_", "\"", "0", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "hosts_", "[_", "0_", "]_", "._", "wait", "\\u", "for", "\\u", "pend", "ing", "\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Install", "ing", " ", "addition", "al", " ", "monit", "ors", " ", "(", "if", " ", "any", ")", " ", "and", " ", "meta", "-", "data", " ", "service", "(", "s", ").", "..\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "1_", ",_", "len_", "(_", "mon", "\\u", "hosts_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mon", "\\u", "hosts_", "[_", "i_", "]_", "._", "install_", "(_", "\"", "Ce", "ph", " ", "Meta", "data", "\"_", ",_", "{_", "\"", "mds", "\\u", "id", "\"_", ":_", "str_", "(_", "i_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mon", "\\u", "hosts_", "[_", "i_", "]_", "._", "install_", "(_", "\"", "Ce", "ph", " ", "Monitor", "\"_", ",_", "{_", "\"", "mon", "\\u", "id", "\"_", ":_", "str_", "(_", "i_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "h_", "in_", "mon", "\\u", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "wait", "\\u", "for", "\\u", "pend", "ing", "\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Install", "ing", " ", "OS", "D", "(", "s", ").", "..\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "len_", "(_", "osd", "\\u", "hosts_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "osd", "\\u", "hosts_", "[_", "i_", "]_", "._", "install_", "(_", "\"", "Ce", "ph", " ", "Object", " ", "Stor", "e", "\"_", ",_", "{_", "\"", "osd", "\\u", "id", "\"_", ":_", "str_", "(_", "i_", ")_", ",_", "\"", "osd", "\\u", "host", "name", "\"_", ":_", "osd", "\\u", "names_", "[_", "i_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "h_", "in_", "osd", "\\u", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "wait", "\\u", "for", "\\u", "pend", "ing", "\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "start", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Master", " ", "node", "'", "s", " ", "public", " ", "IP", ":", " ", "%", "s", "\"_", "%_", "(_", "mon", "\\u", "hosts_", "[_", "0_", "]_", "._", "get", "\\u", "instance_", "(_", ")_", "._", "wait", "\\u", "for", "\\u", "address_", "(_", "config_", "._", "time", "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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 ]
Unused import
nextml/NEXT/next/query_page/query_page.py
[ { "content": "import os\n\nfrom flask import Blueprint, render_template, flash, request, redirect, url_for\n\nimport next.constants as constants\nfrom next.api.keychain import KeyChain\nfrom next.api.resource_manager import ResourceManager\n\nresource_manager = ResourceManager()\nkeychain = KeyChain()\nquery_page = Blueprint('query_page',\n __name__,\n template_folder='templates',\n static_folder='static')\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@query_page.route('/query_page/<page>')\n@query_page.route('/query_page/<page>/<exp_uid>/<widget_key>')\ndef load_page(page, exp_uid=None, widget_key=None):\n experiment = resource_manager.get_experiment(exp_uid)\n num_tries = experiment['num_tries']\n app_template = page+'.html'\n\n if constants.NEXT_BACKEND_GLOBAL_HOST:\n host_url = 'http://{}:{}'.format(constants.NEXT_BACKEND_GLOBAL_HOST,\n constants.NEXT_BACKEND_GLOBAL_PORT)\n else:\n host_url = ''\n \n return render_template(app_template, host_url=host_url, exp_uid=exp_uid,\n widget_key=widget_key, num_tries=num_tries), \\\n 200, {'Cache-Control':'private, max-age=0, no-cache, no-store'}", "metadata": "root.load_page", "header": "['module', '___EOS___']", "index": 15 } ]
[ { "span": "import os", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "from flask import Blueprint, render_template, flash, request, redirect, url_for", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 79 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flask_", "import_", "Blueprint_", ",_", "render", "\\u", "template_", ",_", "flash_", ",_", "request_", ",_", "redirect_", ",_", "url", "\\u", "for_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "next_", "._", "constants_", "as_", "constants_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "next_", "._", "api_", "._", "keyc", "hain", "_", "import_", "Key", "Chain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "next_", "._", "api_", "._", "resource", "\\u", "manager_", "import_", "Reso", "urc", "e", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resource", "\\u", "manager_", "=_", "Reso", "urc", "e", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyc", "hain", "_", "=_", "Key", "Chain_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query", "\\u", "page_", "=_", "Blueprint_", "(_", "'", "query", "\\u", "page", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template", "\\u", "folder_", "=_", "'", "template", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "static", "\\u", "folder_", "=_", "'", "static", "'_", ")_", "\\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_", "@_", "query", "\\u", "page_", "._", "route_", "(_", "'/", "query", "\\u", "page", "/", "<", "page", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "query", "\\u", "page_", "._", "route_", "(_", "'/", "query", "\\u", "page", "/", "<", "page", ">/", "<", "exp", "\\u", "uid", ">/", "<", "widget", "\\u", "key", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "load", "\\u", "page_", "(_", "page_", ",_", "exp", "\\u", "uid_", "=_", "None_", ",_", "widget", "\\u", "key_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment_", "=_", "resource", "\\u", "manager_", "._", "get", "\\u", "experiment_", "(_", "exp", "\\u", "uid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "tries_", "=_", "experiment_", "[_", "'", "num", "\\u", "trie", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "template_", "=_", "page_", "+_", "'.", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "constants_", "._", "NEXT", "\\u", "BACK", "END", "\\u", "GLOB", "AL", "\\u", "HOST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "\\u", "url_", "=_", "'", "http", "://{}", ":{}'_", "._", "format_", "(_", "constants_", "._", "NEXT", "\\u", "BACK", "END", "\\u", "GLOB", "AL", "\\u", "HOST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "NEXT", "\\u", "BACK", "END", "\\u", "GLOB", "AL", "\\u", "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 ", " _", "host", "\\u", "url_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render", "\\u", "template_", "(_", "app", "\\u", "template_", ",_", "host", "\\u", "url_", "=_", "host", "\\u", "url_", ",_", "exp", "\\u", "uid_", "=_", "exp", "\\u", "uid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "key_", "=_", "widget", "\\u", "key_", ",_", "num", "\\u", "tries_", "=_", "num", "\\u", "tries_", ")_", ",_", "200_", ",_", "{_", "'", "Cache", "-", "Control", "'_", ":_", "'", "private", ",", " ", "max", "-", "age", "=", "0", ",", " ", "no", "-", "cache", ",", " ", "no", "-", "store", "'_", "}_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
AcademicsToday/py-academicstoday/academicstoday_project/teacher/views/lecture.py
[ { "content": "from django.shortcuts import render\nfrom django.core import serializers\nfrom django.http import HttpResponse\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.decorators import login_required\nfrom django.conf import settings\nimport json\nimport datetime\nfrom registrar.models import Teacher\nfrom registrar.models import Student\nfrom registrar.models import Course\nfrom registrar.models import Lecture\nfrom teacher.forms import LectureForm\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@login_required(login_url='/landpage')\ndef lectures_page(request, course_id):\n course = Course.objects.get(id=course_id)\n teacher = Teacher.objects.get(user=request.user)\n return render(request, 'teacher/lecture/view.html',{\n 'teacher' : teacher,\n 'course' : course,\n 'NO_VIDEO_PLAYER': settings.NO_VIDEO_PLAYER,\n 'YOUTUBE_VIDEO_PLAYER': settings.YOUTUBE_VIDEO_PLAYER,\n 'VIMEO_VIDEO_PLAYER': settings.VIMEO_VIDEO_PLAYER,\n 'BLIPTV_VIDEO_PLAYER': settings.BLIPTV_VIDEO_PLAYER,\n 'user' : request.user,\n 'tab' : 'lectures',\n 'HAS_ADVERTISMENT': settings.APPLICATION_HAS_ADVERTISMENT,\n 'local_css_urls' : settings.SB_ADMIN_2_CSS_LIBRARY_URLS,\n 'local_js_urls' : settings.SB_ADMIN_2_JS_LIBRARY_URLS,\n })", "metadata": "root.lectures_page", "header": "['module', '___EOS___']", "index": 15 }, { "content": "@login_required(login_url='/landpage')\ndef lectures_table(request, course_id):\n course = Course.objects.get(id=course_id)\n teacher = Teacher.objects.get(user=request.user)\n \n try:\n lectures = Lecture.objects.filter(course=course).order_by('-week_num', '-lecture_num')\n except Lecture.DoesNotExist:\n lectures = None\n return render(request, 'teacher/lecture/table.html',{\n 'teacher' : teacher,\n 'course' : course,\n 'lectures' : lectures,\n 'NO_VIDEO_PLAYER': settings.NO_VIDEO_PLAYER,\n 'YOUTUBE_VIDEO_PLAYER': settings.YOUTUBE_VIDEO_PLAYER,\n 'VIMEO_VIDEO_PLAYER': settings.VIMEO_VIDEO_PLAYER,\n 'BLIPTV_VIDEO_PLAYER': settings.BLIPTV_VIDEO_PLAYER,\n 'user' : request.user,\n })", "metadata": "root.lectures_table", "header": "['module', '___EOS___']", "index": 34 }, { "content": "@login_required(login_url='/landpage')\ndef lecture_modal(request, course_id):\n if request.method == u'POST':\n # Get the lecture_id of post and either create a brand new form\n # for the user, or load up existing one based on the database\n # data for the particular lecture.\n lecture_id = int(request.POST['lecture_id'])\n form = None\n if lecture_id > 0:\n lecture = Lecture.objects.get(lecture_id=lecture_id)\n form = LectureForm(instance=lecture)\n else:\n form = LectureForm()\n return render(request, 'teacher/lecture/modal.html',{\n 'form' : form,\n })", "metadata": "root.lecture_modal", "header": "['module', '___EOS___']", "index": 55 }, { "content": "@login_required(login_url='/landpage')\ndef save_lecture(request, course_id):\n response_data = {'status' : 'failed', 'message' : 'unknown error with saving'}\n if request.is_ajax():\n if request.method == 'POST':\n course = Course.objects.get(id=course_id)\n lecture_id = int(request.POST['lecture_id'])\n form = None\n\n # If lecture already exists, then lets update only, else insert.\n if lecture_id > 0:\n lecture = Lecture.objects.get(lecture_id=lecture_id)\n form = LectureForm(instance=lecture, data=request.POST)\n else:\n form = LectureForm(request.POST, request.FILES)\n\n if form.is_valid():\n instance = form.save(commit=False)\n instance.course = course\n instance.save()\n response_data = {'status' : 'success', 'message' : 'saved'}\n else:\n response_data = {'status' : 'failed', 'message' : json.dumps(form.errors)}\n return HttpResponse(json.dumps(response_data), content_type=\"application/json\")", "metadata": "root.save_lecture", "header": "['module', '___EOS___']", "index": 73 }, { "content": "@login_required(login_url='/landpage')\ndef delete_lecture(request, course_id):\n response_data = {'status' : 'failed', 'message' : 'unknown error with deleting'}\n if request.is_ajax():\n if request.method == 'POST':\n lecture_id = int(request.POST['lecture_id'])\n teacher = Teacher.objects.get(user=request.user)\n try:\n lecture = Lecture.objects.get(lecture_id=lecture_id)\n if lecture.course.teacher == teacher:\n lecture.delete()\n response_data = {'status' : 'success', 'message' : 'deleted'}\n else:\n response_data = {'status' : 'failed', 'message' : 'unauthorized deletion'}\n except Lecture.DoesNotExist:\n response_data = {'status' : 'failed', 'message' : 'record not found'}\n return HttpResponse(json.dumps(response_data), content_type=\"application/json\")", "metadata": "root.delete_lecture", "header": "['module', '___EOS___']", "index": 99 } ]
[ { "span": "from django.core import serializers", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 35 }, { "span": "from django.contrib.auth.models import User", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 43 }, { "span": "import datetime", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 15 }, { "span": "from registrar.models import Student", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 36 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "import_", "serializers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "decorators_", "import_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "registrar", "_", "._", "models_", "import_", "Teacher", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "registrar", "_", "._", "models_", "import_", "Student_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "registrar", "_", "._", "models_", "import_", "Course_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "registrar", "_", "._", "models_", "import_", "Le", "ctu", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "teacher_", "._", "forms_", "import_", "Le", "ctu", "re", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "login", "\\u", "required_", "(_", "login", "\\u", "url_", "=_", "'/", "land", "page", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lecture", "s", "\\u", "page_", "(_", "request_", ",_", "course", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "course_", "=_", "Course_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "course", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "teacher_", "=_", "Teacher", "_", "._", "objects_", "._", "get_", "(_", "user_", "=_", "request_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "teacher", "/", "lecture", "/", "view", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "teacher", "'_", ":_", "teacher_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "course", "'_", ":_", "course_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "NO", "\\u", "VIDEO", "\\u", "PLAYER", "'_", ":_", "settings_", "._", "NO", "\\u", "VIDEO", "\\u", "PLAYER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "YOU", "TUBE", "\\u", "VIDEO", "\\u", "PLAYER", "'_", ":_", "settings_", "._", "YOU", "TUBE", "\\u", "VIDEO", "\\u", "PLAYER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "VI", "ME", "O", "\\u", "VIDEO", "\\u", "PLAYER", "'_", ":_", "settings_", "._", "VI", "ME", "O", "\\u", "VIDEO", "\\u", "PLAYER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "BLI", "PT", "V", "\\u", "VIDEO", "\\u", "PLAYER", "'_", ":_", "settings_", "._", "BLI", "PT", "V", "\\u", "VIDEO", "\\u", "PLAYER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tab", "'_", ":_", "'", "lecture", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "HAS", "\\u", "ADV", "ERT", "IS", "MENT", "'_", ":_", "settings_", "._", "APPLICATION", "\\u", "HAS", "\\u", "ADV", "ERT", "IS", "MENT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "local", "\\u", "css", "\\u", "urls", "'_", ":_", "settings_", "._", "SB", "\\u", "ADM", "IN", "\\u", "2", "\\u", "CS", "S", "\\u", "LIBRARY", "\\u", "URLS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "local", "\\u", "js", "\\u", "urls", "'_", ":_", "settings_", "._", "SB", "\\u", "ADM", "IN", "\\u", "2", "\\u", "JS", "\\u", "LIBRARY", "\\u", "URLS_", ",_", "\\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_", "@_", "login", "\\u", "required_", "(_", "login", "\\u", "url_", "=_", "'/", "land", "page", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lecture", "s", "\\u", "table_", "(_", "request_", ",_", "course", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "course_", "=_", "Course_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "course", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "teacher_", "=_", "Teacher", "_", "._", "objects_", "._", "get_", "(_", "user_", "=_", "request_", "._", "user_", ")_", "\\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 ", " _", "lecture", "s_", "=_", "Le", "ctu", "re_", "._", "objects_", "._", "filter_", "(_", "course_", "=_", "course_", ")_", "._", "order", "\\u", "by_", "(_", "'-", "week", "\\u", "num", "'_", ",_", "'-", "lecture", "\\u", "num", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Le", "ctu", "re_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lecture", "s_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "teacher", "/", "lecture", "/", "table", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "teacher", "'_", ":_", "teacher_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "course", "'_", ":_", "course_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lecture", "s", "'_", ":_", "lecture", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "NO", "\\u", "VIDEO", "\\u", "PLAYER", "'_", ":_", "settings_", "._", "NO", "\\u", "VIDEO", "\\u", "PLAYER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "YOU", "TUBE", "\\u", "VIDEO", "\\u", "PLAYER", "'_", ":_", "settings_", "._", "YOU", "TUBE", "\\u", "VIDEO", "\\u", "PLAYER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "VI", "ME", "O", "\\u", "VIDEO", "\\u", "PLAYER", "'_", ":_", "settings_", "._", "VI", "ME", "O", "\\u", "VIDEO", "\\u", "PLAYER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "BLI", "PT", "V", "\\u", "VIDEO", "\\u", "PLAYER", "'_", ":_", "settings_", "._", "BLI", "PT", "V", "\\u", "VIDEO", "\\u", "PLAYER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "request_", "._", "user_", ",_", "\\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_", "@_", "login", "\\u", "required_", "(_", "login", "\\u", "url_", "=_", "'/", "land", "page", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lecture", "\\u", "modal_", "(_", "request_", ",_", "course", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "method_", "==_", "u", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "lecture", "\\u", "id", " ", "of", " ", "post", " ", "and", " ", "eit", "her", " ", "create", " ", "a", " ", "brand", " ", "new", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "the", " ", "user", ",", " ", "or", " ", "load", " ", "up", " ", "exist", "ing", " ", "one", " ", "based", " ", "on", " ", "the", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "data", " ", "for", " ", "the", " ", "partic", "ular", " ", "lecture", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lecture", "\\u", "id_", "=_", "int_", "(_", "request_", "._", "POST_", "[_", "'", "lecture", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lecture", "\\u", "id_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lecture", "_", "=_", "Le", "ctu", "re_", "._", "objects_", "._", "get_", "(_", "lecture", "\\u", "id_", "=_", "lecture", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Le", "ctu", "re", "Form_", "(_", "instance_", "=_", "lecture", "_", ")_", "\\u\\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_", "=_", "Le", "ctu", "re", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "teacher", "/", "lecture", "/", "modal", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "'_", ":_", "form_", ",_", "\\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_", "@_", "login", "\\u", "required_", "(_", "login", "\\u", "url_", "=_", "'/", "land", "page", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "save", "\\u", "lecture", "_", "(_", "request_", ",_", "course", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response", "\\u", "data_", "=_", "{_", "'", "status", "'_", ":_", "'", "fail", "ed", "'_", ",_", "'", "message", "'_", ":_", "'", "unknown", " ", "error", " ", "with", " ", "saving", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "is", "\\u", "ajax_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "course_", "=_", "Course_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "course", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lecture", "\\u", "id_", "=_", "int_", "(_", "request_", "._", "POST_", "[_", "'", "lecture", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "lecture", " ", "alr", "ead", "y", " ", "exist", "s", ",", " ", "then", " ", "lets", " ", "update", " ", "only", ",", " ", "else", " ", "insert", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "lecture", "\\u", "id_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lecture", "_", "=_", "Le", "ctu", "re_", "._", "objects_", "._", "get_", "(_", "lecture", "\\u", "id_", "=_", "lecture", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Le", "ctu", "re", "Form_", "(_", "instance_", "=_", "lecture", "_", ",_", "data_", "=_", "request_", "._", "POST_", ")_", "\\u\\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_", "=_", "Le", "ctu", "re", "Form_", "(_", "request_", "._", "POST_", ",_", "request_", "._", "FILES_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance_", "=_", "form_", "._", "save_", "(_", "commit_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "._", "course_", "=_", "course_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "data_", "=_", "{_", "'", "status", "'_", ":_", "'", "success", "'_", ",_", "'", "message", "'_", ":_", "'", "saved", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response", "\\u", "data_", "=_", "{_", "'", "status", "'_", ":_", "'", "fail", "ed", "'_", ",_", "'", "message", "'_", ":_", "json_", "._", "dumps_", "(_", "form_", "._", "errors_", ")_", "}_", "\\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_", "Http", "Response_", "(_", "json_", "._", "dumps_", "(_", "response", "\\u", "data_", ")_", ",_", "content", "\\u", "type_", "=_", "\"", "applica", "tion", "/", "json", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "login", "\\u", "required_", "(_", "login", "\\u", "url_", "=_", "'/", "land", "page", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "delete", "\\u", "lecture", "_", "(_", "request_", ",_", "course", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response", "\\u", "data_", "=_", "{_", "'", "status", "'_", ":_", "'", "fail", "ed", "'_", ",_", "'", "message", "'_", ":_", "'", "unknown", " ", "error", " ", "with", " ", "delet", "ing", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "is", "\\u", "ajax_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lecture", "\\u", "id_", "=_", "int_", "(_", "request_", "._", "POST_", "[_", "'", "lecture", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "teacher_", "=_", "Teacher", "_", "._", "objects_", "._", "get_", "(_", "user_", "=_", "request_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lecture", "_", "=_", "Le", "ctu", "re_", "._", "objects_", "._", "get_", "(_", "lecture", "\\u", "id_", "=_", "lecture", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lecture", "_", "._", "course_", "._", "teacher_", "==_", "teacher_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "lecture", "_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "data_", "=_", "{_", "'", "status", "'_", ":_", "'", "success", "'_", ",_", "'", "message", "'_", ":_", "'", "delete", "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 ", " ", "_", "response", "\\u", "data_", "=_", "{_", "'", "status", "'_", ":_", "'", "fail", "ed", "'_", ",_", "'", "message", "'_", ":_", "'", "unauthorized", " ", "deletion", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Le", "ctu", "re_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response", "\\u", "data_", "=_", "{_", "'", "status", "'_", ":_", "'", "fail", "ed", "'_", ",_", "'", "message", "'_", ":_", "'", "record", " ", "not", " ", "found", "'_", "}_", "\\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_", "Http", "Response_", "(_", "json_", "._", "dumps_", "(_", "response", "\\u", "data_", ")_", ",_", "content", "\\u", "type_", "=_", "\"", "applica", "tion", "/", "json", "\"_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 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, 0, 1, 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,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
neurodata/ndstore/django/ocpgraph/views.py
[ { "content": "# Copyright 2014 Open Connectome Project (http://openconnecto.me)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom django.shortcuts import render\n\n# Create your views here.\n\nfrom django.http import HttpResponse\nfrom django.core.files.base import ContentFile\nfrom django.core.servers.basehttp import FileWrapper\nimport numpy as np\nimport urllib2\nimport json\nimport re\nfrom contextlib import closing\n\nimport cStringIO\n\nfrom django.conf import settings\n\nfrom ocpcaerror import OCPCAError\nimport ocpcaproj\nimport ocpcadb\nimport ocpgraph\n\nimport logging\nlogger=logging.getLogger(\"ocp\")\n\nimport tempfile\nimport tarfile\nimport zipfile\nimport os\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def getResponse( filename ):\n\n output = tarfile.open('/tmp/GeneratedGraph.tar.gz', mode='w')\n try:\n output.add(filename)\n except Exception, e:\n logger.warning(\"Unable to write to tar\")\n raise OCPCAError(\"Unable to write to tar\")\n finally:\n output.close()\n\n wrapper = FileWrapper(file(\"/tmp/GeneratedGraph.tar.gz\"))\n response = HttpResponse(wrapper,'application/x-gzip')\n response['Content-Length'] = 5\n response['Content-Disposition'] = 'attachment; filename=\"GeneratedGraph.tar.gz\"'\n return response", "metadata": "root.getResponse", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def buildGraph (request, webargs):\n #Indicated which type of arguements to return/send\n arguementType=0\n\n try:\n # argument of format /token/channel/Arguments\n #Tries each of the possible 3 entries\n #ocpgraph/test_graph_syn/test_graph_syn/pajek/5472/6496/8712/9736/1000/1100/\n #http://127.0.0.1:8000/ocp/ocpgraph/GraphAnno/synanno/\n #\n\n if re.match(\"(\\w+)/(\\w+)/$\", webargs) is not None:\n m = re.match(\"(\\w+)/(\\w+)/$\", webargs)\n [syntoken, synchan_name] = [i for i in m.groups()]\n arguementType=1\n elif re.match(\"(\\w+)/(\\w+)/(\\w+)/$\", webargs) is not None:\n m = re.match(\"(\\w+)/(\\w+)/(\\w+)/$\", webargs)\n [syntoken, synchan_name, graphType] = [i for i in m.groups()]\n arguementType=2\n elif re.match(\"(\\w+)/(\\w+)/(\\w+)/(\\d+)/(\\d+)/(\\d+)/(\\d+)/(\\d+)/(\\d+)/$\", webargs) is not None:\n m = re.match(\"(\\w+)/(\\w+)/(\\w+)/(\\d+)/(\\d+)/(\\d+)/(\\d+)/(\\d+)/(\\d+)/$\", webargs)\n [syntoken, synchan_name, graphType, Xmin,Xmax,Ymin,Ymax,Zmin,Zmax] = [i for i in m.groups()]\n arguementType=3\n else:\n logger.warning(\"Arguments not in the correct format: /token/channel/Arguments\")\n raise OCPCAError(\"Arguments not in the correct format: /token/channel/Arguments\")\n\n\n except Exception, e:\n logger.warning(\"Arguments not in the correct format: /token/channel/Arguments\")\n raise OCPCAError(\"Arguments not in the correct format: /token/channel/Arguments\")\n\n # get the project\n with closing ( ocpcaproj.OCPCAProjectsDB() ) as projdb:\n\n synproj = projdb.loadToken ( syntoken )\n\n # and the database and then call the db function\n with closing ( ocpcadb.OCPCADB(synproj) ) as syndb:\n # open the segment channel and the synapse channel\n synch = synproj.getChannelObj(synchan_name)\n #AETODO verify that they are both annotation channels\n if arguementType==1:\n return getResponse(ocpgraph.genGraphRAMON (syndb, synproj, synch))\n elif arguementType==2:\n return getResponse(ocpgraph.genGraphRAMON (syndb, synproj, synch, graphType))\n elif arguementType==3:\n return getResponse(ocpgraph.genGraphRAMON (syndb, synproj, synch, graphType, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax))\n else:\n logger.warning(\"Unable to return file\")\n raise OCPCAError(\"Unable to return file\")", "metadata": "root.buildGraph", "header": "['module', '___EOS___']", "index": 63 } ]
[ { "span": "from django.shortcuts import render", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 35 }, { "span": "from django.core.files.base import ContentFile", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 46 }, { "span": "import numpy as np", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 18 }, { "span": "import urllib2", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 14 }, { "span": "import json", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 11 }, { "span": "import cStringIO", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 16 }, { "span": "from django.conf import settings", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 32 }, { "span": "import tempfile", "start_line": 39, "start_column": 0, "end_line": 39, "end_column": 15 }, { "span": "import zipfile", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 14 }, { "span": "import os", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2014", " ", "Open", " ", "Connect", "ome", " ", "Project", " ", "(", "http", "://", "openco", "nnect", "o", ".", "me", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "your", " ", "views", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "files_", "._", "base_", "import_", "Conten", "t", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "servers_", "._", "base", "http_", "import_", "File", "Wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "contextlib_", "import_", "closing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "oc", "pca", "error_", "import_", "OC", "PCA", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "oc", "pcap", "roj", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "oc", "pca", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "oc", "pgr", "aph", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\"", "oc", "p", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tarfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zipfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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_", "get", "Response_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "tarfile_", "._", "open_", "(_", "'/", "tmp", "/", "Generate", "d", "Graph", ".", "tar", ".", "gz", "'_", ",_", "mode_", "=_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "._", "add_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Una", "ble", " ", "to", " ", "write", " ", "to", " ", "tar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "OC", "PCA", "Error_", "(_", "\"", "Una", "ble", " ", "to", " ", "write", " ", "to", " ", "tar", "\"_", ")_", "\\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 ", " _", "output_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wrapper_", "=_", "File", "Wrapper_", "(_", "file_", "(_", "\"/", "tmp", "/", "Generate", "d", "Graph", ".", "tar", ".", "gz", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Http", "Response_", "(_", "wrapper_", ",_", "'", "applica", "tion", "/", "x", "-", "gzip", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "[_", "'", "Conten", "t", "-", "Length", "'_", "]_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "[_", "'", "Conten", "t", "-", "Dispo", "sition", "'_", "]_", "=_", "'", "attach", "ment", ";", " ", "filename", "=\"", "Generate", "d", "Graph", ".", "tar", ".", "gz", "\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "Graph_", "(_", "request_", ",_", "weba", "rgs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Indicat", "ed", " ", "whi", "ch", " ", "type", " ", "of", " ", "argu", "ement", "s", " ", "to", " ", "return", "/", "send_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argu", "ement", "Type_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "argu", "ment", " ", "of", " ", "format", " ", "/", "token", "/", "channel", "/", "Arguments_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Trie", "s", " ", "each", " ", "of", " ", "the", " ", "possib", "le", " ", "3", " ", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "#", "oc", "pgr", "aph", "/", "test\\u", "graph", "\\u", "syn", "/", "test\\u", "graph", "\\u", "syn", "/", "pa", "je", "k", "/", "547", "2", "/", "649", "6", "/", "871", "2", "/", "973", "6", "/", "1000", "/", "1100", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", "http", "://", "127", ".0", ".0", ".1", ":", "800", "0", "/", "oc", "p", "/", "oc", "pgr", "aph", "/", "Graph", "Ann", "o", "/", "syn", "anno", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "re_", "._", "match_", "(_", "\"(", "\\\\", "w", "+)/(", "\\\\", "w", "+)", "/$", "\"_", ",_", "weba", "rgs_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "re_", "._", "match_", "(_", "\"(", "\\\\", "w", "+)/(", "\\\\", "w", "+)", "/$", "\"_", ",_", "weba", "rgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "syn", "token_", ",_", "sync", "han", "\\u", "name_", "]_", "=_", "[_", "i_", "for_", "i_", "in_", "m_", "._", "groups_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "argu", "ement", "Type_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "re_", "._", "match_", "(_", "\"(", "\\\\", "w", "+)/(", "\\\\", "w", "+)/(", "\\\\", "w", "+)", "/$", "\"_", ",_", "weba", "rgs_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "re_", "._", "match_", "(_", "\"(", "\\\\", "w", "+)/(", "\\\\", "w", "+)/(", "\\\\", "w", "+)", "/$", "\"_", ",_", "weba", "rgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "syn", "token_", ",_", "sync", "han", "\\u", "name_", ",_", "graph", "Type_", "]_", "=_", "[_", "i_", "for_", "i_", "in_", "m_", "._", "groups_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "argu", "ement", "Type_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "re_", "._", "match_", "(_", "\"(", "\\\\", "w", "+)/(", "\\\\", "w", "+)/(", "\\\\", "w", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)", "/$", "\"_", ",_", "weba", "rgs_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "re_", "._", "match_", "(_", "\"(", "\\\\", "w", "+)/(", "\\\\", "w", "+)/(", "\\\\", "w", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)/(", "\\\\", "d", "+)", "/$", "\"_", ",_", "weba", "rgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "syn", "token_", ",_", "sync", "han", "\\u", "name_", ",_", "graph", "Type_", ",_", "Xm", "in_", ",_", "Xm", "ax_", ",_", "Ym", "in_", ",_", "Ym", "ax_", ",_", "Zm", "in_", ",_", "Zm", "ax_", "]_", "=_", "[_", "i_", "for_", "i_", "in_", "m_", "._", "groups_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "argu", "ement", "Type_", "=_", "3_", "\\u\\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_", "._", "warning_", "(_", "\"", "Arg", "ument", "s", " ", "not", " ", "in", " ", "the", " ", "correct", " ", "format", ":", " ", "/", "token", "/", "channel", "/", "Arg", "ument", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "OC", "PCA", "Error_", "(_", "\"", "Arg", "ument", "s", " ", "not", " ", "in", " ", "the", " ", "correct", " ", "format", ":", " ", "/", "token", "/", "channel", "/", "Arg", "ument", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Arg", "ument", "s", " ", "not", " ", "in", " ", "the", " ", "correct", " ", "format", ":", " ", "/", "token", "/", "channel", "/", "Arg", "ument", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "OC", "PCA", "Error_", "(_", "\"", "Arg", "ument", "s", " ", "not", " ", "in", " ", "the", " ", "correct", " ", "format", ":", " ", "/", "token", "/", "channel", "/", "Arg", "ument", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "project_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "closing_", "(_", "oc", "pcap", "roj", "_", "._", "OC", "PCA", "Project", "s", "DB_", "(_", ")_", ")_", "as_", "proj", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "syn", "proj_", "=_", "proj", "db_", "._", "load", "Token_", "(_", "syn", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "the", " ", "databa", "se", " ", "and", " ", "then", " ", "call", " ", "the", " ", "db", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "closing_", "(_", "oc", "pca", "db_", "._", "OC", "PCA", "DB_", "(_", "syn", "proj_", ")_", ")_", "as_", "syn", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "open", " ", "the", " ", "segment", " ", "channel", " ", "and", " ", "the", " ", "synapse", " ", "channel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sync", "h_", "=_", "syn", "proj_", "._", "get", "Chan", "nel", "Obj_", "(_", "sync", "han", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "AE", "TOD", "O", " ", "verify", " ", "tha", "t", " ", "the", "y", " ", "are", " ", "bot", "h", " ", "annot", "ation", " ", "channels_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "argu", "ement", "Type_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "Response_", "(_", "oc", "pgr", "aph", "_", "._", "gen", "Graph", "RAM", "ON_", "(_", "syn", "db_", ",_", "syn", "proj_", ",_", "sync", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "argu", "ement", "Type_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "Response_", "(_", "oc", "pgr", "aph", "_", "._", "gen", "Graph", "RAM", "ON_", "(_", "syn", "db_", ",_", "syn", "proj_", ",_", "sync", "h_", ",_", "graph", "Type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "argu", "ement", "Type_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "Response_", "(_", "oc", "pgr", "aph", "_", "._", "gen", "Graph", "RAM", "ON_", "(_", "syn", "db_", ",_", "syn", "proj_", ",_", "sync", "h_", ",_", "graph", "Type_", ",_", "Xm", "in_", ",_", "Xm", "ax_", ",_", "Ym", "in_", ",_", "Ym", "ax_", ",_", "Zm", "in_", ",_", "Zm", "ax_", ")_", ")_", "\\u\\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_", "._", "warning_", "(_", "\"", "Una", "ble", " ", "to", " ", "return", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "OC", "PCA", "Error_", "(_", "\"", "Una", "ble", " ", "to", " ", "return", " ", "file", "\"_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Testing equality to None
sunlightlabs/clearspending/completeness/statlib/io.py
[ { "content": "def bget(imfile,shp=None,unpackstr=N.int16,bytesperpixel=2.0,sliceinit=0):\n \"\"\"\nReads in a binary file, typically with a .bshort or .bfloat extension.\nIf so, the last 3 parameters are set appropriately. If not, the last 3\nparameters default to reading .bshort files (2-byte integers in big-endian\nbinary format).\n\nUsage: bget(imfile,shp=None,unpackstr=N.int16,bytesperpixel=2.0,sliceinit=0)\n\"\"\"\n if imfile[:3] == 'COR':\n return CORget(imfile)\n if imfile[-2:] == 'MR':\n return mrget(imfile,unpackstr)\n if imfile[-4:] == 'BRIK':\n return brikget(imfile,unpackstr,shp)\n if imfile[-3:] in ['mnc','MNC']:\n return mincget(imfile,unpackstr,shp)\n if imfile[-3:] == 'img':\n return mghbget(imfile,unpackstr,shp)\n if imfile[-6:] == 'bshort' or imfile[-6:] == 'bfloat':\n if shp == None:\n return mghbget(imfile,unpackstr=unpackstr,bytesperpixel=bytesperpixel,sliceinit=sliceinit)\n else:\n return mghbget(imfile,shp[0],shp[1],shp[2],unpackstr,bytesperpixel,sliceinit)", "metadata": "root.bget", "header": "['module', '___EOS___']", "index": 323 }, { "content": "def mincget(imfile,unpackstr=N.int16,shp=None):\n \"\"\"\nLoads in a .MNC file.\n\nUsage: mincget(imfile,unpackstr=N.int16,shp=None) default shp = -1,20,64,64\n\"\"\"\n if shp == None:\n shp = (-1,20,64,64)\n os.system('mincextract -short -range 0 4095 -image_range 0 4095 ' +\n imfile+' > minctemp.bshort')\n try:\n d = braw('minctemp.bshort',unpackstr)\n except:\n print \"Couldn't find file: \"+imfile\n raise IOError, \"Couldn't find file in mincget()\"\n\n print shp, d.shape\n d.shape = shp\n os.system('rm minctemp.bshort')\n return d", "metadata": "root.mincget", "header": "['module', '___EOS___']", "index": 362 }, { "content": "def brikget(imfile,unpackstr=N.int16,shp=None):\n \"\"\"\nGets an AFNI BRIK file.\n\nUsage: brikget(imfile,unpackstr=N.int16,shp=None) default shp: (-1,48,61,51)\n\"\"\"\n if shp == None:\n shp = (-1,48,61,51)\n try:\n file = open(imfile, \"rb\")\n except:\n print \"Couldn't find file: \"+imfile\n raise IOError, \"Couldn't find file in brikget()\"\n try:\n header = imfile[0:-4]+'HEAD'\n lines = open(header).readlines()\n for i in range(len(lines)):\n if string.find(lines[i],'DATASET_DIMENSIONS') <> -1:\n dims = string.split(lines[i+2][0:string.find(lines[i+2],' 0')])\n dims = map(string.atoi,dims)\n if string.find(lines[i],'BRICK_FLOAT_FACS') <> -1:\n count = string.atoi(string.split(lines[i+1])[2])\n mults = []\n for j in range(int(N.ceil(count/5.))):\n mults += map(string.atof,string.split(lines[i+2+j]))\n mults = N.array(mults)\n dims.reverse()\n shp = [-1]+dims\n except IOError:\n print \"No header file. Continuing ...\"\n lines = None\n\n print shp\n print 'Using unpackstr:',unpackstr #,', bytesperpixel=',bytesperpixel\n\n file = open(imfile, \"rb\")\n bdata = file.read()\n\n # the > forces big-endian (for or from Sun/SGI)\n bdata = N.fromstring(bdata,unpackstr)\n littleEndian = ( struct.pack('i',1)==struct.pack('<i',1) )\n if (littleEndian and os.uname()[0]<>'Linux') or (max(bdata)>1e30):\n bdata = bdata.byteswapped()\n try:\n bdata.shape = shp\n except:\n print 'Incorrect shape ...',shp,len(bdata)\n raise ValueError, 'Incorrect shape for file size'\n if len(bdata) == 1:\n bdata = bdata[0]\n\n if N.sum(mults) == 0:\n return bdata\n try:\n multshape = [1]*len(bdata.shape)\n for i in range(len(bdata.shape)):\n if len(mults) == bdata.shape[i]:\n multshape[i] = len(mults)\n break\n mults.shape = multshape\n return bdata*mults\n except:\n return bdata", "metadata": "root.brikget", "header": "['module', '___EOS___']", "index": 384 } ]
[ { "span": "shp == None:", "start_line": 343, "start_column": 11, "end_line": 343, "end_column": 22 }, { "span": "shp == None:", "start_line": 368, "start_column": 7, "end_line": 368, "end_column": 18 }, { "span": "shp == None:", "start_line": 390, "start_column": 7, "end_line": 390, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bg", "et_", "(_", "im", "file_", ",_", "shp_", "=_", "None_", ",_", "unpack", "str_", "=_", "N_", "._", "int16_", ",_", "bytes", "perp", "ixel", "_", "=_", "2.0_", ",_", "slice", "init_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", "Read", "s", " ", "in", " ", "a", " ", "binar", "y", " ", "file", ",", " ", "typical", "ly", " ", "with", " ", "a", " ", ".", "bs", "hort", " ", "or", " ", ".", "bf", "loa", "t", " ", "extensi", "on", ".", "\\", "10", ";", "If", " ", "so", ",", " ", "the", " ", "last", " ", "3", " ", "parameter", "s", " ", "are", " ", "set", " ", "appropr", "iate", "ly", ".", " ", " ", "If", " ", "not", ",", " ", "the", " ", "last", " ", "3", "\\", "10", ";", "parameter", "s", " ", "default", " ", "to", " ", "readi", "ng", " ", ".", "bs", "hort", " ", "files", " ", "(", "2", "-", "byte", " ", "integ", "ers", " ", "in", " ", "big", "-", "endian", "\\", "10", ";", "binar", "y", " ", "format", ").", "\\", "10", ";", "\\", "10", ";", "Us", "age", ":", " ", " ", " ", "bg", "et", "(", "im", "file", ",", "shp", "=", "Non", "e", ",", "unpack", "str", "=", "N", ".", "int", "16", ",", "bytes", "perp", "ixel", "=", "2.0", ",", "slice", "init", "=", "0", ")", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "im", "file_", "[_", ":_", "3_", "]_", "==_", "'", "COR", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "COR", "get_", "(_", "im", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "im", "file_", "[_", "-_", "2_", ":_", "]_", "==_", "'", "MR", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mr", "get_", "(_", "im", "file_", ",_", "unpack", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "im", "file_", "[_", "-_", "4_", ":_", "]_", "==_", "'", "BRI", "K", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "bri", "kg", "et_", "(_", "im", "file_", ",_", "unpack", "str_", ",_", "shp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "im", "file_", "[_", "-_", "3_", ":_", "]_", "in_", "[_", "'", "mn", "c", "'_", ",_", "'", "MN", "C", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "min", "cg", "et_", "(_", "im", "file_", ",_", "unpack", "str_", ",_", "shp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "im", "file_", "[_", "-_", "3_", ":_", "]_", "==_", "'", "img", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mg", "hb", "get_", "(_", "im", "file_", ",_", "unpack", "str_", ",_", "shp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "im", "file_", "[_", "-_", "6_", ":_", "]_", "==_", "'", "bs", "hort", "'_", "or_", "im", "file_", "[_", "-_", "6_", ":_", "]_", "==_", "'", "bf", "loa", "t", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "shp_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mg", "hb", "get_", "(_", "im", "file_", ",_", "unpack", "str_", "=_", "unpack", "str_", ",_", "bytes", "perp", "ixel", "_", "=_", "bytes", "perp", "ixel", "_", ",_", "slice", "init_", "=_", "slice", "init_", ")_", "\\u\\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_", "mg", "hb", "get_", "(_", "im", "file_", ",_", "shp_", "[_", "0_", "]_", ",_", "shp_", "[_", "1_", "]_", ",_", "shp_", "[_", "2_", "]_", ",_", "unpack", "str_", ",_", "bytes", "perp", "ixel", "_", ",_", "slice", "init_", ")_", "\\u\\u\\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_", "min", "cg", "et_", "(_", "im", "file_", ",_", "unpack", "str_", "=_", "N_", "._", "int16_", ",_", "shp_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", "Load", "s", " ", "in", " ", "a", " ", ".", "MN", "C", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", "Us", "age", ":", " ", " ", "min", "cg", "et", "(", "im", "file", ",", "unpack", "str", "=", "N", ".", "int", "16", ",", "shp", "=", "Non", "e", ")", " ", " ", "default", " ", "shp", " ", "=", " ", "-1", ",", "20", ",", "64", ",", "64", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "shp_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shp_", "=_", "(_", "-_", "1_", ",_", "20_", ",_", "64_", ",_", "64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "min", "ce", "xtra", "ct", " ", "-", "short", " ", "-", "range", " ", "0", " ", "409", "5", " ", "-", "image", "\\u", "range", " ", "0", " ", "409", "5", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "im", "file_", "+_", "'", " ", ">", " ", "min", "cte", "mp", ".", "bs", "hort", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "bra", "w_", "(_", "'", "min", "cte", "mp", ".", "bs", "hort", "'_", ",_", "unpack", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Cou", "ld", "n", "'", "t", " ", "find", " ", "file", ":", " ", " ", "\"_", "+_", "im", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "IO", "Error_", ",_", "\"", "Cou", "ld", "n", "'", "t", " ", "find", " ", "file", " ", "in", " ", "min", "cg", "et", "()\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "shp_", ",_", "d_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "shape_", "=_", "shp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "rm", " ", "min", "cte", "mp", ".", "bs", "hort", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bri", "kg", "et_", "(_", "im", "file_", ",_", "unpack", "str_", "=_", "N_", "._", "int16_", ",_", "shp_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", "Get", "s", " ", "an", " ", "AF", "NI", " ", "BRI", "K", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", "Us", "age", ":", " ", " ", "bri", "kg", "et", "(", "im", "file", ",", "unpack", "str", "=", "N", ".", "int", "16", ",", "shp", "=", "Non", "e", ")", " ", " ", "default", " ", "shp", ":", " ", "(-", "1", ",", "4", "8", ",", "6", "1", ",", "5", "1", ")", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "shp_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shp_", "=_", "(_", "-_", "1_", ",_", "48_", ",_", "61_", ",_", "51_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file_", "=_", "open_", "(_", "im", "file_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Cou", "ld", "n", "'", "t", " ", "find", " ", "file", ":", " ", " ", "\"_", "+_", "im", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "IO", "Error_", ",_", "\"", "Cou", "ld", "n", "'", "t", " ", "find", " ", "file", " ", "in", " ", "bri", "kg", "et", "()\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "im", "file_", "[_", "0_", ":_", "-_", "4_", "]_", "+_", "'", "HEAD", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "open_", "(_", "header_", ")_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "lines_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "string_", "._", "find_", "(_", "lines_", "[_", "i_", "]_", ",_", "'", "DATASET", "\\u", "DIMENSION", "S", "'_", ")_", "<_", ">_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dims_", "=_", "string_", "._", "split_", "(_", "lines_", "[_", "i_", "+_", "2_", "]_", "[_", "0_", ":_", "string_", "._", "find_", "(_", "lines_", "[_", "i_", "+_", "2_", "]_", ",_", "'", " ", "0", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dims_", "=_", "map_", "(_", "string_", "._", "ato", "i_", ",_", "dims_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "string_", "._", "find_", "(_", "lines_", "[_", "i_", "]_", ",_", "'", "BRI", "CK", "\\u", "FLOAT", "\\u", "FAC", "S", "'_", ")_", "<_", ">_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "string_", "._", "ato", "i_", "(_", "string_", "._", "split_", "(_", "lines_", "[_", "i_", "+_", "1_", "]_", ")_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mult", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "int_", "(_", "N_", "._", "ceil_", "(_", "count_", "/_", "5._", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "mult", "s_", "+=_", "map_", "(_", "string_", "._", "ato", "f_", ",_", "string_", "._", "split_", "(_", "lines_", "[_", "i_", "+_", "2_", "+_", "j_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mult", "s_", "=_", "N_", "._", "array_", "(_", "mult", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dims_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shp_", "=_", "[_", "-_", "1_", "]_", "+_", "dims_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "No", " ", "header", " ", "file", ".", " ", " ", "Continu", "ing", " ", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lines_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "shp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Us", "ing", " ", "unpack", "str", ":'_", ",_", "unpack", "str_", "#", ",'", ",", " ", "bytes", "perp", "ixel", "='", ",", "bytes", "perp", "ixel", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "open_", "(_", "im", "file_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bda", "ta_", "=_", "file_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", ">", " ", "force", "s", " ", "big", "-", "endian", " ", "(", "for", " ", "or", " ", "from", " ", "Sun", "/", "SGI", ")_", "\\u\\u\\uNL\\u\\u\\u_", "bda", "ta_", "=_", "N_", "._", "fromstring_", "(_", "bda", "ta_", ",_", "unpack", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "litt", "le", "Endi", "an_", "=_", "(_", "struct_", "._", "pack_", "(_", "'", "i", "'_", ",_", "1_", ")_", "==_", "struct_", "._", "pack_", "(_", "'<", "i", "'_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "litt", "le", "Endi", "an_", "and_", "os_", "._", "uname_", "(_", ")_", "[_", "0_", "]_", "<_", ">_", "'", "Lin", "ux", "'_", ")_", "or_", "(_", "max_", "(_", "bda", "ta_", ")_", ">_", "1e", "30_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bda", "ta_", "=_", "bda", "ta_", "._", "bytes", "wap", "ped_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bda", "ta_", "._", "shape_", "=_", "shp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Inco", "rrect", " ", "shape", " ", "...'_", ",_", "shp_", ",_", "len_", "(_", "bda", "ta_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", ",_", "'", "Inco", "rrect", " ", "shape", " ", "for", " ", "file", " ", "size", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "bda", "ta_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bda", "ta_", "=_", "bda", "ta_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "N_", "._", "sum_", "(_", "mult", "s_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "bda", "ta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mult", "shape_", "=_", "[_", "1_", "]_", "*_", "len_", "(_", "bda", "ta_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "bda", "ta_", "._", "shape_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "mult", "s_", ")_", "==_", "bda", "ta_", "._", "shape_", "[_", "i_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mult", "shape_", "[_", "i_", "]_", "=_", "len_", "(_", "mult", "s_", ")_", "\\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_", "mult", "s_", "._", "shape_", "=_", "mult", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "bda", "ta_", "*_", "mult", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "bda", "ta_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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use of the return value of a procedure
letsencrypt/letsencrypt/acme/acme/standalone.py
[ { "content": "\"\"\"Support for standalone client challenge solvers. \"\"\"\nimport argparse\nimport collections\nimport functools\nimport logging\nimport os\nimport sys\n\nfrom six.moves import BaseHTTPServer # pylint: disable=import-error\nfrom six.moves import http_client # pylint: disable=import-error\nfrom six.moves import socketserver # pylint: disable=import-error\n\nimport OpenSSL\n\nfrom acme import challenges\nfrom acme import crypto_util\n\n\nlogger = logging.getLogger(__name__)\n\n# six.moves.* | pylint: disable=no-member,attribute-defined-outside-init\n# pylint: disable=too-few-public-methods,no-init\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == \"__main__\":\n sys.exit(simple_tls_sni_01_server(sys.argv)) # pragma: no cover\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def simple_tls_sni_01_server(cli_args, forever=True):\n \"\"\"Run simple standalone TLSSNI01 server.\"\"\"\n logging.basicConfig(level=logging.DEBUG)\n\n parser = argparse.ArgumentParser()\n parser.add_argument(\n \"-p\", \"--port\", default=0, help=\"Port to serve at. By default \"\n \"picks random free port.\")\n args = parser.parse_args(cli_args[1:])\n\n certs = {}\n\n _, hosts, _ = next(os.walk('.'))\n for host in hosts:\n with open(os.path.join(host, \"cert.pem\")) as cert_file:\n cert_contents = cert_file.read()\n with open(os.path.join(host, \"key.pem\")) as key_file:\n key_contents = key_file.read()\n certs[host.encode()] = (\n OpenSSL.crypto.load_privatekey(\n OpenSSL.crypto.FILETYPE_PEM, key_contents),\n OpenSSL.crypto.load_certificate(\n OpenSSL.crypto.FILETYPE_PEM, cert_contents))\n\n server = TLSSNI01Server(('', int(args.port)), certs=certs)\n logger.info(\"Serving at https://%s:%s...\", *server.socket.getsockname()[:2])\n if forever: # pragma: no cover\n server.serve_forever()\n else:\n server.handle_request()", "metadata": "root.simple_tls_sni_01_server", "header": "['module', '___EOS___']", "index": 156 } ]
[ { "span": "simple_tls_sni_01_server(sys.argv))", "start_line": 189, "start_column": 13, "end_line": 189, "end_column": 47 } ]
[ { "span": "def simple_tls_sni_01_server(cli_args, forever=True):", "start_line": 156, "start_column": 0, "end_line": 156, "end_column": 53 } ]
1
false
[ "[CLS]_", "Use_", "of_", "the_", "return_", "value_", "of_", "a_", "procedure_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Supp", "ort", " ", "for", " ", "standalone", " ", "client", " ", "chall", "enge", " ", "solvers", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "functools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "six_", "._", "moves_", "import_", "Base", "HTTP", "Server_", "#", " ", "pylint", ":", " ", "disable", "=", "import", "-", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "six_", "._", "moves_", "import_", "http", "\\u", "client_", "#", " ", "pylint", ":", " ", "disable", "=", "import", "-", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "six_", "._", "moves_", "import_", "socket", "server_", "#", " ", "pylint", ":", " ", "disable", "=", "import", "-", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "Open", "SSL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "acm", "e_", "import_", "challenges", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "acm", "e_", "import_", "crypto", "\\u", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "si", "x", ".", "moves", ".*", " ", "|", " ", "pylint", ":", " ", "disable", "=", "no", "-", "member", ",", "attribute", "-", "defin", "ed", "-", "outsi", "de", "-", "init_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "few", "-", "public", "-", "method", "s", ",", "no", "-", "init_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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 ", " _", "sys_", "._", "exit_", "(_", "simple", "\\u", "tls", "\\u", "sni", "\\u", "01", "\\u", "server_", "(_", "sys_", "._", "argv_", ")_", ")_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "simple", "\\u", "tls", "\\u", "sni", "\\u", "01", "\\u", "server_", "(_", "cli", "\\u", "args_", ",_", "forever_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Run", " ", "simple", " ", "standalone", " ", "TLS", "SNI", "01", " ", "server", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", "level_", "=_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "p", "\"_", ",_", "\"--", "port", "\"_", ",_", "default_", "=_", "0_", ",_", "help_", "=_", "\"", "Port", " ", "to", " ", "serve", " ", "at", ".", " ", "By", " ", "default", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "picks", " ", "random", " ", "free", " ", "port", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", "cli", "\\u", "args_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "certs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", ",_", "hosts_", ",_", "\\u_", "=_", "next_", "(_", "os_", "._", "walk_", "(_", "'.'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "host_", "in_", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "host_", ",_", "\"", "cert", ".", "pe", "m", "\"_", ")_", ")_", "as_", "cert", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cert", "\\u", "contents_", "=_", "cert", "\\u", "file_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "host_", ",_", "\"", "key", ".", "pe", "m", "\"_", ")_", ")_", "as_", "key", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "contents_", "=_", "key", "\\u", "file_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "certs_", "[_", "host_", "._", "encode_", "(_", ")_", "]_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Open", "SSL_", "._", "crypto_", "._", "load", "\\u", "private", "key_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Open", "SSL_", "._", "crypto_", "._", "FILET", "YP", "E", "\\u", "PEM", "_", ",_", "key", "\\u", "contents_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Open", "SSL_", "._", "crypto_", "._", "load", "\\u", "certificate_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Open", "SSL_", "._", "crypto_", "._", "FILET", "YP", "E", "\\u", "PEM", "_", ",_", "cert", "\\u", "contents_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "server_", "=_", "TLS", "SNI", "01", "Server_", "(_", "(_", "''_", ",_", "int_", "(_", "args_", "._", "port_", ")_", ")_", ",_", "certs_", "=_", "certs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "Servi", "ng", " ", "at", " ", "https", "://", "%", "s", ":", "%", "s", "...\"_", ",_", "*_", "server_", "._", "socket_", "._", "getsockname", "_", "(_", ")_", "[_", ":_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "forever_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server_", "._", "serve", "\\u", "forever_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server_", "._", "handle", "\\u", "request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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 ]
Unused import
AppScale/appscale/AppServer/lib/django-1.2/django/db/models/sql/subqueries.py
[ { "content": "\"\"\"\nQuery subclasses which provide extra functionality beyond simple data retrieval.\n\"\"\"\n\nfrom django.core.exceptions import FieldError\nfrom django.db import connections\nfrom django.db.models.sql.constants import *\nfrom django.db.models.sql.datastructures import Date\nfrom django.db.models.sql.expressions import SQLEvaluator\nfrom django.db.models.sql.query import Query\nfrom django.db.models.sql.where import AND, Constraint\n\n\n__all__ = ['DeleteQuery', 'UpdateQuery', 'InsertQuery', 'DateQuery',\n 'AggregateQuery']\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class DeleteQuery(Query):\n \"\"\"\n Delete queries are done through this class, since they are more constrained\n than general queries.\n \"\"\"\n\n compiler = 'SQLDeleteCompiler'\n\n", "metadata": "root.DeleteQuery", "header": "['module', '___EOS___']", "index": 16 }, { "content": " def do_query(self, table, where, using):\n self.tables = [table]\n self.where = where\n self.get_compiler(using).execute_sql(None)", "metadata": "root.DeleteQuery.do_query", "header": "['class', 'DeleteQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 24 }, { "content": " def delete_batch(self, pk_list, using):\n \"\"\"\n Set up and execute delete queries for all the objects in pk_list.\n\n More than one physical query may be executed if there are a\n lot of values in pk_list.\n \"\"\"\n for offset in range(0, len(pk_list), GET_ITERATOR_CHUNK_SIZE):\n where = self.where_class()\n field = self.model._meta.pk\n where.add((Constraint(None, field.column, field), 'in',\n pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]), AND)\n self.do_query(self.model._meta.db_table, where, using=using)", "metadata": "root.DeleteQuery.delete_batch", "header": "['class', 'DeleteQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 29 }, { "content": "class UpdateQuery(Query):\n \"\"\"\n Represents an \"update\" SQL query.\n \"\"\"\n\n compiler = 'SQLUpdateCompiler'\n\n\n\n\n\n\n\n\n", "metadata": "root.UpdateQuery", "header": "['module', '___EOS___']", "index": 43 }, { "content": " def __init__(self, *args, **kwargs):\n super(UpdateQuery, self).__init__(*args, **kwargs)\n self._setup_query()", "metadata": "root.UpdateQuery.__init__", "header": "['class', 'UpdateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 50 }, { "content": " def _setup_query(self):\n \"\"\"\n Runs on initialization and after cloning. Any attributes that would\n normally be set in __init__ should go in here, instead, so that they\n are also set up after a clone() call.\n \"\"\"\n self.values = []\n self.related_ids = None\n if not hasattr(self, 'related_updates'):\n self.related_updates = {}", "metadata": "root.UpdateQuery._setup_query", "header": "['class', 'UpdateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 54 }, { "content": " def clone(self, klass=None, **kwargs):\n return super(UpdateQuery, self).clone(klass,\n related_updates=self.related_updates.copy(), **kwargs)", "metadata": "root.UpdateQuery.clone", "header": "['class', 'UpdateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 65 }, { "content": " def clear_related(self, related_field, pk_list, using):\n \"\"\"\n Set up and execute an update query that clears related entries for the\n keys in pk_list.\n\n This is used by the QuerySet.delete_objects() method.\n \"\"\"\n for offset in range(0, len(pk_list), GET_ITERATOR_CHUNK_SIZE):\n self.where = self.where_class()\n f = self.model._meta.pk\n self.where.add((Constraint(None, f.column, f), 'in',\n pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]),\n AND)\n self.values = [(related_field, None, None)]\n self.get_compiler(using).execute_sql(None)", "metadata": "root.UpdateQuery.clear_related", "header": "['class', 'UpdateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 70 }, { "content": " def add_update_values(self, values):\n \"\"\"\n Convert a dictionary of field name to value mappings into an update\n query. This is the entry point for the public update() method on\n querysets.\n \"\"\"\n values_seq = []\n for name, val in values.iteritems():\n field, model, direct, m2m = self.model._meta.get_field_by_name(name)\n if not direct or m2m:\n raise FieldError('Cannot update model field %r (only non-relations and foreign keys permitted).' % field)\n if model:\n self.add_related_update(model, field, val)\n continue\n values_seq.append((field, model, val))\n return self.add_update_fields(values_seq)", "metadata": "root.UpdateQuery.add_update_values", "header": "['class', 'UpdateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 86 }, { "content": " def add_update_fields(self, values_seq):\n \"\"\"\n Turn a sequence of (field, model, value) triples into an update query.\n Used by add_update_values() as well as the \"fast\" update path when\n saving models.\n \"\"\"\n self.values.extend(values_seq)", "metadata": "root.UpdateQuery.add_update_fields", "header": "['class', 'UpdateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 103 }, { "content": " def add_related_update(self, model, field, value):\n \"\"\"\n Adds (name, value) to an update query for an ancestor model.\n\n Updates are coalesced so that we only run one update query per ancestor.\n \"\"\"\n try:\n self.related_updates[model].append((field, None, value))\n except KeyError:\n self.related_updates[model] = [(field, None, value)]", "metadata": "root.UpdateQuery.add_related_update", "header": "['class', 'UpdateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 111 }, { "content": " def get_related_updates(self):\n \"\"\"\n Returns a list of query objects: one for each update required to an\n ancestor model. Each query will have the same filtering conditions as\n the current query but will only update a single table.\n \"\"\"\n if not self.related_updates:\n return []\n result = []\n for model, values in self.related_updates.iteritems():\n query = UpdateQuery(model)\n query.values = values\n if self.related_ids is not None:\n query.add_filter(('pk__in', self.related_ids))\n result.append(query)\n return result", "metadata": "root.UpdateQuery.get_related_updates", "header": "['class', 'UpdateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 122 }, { "content": "class InsertQuery(Query):\n compiler = 'SQLInsertCompiler'\n\n\n", "metadata": "root.InsertQuery", "header": "['module', '___EOS___']", "index": 139 }, { "content": " def __init__(self, *args, **kwargs):\n super(InsertQuery, self).__init__(*args, **kwargs)\n self.columns = []\n self.values = []\n self.params = ()", "metadata": "root.InsertQuery.__init__", "header": "['class', 'InsertQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 142 }, { "content": " def clone(self, klass=None, **kwargs):\n extras = {\n 'columns': self.columns[:],\n 'values': self.values[:],\n 'params': self.params\n }\n extras.update(kwargs)\n return super(InsertQuery, self).clone(klass, **extras)", "metadata": "root.InsertQuery.clone", "header": "['class', 'InsertQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 148 }, { "content": " def insert_values(self, insert_values, raw_values=False):\n \"\"\"\n Set up the insert query from the 'insert_values' dictionary. The\n dictionary gives the model field names and their target values.\n\n If 'raw_values' is True, the values in the 'insert_values' dictionary\n are inserted directly into the query, rather than passed as SQL\n parameters. This provides a way to insert NULL and DEFAULT keywords\n into the query, for example.\n \"\"\"\n placeholders, values = [], []\n for field, val in insert_values:\n placeholders.append((field, val))\n self.columns.append(field.column)\n values.append(val)\n if raw_values:\n self.values.extend([(None, v) for v in values])\n else:\n self.params += tuple(values)\n self.values.extend(placeholders)", "metadata": "root.InsertQuery.insert_values", "header": "['class', 'InsertQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 157 }, { "content": "class DateQuery(Query):\n \"\"\"\n A DateQuery is a normal query, except that it specifically selects a single\n date field. This requires some special handling when converting the results\n back to Python objects, so we put it in a separate class.\n \"\"\"\n\n compiler = 'SQLDateCompiler'\n", "metadata": "root.DateQuery", "header": "['module', '___EOS___']", "index": 178 }, { "content": " def add_date_select(self, field, lookup_type, order='ASC'):\n \"\"\"\n Converts the query into a date extraction query.\n \"\"\"\n result = self.setup_joins([field.name], self.get_meta(),\n self.get_initial_alias(), False)\n alias = result[3][-1]\n select = Date((alias, field.column), lookup_type)\n self.select = [select]\n self.select_fields = [None]\n self.select_related = False # See #7097.\n self.set_extra_mask([])\n self.distinct = True\n self.order_by = order == 'ASC' and [1] or [-1]", "metadata": "root.DateQuery.add_date_select", "header": "['class', 'DateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 187 }, { "content": "class AggregateQuery(Query):\n \"\"\"\n An AggregateQuery takes another query as a parameter to the FROM\n clause and only selects the elements in the provided list.\n \"\"\"\n\n compiler = 'SQLAggregateCompiler'\n", "metadata": "root.AggregateQuery", "header": "['module', '___EOS___']", "index": 202 }, { "content": " def add_subquery(self, query, using):\n self.subquery, self.sub_params = query.get_compiler(using).as_sql(with_col_aliases=True)", "metadata": "root.AggregateQuery.add_subquery", "header": "['class', 'AggregateQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 210 } ]
[ { "span": "from django.db import connections", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 33 }, { "span": "from django.db.models.sql.expressions import SQLEvaluator", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 57 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Query", " ", "subclasses", " ", "whi", "ch", " ", "provide", " ", "extra", " ", "functional", "it", "y", " ", "be", "yon", "d", " ", "simple", " ", "data", " ", "retrie", "val", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "exceptions_", "import_", "Field", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "connections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "sql_", "._", "constants_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "sql_", "._", "datastr", "ucture", "s_", "import_", "Date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "sql_", "._", "expressions_", "import_", "SQL", "Evaluator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "sql_", "._", "query_", "import_", "Query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "sql_", "._", "where_", "import_", "AND_", ",_", "Constraint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "Delete", "Query", "'_", ",_", "'", "Update", "Query", "'_", ",_", "'", "Insert", "Query", "'_", ",_", "'", "Date", "Query", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Aggregate", "Query", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Delete", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Delete", " ", "querie", "s", " ", "are", " ", "don", "e", " ", "through", " ", "this", " ", "class", ",", " ", "sinc", "e", " ", "the", "y", " ", "are", " ", "more", " ", "constrained", "\\", "10", ";", " ", " ", " ", " ", "than", " ", "genera", "l", " ", "querie", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compiler_", "=_", "'", "SQL", "Delete", "Compil", "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_", "[SEP]_", "class_", "Delete", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "do", "\\u", "query_", "(_", "self_", ",_", "table_", ",_", "where_", ",_", "using_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tables_", "=_", "[_", "table_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "where_", "=_", "where_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "get", "\\u", "compiler_", "(_", "using_", ")_", "._", "execute", "\\u", "sql_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delete", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "batch_", "(_", "self_", ",_", "pk", "\\u", "list_", ",_", "using_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "up", " ", "and", " ", "execute", " ", "delete", " ", "querie", "s", " ", "for", " ", "all", " ", "the", " ", "object", "s", " ", "in", " ", "pk", "\\u", "list", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Mor", "e", " ", "than", " ", "one", " ", "physical", " ", "query", " ", "may", " ", "be", " ", "executed", " ", "if", " ", "there", " ", "are", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "lot", " ", "of", " ", "values", " ", "in", " ", "pk", "\\u", "list", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "offset_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "pk", "\\u", "list_", ")_", ",_", "GET", "\\u", "ITERA", "TOR", "\\u", "CHUNK", "\\u", "SIZE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "where_", "=_", "self_", "._", "where", "\\u", "class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "self_", "._", "model_", "._", "\\u", "meta_", "._", "pk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "where_", "._", "add_", "(_", "(_", "Constraint_", "(_", "None_", ",_", "field_", "._", "column_", ",_", "field_", ")_", ",_", "'", "in", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pk", "\\u", "list_", "[_", "offset_", ":_", "offset_", "+_", "GET", "\\u", "ITERA", "TOR", "\\u", "CHUNK", "\\u", "SIZE_", "]_", ")_", ",_", "AND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "do", "\\u", "query_", "(_", "self_", "._", "model_", "._", "\\u", "meta_", "._", "db", "\\u", "table_", ",_", "where_", ",_", "using_", "=_", "using_", ")_", "\\u\\u\\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_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "an", " ", "\"", "update", "\"", " ", "SQL", " ", "query", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compiler_", "=_", "'", "SQL", "Update", "Compil", "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\\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_", "[SEP]_", "class_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Update", "Query_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "setup", "\\u", "query_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "query_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", "s", " ", "on", " ", "initialization", " ", "and", " ", "after", " ", "clo", "ning", ".", " ", "Any", " ", "attribute", "s", " ", "tha", "t", " ", "wou", "ld", "\\", "10", ";", " ", " ", " ", " ", "normal", "ly", " ", "be", " ", "set", " ", "in", " ", "\\u\\u", "init", "\\u\\u", " ", "shou", "ld", " ", "go", " ", "in", " ", "here", ",", " ", "inst", "ead", ",", " ", "so", " ", "tha", "t", " ", "the", "y", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "als", "o", " ", "set", " ", "up", " ", "after", " ", "a", " ", "clone", "()", " ", "call", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "relate", "d\\u", "ids_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "self_", ",_", "'", "relate", "d\\u", "update", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "relate", "d\\u", "updates_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clone_", "(_", "self_", ",_", "klass_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Update", "Query_", ",_", "self_", ")_", "._", "clone_", "(_", "klass_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "updates_", "=_", "self_", "._", "relate", "d\\u", "updates_", "._", "copy_", "(_", ")_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "related_", "(_", "self_", ",_", "relate", "d\\u", "field_", ",_", "pk", "\\u", "list_", ",_", "using_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "up", " ", "and", " ", "execute", " ", "an", " ", "update", " ", "query", " ", "tha", "t", " ", "clear", "s", " ", "relate", "d", " ", "entri", "es", " ", "for", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "keys", " ", "in", " ", "pk", "\\u", "list", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "used", " ", "by", " ", "the", " ", "Query", "Set", ".", "delete", "\\u", "object", "s", "()", " ", "method", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "offset_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "pk", "\\u", "list_", ")_", ",_", "GET", "\\u", "ITERA", "TOR", "\\u", "CHUNK", "\\u", "SIZE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "where_", "=_", "self_", "._", "where", "\\u", "class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "self_", "._", "model_", "._", "\\u", "meta_", "._", "pk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "where_", "._", "add_", "(_", "(_", "Constraint_", "(_", "None_", ",_", "f_", "._", "column_", ",_", "f_", ")_", ",_", "'", "in", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pk", "\\u", "list_", "[_", "offset_", ":_", "offset_", "+_", "GET", "\\u", "ITERA", "TOR", "\\u", "CHUNK", "\\u", "SIZE_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "AND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "values_", "=_", "[_", "(_", "relate", "d\\u", "field_", ",_", "None_", ",_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "get", "\\u", "compiler_", "(_", "using_", ")_", "._", "execute", "\\u", "sql_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "update", "\\u", "values_", "(_", "self_", ",_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", " ", "a", " ", "dictionar", "y", " ", "of", " ", "field", " ", "name", " ", "to", " ", "value", " ", "mapping", "s", " ", "int", "o", " ", "an", " ", "update", "\\", "10", ";", " ", " ", " ", " ", "query", ".", " ", "Thi", "s", " ", "is", " ", "the", " ", "entry", " ", "point", " ", "for", " ", "the", " ", "public", " ", "update", "()", " ", "method", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "querys", "ets", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values", "\\u", "seq_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", ",_", "val_", "in_", "values_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", ",_", "model_", ",_", "direct_", ",_", "m2", "m_", "=_", "self_", "._", "model_", "._", "\\u", "meta_", "._", "get", "\\u", "field", "\\u", "by", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "direct_", "or_", "m2", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Field", "Error_", "(_", "'", "Cann", "ot", " ", "update", " ", "model", " ", "field", " ", "%", "r", " ", "(", "only", " ", "non", "-", "relation", "s", " ", "and", " ", "foreign", " ", "keys", " ", "permit", "ted", ").'_", "%_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "model_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "relate", "d\\u", "update_", "(_", "model_", ",_", "field_", ",_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values", "\\u", "seq_", "._", "append_", "(_", "(_", "field_", ",_", "model_", ",_", "val_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "add", "\\u", "update", "\\u", "fields_", "(_", "values", "\\u", "seq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "update", "\\u", "fields_", "(_", "self_", ",_", "values", "\\u", "seq_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Turn", " ", "a", " ", "sequence", " ", "of", " ", "(", "field", ",", " ", "model", ",", " ", "value", ")", " ", "triple", "s", " ", "int", "o", " ", "an", " ", "update", " ", "query", ".", "\\", "10", ";", " ", " ", " ", " ", "Us", "ed", " ", "by", " ", "add", "\\u", "update", "\\u", "values", "()", " ", "as", " ", "well", " ", "as", " ", "the", " ", "\"", "fast", "\"", " ", "update", " ", "path", " ", "whe", "n", "\\", "10", ";", " ", " ", " ", " ", "saving", " ", "model", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "values_", "._", "extend_", "(_", "values", "\\u", "seq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "relate", "d\\u", "update_", "(_", "self_", ",_", "model_", ",_", "field_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", "s", " ", "(", "name", ",", " ", "value", ")", " ", "to", " ", "an", " ", "update", " ", "query", " ", "for", " ", "an", " ", "ancestor", " ", "model", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Update", "s", " ", "are", " ", "coalesce", "d", " ", "so", " ", "tha", "t", " ", "we", " ", "only", " ", "run", " ", "one", " ", "update", " ", "query", " ", "per", " ", "ancestor", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "relate", "d\\u", "updates_", "[_", "model_", "]_", "._", "append_", "(_", "(_", "field_", ",_", "None_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "relate", "d\\u", "updates_", "[_", "model_", "]_", "=_", "[_", "(_", "field_", ",_", "None_", ",_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "relate", "d\\u", "updates_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "query", " ", "object", "s", ":", " ", "one", " ", "for", " ", "each", " ", "update", " ", "require", "d", " ", "to", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "ancestor", " ", "model", ".", " ", "Ea", "ch", " ", "query", " ", "will", " ", "have", " ", "the", " ", "same", " ", "filtering", " ", "condition", "s", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "current", " ", "query", " ", "but", " ", "will", " ", "only", " ", "update", " ", "a", " ", "single", " ", "table", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "relate", "d\\u", "updates_", ":_", "\\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_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "model_", ",_", "values_", "in_", "self_", "._", "relate", "d\\u", "updates_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "Update", "Query_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "._", "values_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "relate", "d\\u", "ids_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "._", "add", "\\u", "filter_", "(_", "(_", "'", "pk", "\\u\\u", "in", "'_", ",_", "self_", "._", "relate", "d\\u", "ids_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "._", "append_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "Insert", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compiler_", "=_", "'", "SQL", "Insert", "Compil", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Insert", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Insert", "Query_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "columns_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "params_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Insert", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clone_", "(_", "self_", ",_", "klass_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extras_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "column", "s", "'_", ":_", "self_", "._", "columns_", "[_", ":_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "values", "'_", ":_", "self_", "._", "values_", "[_", ":_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "params", "'_", ":_", "self_", "._", "params_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extras_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Insert", "Query_", ",_", "self_", ")_", "._", "clone_", "(_", "klass_", ",_", "**_", "extras_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Insert", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "insert", "\\u", "values_", "(_", "self_", ",_", "insert", "\\u", "values_", ",_", "raw", "\\u", "values_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "up", " ", "the", " ", "insert", " ", "query", " ", "from", " ", "the", " ", "'", "insert", "\\u", "values", "'", " ", "dictionar", "y", ".", " ", "The", "\\", "10", ";", " ", " ", " ", " ", "dictionar", "y", " ", "give", "s", " ", "the", " ", "model", " ", "field", " ", "names", " ", "and", " ", "thei", "r", " ", "target", " ", "values", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "'", "raw", "\\u", "values", "'", " ", "is", " ", "Tru", "e", ",", " ", "the", " ", "values", " ", "in", " ", "the", " ", "'", "insert", "\\u", "values", "'", " ", "dictionar", "y", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "inserted", " ", "direct", "ly", " ", "int", "o", " ", "the", " ", "query", ",", " ", "rat", "her", " ", "than", " ", "pass", "ed", " ", "as", " ", "SQL", "\\", "10", ";", " ", " ", " ", " ", "parameter", "s", ".", " ", "Thi", "s", " ", "provide", "s", " ", "a", " ", "way", " ", "to", " ", "insert", " ", "NULL", " ", "and", " ", "DEF", "AUL", "T", " ", "keywords", "\\", "10", ";", " ", " ", " ", " ", "int", "o", " ", "the", " ", "query", ",", " ", "for", " ", "example", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "placeholders_", ",_", "values_", "=_", "[_", "]_", ",_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "field_", ",_", "val_", "in_", "insert", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "placeholders_", "._", "append_", "(_", "(_", "field_", ",_", "val_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "columns_", "._", "append_", "(_", "field_", "._", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "._", "append_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "raw", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "values_", "._", "extend_", "(_", "[_", "(_", "None_", ",_", "v_", ")_", "for_", "v_", "in_", "values_", "]_", ")_", "\\u\\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_", "._", "params_", "+=_", "tuple_", "(_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "values_", "._", "extend_", "(_", "placeholders_", ")_", "\\u\\u\\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_", "Date", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "Date", "Query", " ", "is", " ", "a", " ", "normal", " ", "query", ",", " ", "except", " ", "tha", "t", " ", "it", " ", "specifica", "ll", "y", " ", "select", "s", " ", "a", " ", "single", "\\", "10", ";", " ", " ", " ", " ", "date", " ", "field", ".", " ", "Thi", "s", " ", "require", "s", " ", "some", " ", "special", " ", "handling", " ", "whe", "n", " ", "convert", "ing", " ", "the", " ", "results", "\\", "10", ";", " ", " ", " ", " ", "back", " ", "to", " ", "Pyth", "on", " ", "object", "s", ",", " ", "so", " ", "we", " ", "put", " ", "it", " ", "in", " ", "a", " ", "separate", " ", "class", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compiler_", "=_", "'", "SQL", "Date", "Compil", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Date", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "add", "\\u", "date", "\\u", "select_", "(_", "self_", ",_", "field_", ",_", "look", "up", "\\u", "type_", ",_", "order_", "=_", "'", "ASC", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", "s", " ", "the", " ", "query", " ", "int", "o", " ", "a", " ", "date", " ", "extracti", "on", " ", "query", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "setup", "\\u", "joins", "_", "(_", "[_", "field_", "._", "name_", "]_", ",_", "self_", "._", "get", "\\u", "meta_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "get", "\\u", "initial", "\\u", "alias_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alias_", "=_", "result_", "[_", "3_", "]_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "select_", "=_", "Date_", "(_", "(_", "alias_", ",_", "field_", "._", "column_", ")_", ",_", "look", "up", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "select_", "=_", "[_", "select_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "select", "\\u", "fields_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "select", "\\u", "related_", "=_", "False_", "#", " ", "See", " ", "#", "709", "7._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "extra", "\\u", "mask_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "distinct_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "order", "\\u", "by_", "=_", "order_", "==_", "'", "ASC", "'_", "and_", "[_", "1_", "]_", "or_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Aggregate", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "Aggregate", "Query", " ", "take", "s", " ", "anot", "her", " ", "query", " ", "as", " ", "a", " ", "parameter", " ", "to", " ", "the", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "clause", " ", "and", " ", "only", " ", "select", "s", " ", "the", " ", "element", "s", " ", "in", " ", "the", " ", "provided", " ", "list", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compiler_", "=_", "'", "SQL", "Aggregate", "Compil", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Aggregate", "Query_", "(_", "Query_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "add", "\\u", "subquery", "_", "(_", "self_", ",_", "query_", ",_", "using_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "subquery", "_", ",_", "self_", "._", "sub\\u", "params_", "=_", "query_", "._", "get", "\\u", "compiler_", "(_", "using_", ")_", "._", "as", "\\u", "sql_", "(_", "with", "\\u", "col", "\\u", "aliases_", "=_", "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,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