query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
sequence
label_sequence
sequence
Unused import
behave/behave/features/steps/use_steplib_behave4cmd.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"\nUse behave4cmd0 step library (predecessor of behave4cmd).\n\"\"\"\n\nfrom __future__ import absolute_import\n\n# -- REGISTER-STEPS FROM STEP-LIBRARY:\nimport behave4cmd0.__all_steps__\nimport behave4cmd0.passing_steps\nimport behave4cmd0.failing_steps\nimport behave4cmd0.note_steps\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import behave4cmd0.__all_steps__", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 32 }, { "span": "import behave4cmd0.passing_steps", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 32 }, { "span": "import behave4cmd0.failing_steps", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 32 }, { "span": "import behave4cmd0.note_steps", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Us", "e", " ", "behave", "4c", "md", "0", " ", "step", " ", "librar", "y", " ", "(", "predecessor", " ", "of", " ", "behave", "4c", "md", ").", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "REGISTER", "-", "STEPS", " ", "FROM", " ", "STEP", "-", "LIBRARY", ":_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "behave", "4c", "md", "0_", "._", "\\u\\u", "all", "\\u", "step", "s\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "behave", "4c", "md", "0_", "._", "passi", "ng", "\\u", "steps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "behave", "4c", "md", "0_", "._", "faili", "ng", "\\u", "steps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "behave", "4c", "md", "0_", "._", "note", "\\u", "steps_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused import
RDFLib/rdfextras/test/test_sparql/sparql/ConstructTests/constuctTest.py
[ { "content": "#!/d/Bin/Python/python.exe\n# -*- coding: utf-8 -*-\n#\n#\n# $Date: 2005/04/02 07:30:02 $, by $Author: ivan $, $Revision: 1.1 $\n#\n\"\"\"\n\n\"\"\"\nimport sys, os, time, datetime, imp, sys, StringIO\nsys.path.insert(0,\"../\")\n\nfrom testSPARQL import ns_rdf\nfrom testSPARQL import ns_rdfs\nfrom testSPARQL import ns_foaf\nfrom testSPARQL import ns_vcard\nfrom testSPARQL import ns_person\n\nfrom rdfextras.sparql import sparqlGraph\nfrom rdflib.FileInputSource import FileInputSource\n\ntests = {\n 1021: \"Test10_21\",\n 1022: \"Test10_22\",\n 1023: \"Test10_23\",\n}\n\nDebug = False\n\n\n\n\nif __name__ == '__main__' :\n if len(sys.argv) == 1 :\n #print \"Usage: %s modname1 modname2 ...\" % sys.argv[0]\n for mod in tests.values():\n run(mod)\n else :\n for mod in sys.argv[1:] :\n if mod.endswith(\".py\") :\n run(mod[0:-3])\n else :\n run(mod)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def run(modName) :\n # Import the python module\n defs = None\n (fl,realpath,descr) = imp.find_module(modName,[\".\"])\n mod = imp.load_module(modName,fl,realpath,descr)\n defs = mod.__dict__\n\n ##################################################\n # Two ways of identifying the RDF data:\n # 1. A Triple Store generated in the module\n graph = None\n try :\n graph = defs[\"graph\"]\n except :\n pass\n # 2. Directly in the test module as a string\n rdfData = None\n try :\n rdfData = defs[\"rdfData\"]\n except :\n pass\n\n # Get the final of the triple store...\n if graph == None :\n stream = FileInputSource(StringIO.StringIO(rdfData))\n graph = sparqlGraph.SPARQLGraph()\n graph.parse(stream,format=\"xml\")\n\n ###############################################\n # Retrive the query data\n pattern = defs[\"pattern\"]\n optPattern = defs[\"optional\"]\t\n construct = defs[\"construct\"]\t\n\n\n ###############################################\t\t\n print \"\\n============= Test Module: %s =============\" % modName\t\t\t\n\n results = graph.queryObject(pattern,optPattern)\n graph = results.construct(construct)\n graph.serialize(\"output.rdf\")\n\n print \"=== generated RDF file (output.rdf):\\n\"\n for l in file(\"output.rdf\") :\n sys.stdout.write(l)", "metadata": "root.run", "header": "['module', '___EOS___']", "index": 31 } ]
[ { "span": "import sys, os, time, datetime, imp, sys, StringIO", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 50 }, { "span": "from testSPARQL import ns_rdf", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 29 }, { "span": "from testSPARQL import ns_rdfs", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 30 }, { "span": "from testSPARQL import ns_foaf", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 30 }, { "span": "from testSPARQL import ns_vcard", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 31 }, { "span": "from testSPARQL import ns_person", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "d", "/", "Bin", "/", "Pyth", "on", "/", "python", ".", "exe_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "$", "Date", ":", " ", "2005", "/", "04", "/", "02", " ", "0", "7", ":", "30", ":", "02", " ", "$", ",", " ", "by", " ", "$", "Author", ":", " ", "iva", "n", " ", "$", ",", " ", "$", "Revi", "sion", ":", " ", "1.1", " ", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", ",_", "os_", ",_", "time_", ",_", "datetime_", ",_", "imp_", ",_", "sys_", ",_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "\"..", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "test", "SPAR", "QL", "_", "import_", "ns", "\\u", "rdf", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test", "SPAR", "QL", "_", "import_", "ns", "\\u", "rdfs", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test", "SPAR", "QL", "_", "import_", "ns", "\\u", "foa", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test", "SPAR", "QL", "_", "import_", "ns", "\\u", "vcard", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test", "SPAR", "QL", "_", "import_", "ns", "\\u", "person_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "rdf", "extras_", "._", "sparql", "_", "import_", "sparql", "Graph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rdflib_", "._", "File", "Inp", "ut", "Source_", "import_", "File", "Inp", "ut", "Source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "1021", "_", ":_", "\"", "Test", "10", "\\u", "21", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "102", "2_", ":_", "\"", "Test", "10", "\\u", "2", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1023", "_", ":_", "\"", "Test", "10", "\\u", "23", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Debug_", "=_", "False_", "\\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\\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 ", " _", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Us", "age", ":", " ", "%", "s", " ", "mod", "name", "1", " ", "mod", "name2", " ", "...\"", " ", "%", " ", "sys", ".", "argv", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "mod_", "in_", "tests_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "run_", "(_", "mod_", ")_", "\\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_", "mod_", "in_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "mod_", "._", "endswith_", "(_", "\".", "py", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "run_", "(_", "mod_", "[_", "0_", ":_", "-_", "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 ", " ", " _", "run_", "(_", "mod_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "mod", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Import", " ", "the", " ", "python", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defs_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "fl_", ",_", "realpath_", ",_", "descr_", ")_", "=_", "imp_", "._", "find", "\\u", "module_", "(_", "mod", "Name_", ",_", "[_", "\".\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "=_", "imp_", "._", "load", "\\u", "module_", "(_", "mod", "Name_", ",_", "fl_", ",_", "realpath_", ",_", "descr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defs_", "=_", "mod_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tw", "o", " ", "way", "s", " ", "of", " ", "identify", "ing", " ", "the", " ", "RDF", " ", "data", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "A", " ", "Triple", " ", "Stor", "e", " ", "generat", "ed", " ", "in", " ", "the", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "graph_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "graph_", "=_", "defs_", "[_", "\"", "graph", "\"_", "]_", "\\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_", "#", " ", "2", ".", " ", "Direct", "ly", " ", "in", " ", "the", " ", "test", " ", "module", " ", "as", " ", "a", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rdf", "Data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rdf", "Data_", "=_", "defs_", "[_", "\"", "rdf", "Data", "\"_", "]_", "\\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_", "#", " ", "Get", " ", "the", " ", "final", " ", "of", " ", "the", " ", "triple", " ", "store", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "graph_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream_", "=_", "File", "Inp", "ut", "Source_", "(_", "String", "IO_", "._", "String", "IO_", "(_", "rdf", "Data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "=_", "sparql", "Graph_", "._", "SPAR", "QL", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "._", "parse_", "(_", "stream_", ",_", "format_", "=_", "\"", "xml", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Retri", "ve", " ", "the", " ", "query", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pattern_", "=_", "defs_", "[_", "\"", "pattern", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opt", "Pattern_", "=_", "defs_", "[_", "\"", "option", "al", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "construct_", "=_", "defs_", "[_", "\"", "construct", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###", "\t\t_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"\\\\", "n", "============", "=", " ", "Test", " ", "Modul", "e", ":", " ", "%", "s", " ", "============", "=\"_", "%_", "mod", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "graph_", "._", "query", "Object_", "(_", "pattern_", ",_", "opt", "Pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "=_", "results_", "._", "construct_", "(_", "construct_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "._", "serialize_", "(_", "\"", "output", ".", "rdf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"==", "=", " ", "generat", "ed", " ", "RDF", " ", "file", " ", "(", "output", ".", "rdf", "):", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "l_", "in_", "file_", "(_", "\"", "output", ".", "rdf", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "l_", ")_", "\\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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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 ]
Except block handles 'BaseException'
Legrandin/PyAuthenNTLM2/pyntlm.py
[ { "content": "def authenhandler(req):\n '''The request handler called by mod_python in the authentication phase.'''\n req.log_error(\"PYNTLM: Handling connection 0x%X for %s URI %s. %d entries in connection cache.\" % (\n req.connection.id, req.method,req.unparsed_uri,len(cache)), apache.APLOG_INFO)\n\n # Extract Authorization header, as a list (if present)\n auth_headers = req.headers_in.get('Authorization', [])\n if not isinstance(auth_headers, list):\n auth_headers = [ auth_headers ]\n\n # If this connection was authenticated with NTLM, quit immediately with an OK\n # (unless it comes from IE).\n user = req.connection.notes.get('NTLM_AUTHORIZED', None)\n if user:\n req.user = user\n # Internet Explorer sends a Type 1 authorization request with an empty\n # POST, even if the connection is already authenticated.\n # We don't de-authenticate the user (meaning that we don't remove the\n # NTLM_AUTHORIZED key from connection.notes), but we still let a new\n # challenge-response exchange take place.\n # For other methods, it is acceptable to return OK immediately.\n if auth_headers:\n req.log_error('PYTNLM: Spurious authentication request on connection 0x%X. Method = %s. Content-Length = %d. Headers = %s' % (\n req.connection.id, req.method, req.clength, auth_headers), apache.APLOG_INFO)\n if req.method!='POST' or req.clength>0:\n return apache.OK\n else:\n return apache.OK\n \n # If there is no Authorization header it means it is the first request.\n # We reject it with a 401, indicating which authentication protocol we understand.\n if not auth_headers:\n return handle_unauthorized(req)\n\n # Extract authentication data from any of the Authorization headers\n try:\n for ah in auth_headers:\n ah_data = decode_http_authorization_header(ah)\n if ah_data:\n break\n except:\n ah_data = False\n \n if not ah_data:\n req.log_error('Error when parsing Authorization header for URI %s' % req.unparsed_uri, apache.APLOG_ERR)\n return apache.HTTP_BAD_REQUEST\n\n if ah_data[0]=='Basic':\n # If this connection was authenticated with Basic, verify that the\n # credentials match and return 200 (if they do) or 401 (if they\n # don't). We don't need to actually query the DC for that.\n userpwd = req.connection.notes.get('BASIC_AUTHORIZED', None)\n if userpwd:\n if userpwd != ah_data[1]+ah_data[2]:\n return handle_unauthorized(req)\n domain = req.get_options().get('Domain', req.auth_name())\n set_remote_user(req, ah_data[1], domain)\n return apache.OK\n # Connection was not authenticated before\n return handle_basic(req, ah_data[1], ah_data[2])\n\n # If we get here it means that there is an Authorization header, with an\n # NTLM message in it. Moreover, the connection needs to be (re)authenticated.\n # Most likely, the NTLM message is of:\n # - Type 1 (and there is nothing in the cache): the client wants to\n # authenticate for the first time,\n # - Type 3 (and there is something in the cache): the client wants to finalize\n # a pending authentication request.\n #\n # However, it could still be that there is a Type 3 and nothing in the\n # cache (the final client message was erroneously routed to a new connection),\n # or that there is a Type 1 with something in the cache (the client wants to\n # initiate an cancel a pending authentication).\n\n try:\n ntlm_version = ntlm_message_type(ah_data[1])\n if ntlm_version==1:\n return handle_type1(req, ah_data[1]) \n if ntlm_version==3:\n if cache.has_key(req.connection.id):\n return handle_type3(req, ah_data[1])\n req.log_error('Unexpected NTLM message Type 3 in new connection for URI %s' %\n (req.unparsed_uri), apache.APLOG_INFO)\n return handle_unauthorized(req)\n error = 'Type 2 message in client request'\n except Exception, e:\n error = str(e)\n req.log_error('Incorrect NTLM message in Authorization header for URI %s: %s' %\n (req.unparsed_uri,error), apache.APLOG_ERR)\n return apache.HTTP_BAD_REQUEST", "metadata": "root.authenhandler", "header": "['module', '___EOS___']", "index": 380 } ]
[ { "span": "except:", "start_line": 420, "start_column": 4, "end_line": 420, "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "authe", "nha", "ndl", "er_", "(_", "req_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "The", " ", "request", " ", "handler", " ", "call", "ed", " ", "by", " ", "mod", "\\u", "python", " ", "in", " ", "the", " ", "authenticat", "ion", " ", "phase", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "._", "log", "\\u", "error_", "(_", "\"", "PY", "NTLM", ":", " ", "Hand", "ling", " ", "connecti", "on", " ", "0", "x", "%", "X", " ", "for", " ", "%", "s", " ", "URI", " ", "%", "s", ".", " ", "%", "d", " ", "entri", "es", " ", "in", " ", "connecti", "on", " ", "cache", ".\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "req_", "._", "connection_", "._", "id_", ",_", "req_", "._", "method_", ",_", "req_", "._", "unparse", "d\\u", "uri_", ",_", "len_", "(_", "cache_", ")_", ")_", ",_", "apache_", "._", "AP", "LOG", "\\u", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "Authoriz", "ation", " ", "header", ",", " ", "as", " ", "a", " ", "list", " ", "(", "if", " ", "presen", "t", ")_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "headers_", "=_", "req_", "._", "header", "s", "\\u", "in_", "._", "get_", "(_", "'", "Authoriz", "ation", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "auth", "\\u", "headers_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "auth", "\\u", "headers_", "=_", "[_", "auth", "\\u", "headers_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "connecti", "on", " ", "was", " ", "authenticat", "ed", " ", "with", " ", "NTLM", ",", " ", "quit", " ", "immediate", "ly", " ", "with", " ", "an", " ", "OK_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "unl", "ess", " ", "it", " ", "come", "s", " ", "from", " ", "IE", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user_", "=_", "req_", "._", "connection_", "._", "notes_", "._", "get_", "(_", "'", "NTLM", "\\u", "AUTHORI", "ZED", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Intern", "et", " ", "Explorer", " ", "send", "s", " ", "a", " ", "Type", " ", "1", " ", "authoriz", "ation", " ", "request", " ", "with", " ", "an", " ", "empty_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POST", ",", " ", "even", " ", "if", " ", "the", " ", "connecti", "on", " ", "is", " ", "alr", "ead", "y", " ", "authenticat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "de", "-", "authenticat", "e", " ", "the", " ", "user", " ", "(", "meaning", " ", "tha", "t", " ", "we", " ", "don", "'", "t", " ", "remove", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NTLM", "\\u", "AUTHORI", "ZED", " ", "key", " ", "from", " ", "connecti", "on", ".", "note", "s", "),", " ", "but", " ", "we", " ", "still", " ", "let", " ", "a", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "chall", "enge", "-", "response", " ", "exchange", " ", "take", " ", "place", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "other", " ", "method", "s", ",", " ", "it", " ", "is", " ", "acceptabl", "e", " ", "to", " ", "return", " ", "OK", " ", "immediate", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "auth", "\\u", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "._", "log", "\\u", "error_", "(_", "'", "PYT", "NL", "M", ":", " ", "Sp", "uri", "ous", " ", "authenticat", "ion", " ", "request", " ", "on", " ", "connecti", "on", " ", "0", "x", "%", "X", ".", " ", "Meth", "od", " ", "=", " ", "%", "s", ".", " ", "Conten", "t", "-", "Length", " ", "=", " ", "%", "d", ".", " ", "Head", "ers", " ", "=", " ", "%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "req_", "._", "connection_", "._", "id_", ",_", "req_", "._", "method_", ",_", "req_", "._", "cle", "ngt", "h_", ",_", "auth", "\\u", "headers_", ")_", ",_", "apache_", "._", "AP", "LOG", "\\u", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "req_", "._", "method_", "!=_", "'", "POST", "'_", "or_", "req_", "._", "cle", "ngt", "h_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "apache_", "._", "OK_", "\\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_", "apache_", "._", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "there", " ", "is", " ", "no", " ", "Authoriz", "ation", " ", "header", " ", "it", " ", "means", " ", "it", " ", "is", " ", "the", " ", "first", " ", "request", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "reject", " ", "it", " ", "with", " ", "a", " ", "401", ",", " ", "indicati", "ng", " ", "whi", "ch", " ", "authenticat", "ion", " ", "protoc", "ol", " ", "we", " ", "underst", "and", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "auth", "\\u", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "handle", "\\u", "unauthorized", "_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "authenticat", "ion", " ", "data", " ", "from", " ", "any", " ", "of", " ", "the", " ", "Authoriz", "ation", " ", "headers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ah", "_", "in_", "auth", "\\u", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ah", "\\u", "data_", "=_", "decode", "\\u", "http", "\\u", "authoriz", "ation", "\\u", "header_", "(_", "ah", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ah", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ah", "\\u", "data_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ah", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "._", "log", "\\u", "error_", "(_", "'", "Error", " ", "whe", "n", " ", "pars", "ing", " ", "Authoriz", "ation", " ", "header", " ", "for", " ", "URI", " ", "%", "s", "'_", "%_", "req_", "._", "unparse", "d\\u", "uri_", ",_", "apache_", "._", "AP", "LOG", "\\u", "ERR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "apache_", "._", "HTTP", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ah", "\\u", "data_", "[_", "0_", "]_", "==_", "'", "Basic", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "connecti", "on", " ", "was", " ", "authenticat", "ed", " ", "with", " ", "Basic", ",", " ", "verify", " ", "tha", "t", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cred", "ential", "s", " ", "match", " ", "and", " ", "return", " ", "200", " ", "(", "if", " ", "the", "y", " ", "do", ")", " ", "or", " ", "401", " ", "(", "if", " ", "the", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "don", "'", "t", ").", " ", "We", " ", "don", "'", "t", " ", "need", " ", "to", " ", "actual", "ly", " ", "query", " ", "the", " ", "DC", " ", "for", " ", "tha", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "userp", "wd_", "=_", "req_", "._", "connection_", "._", "notes_", "._", "get_", "(_", "'", "BASIC", "\\u", "AUTHORI", "ZED", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "userp", "wd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "userp", "wd_", "!=_", "ah", "\\u", "data_", "[_", "1_", "]_", "+_", "ah", "\\u", "data_", "[_", "2_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "handle", "\\u", "unauthorized", "_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "domain_", "=_", "req_", "._", "get", "\\u", "options_", "(_", ")_", "._", "get_", "(_", "'", "Doma", "in", "'_", ",_", "req_", "._", "auth", "\\u", "name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "remote", "\\u", "user_", "(_", "req_", ",_", "ah", "\\u", "data_", "[_", "1_", "]_", ",_", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "apache_", "._", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Connect", "ion", " ", "was", " ", "not", " ", "authenticat", "ed", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "handle", "\\u", "basic_", "(_", "req_", ",_", "ah", "\\u", "data_", "[_", "1_", "]_", ",_", "ah", "\\u", "data_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "get", " ", "here", " ", "it", " ", "means", " ", "tha", "t", " ", "there", " ", "is", " ", "an", " ", "Authoriz", "ation", " ", "header", ",", " ", "with", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NTLM", " ", "message", " ", "in", " ", "it", ".", " ", "Mor", "eo", "ver", ",", " ", "the", " ", "connecti", "on", " ", "need", "s", " ", "to", " ", "be", " ", "(", "re", ")", "authenticat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mos", "t", " ", "like", "ly", ",", " ", "the", " ", "NTLM", " ", "message", " ", "is", " ", "of", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "Type", " ", "1", " ", "(", "and", " ", "there", " ", "is", " ", "not", "hing", " ", "in", " ", "the", " ", "cache", "):", " ", "the", " ", "client", " ", "want", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "authenticat", "e", " ", "for", " ", "the", " ", "first", " ", "time", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "Type", " ", "3", " ", "(", "and", " ", "there", " ", "is", " ", "somet", "hing", " ", "in", " ", "the", " ", "cache", "):", " ", "the", " ", "client", " ", "want", "s", " ", "to", " ", "finalize_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "a", " ", "pend", "ing", " ", "authenticat", "ion", " ", "request", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "we", "ver", ",", " ", "it", " ", "coul", "d", " ", "still", " ", "be", " ", "tha", "t", " ", "there", " ", "is", " ", "a", " ", "Type", " ", "3", " ", "and", " ", "not", "hing", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cache", " ", "(", "the", " ", "final", " ", "client", " ", "message", " ", "was", " ", "erro", "neous", "ly", " ", "route", "d", " ", "to", " ", "a", " ", "new", " ", "connecti", "on", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "tha", "t", " ", "there", " ", "is", " ", "a", " ", "Type", " ", "1", " ", "with", " ", "somet", "hing", " ", "in", " ", "the", " ", "cache", " ", "(", "the", " ", "client", " ", "want", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "initiate", " ", "an", " ", "cancel", " ", "a", " ", "pend", "ing", " ", "authenticat", "ion", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ntl", "m", "\\u", "version_", "=_", "ntl", "m", "\\u", "message", "\\u", "type_", "(_", "ah", "\\u", "data_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ntl", "m", "\\u", "version_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "handle", "\\u", "type1_", "(_", "req_", ",_", "ah", "\\u", "data_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ntl", "m", "\\u", "version_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cache_", "._", "has", "\\u", "key_", "(_", "req_", "._", "connection_", "._", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "handle", "\\u", "type", "3_", "(_", "req_", ",_", "ah", "\\u", "data_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "req_", "._", "log", "\\u", "error_", "(_", "'", "Une", "xpe", "cte", "d", " ", "NTLM", " ", "message", " ", "Type", " ", "3", " ", "in", " ", "new", " ", "connecti", "on", " ", "for", " ", "URI", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "req_", "._", "unparse", "d\\u", "uri_", ")_", ",_", "apache_", "._", "AP", "LOG", "\\u", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "handle", "\\u", "unauthorized", "_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "error_", "=_", "'", "Type", " ", "2", " ", "message", " ", "in", " ", "client", " ", "request", "'_", "\\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 ", " _", "error_", "=_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "req_", "._", "log", "\\u", "error_", "(_", "'", "Inco", "rrect", " ", "NTLM", " ", "message", " ", "in", " ", "Authoriz", "ation", " ", "header", " ", "for", " ", "URI", " ", "%", "s", ":", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "req_", "._", "unparse", "d\\u", "uri_", ",_", "error_", ")_", ",_", "apache_", "._", "AP", "LOG", "\\u", "ERR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "apache_", "._", "HTTP", "\\u", "BAD", "\\u", "REQUEST_" ]
[ 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,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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
marcgibbons/django-rest-framework-docs/cigar_example/cigar_example/restapi/urls.py
[ { "content": "from django.conf.urls import patterns, include, url\n\nfrom cigar_example.restapi import views as api_views\n\n# Uncomment the next two lines to enable the admin:\n# from django.contrib import admin\n# admin.autodiscover()\n\nurlpatterns = patterns('',\n # Examples:\n url(r'custom$', api_views.MyCustomView.as_view(), name='a-custom-view'),\n url(r'cigars/?$', api_views.CigarList.as_view(), name='list_of_cigars'),\n url(r'cigars/(?P<pk>[^/]+)/?$', api_views.CigarDetails.as_view(), name='cigar_details'),\n\n url(r'manufacturers/?$', api_views.ManufacturerList.as_view(), name='list_of_manufacturers'),\n url(r'manufacturers/(?P<pk>[^/]+)/?$', api_views.ManufacturerDetails.as_view(), name='manufacturer_details'),\n\n url(r'countries/?$', api_views.CountryList.as_view(), name='list_of_countries'),\n url(r'countries/(?P<pk>[^/]+)/?$', api_views.CountryDetails.as_view(), name='countries_details'),\n\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_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "cigar", "\\u", "example_", "._", "resta", "pi_", "import_", "views_", "as_", "api", "\\u", "views_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Unco", "mmen", "t", " ", "the", " ", "next", " ", "two", " ", "lines", " ", "to", " ", "enable", " ", "the", " ", "admin", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "django", ".", "contrib", " ", "import", " ", "admin_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "admin", ".", "autodiscover", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "urlpatterns_", "=_", "patterns_", "(_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exam", "ples", ":_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "custom", "$'_", ",_", "api", "\\u", "views_", "._", "My", "Custom", "View_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "'", "a", "-", "custom", "-", "view", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "cigar", "s", "/?$'_", ",_", "api", "\\u", "views_", "._", "Ci", "gar", "List_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "'", "list", "\\u", "of", "\\u", "cigar", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "cigar", "s", "/(", "?", "P", "<", "pk", ">[", "^", "/]+)/", "?$", "'_", ",_", "api", "\\u", "views_", "._", "Ci", "gar", "Details_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "'", "cigar", "\\u", "deta", "il", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "manufactur", "ers", "/?$'_", ",_", "api", "\\u", "views_", "._", "Manufacturer", "List_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "'", "list", "\\u", "of", "\\u", "manufactur", "ers", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "manufactur", "ers", "/(", "?", "P", "<", "pk", ">[", "^", "/]+)/", "?$", "'_", ",_", "api", "\\u", "views_", "._", "Manufacturer", "Details_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "'", "manufactur", "er", "\\u", "deta", "il", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "countr", "ies", "/?$'_", ",_", "api", "\\u", "views_", "._", "Count", "ry", "List_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "'", "list", "\\u", "of", "\\u", "countr", "ies", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "countr", "ies", "/(", "?", "P", "<", "pk", ">[", "^", "/]+)/", "?$", "'_", ",_", "api", "\\u", "views_", "._", "Count", "ry", "Details_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "'", "countr", "ies", "\\u", "deta", "il", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
Masood-M/yalih/mechanize/_html.py
[ { "content": "class Factory:\n \"\"\"Factory for forms, links, etc.\n\n This interface may expand in future.\n\n Public methods:\n\n set_request_class(request_class)\n set_response(response)\n forms()\n links()\n\n Public attributes:\n\n Note that accessing these attributes may raise ParseError.\n\n encoding: string specifying the encoding of response if it contains a text\n document (this value is left unspecified for documents that do not have\n an encoding, e.g. an image file)\n is_html: true if response contains an HTML document (XHTML may be\n regarded as HTML too)\n title: page title, or None if no title or not HTML\n global_form: form object containing all controls that are not descendants\n of any FORM element, or None if the forms_factory does not support\n supplying a global form\n\n \"\"\"\n\n LAZY_ATTRS = [\"encoding\", \"is_html\", \"title\", \"global_form\"]\n\n\n\n\n\n", "metadata": "root.Factory", "header": "['module', '___EOS___']", "index": 446 }, { "content": " def __init__(self, forms_factory, links_factory, title_factory,\n encoding_finder=EncodingFinder(DEFAULT_ENCODING),\n response_type_finder=ResponseTypeFinder(allow_xhtml=False),\n ):\n \"\"\"\n\n Pass keyword arguments only.\n\n default_encoding: character encoding to use if encoding cannot be\n determined (or guessed) from the response. You should turn on\n HTTP-EQUIV handling if you want the best chance of getting this right\n without resorting to this default. The default value of this\n parameter (currently latin-1) may change in future.\n\n \"\"\"\n self._forms_factory = forms_factory\n self._links_factory = links_factory\n self._title_factory = title_factory\n self._encoding_finder = encoding_finder\n self._response_type_finder = response_type_finder\n\n self.set_response(None)", "metadata": "root.Factory.__init__", "header": "['class', 'Factory', ':', '___EOS___']", "index": 476 }, { "content": " def set_request_class(self, request_class):\n \"\"\"Set request class (mechanize.Request by default).\n\n HTMLForm instances returned by .forms() will return instances of this\n class when .click()ed.\n\n \"\"\"\n self._forms_factory.request_class = request_class", "metadata": "root.Factory.set_request_class", "header": "['class', 'Factory', ':', '___EOS___']", "index": 499 }, { "content": " def set_response(self, response):\n \"\"\"Set response.\n\n The response must either be None or implement the same interface as\n objects returned by mechanize.urlopen().\n\n \"\"\"\n self._response = response\n self._forms_genf = self._links_genf = None\n self._get_title = None\n for name in self.LAZY_ATTRS:\n try:\n delattr(self, name)\n except AttributeError:\n pass", "metadata": "root.Factory.set_response", "header": "['class', 'Factory', ':', '___EOS___']", "index": 508 }, { "content": " def __getattr__(self, name):\n if name not in self.LAZY_ATTRS:\n return getattr(self.__class__, name)\n\n if name == \"encoding\":\n self.encoding = self._encoding_finder.encoding(\n copy.copy(self._response))\n return self.encoding\n elif name == \"is_html\":\n self.is_html = self._response_type_finder.is_html(\n copy.copy(self._response), self.encoding)\n return self.is_html\n elif name == \"title\":\n if self.is_html:\n self.title = self._title_factory.title()\n else:\n self.title = None\n return self.title\n elif name == \"global_form\":\n self.forms()\n return self.global_form", "metadata": "root.Factory.__getattr__", "header": "['class', 'Factory', ':', '___EOS___']", "index": 524 }, { "content": " def forms(self):\n \"\"\"Return iterable over HTMLForm-like objects.\n\n Raises mechanize.ParseError on failure.\n \"\"\"\n # this implementation sets .global_form as a side-effect, for benefit\n # of __getattr__ impl\n if self._forms_genf is None:\n try:\n self._forms_genf = CachingGeneratorFunction(\n self._forms_factory.forms())\n except: # XXXX define exception!\n self.set_response(self._response)\n raise\n self.global_form = getattr(\n self._forms_factory, \"global_form\", None)\n return self._forms_genf()", "metadata": "root.Factory.forms", "header": "['class', 'Factory', ':', '___EOS___']", "index": 546 }, { "content": " def links(self):\n \"\"\"Return iterable over mechanize.Link-like objects.\n\n Raises mechanize.ParseError on failure.\n \"\"\"\n if self._links_genf is None:\n try:\n self._links_genf = CachingGeneratorFunction(\n self._links_factory.links())\n except: # XXXX define exception!\n self.set_response(self._response)\n raise\n return self._links_genf()", "metadata": "root.Factory.links", "header": "['class', 'Factory', ':', '___EOS___']", "index": 564 }, { "content": "class DefaultFactory(Factory):\n \"\"\"Based on sgmllib.\"\"\"\n", "metadata": "root.DefaultFactory", "header": "['module', '___EOS___']", "index": 578 }, { "content": " def __init__(self, i_want_broken_xhtml_support=False):\n Factory.__init__(\n self,\n forms_factory=FormsFactory(),\n links_factory=LinksFactory(),\n title_factory=TitleFactory(),\n response_type_finder=ResponseTypeFinder(\n allow_xhtml=i_want_broken_xhtml_support),\n )", "metadata": "root.DefaultFactory.__init__", "header": "['class', 'DefaultFactory', '(', 'Factory', ')', ':', '___EOS___']", "index": 580 }, { "content": " def set_response(self, response):\n Factory.set_response(self, response)\n if response is not None:\n self._forms_factory.set_response(\n copy.copy(response), self.encoding)\n self._links_factory.set_response(\n copy.copy(response), response.geturl(), self.encoding)\n self._title_factory.set_response(\n copy.copy(response), self.encoding)", "metadata": "root.DefaultFactory.set_response", "header": "['class', 'DefaultFactory', '(', 'Factory', ')', ':', '___EOS___']", "index": 590 }, { "content": "class RobustFactory(Factory):\n \"\"\"Based on BeautifulSoup, hopefully a bit more robust to bad HTML than is\n DefaultFactory.\n\n \"\"\"\n", "metadata": "root.RobustFactory", "header": "['module', '___EOS___']", "index": 600 }, { "content": " def __init__(self, i_want_broken_xhtml_support=False,\n soup_class=None):\n Factory.__init__(\n self,\n forms_factory=RobustFormsFactory(),\n links_factory=RobustLinksFactory(),\n title_factory=RobustTitleFactory(),\n response_type_finder=ResponseTypeFinder(\n allow_xhtml=i_want_broken_xhtml_support),\n )\n if soup_class is None:\n soup_class = MechanizeBs\n self._soup_class = soup_class", "metadata": "root.RobustFactory.__init__", "header": "['class', 'RobustFactory', '(', 'Factory', ')', ':', '___EOS___']", "index": 605 }, { "content": " def set_response(self, response):\n Factory.set_response(self, response)\n if response is not None:\n data = response.read()\n soup = self._soup_class(self.encoding, data)\n self._forms_factory.set_response(\n copy.copy(response), self.encoding)\n self._links_factory.set_soup(\n soup, response.geturl(), self.encoding)\n self._title_factory.set_soup(soup, self.encoding)", "metadata": "root.RobustFactory.set_response", "header": "['class', 'RobustFactory', '(', 'Factory', ')', ':', '___EOS___']", "index": 619 } ]
[ { "span": "self.set_response(None)", "start_line": 497, "start_column": 8, "end_line": 497, "end_column": 31 } ]
[ { "span": "def set_response(self, response):", "start_line": 508, "start_column": 4, "end_line": 508, "end_column": 37 }, { "span": "def set_response(self, response):", "start_line": 590, "start_column": 4, "end_line": 590, "end_column": 37 }, { "span": "def set_response(self, response):", "start_line": 619, "start_column": 4, "end_line": 619, "end_column": 37 } ]
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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Factory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Factor", "y", " ", "for", " ", "forms", ",", " ", "link", "s", ",", " ", "etc", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "interface", " ", "may", " ", "expand", " ", "in", " ", "future", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Public", " ", "method", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "set\\u", "request", "\\u", "class", "(", "request", "\\u", "class", ")", "\\", "10", ";", " ", " ", " ", " ", "set\\u", "response", "(", "response", ")", "\\", "10", ";", " ", " ", " ", " ", "forms", "()", "\\", "10", ";", " ", " ", " ", " ", "link", "s", "()", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Public", " ", "attribute", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", " ", "accessi", "ng", " ", "these", " ", "attribute", "s", " ", "may", " ", "raise", " ", "Pars", "e", "Error", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "encoding", ":", " ", "string", " ", "speci", "fy", "ing", " ", "the", " ", "encoding", " ", "of", " ", "response", " ", "if", " ", "it", " ", "contain", "s", " ", "a", " ", "text", "\\", "10", ";", " ", "document", " ", "(", "this", " ", "value", " ", "is", " ", "left", " ", "unspe", "cif", "ied", " ", "for", " ", "document", "s", " ", "tha", "t", " ", "do", " ", "not", " ", "have", "\\", "10", ";", " ", "an", " ", "encoding", ",", " ", "e", ".", "g", ".", " ", "an", " ", "image", " ", "file", ")", "\\", "10", ";", " ", " ", " ", " ", "is", "\\u", "html", ":", " ", "true", " ", "if", " ", "response", " ", "contain", "s", " ", "an", " ", "HTM", "L", " ", "document", " ", "(", "XH", "TML", " ", "may", " ", "be", "\\", "10", ";", " ", "rega", "rde", "d", " ", "as", " ", "HTM", "L", " ", "too", ")", "\\", "10", ";", " ", " ", " ", " ", "title", ":", " ", "page", " ", "title", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "no", " ", "title", " ", "or", " ", "not", " ", "HTM", "L", "\\", "10", ";", " ", " ", " ", " ", "global", "\\u", "form", ":", " ", "form", " ", "object", " ", "contain", "ing", " ", "all", " ", "controls", " ", "tha", "t", " ", "are", " ", "not", " ", "descendants", "\\", "10", ";", " ", "of", " ", "any", " ", "FORM", " ", "element", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "the", " ", "forms", "\\u", "factor", "y", " ", "doe", "s", " ", "not", " ", "support", "\\", "10", ";", " ", "supply", "ing", " ", "a", " ", "global", " ", "form", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LA", "ZY", "\\u", "ATTRS", "_", "=_", "[_", "\"", "encoding", "\"_", ",_", "\"", "is", "\\u", "html", "\"_", ",_", "\"", "title", "\"_", ",_", "\"", "global", "\\u", "form", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Factory_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "forms", "\\u", "factory_", ",_", "link", "s", "\\u", "factory_", ",_", "title", "\\u", "factory_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encoding", "\\u", "finder_", "=_", "Enco", "ding", "Finder_", "(_", "DEF", "AUL", "T", "\\u", "ENCODING_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "response", "\\u", "type", "\\u", "finder_", "=_", "Respons", "e", "Type", "Finder_", "(_", "allow", "\\u", "xh", "tml_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Pass", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "only", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "default", "\\u", "encoding", ":", " ", "character", " ", "encoding", " ", "to", " ", "use", " ", "if", " ", "encoding", " ", "cann", "ot", " ", "be", "\\", "10", ";", " ", " ", " ", " ", " ", "dete", "rmin", "ed", " ", "(", "or", " ", "guessed", ")", " ", "from", " ", "the", " ", "response", ".", " ", " ", "You", " ", "shou", "ld", " ", "turn", " ", "on", "\\", "10", ";", " ", " ", " ", " ", " ", "HTTP", "-", "EQU", "IV", " ", "handling", " ", "if", " ", "you", " ", "want", " ", "the", " ", "best", " ", "chan", "ce", " ", "of", " ", "getti", "ng", " ", "this", " ", "right", "\\", "10", ";", " ", " ", " ", " ", " ", "with", "out", " ", "reso", "rti", "ng", " ", "to", " ", "this", " ", "default", ".", " ", " ", "The", " ", "default", " ", "value", " ", "of", " ", "this", "\\", "10", ";", " ", " ", " ", " ", " ", "parameter", " ", "(", "currentl", "y", " ", "latin", "-1", ")", " ", "may", " ", "change", " ", "in", " ", "future", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "forms", "\\u", "factory_", "=_", "forms", "\\u", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "link", "s", "\\u", "factory_", "=_", "link", "s", "\\u", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "title", "\\u", "factory_", "=_", "title", "\\u", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "encoding", "\\u", "finder_", "=_", "encoding", "\\u", "finder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "response", "\\u", "type", "\\u", "finder_", "=_", "response", "\\u", "type", "\\u", "finder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "response_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Factory_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "request", "\\u", "class_", "(_", "self_", ",_", "request", "\\u", "class_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "request", " ", "class", " ", "(", "mechani", "ze", ".", "Request", " ", "by", " ", "default", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "HTM", "LF", "orm", " ", "instance", "s", " ", "return", "ed", " ", "by", " ", ".", "forms", "()", " ", "will", " ", "return", " ", "instance", "s", " ", "of", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "whe", "n", " ", ".", "click", "()", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "forms", "\\u", "factory_", "._", "request", "\\u", "class_", "=_", "request", "\\u", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Factory_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "response_", "(_", "self_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "response", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "response", " ", "must", " ", "eit", "her", " ", "be", " ", "Non", "e", " ", "or", " ", "implement", " ", "the", " ", "same", " ", "interface", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "object", "s", " ", "return", "ed", " ", "by", " ", "mechani", "ze", ".", "urlo", "pen", "()", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "response_", "=_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "forms", "\\u", "gen", "f_", "=_", "self_", "._", "\\u", "link", "s", "\\u", "gen", "f_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "get", "\\u", "title_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "self_", "._", "LA", "ZY", "\\u", "ATTRS", "_", ":_", "\\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 ", " _", "delattr", "_", "(_", "self_", ",_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Factory_", ":_", "\\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", "getattr\\u\\u_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "not_", "in_", "self_", "._", "LA", "ZY", "\\u", "ATTRS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "name_", "==_", "\"", "encoding", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "encoding_", "=_", "self_", "._", "\\u", "encoding", "\\u", "finder_", "._", "encoding_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "._", "copy_", "(_", "self_", "._", "\\u", "response_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "encoding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "\"", "is", "\\u", "html", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "is", "\\u", "html_", "=_", "self_", "._", "\\u", "response", "\\u", "type", "\\u", "finder_", "._", "is", "\\u", "html_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "._", "copy_", "(_", "self_", "._", "\\u", "response_", ")_", ",_", "self_", "._", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "is", "\\u", "html_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "\"", "title", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "html_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "title_", "=_", "self_", "._", "\\u", "title", "\\u", "factory_", "._", "title_", "(_", ")_", "\\u\\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_", "._", "title_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "title_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "\"", "global", "\\u", "form", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "forms_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "global", "\\u", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Factory_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "forms_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "iterable", " ", "over", " ", "HTM", "LF", "orm", "-", "like", " ", "object", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", " ", "mechani", "ze", ".", "Pars", "e", "Error", " ", "on", " ", "fail", "ure", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "implementation", " ", "sets", " ", ".", "global", "\\u", "form", " ", "as", " ", "a", " ", "side", "-", "effect", ",", " ", "for", " ", "benefit", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "\\u\\u", "getattr", "\\u\\u", " ", "impl_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "forms", "\\u", "gen", "f_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "forms", "\\u", "gen", "f_", "=_", "Caching", "Generat", "or", "Function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "forms", "\\u", "factory_", "._", "forms_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "XXXX", " ", "defin", "e", " ", "exception", "!", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "response_", "(_", "self_", "._", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "global", "\\u", "form_", "=_", "getattr_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "forms", "\\u", "factory_", ",_", "\"", "global", "\\u", "form", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "forms", "\\u", "gen", "f_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Factory_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "links_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "iterable", " ", "over", " ", "mechani", "ze", ".", "Link", "-", "like", " ", "object", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", " ", "mechani", "ze", ".", "Pars", "e", "Error", " ", "on", " ", "fail", "ure", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "link", "s", "\\u", "gen", "f_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "link", "s", "\\u", "gen", "f_", "=_", "Caching", "Generat", "or", "Function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "link", "s", "\\u", "factory_", "._", "links_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "XXXX", " ", "defin", "e", " ", "exception", "!", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "response_", "(_", "self_", "._", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "link", "s", "\\u", "gen", "f_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Default", "Factory_", "(_", "Factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", "d", " ", "on", " ", "sg", "ml", "lib", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Default", "Factory_", "(_", "Factory_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "i", "\\u", "want", "\\u", "broken", "\\u", "xh", "tml", "\\u", "support_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Factory_", "._", "\\u\\u", "init\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "forms", "\\u", "factory_", "=_", "Form", "s", "Factory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "link", "s", "\\u", "factory_", "=_", "Link", "s", "Factory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "factory_", "=_", "Tit", "le", "Factory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "response", "\\u", "type", "\\u", "finder_", "=_", "Respons", "e", "Type", "Finder_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "\\u", "xh", "tml_", "=_", "i", "\\u", "want", "\\u", "broken", "\\u", "xh", "tml", "\\u", "support_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Default", "Factory_", "(_", "Factory_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "response_", "(_", "self_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Factory_", "._", "set\\u", "response_", "(_", "self_", ",_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "forms", "\\u", "factory_", "._", "set\\u", "response_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "._", "copy_", "(_", "response_", ")_", ",_", "self_", "._", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "link", "s", "\\u", "factory_", "._", "set\\u", "response_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "._", "copy_", "(_", "response_", ")_", ",_", "response_", "._", "geturl", "_", "(_", ")_", ",_", "self_", "._", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "title", "\\u", "factory_", "._", "set\\u", "response_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "._", "copy_", "(_", "response_", ")_", ",_", "self_", "._", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Rob", "ust", "Factory_", "(_", "Factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", "d", " ", "on", " ", "Bea", "uti", "ful", "Sou", "p", ",", " ", "hop", "efu", "ll", "y", " ", "a", " ", "bit", " ", "more", " ", "robust", " ", "to", " ", "bad", " ", "HTM", "L", " ", "than", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "Default", "Factor", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Rob", "ust", "Factory_", "(_", "Factory_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "i", "\\u", "want", "\\u", "broken", "\\u", "xh", "tml", "\\u", "support_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "soup", "\\u", "class_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Factory_", "._", "\\u\\u", "init\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "forms", "\\u", "factory_", "=_", "Rob", "ust", "Form", "s", "Factory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "link", "s", "\\u", "factory_", "=_", "Rob", "ust", "Link", "s", "Factory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title", "\\u", "factory_", "=_", "Rob", "ust", "Tit", "le", "Factory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "response", "\\u", "type", "\\u", "finder_", "=_", "Respons", "e", "Type", "Finder_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "\\u", "xh", "tml_", "=_", "i", "\\u", "want", "\\u", "broken", "\\u", "xh", "tml", "\\u", "support_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "soup", "\\u", "class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "soup", "\\u", "class_", "=_", "Mechani", "ze", "Bs", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "soup", "\\u", "class_", "=_", "soup", "\\u", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rob", "ust", "Factory_", "(_", "Factory_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "response_", "(_", "self_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Factory_", "._", "set\\u", "response_", "(_", "self_", ",_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soup_", "=_", "self_", "._", "\\u", "soup", "\\u", "class_", "(_", "self_", "._", "encoding_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "forms", "\\u", "factory_", "._", "set\\u", "response_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "._", "copy_", "(_", "response_", ")_", ",_", "self_", "._", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "link", "s", "\\u", "factory_", "._", "set\\u", "soup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "soup_", ",_", "response_", "._", "ge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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
CybOXProject/python-cybox/cybox/bindings/unix_network_route_entry_object.py
[ { "content": " def exportChildren(self, lwrite, level, namespace_='UnixNetworkRouteEntryObj:', name_='UnixNetworkRouteEntryObjectType', fromsubclass_=False, pretty_print=True):\n super(UnixNetworkRouteEntryObjectType, self).exportChildren(lwrite, level, 'UnixNetworkRouteEntryObj:', name_, True, pretty_print=pretty_print)\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n if self.Flags is not None:\n self.Flags.export(lwrite, level, 'UnixNetworkRouteEntryObj:', name_='Flags', pretty_print=pretty_print)\n if self.MSS is not None:\n self.MSS.export(lwrite, level, 'UnixNetworkRouteEntryObj:', name_='MSS', pretty_print=pretty_print)\n if self.Ref is not None:\n self.Ref.export(lwrite, level, 'UnixNetworkRouteEntryObj:', name_='Ref', pretty_print=pretty_print)\n if self.Use is not None:\n self.Use.export(lwrite, level, 'UnixNetworkRouteEntryObj:', name_='Use', pretty_print=pretty_print)\n if self.Window is not None:\n self.Window.export(lwrite, level, 'UnixNetworkRouteEntryObj:', name_='Window', pretty_print=pretty_print)", "metadata": "root.UnixNetworkRouteEntryObjectType.exportChildren", "header": "['class', 'UnixNetworkRouteEntryObjectType', '(', 'network_route_entry_object', '.', 'NetworkRouteEntryObjectType', ')', ':', '___EOS___']", "index": 78 }, { "content": "def parse(inFileName):\n doc = parsexml_(inFileName)\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'Unix_Network_Route_Entry'\n rootClass = UnixNetworkRouteEntryObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n# sys.stdout.write('<?xml version=\"1.0\" ?>\\n')\n# rootObj.export(sys.stdout.write, 0, name_=rootTag,\n# namespacedef_='',\n# pretty_print=True)\n return rootObj", "metadata": "root.parse", "header": "['module', '___EOS___']", "index": 248 }, { "content": "def parseEtree(inFileName):\n doc = parsexml_(inFileName)\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'Unix_Network_Route_Entry'\n rootClass = UnixNetworkRouteEntryObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n rootElement = rootObj.to_etree(None, name_=rootTag)\n content = etree_.tostring(rootElement, pretty_print=True,\n xml_declaration=True, encoding=\"utf-8\")\n sys.stdout.write(content)\n sys.stdout.write('\\n')\n return rootObj, rootElement", "metadata": "root.parseEtree", "header": "['module', '___EOS___']", "index": 265 }, { "content": "def parseString(inString):\n from mixbox.vendor.six import StringIO\n doc = parsexml_(StringIO(inString))\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'Unix_Network_Route_Entry'\n rootClass = UnixNetworkRouteEntryObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n# sys.stdout.write('<?xml version=\"1.0\" ?>\\n')\n# rootObj.export(sys.stdout.write, 0, name_=\"Unix_Network_Route_Entry\",\n# namespacedef_='')\n return rootObj", "metadata": "root.parseString", "header": "['module', '___EOS___']", "index": 283 } ]
[ { "span": "eol_ ", "start_line": 81, "start_column": 12, "end_line": 81, "end_column": 16 }, { "span": "eol_ ", "start_line": 83, "start_column": 12, "end_line": 83, "end_column": 16 }, { "span": "rootTag ", "start_line": 253, "start_column": 8, "end_line": 253, "end_column": 15 }, { "span": "doc ", "start_line": 258, "start_column": 4, "end_line": 258, "end_column": 7 }, { "span": "doc ", "start_line": 275, "start_column": 4, "end_line": 275, "end_column": 7 }, { "span": "rootTag ", "start_line": 289, "start_column": 8, "end_line": 289, "end_column": 15 }, { "span": "doc ", "start_line": 294, "start_column": 4, "end_line": 294, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Uni", "x", "Network", "Route", "Entr", "y", "Object", "Type_", "(_", "network", "\\u", "route", "\\u", "entry", "\\u", "object_", "._", "Network", "Route", "Entr", "y", "Object", "Type_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Uni", "x", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Uni", "x", "Network", "Route", "Entr", "y", "Object", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Uni", "x", "Network", "Route", "Entr", "y", "Object", "Type_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Uni", "x", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", ",_", "True_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Flags_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Flags_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Uni", "x", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Fla", "gs", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "MS", "S_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "MS", "S_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Uni", "x", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "MS", "S", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Ref_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Ref_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Uni", "x", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Ref", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Use_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Use_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Uni", "x", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Us", "e", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Window_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Window_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Uni", "x", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Window", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "in", "File", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "parse", "xml", "\\u_", "(_", "in", "File", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "Uni", "x", "\\u", "Network", "\\u", "Route", "\\u", "Entr", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Uni", "x", "Network", "Route", "Entr", "y", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "sys", ".", "stdout", ".", "write", "('", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "?>", "\\\\", "n", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "root", "Obj", ".", "export", "(", "sys", ".", "stdout", ".", "write", ",", " ", "0", ",", " ", "name", "\\u", "=", "root", "Ta", "g", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "namespace", "def", "\\u", "=''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pretty", "\\u", "print", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "root", "Obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "Et", "ree_", "(_", "in", "File", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "parse", "xml", "\\u_", "(_", "in", "File", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "Uni", "x", "\\u", "Network", "\\u", "Route", "\\u", "Entr", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Uni", "x", "Network", "Route", "Entr", "y", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Element_", "=_", "root", "Obj_", "._", "to", "\\u", "etree_", "(_", "None_", ",_", "name\\u_", "=_", "root", "Tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "etree", "\\u_", "._", "tostring_", "(_", "root", "Element_", ",_", "pretty", "\\u", "print_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xml", "\\u", "declaration_", "=_", "True_", ",_", "encoding_", "=_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "root", "Obj_", ",_", "root", "Element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "String_", "(_", "in", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "mix", "box_", "._", "vendor_", "._", "six_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "parse", "xml", "\\u_", "(_", "String", "IO_", "(_", "in", "String_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "Uni", "x", "\\u", "Network", "\\u", "Route", "\\u", "Entr", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Uni", "x", "Network", "Route", "Entr", "y", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "sys", ".", "stdout", ".", "write", "('", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "?>", "\\\\", "n", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "root", "Obj", ".", "export", "(", "sys", ".", "stdout", ".", "write", ",", " ", "0", ",", " ", "name", "\\u", "=\"", "Uni", "x", "\\u", "Network", "\\u", "Route", "\\u", "Entr", "y", "\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 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 ]
Testing equality to None
saullocastro/mapy/mapy/model/coords.py
[ { "content": " def read_inputs( self, inputs = {} ):\n if len(inputs) > 0:\n self = user_setattr(self, inputs)\n if self.id == None and self.ida <> None:\n self.id = int(self.ida)\n CSYSGLOBAL = mapy.constants.CSYSGLOBAL\n self.rcid = 0\n self.rcobj = CSYSGLOBAL", "metadata": "root.Coord.read_inputs", "header": "['class', 'Coord', '(', 'object', ')', ':', '___EOS___']", "index": 114 }, { "content": " def rebuild(self, rcobj = None, force_new_axis = False ):\n new_axis = False\n if self.o == None or self.z == None or self.vecxz == None:\n new_axis = True\n if not new_axis:\n if self.o.__class__.__name__.find('Point') == -1:\n self.o = Point( np.array([ 0,0,0 ], dtype=FLOAT ) )\n if self.z == None:\n print 'Please, enter a valid z axis...'\n raise\n if self.vecxz == None:\n print 'Please, enter a valid vector in the xz plane...'\n raise\n if self.z.__class__.__name__.find('Vec') == -1:\n self.z = Vec( self.z )\n if self.vecxz.__class__.__name__.find('Vec') == -1:\n self.vecxz = Vec( self.vecxz )\n if new_axis or force_new_axis:\n if self.model == None:\n print 'The coordinate system must belong to a model...'\n print 'the user may create a coordsys giving directly:'\n print '- origin as a alg3dpy.Point'\n print '- z axis as a alg3dpy.Vec'\n print '- alg3dpy.Vec laying on xz plane'\n raise\n if self.a1 <> None and self.a2 <> None and self.a3 <> None \\\n and self.b1 <> None and self.b2 <> None and self.b3 <> None \\\n and self.c1 <> None and self.c2 <> None and self.c3 <> None:\n self.rcobj = self.model.coorddict[ int(self.rcid) ]\n if self.rcobj.rebuilt:\n #FIXME destroying the reference to rcobj original\n p1 = np.array([self.a1, self.a2, self.a3], dtype=FLOAT)\n p2 = np.array([self.b1, self.b2, self.b3], dtype=FLOAT)\n p3 = np.array([self.c1, self.c2, self.c3], dtype=FLOAT)\n CSYSGLOBAL = mapy.constants.CSYSGLOBAL\n p1 = self.rcobj.transform( p1, CSYSGLOBAL )\n p2 = self.rcobj.transform( p2, CSYSGLOBAL )\n p3 = self.rcobj.transform( p3, CSYSGLOBAL )\n self.rcid = CSYSGLOBAL.id \n self.rcobj = CSYSGLOBAL\n self.o = p1\n self.z = p2 - p1\n self.vecxz = p3 - p1\n\n else:\n print 'The coordsys cannot be rebuilt. The reference'\n print 'coordsys given by rcid is not rebuilt...'\n raise\n elif self.ida <> None\\\n and self.g1a <> None and self.g2a <> None and self.g3a <> None:\n g1a = self.model.griddict[ int(self.g1a) ]\n g2a = self.model.griddict[ int(self.g2a) ]\n g3a = self.model.griddict[ int(self.g3a) ]\n if not g1a.rebuilt \\\n or not g2a.rebuilt \\\n or not g3a.rebuilt:\n print 'The coordsys cannot be rebuilt. The reference'\n print 'grids g1a, g2a and g3a are not rebuilt...'\n raise\n self.o = Point( g1a.array )\n self.z = g2a - g1a\n self.vecxz = g3a - g1a \n else:\n print 'Something wrong with your inputs'\n print 'Please, see all the attributes below:'\n for slot in self.__slots__:\n print '\\t' + slot + '', getattr(self, slot)\n raise \n\n self.y = self.z.cross( self.vecxz )\n self.x = self.y.cross( self.z )\n self.xy = Plane( self.z[0], self.z[1], self.z[2], self.o.mod() ) \n self.xz = Plane( -self.y[0], -self.y[1], -self.y[2], self.o.mod() )\n self.yz = Plane( self.x[0], self.x[1], self.x[2], self.o.mod() )\n self.rebuilt = True", "metadata": "root.Coord.rebuild", "header": "['class', 'Coord', '(', 'object', ')', ':', '___EOS___']", "index": 175 }, { "content": " def transform(self, vec, new_csys):\n \"\"\"\n The transformation will go as follows:\n - transform to cartesian in the local coordsys;\n - rotate to the new_csys (which is cartesian);\n - translate to the new_csys.\n All systems: cartesian, cylindrical or spherical; have\n the method vec2cr which will automatically transform vec into\n cartesian coordinates in the local coordsys.\n The two other steps will rotate and translate vec to new_csys.\n The last step will transform again from the new_csys cartesian\n coordinates to its cylindrical or spherical coordinates.\n All coordinate systems have the method cr2me to transform from\n local cartesian to local something.\n \n \"\"\"\n #FIXME modify this to keep the original reference to rcobj\n if new_csys == None:\n new_csys = CSYSGLOBAL \n vec_cr = self.vec2cr( vec )\n R = self.Rmatrix( new_csys )\n vec_rot = np.dot( R, vec_cr ) \n vec_t = self.translate( vec_rot, new_csys ) \n vec_final = new_csys.cr2me( vec_t )\n return vec_final", "metadata": "root.Coord.transform", "header": "['class', 'Coord', '(', 'object', ')', ':', '___EOS___']", "index": 251 } ]
[ { "span": "self.id == None ", "start_line": 117, "start_column": 11, "end_line": 117, "end_column": 26 }, { "span": "self.o == None ", "start_line": 177, "start_column": 11, "end_line": 177, "end_column": 25 }, { "span": "self.z == None ", "start_line": 177, "start_column": 29, "end_line": 177, "end_column": 43 }, { "span": "self.vecxz == None:", "start_line": 177, "start_column": 47, "end_line": 177, "end_column": 65 }, { "span": "self.z == None:", "start_line": 182, "start_column": 15, "end_line": 182, "end_column": 29 }, { "span": "self.vecxz == None:", "start_line": 185, "start_column": 15, "end_line": 185, "end_column": 33 }, { "span": "self.model == None:", "start_line": 193, "start_column": 15, "end_line": 193, "end_column": 33 }, { "span": "new_csys == None:", "start_line": 268, "start_column": 11, "end_line": 268, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Coord_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read", "\\u", "inputs_", "(_", "self_", ",_", "inputs_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "inputs_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "=_", "user", "\\u", "setattr_", "(_", "self_", ",_", "inputs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "id_", "==_", "None_", "and_", "self_", "._", "ida", "_", "<_", ">_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "id_", "=_", "int_", "(_", "self_", "._", "ida", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CS", "YS", "GLOBAL_", "=_", "map", "y_", "._", "constants_", "._", "CS", "YS", "GLOBAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rci", "d_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rco", "bj_", "=_", "CS", "YS", "GLOBAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Coord_", "(_", "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_", "rebuild_", "(_", "self_", ",_", "rco", "bj_", "=_", "None_", ",_", "force", "\\u", "new", "\\u", "axis_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "axis_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "o_", "==_", "None_", "or_", "self_", "._", "z_", "==_", "None_", "or_", "self_", "._", "vec", "xz", "_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "axis_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "new", "\\u", "axis_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "o_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "._", "find_", "(_", "'", "Point", "'_", ")_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "o_", "=_", "Point_", "(_", "np_", "._", "array_", "(_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "dtype_", "=_", "FLOAT_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "z_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Ple", "ase", ",", " ", "enter", " ", "a", " ", "valid", " ", "z", " ", "axis", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "vec", "xz", "_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Ple", "ase", ",", " ", "enter", " ", "a", " ", "valid", " ", "vector", " ", "in", " ", "the", " ", "xz", " ", "plane", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "z_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "._", "find_", "(_", "'", "Vec", "'_", ")_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "z_", "=_", "Vec_", "(_", "self_", "._", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "vec", "xz", "_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "._", "find_", "(_", "'", "Vec", "'_", ")_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "vec", "xz", "_", "=_", "Vec_", "(_", "self_", "._", "vec", "xz", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "new", "\\u", "axis_", "or_", "force", "\\u", "new", "\\u", "axis_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "model_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "The", " ", "coordinate", " ", "system", " ", "must", " ", "belo", "ng", " ", "to", " ", "a", " ", "model", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "the", " ", "user", " ", "may", " ", "create", " ", "a", " ", "coords", "ys", " ", "gi", "ving", " ", "direct", "ly", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-", " ", "orig", "in", " ", "as", " ", "a", " ", "alg", "3d", "py", ".", "Point", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-", " ", "z", " ", "axis", " ", "as", " ", "a", " ", "alg", "3d", "py", ".", "Vec", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-", " ", "alg", "3d", "py", ".", "Vec", " ", "lay", "ing", " ", "on", " ", "xz", " ", "plane", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "a1_", "<_", ">_", "None_", "and_", "self_", "._", "a2_", "<_", ">_", "None_", "and_", "self_", "._", "a3_", "<_", ">_", "None_", "and_", "self_", "._", "b1_", "<_", ">_", "None_", "and_", "self_", "._", "b2_", "<_", ">_", "None_", "and_", "self_", "._", "b3_", "<_", ">_", "None_", "and_", "self_", "._", "c1_", "<_", ">_", "None_", "and_", "self_", "._", "c2_", "<_", ">_", "None_", "and_", "self_", "._", "c3_", "<_", ">_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rco", "bj_", "=_", "self_", "._", "model_", "._", "coord", "dict_", "[_", "int_", "(_", "self_", "._", "rci", "d_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rco", "bj_", "._", "rebu", "ilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "FIX", "ME", " ", "destroy", "ing", " ", "the", " ", "reference", " ", "to", " ", "rco", "bj", " ", "original_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "p1_", "=_", "np_", "._", "array_", "(_", "[_", "self_", "._", "a1_", ",_", "self_", "._", "a2_", ",_", "self_", "._", "a3_", "]_", ",_", "dtype_", "=_", "FLOAT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "np_", "._", "array_", "(_", "[_", "self_", "._", "b1_", ",_", "self_", "._", "b2_", ",_", "self_", "._", "b3_", "]_", ",_", "dtype_", "=_", "FLOAT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p3_", "=_", "np_", "._", "array_", "(_", "[_", "self_", "._", "c1_", ",_", "self_", "._", "c2_", ",_", "self_", "._", "c3_", "]_", ",_", "dtype_", "=_", "FLOAT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CS", "YS", "GLOBAL_", "=_", "map", "y_", "._", "constants_", "._", "CS", "YS", "GLOBAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "=_", "self_", "._", "rco", "bj_", "._", "transform_", "(_", "p1_", ",_", "CS", "YS", "GLOBAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "self_", "._", "rco", "bj_", "._", "transform_", "(_", "p2_", ",_", "CS", "YS", "GLOBAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p3_", "=_", "self_", "._", "rco", "bj_", "._", "transform_", "(_", "p3_", ",_", "CS", "YS", "GLOBAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rci", "d_", "=_", "CS", "YS", "GLOBAL_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rco", "bj_", "=_", "CS", "YS", "GLOBAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "o_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "z_", "=_", "p2_", "-_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "vec", "xz", "_", "=_", "p3_", "-_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "The", " ", "coords", "ys", " ", "cann", "ot", " ", "be", " ", "rebu", "ilt", ".", " ", "The", " ", "reference", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "coords", "ys", " ", "give", "n", " ", "by", " ", "rci", "d", " ", "is", " ", "not", " ", "rebu", "ilt", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "ida", "_", "<_", ">_", "None_", "and_", "self_", "._", "g1", "a_", "<_", ">_", "None_", "and_", "self_", "._", "g2", "a_", "<_", ">_", "None_", "and_", "self_", "._", "g3", "a_", "<_", ">_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g1", "a_", "=_", "self_", "._", "model_", "._", "gridd", "ict_", "[_", "int_", "(_", "self_", "._", "g1", "a_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2", "a_", "=_", "self_", "._", "model_", "._", "gridd", "ict_", "[_", "int_", "(_", "self_", "._", "g2", "a_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g3", "a_", "=_", "self_", "._", "model_", "._", "gridd", "ict_", "[_", "int_", "(_", "self_", "._", "g3", "a_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "g1", "a_", "._", "rebu", "ilt", "_", "or_", "not_", "g2", "a_", "._", "rebu", "ilt", "_", "or_", "not_", "g3", "a_", "._", "rebu", "ilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "The", " ", "coords", "ys", " ", "cann", "ot", " ", "be", " ", "rebu", "ilt", ".", " ", "The", " ", "reference", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "grids", " ", "g1", "a", ",", " ", "g2", "a", " ", "and", " ", "g3", "a", " ", "are", " ", "not", " ", "rebu", "ilt", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "o_", "=_", "Point_", "(_", "g1", "a_", "._", "array_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "z_", "=_", "g2", "a_", "-_", "g1", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "vec", "xz", "_", "=_", "g3", "a_", "-_", "g1", "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 ", " _", "print_", "'", "Some", "thing", " ", "wrong", " ", "with", " ", "your", " ", "inputs", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Ple", "ase", ",", " ", "see", " ", "all", " ", "the", " ", "attribute", "s", " ", "belo", "w", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "slot_", "in_", "self_", "._", "\\u\\u", "slots\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'\\\\", "t", "'_", "+_", "slot_", "+_", "''_", ",_", "getattr_", "(_", "self_", ",_", "slot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "y_", "=_", "self_", "._", "z_", "._", "cross_", "(_", "self_", "._", "vec", "xz", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "x_", "=_", "self_", "._", "y_", "._", "cross_", "(_", "self_", "._", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xy_", "=_", "Plane_", "(_", "self_", "._", "z_", "[_", "0_", "]_", ",_", "self_", "._", "z_", "[_", "1_", "]_", ",_", "self_", "._", "z_", "[_", "2_", "]_", ",_", "self_", "._", "o_", "._", "mod_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xz", "_", "=_", "Plane_", "(_", "-_", "self_", "._", "y_", "[_", "0_", "]_", ",_", "-_", "self_", "._", "y_", "[_", "1_", "]_", ",_", "-_", "self_", "._", "y_", "[_", "2_", "]_", ",_", "self_", "._", "o_", "._", "mod_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "yz_", "=_", "Plane_", "(_", "self_", "._", "x_", "[_", "0_", "]_", ",_", "self_", "._", "x_", "[_", "1_", "]_", ",_", "self_", "._", "x_", "[_", "2_", "]_", ",_", "self_", "._", "o_", "._", "mod_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rebu", "ilt", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Coord_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "transform_", "(_", "self_", ",_", "vec_", ",_", "new", "\\u", "cs", "ys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "transformation", " ", "will", " ", "go", " ", "as", " ", "follow", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "transform", " ", "to", " ", "cartesian", " ", "in", " ", "the", " ", "local", " ", "coords", "ys", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "rota", "te", " ", "to", " ", "the", " ", "new", "\\u", "cs", "ys", " ", "(", "whi", "ch", " ", "is", " ", "cartesian", ");", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "translat", "e", " ", "to", " ", "the", " ", "new", "\\u", "cs", "ys", ".", "\\", "10", ";", " ", " ", " ", " ", "All", " ", "system", "s", ":", " ", "cartesian", ",", " ", "cyl", "indr", "ical", " ", "or", " ", "spherical", ";", " ", "have", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "method", " ", "vec2", "cr", " ", "whi", "ch", " ", "will", " ", "automati", "call", "y", " ", "transform", " ", "vec", " ", "int", "o", "\\", "10", ";", " ", " ", " ", " ", "cartesian", " ", "coordinate", "s", " ", "in", " ", "the", " ", "local", " ", "coords", "ys", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "two", " ", "other", " ", "step", "s", " ", "will", " ", "rota", "te", " ", "and", " ", "translat", "e", " ", "vec", " ", "to", " ", "new", "\\u", "cs", "ys", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "last", " ", "step", " ", "will", " ", "transform", " ", "again", " ", "from", " ", "the", " ", "new", "\\u", "cs", "ys", " ", "cartesian", "\\", "10", ";", " ", " ", " ", " ", "coordinate", "s", " ", "to", " ", "its", " ", "cyl", "indr", "ical", " ", "or", " ", "spherical", " ", "coordinate", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "All", " ", "coordinate", " ", "system", "s", " ", "have", " ", "the", " ", "method", " ", "cr", "2m", "e", " ", "to", " ", "transform", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "local", " ", "cartesian", " ", "to", " ", "local", " ", "somet", "hing", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "FIX", "ME", " ", "modif", "y", " ", "this", " ", "to", " ", "keep", " ", "the", " ", "original", " ", "reference", " ", "to", " ", "rco", "bj_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "new", "\\u", "cs", "ys_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "cs", "ys_", "=_", "CS", "YS", "GLOBAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vec", "\\u", "cr_", "=_", "self_", "._", "vec2", "cr_", "(_", "vec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "=_", "self_", "._", "Rm", "atrix", "_", "(_", "new", "\\u", "cs", "ys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vec", "\\u", "rot_", "=_", "np_", "._", "dot_", "(_", "R_", ",_", "vec", "\\u", "cr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vec", "\\u", "t_", "=_", "self_", "._", "translate_", "(_", "vec", "\\u", "rot_", ",_", "new", "\\u", "cs", "ys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vec", "\\u", "final_", "=_", "new", "\\u", "cs", "ys_", "._", "cr", "2m", "e_", "(_", "vec", "\\u", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "vec", "\\u", "final_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
longaccess/longaccess-client/lacli/server/interface/ClientInterface/CLI.py
[ { "content": "#\n# Autogenerated by Thrift Compiler (0.9.0)\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n# options string: py:twisted,new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\nfrom thrift.Thrift import TProcessor\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n from thrift.protocol import fastbinary\nexcept:\n fastbinary = None\n\nfrom zope.interface import Interface, implements\nfrom twisted.internet import defer\nfrom thrift.transport import TTwisted\n\n\n\n\n\n\n\n# HELPER FUNCTIONS AND STRUCTURES\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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 Iface(Interface):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Iface", "header": "['module', '___EOS___']", "index": 22 }, { "content": " def PingCLI():\n pass", "metadata": "root.Iface.PingCLI", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 23 }, { "content": " def CloseWhenPossible():\n pass", "metadata": "root.Iface.CloseWhenPossible", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 26 }, { "content": " def LoginUser(username, Pass, Remember):\n \"\"\"\n Parameters:\n - username\n - Pass\n - Remember\n \"\"\"\n pass", "metadata": "root.Iface.LoginUser", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 29 }, { "content": " def UserIsLoggedIn():\n pass", "metadata": "root.Iface.UserIsLoggedIn", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 38 }, { "content": " def Logout():\n pass", "metadata": "root.Iface.Logout", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 41 }, { "content": " def GetCapsules():\n pass", "metadata": "root.Iface.GetCapsules", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 44 }, { "content": " def CreateArchive(filePaths):\n \"\"\"\n Parameters:\n - filePaths\n \"\"\"\n pass", "metadata": "root.Iface.CreateArchive", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 47 }, { "content": " def GetUploads():\n pass", "metadata": "root.Iface.GetUploads", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 54 }, { "content": " def UploadToCapsule(ArchiveLocalID, CapsuleID, title, description, sandbox):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n - CapsuleID\n - title\n - description\n - sandbox\n \"\"\"\n pass", "metadata": "root.Iface.UploadToCapsule", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 57 }, { "content": " def ResumeUpload(ArchiveLocalID):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n \"\"\"\n pass", "metadata": "root.Iface.ResumeUpload", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 68 }, { "content": " def QueryArchiveStatus(ArchiveLocalID):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n \"\"\"\n pass", "metadata": "root.Iface.QueryArchiveStatus", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 75 }, { "content": " def PauseUpload(ArchiveLocalID):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n \"\"\"\n pass", "metadata": "root.Iface.PauseUpload", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 82 }, { "content": " def CancelUpload(ArchiveLocalID):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n \"\"\"\n pass", "metadata": "root.Iface.CancelUpload", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 89 }, { "content": " def GetCertificates():\n pass", "metadata": "root.Iface.GetCertificates", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 96 }, { "content": " def ExportCertificate(ArchiveID, format):\n \"\"\"\n Parameters:\n - ArchiveID\n - format\n \"\"\"\n pass", "metadata": "root.Iface.ExportCertificate", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 99 }, { "content": " def Decrypt(archivePath, key, destinationPath):\n \"\"\"\n Parameters:\n - archivePath\n - key\n - destinationPath\n \"\"\"\n pass", "metadata": "root.Iface.Decrypt", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 107 }, { "content": " def GetSettings():\n pass", "metadata": "root.Iface.GetSettings", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 116 }, { "content": " def SetSettings(settings):\n \"\"\"\n Parameters:\n - settings\n \"\"\"\n pass", "metadata": "root.Iface.SetSettings", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 119 }, { "content": " def GetLatestVersion():\n pass", "metadata": "root.Iface.GetLatestVersion", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 126 }, { "content": " def GetVersion():\n pass", "metadata": "root.Iface.GetVersion", "header": "['class', 'Iface', '(', 'Interface', ')', ':', '___EOS___']", "index": 129 }, { "content": "class Client(object):\n implements(Iface)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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.Client", "header": "['module', '___EOS___']", "index": 133 }, { "content": " def __init__(self, transport, oprot_factory):\n self._transport = transport\n self._oprot_factory = oprot_factory\n self._seqid = 0\n self._reqs = {}", "metadata": "root.Client.__init__", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 136 }, { "content": " def PingCLI(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_PingCLI()\n return d", "metadata": "root.Client.PingCLI", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 142 }, { "content": " def send_PingCLI(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('PingCLI', TMessageType.CALL, self._seqid)\n args = PingCLI_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_PingCLI", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 148 }, { "content": " def recv_PingCLI(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = PingCLI_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"PingCLI failed: unknown result\"))", "metadata": "root.Client.recv_PingCLI", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 156 }, { "content": " def CloseWhenPossible(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_CloseWhenPossible()\n return d", "metadata": "root.Client.CloseWhenPossible", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 170 }, { "content": " def send_CloseWhenPossible(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('CloseWhenPossible', TMessageType.CALL, self._seqid)\n args = CloseWhenPossible_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_CloseWhenPossible", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 176 }, { "content": " def recv_CloseWhenPossible(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = CloseWhenPossible_result()\n result.read(iprot)\n iprot.readMessageEnd()\n return d.callback(None)", "metadata": "root.Client.recv_CloseWhenPossible", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 184 }, { "content": " def LoginUser(self, username, Pass, Remember):\n \"\"\"\n Parameters:\n - username\n - Pass\n - Remember\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_LoginUser(username, Pass, Remember)\n return d", "metadata": "root.Client.LoginUser", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 196 }, { "content": " def send_LoginUser(self, username, Pass, Remember):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('LoginUser', TMessageType.CALL, self._seqid)\n args = LoginUser_args()\n args.username = username\n args.Pass = Pass\n args.Remember = Remember\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_LoginUser", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 208 }, { "content": " def recv_LoginUser(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = LoginUser_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n if result.error is not None:\n return d.errback(result.error)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"LoginUser failed: unknown result\"))", "metadata": "root.Client.recv_LoginUser", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 219 }, { "content": " def UserIsLoggedIn(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_UserIsLoggedIn()\n return d", "metadata": "root.Client.UserIsLoggedIn", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 235 }, { "content": " def send_UserIsLoggedIn(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('UserIsLoggedIn', TMessageType.CALL, self._seqid)\n args = UserIsLoggedIn_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_UserIsLoggedIn", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 241 }, { "content": " def recv_UserIsLoggedIn(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = UserIsLoggedIn_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"UserIsLoggedIn failed: unknown result\"))", "metadata": "root.Client.recv_UserIsLoggedIn", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 249 }, { "content": " def Logout(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_Logout()\n return d", "metadata": "root.Client.Logout", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 263 }, { "content": " def send_Logout(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('Logout', TMessageType.CALL, self._seqid)\n args = Logout_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_Logout", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 269 }, { "content": " def recv_Logout(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = Logout_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n if result.error is not None:\n return d.errback(result.error)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"Logout failed: unknown result\"))", "metadata": "root.Client.recv_Logout", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 277 }, { "content": " def GetCapsules(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_GetCapsules()\n return d", "metadata": "root.Client.GetCapsules", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 293 }, { "content": " def send_GetCapsules(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('GetCapsules', TMessageType.CALL, self._seqid)\n args = GetCapsules_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_GetCapsules", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 299 }, { "content": " def recv_GetCapsules(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = GetCapsules_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n if result.error is not None:\n return d.errback(result.error)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"GetCapsules failed: unknown result\"))", "metadata": "root.Client.recv_GetCapsules", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 307 }, { "content": " def CreateArchive(self, filePaths):\n \"\"\"\n Parameters:\n - filePaths\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_CreateArchive(filePaths)\n return d", "metadata": "root.Client.CreateArchive", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 323 }, { "content": " def send_CreateArchive(self, filePaths):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('CreateArchive', TMessageType.CALL, self._seqid)\n args = CreateArchive_args()\n args.filePaths = filePaths\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_CreateArchive", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 333 }, { "content": " def recv_CreateArchive(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = CreateArchive_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n if result.error is not None:\n return d.errback(result.error)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"CreateArchive failed: unknown result\"))", "metadata": "root.Client.recv_CreateArchive", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 342 }, { "content": " def GetUploads(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_GetUploads()\n return d", "metadata": "root.Client.GetUploads", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 358 }, { "content": " def send_GetUploads(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('GetUploads', TMessageType.CALL, self._seqid)\n args = GetUploads_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_GetUploads", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 364 }, { "content": " def recv_GetUploads(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = GetUploads_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"GetUploads failed: unknown result\"))", "metadata": "root.Client.recv_GetUploads", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 372 }, { "content": " def UploadToCapsule(self, ArchiveLocalID, CapsuleID, title, description, sandbox):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n - CapsuleID\n - title\n - description\n - sandbox\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_UploadToCapsule(ArchiveLocalID, CapsuleID, title, description, sandbox)\n return d", "metadata": "root.Client.UploadToCapsule", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 386 }, { "content": " def send_UploadToCapsule(self, ArchiveLocalID, CapsuleID, title, description, sandbox):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('UploadToCapsule', TMessageType.CALL, self._seqid)\n args = UploadToCapsule_args()\n args.ArchiveLocalID = ArchiveLocalID\n args.CapsuleID = CapsuleID\n args.title = title\n args.description = description\n args.sandbox = sandbox\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_UploadToCapsule", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 400 }, { "content": " def recv_UploadToCapsule(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = UploadToCapsule_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.error is not None:\n return d.errback(result.error)\n return d.callback(None)", "metadata": "root.Client.recv_UploadToCapsule", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 413 }, { "content": " def ResumeUpload(self, ArchiveLocalID):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_ResumeUpload(ArchiveLocalID)\n return d", "metadata": "root.Client.ResumeUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 427 }, { "content": " def send_ResumeUpload(self, ArchiveLocalID):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('ResumeUpload', TMessageType.CALL, self._seqid)\n args = ResumeUpload_args()\n args.ArchiveLocalID = ArchiveLocalID\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_ResumeUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 437 }, { "content": " def recv_ResumeUpload(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = ResumeUpload_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.error is not None:\n return d.errback(result.error)\n return d.callback(None)", "metadata": "root.Client.recv_ResumeUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 446 }, { "content": " def QueryArchiveStatus(self, ArchiveLocalID):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_QueryArchiveStatus(ArchiveLocalID)\n return d", "metadata": "root.Client.QueryArchiveStatus", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 460 }, { "content": " def send_QueryArchiveStatus(self, ArchiveLocalID):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('QueryArchiveStatus', TMessageType.CALL, self._seqid)\n args = QueryArchiveStatus_args()\n args.ArchiveLocalID = ArchiveLocalID\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_QueryArchiveStatus", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 470 }, { "content": " def recv_QueryArchiveStatus(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = QueryArchiveStatus_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n if result.error is not None:\n return d.errback(result.error)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"QueryArchiveStatus failed: unknown result\"))", "metadata": "root.Client.recv_QueryArchiveStatus", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 479 }, { "content": " def PauseUpload(self, ArchiveLocalID):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_PauseUpload(ArchiveLocalID)\n return d", "metadata": "root.Client.PauseUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 495 }, { "content": " def send_PauseUpload(self, ArchiveLocalID):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('PauseUpload', TMessageType.CALL, self._seqid)\n args = PauseUpload_args()\n args.ArchiveLocalID = ArchiveLocalID\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_PauseUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 505 }, { "content": " def recv_PauseUpload(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = PauseUpload_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.error is not None:\n return d.errback(result.error)\n return d.callback(None)", "metadata": "root.Client.recv_PauseUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 514 }, { "content": " def CancelUpload(self, ArchiveLocalID):\n \"\"\"\n Parameters:\n - ArchiveLocalID\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_CancelUpload(ArchiveLocalID)\n return d", "metadata": "root.Client.CancelUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 528 }, { "content": " def send_CancelUpload(self, ArchiveLocalID):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('CancelUpload', TMessageType.CALL, self._seqid)\n args = CancelUpload_args()\n args.ArchiveLocalID = ArchiveLocalID\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_CancelUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 538 }, { "content": " def recv_CancelUpload(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = CancelUpload_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.error is not None:\n return d.errback(result.error)\n return d.callback(None)", "metadata": "root.Client.recv_CancelUpload", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 547 }, { "content": " def GetCertificates(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_GetCertificates()\n return d", "metadata": "root.Client.GetCertificates", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 561 }, { "content": " def send_GetCertificates(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('GetCertificates', TMessageType.CALL, self._seqid)\n args = GetCertificates_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_GetCertificates", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 567 }, { "content": " def recv_GetCertificates(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = GetCertificates_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"GetCertificates failed: unknown result\"))", "metadata": "root.Client.recv_GetCertificates", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 575 }, { "content": " def ExportCertificate(self, ArchiveID, format):\n \"\"\"\n Parameters:\n - ArchiveID\n - format\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_ExportCertificate(ArchiveID, format)\n return d", "metadata": "root.Client.ExportCertificate", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 589 }, { "content": " def send_ExportCertificate(self, ArchiveID, format):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('ExportCertificate', TMessageType.CALL, self._seqid)\n args = ExportCertificate_args()\n args.ArchiveID = ArchiveID\n args.format = format\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_ExportCertificate", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 600 }, { "content": " def recv_ExportCertificate(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = ExportCertificate_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n if result.error is not None:\n return d.errback(result.error)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"ExportCertificate failed: unknown result\"))", "metadata": "root.Client.recv_ExportCertificate", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 610 }, { "content": " def Decrypt(self, archivePath, key, destinationPath):\n \"\"\"\n Parameters:\n - archivePath\n - key\n - destinationPath\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_Decrypt(archivePath, key, destinationPath)\n return d", "metadata": "root.Client.Decrypt", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 626 }, { "content": " def send_Decrypt(self, archivePath, key, destinationPath):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('Decrypt', TMessageType.CALL, self._seqid)\n args = Decrypt_args()\n args.archivePath = archivePath\n args.key = key\n args.destinationPath = destinationPath\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_Decrypt", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 638 }, { "content": " def recv_Decrypt(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = Decrypt_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.error is not None:\n return d.errback(result.error)\n return d.callback(None)", "metadata": "root.Client.recv_Decrypt", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 649 }, { "content": " def GetSettings(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_GetSettings()\n return d", "metadata": "root.Client.GetSettings", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 663 }, { "content": " def send_GetSettings(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('GetSettings', TMessageType.CALL, self._seqid)\n args = GetSettings_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_GetSettings", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 669 }, { "content": " def recv_GetSettings(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = GetSettings_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"GetSettings failed: unknown result\"))", "metadata": "root.Client.recv_GetSettings", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 677 }, { "content": " def SetSettings(self, settings):\n \"\"\"\n Parameters:\n - settings\n \"\"\"\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_SetSettings(settings)\n return d", "metadata": "root.Client.SetSettings", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 691 }, { "content": " def send_SetSettings(self, settings):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('SetSettings', TMessageType.CALL, self._seqid)\n args = SetSettings_args()\n args.settings = settings\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_SetSettings", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 701 }, { "content": " def recv_SetSettings(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = SetSettings_result()\n result.read(iprot)\n iprot.readMessageEnd()\n return d.callback(None)", "metadata": "root.Client.recv_SetSettings", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 710 }, { "content": " def GetLatestVersion(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_GetLatestVersion()\n return d", "metadata": "root.Client.GetLatestVersion", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 722 }, { "content": " def send_GetLatestVersion(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('GetLatestVersion', TMessageType.CALL, self._seqid)\n args = GetLatestVersion_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_GetLatestVersion", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 728 }, { "content": " def recv_GetLatestVersion(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = GetLatestVersion_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"GetLatestVersion failed: unknown result\"))", "metadata": "root.Client.recv_GetLatestVersion", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 736 }, { "content": " def GetVersion(self, ):\n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_GetVersion()\n return d", "metadata": "root.Client.GetVersion", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 750 }, { "content": " def send_GetVersion(self, ):\n oprot = self._oprot_factory.getProtocol(self._transport)\n oprot.writeMessageBegin('GetVersion', TMessageType.CALL, self._seqid)\n args = GetVersion_args()\n args.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Client.send_GetVersion", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 756 }, { "content": " def recv_GetVersion(self, iprot, mtype, rseqid):\n d = self._reqs.pop(rseqid)\n if mtype == TMessageType.EXCEPTION:\n x = TApplicationException()\n x.read(iprot)\n iprot.readMessageEnd()\n return d.errback(x)\n result = GetVersion_result()\n result.read(iprot)\n iprot.readMessageEnd()\n if result.success is not None:\n return d.callback(result.success)\n return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \"GetVersion failed: unknown result\"))", "metadata": "root.Client.recv_GetVersion", "header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']", "index": 764 }, { "content": "class Processor(TProcessor):\n implements(Iface)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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.Processor", "header": "['module', '___EOS___']", "index": 779 }, { "content": " def __init__(self, handler):\n self._handler = Iface(handler)\n self._processMap = {}\n self._processMap[\"PingCLI\"] = Processor.process_PingCLI\n self._processMap[\"CloseWhenPossible\"] = Processor.process_CloseWhenPossible\n self._processMap[\"LoginUser\"] = Processor.process_LoginUser\n self._processMap[\"UserIsLoggedIn\"] = Processor.process_UserIsLoggedIn\n self._processMap[\"Logout\"] = Processor.process_Logout\n self._processMap[\"GetCapsules\"] = Processor.process_GetCapsules\n self._processMap[\"CreateArchive\"] = Processor.process_CreateArchive\n self._processMap[\"GetUploads\"] = Processor.process_GetUploads\n self._processMap[\"UploadToCapsule\"] = Processor.process_UploadToCapsule\n self._processMap[\"ResumeUpload\"] = Processor.process_ResumeUpload\n self._processMap[\"QueryArchiveStatus\"] = Processor.process_QueryArchiveStatus\n self._processMap[\"PauseUpload\"] = Processor.process_PauseUpload\n self._processMap[\"CancelUpload\"] = Processor.process_CancelUpload\n self._processMap[\"GetCertificates\"] = Processor.process_GetCertificates\n self._processMap[\"ExportCertificate\"] = Processor.process_ExportCertificate\n self._processMap[\"Decrypt\"] = Processor.process_Decrypt\n self._processMap[\"GetSettings\"] = Processor.process_GetSettings\n self._processMap[\"SetSettings\"] = Processor.process_SetSettings\n self._processMap[\"GetLatestVersion\"] = Processor.process_GetLatestVersion\n self._processMap[\"GetVersion\"] = Processor.process_GetVersion", "metadata": "root.Processor.__init__", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 782 }, { "content": " def process(self, iprot, oprot):\n (name, type, seqid) = iprot.readMessageBegin()\n if name not in self._processMap:\n iprot.skip(TType.STRUCT)\n iprot.readMessageEnd()\n x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))\n oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)\n x.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()\n return defer.succeed(None)\n else:\n return self._processMap[name](self, seqid, iprot, oprot)", "metadata": "root.Processor.process", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 806 }, { "content": " def process_PingCLI(self, seqid, iprot, oprot):\n args = PingCLI_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = PingCLI_result()\n d = defer.maybeDeferred(self._handler.PingCLI, )\n d.addCallback(self.write_results_success_PingCLI, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_PingCLI", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 820 }, { "content": " def write_results_success_PingCLI(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"PingCLI\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_PingCLI", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 829 }, { "content": " def process_CloseWhenPossible(self, seqid, iprot, oprot):\n args = CloseWhenPossible_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = CloseWhenPossible_result()\n d = defer.maybeDeferred(self._handler.CloseWhenPossible, )\n d.addCallback(self.write_results_success_CloseWhenPossible, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_CloseWhenPossible", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 836 }, { "content": " def write_results_success_CloseWhenPossible(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"CloseWhenPossible\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_CloseWhenPossible", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 845 }, { "content": " def process_LoginUser(self, seqid, iprot, oprot):\n args = LoginUser_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = LoginUser_result()\n d = defer.maybeDeferred(self._handler.LoginUser, args.username, args.Pass, args.Remember)\n d.addCallback(self.write_results_success_LoginUser, result, seqid, oprot)\n d.addErrback(self.write_results_exception_LoginUser, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_LoginUser", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 852 }, { "content": " def write_results_success_LoginUser(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"LoginUser\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_LoginUser", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 862 }, { "content": " def write_results_exception_LoginUser(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"LoginUser\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_LoginUser", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 869 }, { "content": " def process_UserIsLoggedIn(self, seqid, iprot, oprot):\n args = UserIsLoggedIn_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = UserIsLoggedIn_result()\n d = defer.maybeDeferred(self._handler.UserIsLoggedIn, )\n d.addCallback(self.write_results_success_UserIsLoggedIn, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_UserIsLoggedIn", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 879 }, { "content": " def write_results_success_UserIsLoggedIn(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"UserIsLoggedIn\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_UserIsLoggedIn", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 888 }, { "content": " def process_Logout(self, seqid, iprot, oprot):\n args = Logout_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = Logout_result()\n d = defer.maybeDeferred(self._handler.Logout, )\n d.addCallback(self.write_results_success_Logout, result, seqid, oprot)\n d.addErrback(self.write_results_exception_Logout, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_Logout", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 895 }, { "content": " def write_results_success_Logout(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"Logout\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_Logout", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 905 }, { "content": " def write_results_exception_Logout(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"Logout\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_Logout", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 912 }, { "content": " def process_GetCapsules(self, seqid, iprot, oprot):\n args = GetCapsules_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = GetCapsules_result()\n d = defer.maybeDeferred(self._handler.GetCapsules, )\n d.addCallback(self.write_results_success_GetCapsules, result, seqid, oprot)\n d.addErrback(self.write_results_exception_GetCapsules, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_GetCapsules", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 922 }, { "content": " def write_results_success_GetCapsules(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"GetCapsules\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_GetCapsules", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 932 }, { "content": " def write_results_exception_GetCapsules(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"GetCapsules\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_GetCapsules", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 939 }, { "content": " def process_CreateArchive(self, seqid, iprot, oprot):\n args = CreateArchive_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = CreateArchive_result()\n d = defer.maybeDeferred(self._handler.CreateArchive, args.filePaths)\n d.addCallback(self.write_results_success_CreateArchive, result, seqid, oprot)\n d.addErrback(self.write_results_exception_CreateArchive, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_CreateArchive", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 949 }, { "content": " def write_results_success_CreateArchive(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"CreateArchive\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_CreateArchive", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 959 }, { "content": " def write_results_exception_CreateArchive(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"CreateArchive\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_CreateArchive", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 966 }, { "content": " def process_GetUploads(self, seqid, iprot, oprot):\n args = GetUploads_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = GetUploads_result()\n d = defer.maybeDeferred(self._handler.GetUploads, )\n d.addCallback(self.write_results_success_GetUploads, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_GetUploads", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 976 }, { "content": " def write_results_success_GetUploads(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"GetUploads\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_GetUploads", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 985 }, { "content": " def process_UploadToCapsule(self, seqid, iprot, oprot):\n args = UploadToCapsule_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = UploadToCapsule_result()\n d = defer.maybeDeferred(self._handler.UploadToCapsule, args.ArchiveLocalID, args.CapsuleID, args.title, args.description, args.sandbox)\n d.addCallback(self.write_results_success_UploadToCapsule, result, seqid, oprot)\n d.addErrback(self.write_results_exception_UploadToCapsule, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_UploadToCapsule", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 992 }, { "content": " def write_results_success_UploadToCapsule(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"UploadToCapsule\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_UploadToCapsule", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1002 }, { "content": " def write_results_exception_UploadToCapsule(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"UploadToCapsule\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_UploadToCapsule", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1009 }, { "content": " def process_ResumeUpload(self, seqid, iprot, oprot):\n args = ResumeUpload_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = ResumeUpload_result()\n d = defer.maybeDeferred(self._handler.ResumeUpload, args.ArchiveLocalID)\n d.addCallback(self.write_results_success_ResumeUpload, result, seqid, oprot)\n d.addErrback(self.write_results_exception_ResumeUpload, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_ResumeUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1019 }, { "content": " def write_results_success_ResumeUpload(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"ResumeUpload\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_ResumeUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1029 }, { "content": " def write_results_exception_ResumeUpload(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"ResumeUpload\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_ResumeUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1036 }, { "content": " def process_QueryArchiveStatus(self, seqid, iprot, oprot):\n args = QueryArchiveStatus_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = QueryArchiveStatus_result()\n d = defer.maybeDeferred(self._handler.QueryArchiveStatus, args.ArchiveLocalID)\n d.addCallback(self.write_results_success_QueryArchiveStatus, result, seqid, oprot)\n d.addErrback(self.write_results_exception_QueryArchiveStatus, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_QueryArchiveStatus", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1046 }, { "content": " def write_results_success_QueryArchiveStatus(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"QueryArchiveStatus\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_QueryArchiveStatus", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1056 }, { "content": " def write_results_exception_QueryArchiveStatus(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"QueryArchiveStatus\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_QueryArchiveStatus", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1063 }, { "content": " def process_PauseUpload(self, seqid, iprot, oprot):\n args = PauseUpload_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = PauseUpload_result()\n d = defer.maybeDeferred(self._handler.PauseUpload, args.ArchiveLocalID)\n d.addCallback(self.write_results_success_PauseUpload, result, seqid, oprot)\n d.addErrback(self.write_results_exception_PauseUpload, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_PauseUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1073 }, { "content": " def write_results_success_PauseUpload(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"PauseUpload\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_PauseUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1083 }, { "content": " def write_results_exception_PauseUpload(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"PauseUpload\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_PauseUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1090 }, { "content": " def process_CancelUpload(self, seqid, iprot, oprot):\n args = CancelUpload_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = CancelUpload_result()\n d = defer.maybeDeferred(self._handler.CancelUpload, args.ArchiveLocalID)\n d.addCallback(self.write_results_success_CancelUpload, result, seqid, oprot)\n d.addErrback(self.write_results_exception_CancelUpload, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_CancelUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1100 }, { "content": " def write_results_success_CancelUpload(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"CancelUpload\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_CancelUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1110 }, { "content": " def write_results_exception_CancelUpload(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"CancelUpload\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_CancelUpload", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1117 }, { "content": " def process_GetCertificates(self, seqid, iprot, oprot):\n args = GetCertificates_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = GetCertificates_result()\n d = defer.maybeDeferred(self._handler.GetCertificates, )\n d.addCallback(self.write_results_success_GetCertificates, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_GetCertificates", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1127 }, { "content": " def write_results_success_GetCertificates(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"GetCertificates\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_GetCertificates", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1136 }, { "content": " def process_ExportCertificate(self, seqid, iprot, oprot):\n args = ExportCertificate_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = ExportCertificate_result()\n d = defer.maybeDeferred(self._handler.ExportCertificate, args.ArchiveID, args.format)\n d.addCallback(self.write_results_success_ExportCertificate, result, seqid, oprot)\n d.addErrback(self.write_results_exception_ExportCertificate, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_ExportCertificate", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1143 }, { "content": " def write_results_success_ExportCertificate(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"ExportCertificate\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_ExportCertificate", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1153 }, { "content": " def write_results_exception_ExportCertificate(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"ExportCertificate\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_ExportCertificate", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1160 }, { "content": " def process_Decrypt(self, seqid, iprot, oprot):\n args = Decrypt_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = Decrypt_result()\n d = defer.maybeDeferred(self._handler.Decrypt, args.archivePath, args.key, args.destinationPath)\n d.addCallback(self.write_results_success_Decrypt, result, seqid, oprot)\n d.addErrback(self.write_results_exception_Decrypt, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_Decrypt", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1170 }, { "content": " def write_results_success_Decrypt(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"Decrypt\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_Decrypt", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1180 }, { "content": " def write_results_exception_Decrypt(self, error, result, seqid, oprot):\n try:\n error.raiseException()\n except InvalidOperation as error:\n result.error = error\n oprot.writeMessageBegin(\"Decrypt\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_exception_Decrypt", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1187 }, { "content": " def process_GetSettings(self, seqid, iprot, oprot):\n args = GetSettings_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = GetSettings_result()\n d = defer.maybeDeferred(self._handler.GetSettings, )\n d.addCallback(self.write_results_success_GetSettings, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_GetSettings", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1197 }, { "content": " def write_results_success_GetSettings(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"GetSettings\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_GetSettings", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1206 }, { "content": " def process_SetSettings(self, seqid, iprot, oprot):\n args = SetSettings_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = SetSettings_result()\n d = defer.maybeDeferred(self._handler.SetSettings, args.settings)\n d.addCallback(self.write_results_success_SetSettings, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_SetSettings", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1213 }, { "content": " def write_results_success_SetSettings(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"SetSettings\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_SetSettings", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1222 }, { "content": " def process_GetLatestVersion(self, seqid, iprot, oprot):\n args = GetLatestVersion_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = GetLatestVersion_result()\n d = defer.maybeDeferred(self._handler.GetLatestVersion, )\n d.addCallback(self.write_results_success_GetLatestVersion, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_GetLatestVersion", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1229 }, { "content": " def write_results_success_GetLatestVersion(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"GetLatestVersion\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_GetLatestVersion", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1238 }, { "content": " def process_GetVersion(self, seqid, iprot, oprot):\n args = GetVersion_args()\n args.read(iprot)\n iprot.readMessageEnd()\n result = GetVersion_result()\n d = defer.maybeDeferred(self._handler.GetVersion, )\n d.addCallback(self.write_results_success_GetVersion, result, seqid, oprot)\n return d", "metadata": "root.Processor.process_GetVersion", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1245 }, { "content": " def write_results_success_GetVersion(self, success, result, seqid, oprot):\n result.success = success\n oprot.writeMessageBegin(\"GetVersion\", TMessageType.REPLY, seqid)\n result.write(oprot)\n oprot.writeMessageEnd()\n oprot.trans.flush()", "metadata": "root.Processor.write_results_success_GetVersion", "header": "['class', 'Processor', '(', 'TProcessor', ')', ':', '___EOS___']", "index": 1254 }, { "content": "class PingCLI_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.PingCLI_args", "header": "['module', '___EOS___']", "index": 1264 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.PingCLI_args.read", "header": "['class', 'PingCLI_args', '(', 'object', ')', ':', '___EOS___']", "index": 1269 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('PingCLI_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.PingCLI_args.write", "header": "['class', 'PingCLI_args', '(', 'object', ')', ':', '___EOS___']", "index": 1283 }, { "content": " def validate(self):\n return", "metadata": "root.PingCLI_args.validate", "header": "['class', 'PingCLI_args', '(', 'object', ')', ':', '___EOS___']", "index": 1291 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.PingCLI_args.__repr__", "header": "['class', 'PingCLI_args', '(', 'object', ')', ':', '___EOS___']", "index": 1295 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.PingCLI_args.__eq__", "header": "['class', 'PingCLI_args', '(', 'object', ')', ':', '___EOS___']", "index": 1300 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.PingCLI_args.__ne__", "header": "['class', 'PingCLI_args', '(', 'object', ')', ':', '___EOS___']", "index": 1303 }, { "content": "class PingCLI_result(object):\n \"\"\"\n Attributes:\n - success\n \"\"\"\n\n thrift_spec = (\n (0, TType.BOOL, 'success', None, None, ), # 0\n )\n\n\n\n\n\n\n\n", "metadata": "root.PingCLI_result", "header": "['module', '___EOS___']", "index": 1306 }, { "content": " def __init__(self, success=None,):\n self.success = success", "metadata": "root.PingCLI_result.__init__", "header": "['class', 'PingCLI_result', '(', 'object', ')', ':', '___EOS___']", "index": 1316 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.BOOL:\n self.success = iprot.readBool();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.PingCLI_result.read", "header": "['class', 'PingCLI_result', '(', 'object', ')', ':', '___EOS___']", "index": 1319 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('PingCLI_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.BOOL, 0)\n oprot.writeBool(self.success)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.PingCLI_result.write", "header": "['class', 'PingCLI_result', '(', 'object', ')', ':', '___EOS___']", "index": 1338 }, { "content": " def validate(self):\n return", "metadata": "root.PingCLI_result.validate", "header": "['class', 'PingCLI_result', '(', 'object', ')', ':', '___EOS___']", "index": 1350 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.PingCLI_result.__repr__", "header": "['class', 'PingCLI_result', '(', 'object', ')', ':', '___EOS___']", "index": 1354 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.PingCLI_result.__eq__", "header": "['class', 'PingCLI_result', '(', 'object', ')', ':', '___EOS___']", "index": 1359 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.PingCLI_result.__ne__", "header": "['class', 'PingCLI_result', '(', 'object', ')', ':', '___EOS___']", "index": 1362 }, { "content": "class CloseWhenPossible_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.CloseWhenPossible_args", "header": "['module', '___EOS___']", "index": 1365 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.CloseWhenPossible_args.read", "header": "['class', 'CloseWhenPossible_args', '(', 'object', ')', ':', '___EOS___']", "index": 1370 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('CloseWhenPossible_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.CloseWhenPossible_args.write", "header": "['class', 'CloseWhenPossible_args', '(', 'object', ')', ':', '___EOS___']", "index": 1384 }, { "content": " def validate(self):\n return", "metadata": "root.CloseWhenPossible_args.validate", "header": "['class', 'CloseWhenPossible_args', '(', 'object', ')', ':', '___EOS___']", "index": 1392 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.CloseWhenPossible_args.__repr__", "header": "['class', 'CloseWhenPossible_args', '(', 'object', ')', ':', '___EOS___']", "index": 1396 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.CloseWhenPossible_args.__eq__", "header": "['class', 'CloseWhenPossible_args', '(', 'object', ')', ':', '___EOS___']", "index": 1401 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.CloseWhenPossible_args.__ne__", "header": "['class', 'CloseWhenPossible_args', '(', 'object', ')', ':', '___EOS___']", "index": 1404 }, { "content": "class CloseWhenPossible_result(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.CloseWhenPossible_result", "header": "['module', '___EOS___']", "index": 1407 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.CloseWhenPossible_result.read", "header": "['class', 'CloseWhenPossible_result', '(', 'object', ')', ':', '___EOS___']", "index": 1412 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('CloseWhenPossible_result')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.CloseWhenPossible_result.write", "header": "['class', 'CloseWhenPossible_result', '(', 'object', ')', ':', '___EOS___']", "index": 1426 }, { "content": " def validate(self):\n return", "metadata": "root.CloseWhenPossible_result.validate", "header": "['class', 'CloseWhenPossible_result', '(', 'object', ')', ':', '___EOS___']", "index": 1434 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.CloseWhenPossible_result.__repr__", "header": "['class', 'CloseWhenPossible_result', '(', 'object', ')', ':', '___EOS___']", "index": 1438 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.CloseWhenPossible_result.__eq__", "header": "['class', 'CloseWhenPossible_result', '(', 'object', ')', ':', '___EOS___']", "index": 1443 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.CloseWhenPossible_result.__ne__", "header": "['class', 'CloseWhenPossible_result', '(', 'object', ')', ':', '___EOS___']", "index": 1446 }, { "content": "class LoginUser_args(object):\n \"\"\"\n Attributes:\n - username\n - Pass\n - Remember\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'username', None, None, ), # 1\n (2, TType.STRING, 'Pass', None, None, ), # 2\n (3, TType.BOOL, 'Remember', None, None, ), # 3\n )\n\n\n\n\n\n\n\n", "metadata": "root.LoginUser_args", "header": "['module', '___EOS___']", "index": 1449 }, { "content": " def __init__(self, username=None, Pass=None, Remember=None,):\n self.username = username\n self.Pass = Pass\n self.Remember = Remember", "metadata": "root.LoginUser_args.__init__", "header": "['class', 'LoginUser_args', '(', 'object', ')', ':', '___EOS___']", "index": 1464 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.username = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 2:\n if ftype == TType.STRING:\n self.Pass = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 3:\n if ftype == TType.BOOL:\n self.Remember = iprot.readBool();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.LoginUser_args.read", "header": "['class', 'LoginUser_args', '(', 'object', ')', ':', '___EOS___']", "index": 1469 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('LoginUser_args')\n if self.username is not None:\n oprot.writeFieldBegin('username', TType.STRING, 1)\n oprot.writeString(self.username)\n oprot.writeFieldEnd()\n if self.Pass is not None:\n oprot.writeFieldBegin('Pass', TType.STRING, 2)\n oprot.writeString(self.Pass)\n oprot.writeFieldEnd()\n if self.Remember is not None:\n oprot.writeFieldBegin('Remember', TType.BOOL, 3)\n oprot.writeBool(self.Remember)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.LoginUser_args.write", "header": "['class', 'LoginUser_args', '(', 'object', ')', ':', '___EOS___']", "index": 1498 }, { "content": " def validate(self):\n return", "metadata": "root.LoginUser_args.validate", "header": "['class', 'LoginUser_args', '(', 'object', ')', ':', '___EOS___']", "index": 1518 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.LoginUser_args.__repr__", "header": "['class', 'LoginUser_args', '(', 'object', ')', ':', '___EOS___']", "index": 1522 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.LoginUser_args.__eq__", "header": "['class', 'LoginUser_args', '(', 'object', ')', ':', '___EOS___']", "index": 1527 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.LoginUser_args.__ne__", "header": "['class', 'LoginUser_args', '(', 'object', ')', ':', '___EOS___']", "index": 1530 }, { "content": "class LoginUser_result(object):\n \"\"\"\n Attributes:\n - success\n - error\n \"\"\"\n\n thrift_spec = (\n (0, TType.BOOL, 'success', None, None, ), # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.LoginUser_result", "header": "['module', '___EOS___']", "index": 1533 }, { "content": " def __init__(self, success=None, error=None,):\n self.success = success\n self.error = error", "metadata": "root.LoginUser_result.__init__", "header": "['class', 'LoginUser_result', '(', 'object', ')', ':', '___EOS___']", "index": 1545 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.BOOL:\n self.success = iprot.readBool();\n else:\n iprot.skip(ftype)\n elif fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.LoginUser_result.read", "header": "['class', 'LoginUser_result', '(', 'object', ')', ':', '___EOS___']", "index": 1549 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('LoginUser_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.BOOL, 0)\n oprot.writeBool(self.success)\n oprot.writeFieldEnd()\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.LoginUser_result.write", "header": "['class', 'LoginUser_result', '(', 'object', ')', ':', '___EOS___']", "index": 1574 }, { "content": " def validate(self):\n return", "metadata": "root.LoginUser_result.validate", "header": "['class', 'LoginUser_result', '(', 'object', ')', ':', '___EOS___']", "index": 1590 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.LoginUser_result.__repr__", "header": "['class', 'LoginUser_result', '(', 'object', ')', ':', '___EOS___']", "index": 1594 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.LoginUser_result.__eq__", "header": "['class', 'LoginUser_result', '(', 'object', ')', ':', '___EOS___']", "index": 1599 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.LoginUser_result.__ne__", "header": "['class', 'LoginUser_result', '(', 'object', ')', ':', '___EOS___']", "index": 1602 }, { "content": "class UserIsLoggedIn_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.UserIsLoggedIn_args", "header": "['module', '___EOS___']", "index": 1605 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.UserIsLoggedIn_args.read", "header": "['class', 'UserIsLoggedIn_args', '(', 'object', ')', ':', '___EOS___']", "index": 1610 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('UserIsLoggedIn_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.UserIsLoggedIn_args.write", "header": "['class', 'UserIsLoggedIn_args', '(', 'object', ')', ':', '___EOS___']", "index": 1624 }, { "content": " def validate(self):\n return", "metadata": "root.UserIsLoggedIn_args.validate", "header": "['class', 'UserIsLoggedIn_args', '(', 'object', ')', ':', '___EOS___']", "index": 1632 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.UserIsLoggedIn_args.__repr__", "header": "['class', 'UserIsLoggedIn_args', '(', 'object', ')', ':', '___EOS___']", "index": 1636 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.UserIsLoggedIn_args.__eq__", "header": "['class', 'UserIsLoggedIn_args', '(', 'object', ')', ':', '___EOS___']", "index": 1641 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.UserIsLoggedIn_args.__ne__", "header": "['class', 'UserIsLoggedIn_args', '(', 'object', ')', ':', '___EOS___']", "index": 1644 }, { "content": "class UserIsLoggedIn_result(object):\n \"\"\"\n Attributes:\n - success\n \"\"\"\n\n thrift_spec = (\n (0, TType.BOOL, 'success', None, None, ), # 0\n )\n\n\n\n\n\n\n\n", "metadata": "root.UserIsLoggedIn_result", "header": "['module', '___EOS___']", "index": 1647 }, { "content": " def __init__(self, success=None,):\n self.success = success", "metadata": "root.UserIsLoggedIn_result.__init__", "header": "['class', 'UserIsLoggedIn_result', '(', 'object', ')', ':', '___EOS___']", "index": 1657 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.BOOL:\n self.success = iprot.readBool();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.UserIsLoggedIn_result.read", "header": "['class', 'UserIsLoggedIn_result', '(', 'object', ')', ':', '___EOS___']", "index": 1660 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('UserIsLoggedIn_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.BOOL, 0)\n oprot.writeBool(self.success)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.UserIsLoggedIn_result.write", "header": "['class', 'UserIsLoggedIn_result', '(', 'object', ')', ':', '___EOS___']", "index": 1679 }, { "content": " def validate(self):\n return", "metadata": "root.UserIsLoggedIn_result.validate", "header": "['class', 'UserIsLoggedIn_result', '(', 'object', ')', ':', '___EOS___']", "index": 1691 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.UserIsLoggedIn_result.__repr__", "header": "['class', 'UserIsLoggedIn_result', '(', 'object', ')', ':', '___EOS___']", "index": 1695 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.UserIsLoggedIn_result.__eq__", "header": "['class', 'UserIsLoggedIn_result', '(', 'object', ')', ':', '___EOS___']", "index": 1700 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.UserIsLoggedIn_result.__ne__", "header": "['class', 'UserIsLoggedIn_result', '(', 'object', ')', ':', '___EOS___']", "index": 1703 }, { "content": "class Logout_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.Logout_args", "header": "['module', '___EOS___']", "index": 1706 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.Logout_args.read", "header": "['class', 'Logout_args', '(', 'object', ')', ':', '___EOS___']", "index": 1711 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('Logout_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.Logout_args.write", "header": "['class', 'Logout_args', '(', 'object', ')', ':', '___EOS___']", "index": 1725 }, { "content": " def validate(self):\n return", "metadata": "root.Logout_args.validate", "header": "['class', 'Logout_args', '(', 'object', ')', ':', '___EOS___']", "index": 1733 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.Logout_args.__repr__", "header": "['class', 'Logout_args', '(', 'object', ')', ':', '___EOS___']", "index": 1737 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.Logout_args.__eq__", "header": "['class', 'Logout_args', '(', 'object', ')', ':', '___EOS___']", "index": 1742 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.Logout_args.__ne__", "header": "['class', 'Logout_args', '(', 'object', ')', ':', '___EOS___']", "index": 1745 }, { "content": "class Logout_result(object):\n \"\"\"\n Attributes:\n - success\n - error\n \"\"\"\n\n thrift_spec = (\n (0, TType.BOOL, 'success', None, None, ), # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.Logout_result", "header": "['module', '___EOS___']", "index": 1748 }, { "content": " def __init__(self, success=None, error=None,):\n self.success = success\n self.error = error", "metadata": "root.Logout_result.__init__", "header": "['class', 'Logout_result', '(', 'object', ')', ':', '___EOS___']", "index": 1760 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.BOOL:\n self.success = iprot.readBool();\n else:\n iprot.skip(ftype)\n elif fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.Logout_result.read", "header": "['class', 'Logout_result', '(', 'object', ')', ':', '___EOS___']", "index": 1764 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('Logout_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.BOOL, 0)\n oprot.writeBool(self.success)\n oprot.writeFieldEnd()\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.Logout_result.write", "header": "['class', 'Logout_result', '(', 'object', ')', ':', '___EOS___']", "index": 1789 }, { "content": " def validate(self):\n return", "metadata": "root.Logout_result.validate", "header": "['class', 'Logout_result', '(', 'object', ')', ':', '___EOS___']", "index": 1805 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.Logout_result.__repr__", "header": "['class', 'Logout_result', '(', 'object', ')', ':', '___EOS___']", "index": 1809 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.Logout_result.__eq__", "header": "['class', 'Logout_result', '(', 'object', ')', ':', '___EOS___']", "index": 1814 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.Logout_result.__ne__", "header": "['class', 'Logout_result', '(', 'object', ')', ':', '___EOS___']", "index": 1817 }, { "content": "class GetCapsules_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.GetCapsules_args", "header": "['module', '___EOS___']", "index": 1820 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetCapsules_args.read", "header": "['class', 'GetCapsules_args', '(', 'object', ')', ':', '___EOS___']", "index": 1825 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetCapsules_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetCapsules_args.write", "header": "['class', 'GetCapsules_args', '(', 'object', ')', ':', '___EOS___']", "index": 1839 }, { "content": " def validate(self):\n return", "metadata": "root.GetCapsules_args.validate", "header": "['class', 'GetCapsules_args', '(', 'object', ')', ':', '___EOS___']", "index": 1847 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetCapsules_args.__repr__", "header": "['class', 'GetCapsules_args', '(', 'object', ')', ':', '___EOS___']", "index": 1851 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetCapsules_args.__eq__", "header": "['class', 'GetCapsules_args', '(', 'object', ')', ':', '___EOS___']", "index": 1856 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetCapsules_args.__ne__", "header": "['class', 'GetCapsules_args', '(', 'object', ')', ':', '___EOS___']", "index": 1859 }, { "content": "class GetCapsules_result(object):\n \"\"\"\n Attributes:\n - success\n - error\n \"\"\"\n\n thrift_spec = (\n (0, TType.LIST, 'success', (TType.STRUCT,(Capsule, Capsule.thrift_spec)), None, ), # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.GetCapsules_result", "header": "['module', '___EOS___']", "index": 1862 }, { "content": " def __init__(self, success=None, error=None,):\n self.success = success\n self.error = error", "metadata": "root.GetCapsules_result.__init__", "header": "['class', 'GetCapsules_result', '(', 'object', ')', ':', '___EOS___']", "index": 1874 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.LIST:\n self.success = []\n (_etype10, _size7) = iprot.readListBegin()\n for _i11 in xrange(_size7):\n _elem12 = Capsule()\n _elem12.read(iprot)\n self.success.append(_elem12)\n iprot.readListEnd()\n else:\n iprot.skip(ftype)\n elif fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetCapsules_result.read", "header": "['class', 'GetCapsules_result', '(', 'object', ')', ':', '___EOS___']", "index": 1878 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetCapsules_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.LIST, 0)\n oprot.writeListBegin(TType.STRUCT, len(self.success))\n for iter13 in self.success:\n iter13.write(oprot)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetCapsules_result.write", "header": "['class', 'GetCapsules_result', '(', 'object', ')', ':', '___EOS___']", "index": 1909 }, { "content": " def validate(self):\n return", "metadata": "root.GetCapsules_result.validate", "header": "['class', 'GetCapsules_result', '(', 'object', ')', ':', '___EOS___']", "index": 1928 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetCapsules_result.__repr__", "header": "['class', 'GetCapsules_result', '(', 'object', ')', ':', '___EOS___']", "index": 1932 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetCapsules_result.__eq__", "header": "['class', 'GetCapsules_result', '(', 'object', ')', ':', '___EOS___']", "index": 1937 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetCapsules_result.__ne__", "header": "['class', 'GetCapsules_result', '(', 'object', ')', ':', '___EOS___']", "index": 1940 }, { "content": "class CreateArchive_args(object):\n \"\"\"\n Attributes:\n - filePaths\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.LIST, 'filePaths', (TType.STRING,None), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.CreateArchive_args", "header": "['module', '___EOS___']", "index": 1943 }, { "content": " def __init__(self, filePaths=None,):\n self.filePaths = filePaths", "metadata": "root.CreateArchive_args.__init__", "header": "['class', 'CreateArchive_args', '(', 'object', ')', ':', '___EOS___']", "index": 1954 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.LIST:\n self.filePaths = []\n (_etype17, _size14) = iprot.readListBegin()\n for _i18 in xrange(_size14):\n _elem19 = iprot.readString();\n self.filePaths.append(_elem19)\n iprot.readListEnd()\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.CreateArchive_args.read", "header": "['class', 'CreateArchive_args', '(', 'object', ')', ':', '___EOS___']", "index": 1957 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('CreateArchive_args')\n if self.filePaths is not None:\n oprot.writeFieldBegin('filePaths', TType.LIST, 1)\n oprot.writeListBegin(TType.STRING, len(self.filePaths))\n for iter20 in self.filePaths:\n oprot.writeString(iter20)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.CreateArchive_args.write", "header": "['class', 'CreateArchive_args', '(', 'object', ')', ':', '___EOS___']", "index": 1981 }, { "content": " def validate(self):\n return", "metadata": "root.CreateArchive_args.validate", "header": "['class', 'CreateArchive_args', '(', 'object', ')', ':', '___EOS___']", "index": 1996 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.CreateArchive_args.__repr__", "header": "['class', 'CreateArchive_args', '(', 'object', ')', ':', '___EOS___']", "index": 2000 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.CreateArchive_args.__eq__", "header": "['class', 'CreateArchive_args', '(', 'object', ')', ':', '___EOS___']", "index": 2005 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.CreateArchive_args.__ne__", "header": "['class', 'CreateArchive_args', '(', 'object', ')', ':', '___EOS___']", "index": 2008 }, { "content": "class CreateArchive_result(object):\n \"\"\"\n Attributes:\n - success\n - error\n \"\"\"\n\n thrift_spec = (\n (0, TType.STRUCT, 'success', (Archive, Archive.thrift_spec), None, ), # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.CreateArchive_result", "header": "['module', '___EOS___']", "index": 2011 }, { "content": " def __init__(self, success=None, error=None,):\n self.success = success\n self.error = error", "metadata": "root.CreateArchive_result.__init__", "header": "['class', 'CreateArchive_result', '(', 'object', ')', ':', '___EOS___']", "index": 2023 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.STRUCT:\n self.success = Archive()\n self.success.read(iprot)\n else:\n iprot.skip(ftype)\n elif fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.CreateArchive_result.read", "header": "['class', 'CreateArchive_result', '(', 'object', ')', ':', '___EOS___']", "index": 2027 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('CreateArchive_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.STRUCT, 0)\n self.success.write(oprot)\n oprot.writeFieldEnd()\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.CreateArchive_result.write", "header": "['class', 'CreateArchive_result', '(', 'object', ')', ':', '___EOS___']", "index": 2053 }, { "content": " def validate(self):\n return", "metadata": "root.CreateArchive_result.validate", "header": "['class', 'CreateArchive_result', '(', 'object', ')', ':', '___EOS___']", "index": 2069 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.CreateArchive_result.__repr__", "header": "['class', 'CreateArchive_result', '(', 'object', ')', ':', '___EOS___']", "index": 2073 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.CreateArchive_result.__eq__", "header": "['class', 'CreateArchive_result', '(', 'object', ')', ':', '___EOS___']", "index": 2078 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.CreateArchive_result.__ne__", "header": "['class', 'CreateArchive_result', '(', 'object', ')', ':', '___EOS___']", "index": 2081 }, { "content": "class GetUploads_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.GetUploads_args", "header": "['module', '___EOS___']", "index": 2084 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetUploads_args.read", "header": "['class', 'GetUploads_args', '(', 'object', ')', ':', '___EOS___']", "index": 2089 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetUploads_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetUploads_args.write", "header": "['class', 'GetUploads_args', '(', 'object', ')', ':', '___EOS___']", "index": 2103 }, { "content": " def validate(self):\n return", "metadata": "root.GetUploads_args.validate", "header": "['class', 'GetUploads_args', '(', 'object', ')', ':', '___EOS___']", "index": 2111 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetUploads_args.__repr__", "header": "['class', 'GetUploads_args', '(', 'object', ')', ':', '___EOS___']", "index": 2115 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetUploads_args.__eq__", "header": "['class', 'GetUploads_args', '(', 'object', ')', ':', '___EOS___']", "index": 2120 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetUploads_args.__ne__", "header": "['class', 'GetUploads_args', '(', 'object', ')', ':', '___EOS___']", "index": 2123 }, { "content": "class GetUploads_result(object):\n \"\"\"\n Attributes:\n - success\n \"\"\"\n\n thrift_spec = (\n (0, TType.LIST, 'success', (TType.STRUCT,(Archive, Archive.thrift_spec)), None, ), # 0\n )\n\n\n\n\n\n\n\n", "metadata": "root.GetUploads_result", "header": "['module', '___EOS___']", "index": 2126 }, { "content": " def __init__(self, success=None,):\n self.success = success", "metadata": "root.GetUploads_result.__init__", "header": "['class', 'GetUploads_result', '(', 'object', ')', ':', '___EOS___']", "index": 2136 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.LIST:\n self.success = []\n (_etype24, _size21) = iprot.readListBegin()\n for _i25 in xrange(_size21):\n _elem26 = Archive()\n _elem26.read(iprot)\n self.success.append(_elem26)\n iprot.readListEnd()\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetUploads_result.read", "header": "['class', 'GetUploads_result', '(', 'object', ')', ':', '___EOS___']", "index": 2139 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetUploads_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.LIST, 0)\n oprot.writeListBegin(TType.STRUCT, len(self.success))\n for iter27 in self.success:\n iter27.write(oprot)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetUploads_result.write", "header": "['class', 'GetUploads_result', '(', 'object', ')', ':', '___EOS___']", "index": 2164 }, { "content": " def validate(self):\n return", "metadata": "root.GetUploads_result.validate", "header": "['class', 'GetUploads_result', '(', 'object', ')', ':', '___EOS___']", "index": 2179 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetUploads_result.__repr__", "header": "['class', 'GetUploads_result', '(', 'object', ')', ':', '___EOS___']", "index": 2183 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetUploads_result.__eq__", "header": "['class', 'GetUploads_result', '(', 'object', ')', ':', '___EOS___']", "index": 2188 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetUploads_result.__ne__", "header": "['class', 'GetUploads_result', '(', 'object', ')', ':', '___EOS___']", "index": 2191 }, { "content": "class UploadToCapsule_args(object):\n \"\"\"\n Attributes:\n - ArchiveLocalID\n - CapsuleID\n - title\n - description\n - sandbox\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'ArchiveLocalID', None, None, ), # 1\n (2, TType.STRING, 'CapsuleID', None, None, ), # 2\n (3, TType.STRING, 'title', None, None, ), # 3\n (4, TType.STRING, 'description', None, None, ), # 4\n (5, TType.BOOL, 'sandbox', None, None, ), # 5\n )\n\n\n\n\n\n\n\n", "metadata": "root.UploadToCapsule_args", "header": "['module', '___EOS___']", "index": 2194 }, { "content": " def __init__(self, ArchiveLocalID=None, CapsuleID=None, title=None, description=None, sandbox=None,):\n self.ArchiveLocalID = ArchiveLocalID\n self.CapsuleID = CapsuleID\n self.title = title\n self.description = description\n self.sandbox = sandbox", "metadata": "root.UploadToCapsule_args.__init__", "header": "['class', 'UploadToCapsule_args', '(', 'object', ')', ':', '___EOS___']", "index": 2213 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.ArchiveLocalID = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 2:\n if ftype == TType.STRING:\n self.CapsuleID = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 3:\n if ftype == TType.STRING:\n self.title = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 4:\n if ftype == TType.STRING:\n self.description = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 5:\n if ftype == TType.BOOL:\n self.sandbox = iprot.readBool();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.UploadToCapsule_args.read", "header": "['class', 'UploadToCapsule_args', '(', 'object', ')', ':', '___EOS___']", "index": 2220 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('UploadToCapsule_args')\n if self.ArchiveLocalID is not None:\n oprot.writeFieldBegin('ArchiveLocalID', TType.STRING, 1)\n oprot.writeString(self.ArchiveLocalID)\n oprot.writeFieldEnd()\n if self.CapsuleID is not None:\n oprot.writeFieldBegin('CapsuleID', TType.STRING, 2)\n oprot.writeString(self.CapsuleID)\n oprot.writeFieldEnd()\n if self.title is not None:\n oprot.writeFieldBegin('title', TType.STRING, 3)\n oprot.writeString(self.title)\n oprot.writeFieldEnd()\n if self.description is not None:\n oprot.writeFieldBegin('description', TType.STRING, 4)\n oprot.writeString(self.description)\n oprot.writeFieldEnd()\n if self.sandbox is not None:\n oprot.writeFieldBegin('sandbox', TType.BOOL, 5)\n oprot.writeBool(self.sandbox)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.UploadToCapsule_args.write", "header": "['class', 'UploadToCapsule_args', '(', 'object', ')', ':', '___EOS___']", "index": 2259 }, { "content": " def validate(self):\n return", "metadata": "root.UploadToCapsule_args.validate", "header": "['class', 'UploadToCapsule_args', '(', 'object', ')', ':', '___EOS___']", "index": 2287 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.UploadToCapsule_args.__repr__", "header": "['class', 'UploadToCapsule_args', '(', 'object', ')', ':', '___EOS___']", "index": 2291 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.UploadToCapsule_args.__eq__", "header": "['class', 'UploadToCapsule_args', '(', 'object', ')', ':', '___EOS___']", "index": 2296 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.UploadToCapsule_args.__ne__", "header": "['class', 'UploadToCapsule_args', '(', 'object', ')', ':', '___EOS___']", "index": 2299 }, { "content": "class UploadToCapsule_result(object):\n \"\"\"\n Attributes:\n - error\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.UploadToCapsule_result", "header": "['module', '___EOS___']", "index": 2302 }, { "content": " def __init__(self, error=None,):\n self.error = error", "metadata": "root.UploadToCapsule_result.__init__", "header": "['class', 'UploadToCapsule_result', '(', 'object', ')', ':', '___EOS___']", "index": 2313 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.UploadToCapsule_result.read", "header": "['class', 'UploadToCapsule_result', '(', 'object', ')', ':', '___EOS___']", "index": 2316 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('UploadToCapsule_result')\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.UploadToCapsule_result.write", "header": "['class', 'UploadToCapsule_result', '(', 'object', ')', ':', '___EOS___']", "index": 2336 }, { "content": " def validate(self):\n return", "metadata": "root.UploadToCapsule_result.validate", "header": "['class', 'UploadToCapsule_result', '(', 'object', ')', ':', '___EOS___']", "index": 2348 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.UploadToCapsule_result.__repr__", "header": "['class', 'UploadToCapsule_result', '(', 'object', ')', ':', '___EOS___']", "index": 2352 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.UploadToCapsule_result.__eq__", "header": "['class', 'UploadToCapsule_result', '(', 'object', ')', ':', '___EOS___']", "index": 2357 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.UploadToCapsule_result.__ne__", "header": "['class', 'UploadToCapsule_result', '(', 'object', ')', ':', '___EOS___']", "index": 2360 }, { "content": "class ResumeUpload_args(object):\n \"\"\"\n Attributes:\n - ArchiveLocalID\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'ArchiveLocalID', None, None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.ResumeUpload_args", "header": "['module', '___EOS___']", "index": 2363 }, { "content": " def __init__(self, ArchiveLocalID=None,):\n self.ArchiveLocalID = ArchiveLocalID", "metadata": "root.ResumeUpload_args.__init__", "header": "['class', 'ResumeUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2374 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.ArchiveLocalID = iprot.readString();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.ResumeUpload_args.read", "header": "['class', 'ResumeUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2377 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('ResumeUpload_args')\n if self.ArchiveLocalID is not None:\n oprot.writeFieldBegin('ArchiveLocalID', TType.STRING, 1)\n oprot.writeString(self.ArchiveLocalID)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.ResumeUpload_args.write", "header": "['class', 'ResumeUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2396 }, { "content": " def validate(self):\n return", "metadata": "root.ResumeUpload_args.validate", "header": "['class', 'ResumeUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2408 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.ResumeUpload_args.__repr__", "header": "['class', 'ResumeUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2412 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.ResumeUpload_args.__eq__", "header": "['class', 'ResumeUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2417 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.ResumeUpload_args.__ne__", "header": "['class', 'ResumeUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2420 }, { "content": "class ResumeUpload_result(object):\n \"\"\"\n Attributes:\n - error\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.ResumeUpload_result", "header": "['module', '___EOS___']", "index": 2423 }, { "content": " def __init__(self, error=None,):\n self.error = error", "metadata": "root.ResumeUpload_result.__init__", "header": "['class', 'ResumeUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2434 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.ResumeUpload_result.read", "header": "['class', 'ResumeUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2437 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('ResumeUpload_result')\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.ResumeUpload_result.write", "header": "['class', 'ResumeUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2457 }, { "content": " def validate(self):\n return", "metadata": "root.ResumeUpload_result.validate", "header": "['class', 'ResumeUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2469 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.ResumeUpload_result.__repr__", "header": "['class', 'ResumeUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2473 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.ResumeUpload_result.__eq__", "header": "['class', 'ResumeUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2478 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.ResumeUpload_result.__ne__", "header": "['class', 'ResumeUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2481 }, { "content": "class QueryArchiveStatus_args(object):\n \"\"\"\n Attributes:\n - ArchiveLocalID\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'ArchiveLocalID', None, None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.QueryArchiveStatus_args", "header": "['module', '___EOS___']", "index": 2484 }, { "content": " def __init__(self, ArchiveLocalID=None,):\n self.ArchiveLocalID = ArchiveLocalID", "metadata": "root.QueryArchiveStatus_args.__init__", "header": "['class', 'QueryArchiveStatus_args', '(', 'object', ')', ':', '___EOS___']", "index": 2495 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.ArchiveLocalID = iprot.readString();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.QueryArchiveStatus_args.read", "header": "['class', 'QueryArchiveStatus_args', '(', 'object', ')', ':', '___EOS___']", "index": 2498 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('QueryArchiveStatus_args')\n if self.ArchiveLocalID is not None:\n oprot.writeFieldBegin('ArchiveLocalID', TType.STRING, 1)\n oprot.writeString(self.ArchiveLocalID)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.QueryArchiveStatus_args.write", "header": "['class', 'QueryArchiveStatus_args', '(', 'object', ')', ':', '___EOS___']", "index": 2517 }, { "content": " def validate(self):\n return", "metadata": "root.QueryArchiveStatus_args.validate", "header": "['class', 'QueryArchiveStatus_args', '(', 'object', ')', ':', '___EOS___']", "index": 2529 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.QueryArchiveStatus_args.__repr__", "header": "['class', 'QueryArchiveStatus_args', '(', 'object', ')', ':', '___EOS___']", "index": 2533 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.QueryArchiveStatus_args.__eq__", "header": "['class', 'QueryArchiveStatus_args', '(', 'object', ')', ':', '___EOS___']", "index": 2538 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.QueryArchiveStatus_args.__ne__", "header": "['class', 'QueryArchiveStatus_args', '(', 'object', ')', ':', '___EOS___']", "index": 2541 }, { "content": "class QueryArchiveStatus_result(object):\n \"\"\"\n Attributes:\n - success\n - error\n \"\"\"\n\n thrift_spec = (\n (0, TType.STRUCT, 'success', (TransferStatus, TransferStatus.thrift_spec), None, ), # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.QueryArchiveStatus_result", "header": "['module', '___EOS___']", "index": 2544 }, { "content": " def __init__(self, success=None, error=None,):\n self.success = success\n self.error = error", "metadata": "root.QueryArchiveStatus_result.__init__", "header": "['class', 'QueryArchiveStatus_result', '(', 'object', ')', ':', '___EOS___']", "index": 2556 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.STRUCT:\n self.success = TransferStatus()\n self.success.read(iprot)\n else:\n iprot.skip(ftype)\n elif fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.QueryArchiveStatus_result.read", "header": "['class', 'QueryArchiveStatus_result', '(', 'object', ')', ':', '___EOS___']", "index": 2560 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('QueryArchiveStatus_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.STRUCT, 0)\n self.success.write(oprot)\n oprot.writeFieldEnd()\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.QueryArchiveStatus_result.write", "header": "['class', 'QueryArchiveStatus_result', '(', 'object', ')', ':', '___EOS___']", "index": 2586 }, { "content": " def validate(self):\n return", "metadata": "root.QueryArchiveStatus_result.validate", "header": "['class', 'QueryArchiveStatus_result', '(', 'object', ')', ':', '___EOS___']", "index": 2602 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.QueryArchiveStatus_result.__repr__", "header": "['class', 'QueryArchiveStatus_result', '(', 'object', ')', ':', '___EOS___']", "index": 2606 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.QueryArchiveStatus_result.__eq__", "header": "['class', 'QueryArchiveStatus_result', '(', 'object', ')', ':', '___EOS___']", "index": 2611 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.QueryArchiveStatus_result.__ne__", "header": "['class', 'QueryArchiveStatus_result', '(', 'object', ')', ':', '___EOS___']", "index": 2614 }, { "content": "class PauseUpload_args(object):\n \"\"\"\n Attributes:\n - ArchiveLocalID\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'ArchiveLocalID', None, None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.PauseUpload_args", "header": "['module', '___EOS___']", "index": 2617 }, { "content": " def __init__(self, ArchiveLocalID=None,):\n self.ArchiveLocalID = ArchiveLocalID", "metadata": "root.PauseUpload_args.__init__", "header": "['class', 'PauseUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2628 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.ArchiveLocalID = iprot.readString();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.PauseUpload_args.read", "header": "['class', 'PauseUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2631 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('PauseUpload_args')\n if self.ArchiveLocalID is not None:\n oprot.writeFieldBegin('ArchiveLocalID', TType.STRING, 1)\n oprot.writeString(self.ArchiveLocalID)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.PauseUpload_args.write", "header": "['class', 'PauseUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2650 }, { "content": " def validate(self):\n return", "metadata": "root.PauseUpload_args.validate", "header": "['class', 'PauseUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2662 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.PauseUpload_args.__repr__", "header": "['class', 'PauseUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2666 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.PauseUpload_args.__eq__", "header": "['class', 'PauseUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2671 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.PauseUpload_args.__ne__", "header": "['class', 'PauseUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2674 }, { "content": "class PauseUpload_result(object):\n \"\"\"\n Attributes:\n - error\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.PauseUpload_result", "header": "['module', '___EOS___']", "index": 2677 }, { "content": " def __init__(self, error=None,):\n self.error = error", "metadata": "root.PauseUpload_result.__init__", "header": "['class', 'PauseUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2688 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.PauseUpload_result.read", "header": "['class', 'PauseUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2691 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('PauseUpload_result')\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.PauseUpload_result.write", "header": "['class', 'PauseUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2711 }, { "content": " def validate(self):\n return", "metadata": "root.PauseUpload_result.validate", "header": "['class', 'PauseUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2723 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.PauseUpload_result.__repr__", "header": "['class', 'PauseUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2727 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.PauseUpload_result.__eq__", "header": "['class', 'PauseUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2732 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.PauseUpload_result.__ne__", "header": "['class', 'PauseUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2735 }, { "content": "class CancelUpload_args(object):\n \"\"\"\n Attributes:\n - ArchiveLocalID\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'ArchiveLocalID', None, None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.CancelUpload_args", "header": "['module', '___EOS___']", "index": 2738 }, { "content": " def __init__(self, ArchiveLocalID=None,):\n self.ArchiveLocalID = ArchiveLocalID", "metadata": "root.CancelUpload_args.__init__", "header": "['class', 'CancelUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2749 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.ArchiveLocalID = iprot.readString();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.CancelUpload_args.read", "header": "['class', 'CancelUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2752 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('CancelUpload_args')\n if self.ArchiveLocalID is not None:\n oprot.writeFieldBegin('ArchiveLocalID', TType.STRING, 1)\n oprot.writeString(self.ArchiveLocalID)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.CancelUpload_args.write", "header": "['class', 'CancelUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2771 }, { "content": " def validate(self):\n return", "metadata": "root.CancelUpload_args.validate", "header": "['class', 'CancelUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2783 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.CancelUpload_args.__repr__", "header": "['class', 'CancelUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2787 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.CancelUpload_args.__eq__", "header": "['class', 'CancelUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2792 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.CancelUpload_args.__ne__", "header": "['class', 'CancelUpload_args', '(', 'object', ')', ':', '___EOS___']", "index": 2795 }, { "content": "class CancelUpload_result(object):\n \"\"\"\n Attributes:\n - error\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.CancelUpload_result", "header": "['module', '___EOS___']", "index": 2798 }, { "content": " def __init__(self, error=None,):\n self.error = error", "metadata": "root.CancelUpload_result.__init__", "header": "['class', 'CancelUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2809 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.CancelUpload_result.read", "header": "['class', 'CancelUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2812 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('CancelUpload_result')\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.CancelUpload_result.write", "header": "['class', 'CancelUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2832 }, { "content": " def validate(self):\n return", "metadata": "root.CancelUpload_result.validate", "header": "['class', 'CancelUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2844 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.CancelUpload_result.__repr__", "header": "['class', 'CancelUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2848 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.CancelUpload_result.__eq__", "header": "['class', 'CancelUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2853 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.CancelUpload_result.__ne__", "header": "['class', 'CancelUpload_result', '(', 'object', ')', ':', '___EOS___']", "index": 2856 }, { "content": "class GetCertificates_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.GetCertificates_args", "header": "['module', '___EOS___']", "index": 2859 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetCertificates_args.read", "header": "['class', 'GetCertificates_args', '(', 'object', ')', ':', '___EOS___']", "index": 2864 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetCertificates_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetCertificates_args.write", "header": "['class', 'GetCertificates_args', '(', 'object', ')', ':', '___EOS___']", "index": 2878 }, { "content": " def validate(self):\n return", "metadata": "root.GetCertificates_args.validate", "header": "['class', 'GetCertificates_args', '(', 'object', ')', ':', '___EOS___']", "index": 2886 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetCertificates_args.__repr__", "header": "['class', 'GetCertificates_args', '(', 'object', ')', ':', '___EOS___']", "index": 2890 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetCertificates_args.__eq__", "header": "['class', 'GetCertificates_args', '(', 'object', ')', ':', '___EOS___']", "index": 2895 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetCertificates_args.__ne__", "header": "['class', 'GetCertificates_args', '(', 'object', ')', ':', '___EOS___']", "index": 2898 }, { "content": "class GetCertificates_result(object):\n \"\"\"\n Attributes:\n - success\n \"\"\"\n\n thrift_spec = (\n (0, TType.LIST, 'success', (TType.STRUCT,(Certificate, Certificate.thrift_spec)), None, ), # 0\n )\n\n\n\n\n\n\n\n", "metadata": "root.GetCertificates_result", "header": "['module', '___EOS___']", "index": 2901 }, { "content": " def __init__(self, success=None,):\n self.success = success", "metadata": "root.GetCertificates_result.__init__", "header": "['class', 'GetCertificates_result', '(', 'object', ')', ':', '___EOS___']", "index": 2911 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.LIST:\n self.success = []\n (_etype31, _size28) = iprot.readListBegin()\n for _i32 in xrange(_size28):\n _elem33 = Certificate()\n _elem33.read(iprot)\n self.success.append(_elem33)\n iprot.readListEnd()\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetCertificates_result.read", "header": "['class', 'GetCertificates_result', '(', 'object', ')', ':', '___EOS___']", "index": 2914 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetCertificates_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.LIST, 0)\n oprot.writeListBegin(TType.STRUCT, len(self.success))\n for iter34 in self.success:\n iter34.write(oprot)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetCertificates_result.write", "header": "['class', 'GetCertificates_result', '(', 'object', ')', ':', '___EOS___']", "index": 2939 }, { "content": " def validate(self):\n return", "metadata": "root.GetCertificates_result.validate", "header": "['class', 'GetCertificates_result', '(', 'object', ')', ':', '___EOS___']", "index": 2954 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetCertificates_result.__repr__", "header": "['class', 'GetCertificates_result', '(', 'object', ')', ':', '___EOS___']", "index": 2958 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetCertificates_result.__eq__", "header": "['class', 'GetCertificates_result', '(', 'object', ')', ':', '___EOS___']", "index": 2963 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetCertificates_result.__ne__", "header": "['class', 'GetCertificates_result', '(', 'object', ')', ':', '___EOS___']", "index": 2966 }, { "content": "class ExportCertificate_args(object):\n \"\"\"\n Attributes:\n - ArchiveID\n - format\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'ArchiveID', None, None, ), # 1\n (2, TType.I32, 'format', None, None, ), # 2\n )\n\n\n\n\n\n\n\n", "metadata": "root.ExportCertificate_args", "header": "['module', '___EOS___']", "index": 2969 }, { "content": " def __init__(self, ArchiveID=None, format=None,):\n self.ArchiveID = ArchiveID\n self.format = format", "metadata": "root.ExportCertificate_args.__init__", "header": "['class', 'ExportCertificate_args', '(', 'object', ')', ':', '___EOS___']", "index": 2982 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.ArchiveID = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 2:\n if ftype == TType.I32:\n self.format = iprot.readI32();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.ExportCertificate_args.read", "header": "['class', 'ExportCertificate_args', '(', 'object', ')', ':', '___EOS___']", "index": 2986 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('ExportCertificate_args')\n if self.ArchiveID is not None:\n oprot.writeFieldBegin('ArchiveID', TType.STRING, 1)\n oprot.writeString(self.ArchiveID)\n oprot.writeFieldEnd()\n if self.format is not None:\n oprot.writeFieldBegin('format', TType.I32, 2)\n oprot.writeI32(self.format)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.ExportCertificate_args.write", "header": "['class', 'ExportCertificate_args', '(', 'object', ')', ':', '___EOS___']", "index": 3010 }, { "content": " def validate(self):\n return", "metadata": "root.ExportCertificate_args.validate", "header": "['class', 'ExportCertificate_args', '(', 'object', ')', ':', '___EOS___']", "index": 3026 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.ExportCertificate_args.__repr__", "header": "['class', 'ExportCertificate_args', '(', 'object', ')', ':', '___EOS___']", "index": 3030 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.ExportCertificate_args.__eq__", "header": "['class', 'ExportCertificate_args', '(', 'object', ')', ':', '___EOS___']", "index": 3035 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.ExportCertificate_args.__ne__", "header": "['class', 'ExportCertificate_args', '(', 'object', ')', ':', '___EOS___']", "index": 3038 }, { "content": "class ExportCertificate_result(object):\n \"\"\"\n Attributes:\n - success\n - error\n \"\"\"\n\n thrift_spec = (\n (0, TType.STRING, 'success', None, None, ), # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.ExportCertificate_result", "header": "['module', '___EOS___']", "index": 3041 }, { "content": " def __init__(self, success=None, error=None,):\n self.success = success\n self.error = error", "metadata": "root.ExportCertificate_result.__init__", "header": "['class', 'ExportCertificate_result', '(', 'object', ')', ':', '___EOS___']", "index": 3053 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.STRING:\n self.success = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.ExportCertificate_result.read", "header": "['class', 'ExportCertificate_result', '(', 'object', ')', ':', '___EOS___']", "index": 3057 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('ExportCertificate_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.STRING, 0)\n oprot.writeString(self.success)\n oprot.writeFieldEnd()\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.ExportCertificate_result.write", "header": "['class', 'ExportCertificate_result', '(', 'object', ')', ':', '___EOS___']", "index": 3082 }, { "content": " def validate(self):\n return", "metadata": "root.ExportCertificate_result.validate", "header": "['class', 'ExportCertificate_result', '(', 'object', ')', ':', '___EOS___']", "index": 3098 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.ExportCertificate_result.__repr__", "header": "['class', 'ExportCertificate_result', '(', 'object', ')', ':', '___EOS___']", "index": 3102 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.ExportCertificate_result.__eq__", "header": "['class', 'ExportCertificate_result', '(', 'object', ')', ':', '___EOS___']", "index": 3107 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.ExportCertificate_result.__ne__", "header": "['class', 'ExportCertificate_result', '(', 'object', ')', ':', '___EOS___']", "index": 3110 }, { "content": "class Decrypt_args(object):\n \"\"\"\n Attributes:\n - archivePath\n - key\n - destinationPath\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'archivePath', None, None, ), # 1\n (2, TType.STRING, 'key', None, None, ), # 2\n (3, TType.STRING, 'destinationPath', None, None, ), # 3\n )\n\n\n\n\n\n\n\n", "metadata": "root.Decrypt_args", "header": "['module', '___EOS___']", "index": 3113 }, { "content": " def __init__(self, archivePath=None, key=None, destinationPath=None,):\n self.archivePath = archivePath\n self.key = key\n self.destinationPath = destinationPath", "metadata": "root.Decrypt_args.__init__", "header": "['class', 'Decrypt_args', '(', 'object', ')', ':', '___EOS___']", "index": 3128 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.archivePath = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 2:\n if ftype == TType.STRING:\n self.key = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 3:\n if ftype == TType.STRING:\n self.destinationPath = iprot.readString();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.Decrypt_args.read", "header": "['class', 'Decrypt_args', '(', 'object', ')', ':', '___EOS___']", "index": 3133 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('Decrypt_args')\n if self.archivePath is not None:\n oprot.writeFieldBegin('archivePath', TType.STRING, 1)\n oprot.writeString(self.archivePath)\n oprot.writeFieldEnd()\n if self.key is not None:\n oprot.writeFieldBegin('key', TType.STRING, 2)\n oprot.writeString(self.key)\n oprot.writeFieldEnd()\n if self.destinationPath is not None:\n oprot.writeFieldBegin('destinationPath', TType.STRING, 3)\n oprot.writeString(self.destinationPath)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.Decrypt_args.write", "header": "['class', 'Decrypt_args', '(', 'object', ')', ':', '___EOS___']", "index": 3162 }, { "content": " def validate(self):\n return", "metadata": "root.Decrypt_args.validate", "header": "['class', 'Decrypt_args', '(', 'object', ')', ':', '___EOS___']", "index": 3182 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.Decrypt_args.__repr__", "header": "['class', 'Decrypt_args', '(', 'object', ')', ':', '___EOS___']", "index": 3186 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.Decrypt_args.__eq__", "header": "['class', 'Decrypt_args', '(', 'object', ')', ':', '___EOS___']", "index": 3191 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.Decrypt_args.__ne__", "header": "['class', 'Decrypt_args', '(', 'object', ')', ':', '___EOS___']", "index": 3194 }, { "content": "class Decrypt_result(object):\n \"\"\"\n Attributes:\n - error\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRUCT, 'error', (InvalidOperation, InvalidOperation.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.Decrypt_result", "header": "['module', '___EOS___']", "index": 3197 }, { "content": " def __init__(self, error=None,):\n self.error = error", "metadata": "root.Decrypt_result.__init__", "header": "['class', 'Decrypt_result', '(', 'object', ')', ':', '___EOS___']", "index": 3208 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRUCT:\n self.error = InvalidOperation()\n self.error.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.Decrypt_result.read", "header": "['class', 'Decrypt_result', '(', 'object', ')', ':', '___EOS___']", "index": 3211 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('Decrypt_result')\n if self.error is not None:\n oprot.writeFieldBegin('error', TType.STRUCT, 1)\n self.error.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.Decrypt_result.write", "header": "['class', 'Decrypt_result', '(', 'object', ')', ':', '___EOS___']", "index": 3231 }, { "content": " def validate(self):\n return", "metadata": "root.Decrypt_result.validate", "header": "['class', 'Decrypt_result', '(', 'object', ')', ':', '___EOS___']", "index": 3243 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.Decrypt_result.__repr__", "header": "['class', 'Decrypt_result', '(', 'object', ')', ':', '___EOS___']", "index": 3247 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.Decrypt_result.__eq__", "header": "['class', 'Decrypt_result', '(', 'object', ')', ':', '___EOS___']", "index": 3252 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.Decrypt_result.__ne__", "header": "['class', 'Decrypt_result', '(', 'object', ')', ':', '___EOS___']", "index": 3255 }, { "content": "class GetSettings_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.GetSettings_args", "header": "['module', '___EOS___']", "index": 3258 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetSettings_args.read", "header": "['class', 'GetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3263 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetSettings_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetSettings_args.write", "header": "['class', 'GetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3277 }, { "content": " def validate(self):\n return", "metadata": "root.GetSettings_args.validate", "header": "['class', 'GetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3285 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetSettings_args.__repr__", "header": "['class', 'GetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3289 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetSettings_args.__eq__", "header": "['class', 'GetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3294 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetSettings_args.__ne__", "header": "['class', 'GetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3297 }, { "content": "class GetSettings_result(object):\n \"\"\"\n Attributes:\n - success\n \"\"\"\n\n thrift_spec = (\n (0, TType.STRUCT, 'success', (Settings, Settings.thrift_spec), None, ), # 0\n )\n\n\n\n\n\n\n\n", "metadata": "root.GetSettings_result", "header": "['module', '___EOS___']", "index": 3300 }, { "content": " def __init__(self, success=None,):\n self.success = success", "metadata": "root.GetSettings_result.__init__", "header": "['class', 'GetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3310 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.STRUCT:\n self.success = Settings()\n self.success.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetSettings_result.read", "header": "['class', 'GetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3313 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetSettings_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.STRUCT, 0)\n self.success.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetSettings_result.write", "header": "['class', 'GetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3333 }, { "content": " def validate(self):\n return", "metadata": "root.GetSettings_result.validate", "header": "['class', 'GetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3345 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetSettings_result.__repr__", "header": "['class', 'GetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3349 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetSettings_result.__eq__", "header": "['class', 'GetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3354 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetSettings_result.__ne__", "header": "['class', 'GetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3357 }, { "content": "class SetSettings_args(object):\n \"\"\"\n Attributes:\n - settings\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRUCT, 'settings', (Settings, Settings.thrift_spec), None, ), # 1\n )\n\n\n\n\n\n\n\n", "metadata": "root.SetSettings_args", "header": "['module', '___EOS___']", "index": 3360 }, { "content": " def __init__(self, settings=None,):\n self.settings = settings", "metadata": "root.SetSettings_args.__init__", "header": "['class', 'SetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3371 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRUCT:\n self.settings = Settings()\n self.settings.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.SetSettings_args.read", "header": "['class', 'SetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3374 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('SetSettings_args')\n if self.settings is not None:\n oprot.writeFieldBegin('settings', TType.STRUCT, 1)\n self.settings.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.SetSettings_args.write", "header": "['class', 'SetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3394 }, { "content": " def validate(self):\n return", "metadata": "root.SetSettings_args.validate", "header": "['class', 'SetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3406 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.SetSettings_args.__repr__", "header": "['class', 'SetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3410 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.SetSettings_args.__eq__", "header": "['class', 'SetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3415 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.SetSettings_args.__ne__", "header": "['class', 'SetSettings_args', '(', 'object', ')', ':', '___EOS___']", "index": 3418 }, { "content": "class SetSettings_result(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.SetSettings_result", "header": "['module', '___EOS___']", "index": 3421 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.SetSettings_result.read", "header": "['class', 'SetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3426 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('SetSettings_result')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.SetSettings_result.write", "header": "['class', 'SetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3440 }, { "content": " def validate(self):\n return", "metadata": "root.SetSettings_result.validate", "header": "['class', 'SetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3448 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.SetSettings_result.__repr__", "header": "['class', 'SetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3452 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.SetSettings_result.__eq__", "header": "['class', 'SetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3457 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.SetSettings_result.__ne__", "header": "['class', 'SetSettings_result', '(', 'object', ')', ':', '___EOS___']", "index": 3460 }, { "content": "class GetLatestVersion_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.GetLatestVersion_args", "header": "['module', '___EOS___']", "index": 3463 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetLatestVersion_args.read", "header": "['class', 'GetLatestVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3468 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetLatestVersion_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetLatestVersion_args.write", "header": "['class', 'GetLatestVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3482 }, { "content": " def validate(self):\n return", "metadata": "root.GetLatestVersion_args.validate", "header": "['class', 'GetLatestVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3490 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetLatestVersion_args.__repr__", "header": "['class', 'GetLatestVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3494 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetLatestVersion_args.__eq__", "header": "['class', 'GetLatestVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3499 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetLatestVersion_args.__ne__", "header": "['class', 'GetLatestVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3502 }, { "content": "class GetLatestVersion_result(object):\n \"\"\"\n Attributes:\n - success\n \"\"\"\n\n thrift_spec = (\n (0, TType.STRUCT, 'success', (VersionInfo, VersionInfo.thrift_spec), None, ), # 0\n )\n\n\n\n\n\n\n\n", "metadata": "root.GetLatestVersion_result", "header": "['module', '___EOS___']", "index": 3505 }, { "content": " def __init__(self, success=None,):\n self.success = success", "metadata": "root.GetLatestVersion_result.__init__", "header": "['class', 'GetLatestVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3515 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.STRUCT:\n self.success = VersionInfo()\n self.success.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetLatestVersion_result.read", "header": "['class', 'GetLatestVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3518 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetLatestVersion_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.STRUCT, 0)\n self.success.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetLatestVersion_result.write", "header": "['class', 'GetLatestVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3538 }, { "content": " def validate(self):\n return", "metadata": "root.GetLatestVersion_result.validate", "header": "['class', 'GetLatestVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3550 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetLatestVersion_result.__repr__", "header": "['class', 'GetLatestVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3554 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetLatestVersion_result.__eq__", "header": "['class', 'GetLatestVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3559 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetLatestVersion_result.__ne__", "header": "['class', 'GetLatestVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3562 }, { "content": "class GetVersion_args(object):\n\n thrift_spec = (\n )\n\n\n\n\n\n\n", "metadata": "root.GetVersion_args", "header": "['module', '___EOS___']", "index": 3565 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetVersion_args.read", "header": "['class', 'GetVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3570 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetVersion_args')\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetVersion_args.write", "header": "['class', 'GetVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3584 }, { "content": " def validate(self):\n return", "metadata": "root.GetVersion_args.validate", "header": "['class', 'GetVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3592 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetVersion_args.__repr__", "header": "['class', 'GetVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3596 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetVersion_args.__eq__", "header": "['class', 'GetVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3601 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetVersion_args.__ne__", "header": "['class', 'GetVersion_args', '(', 'object', ')', ':', '___EOS___']", "index": 3604 }, { "content": "class GetVersion_result(object):\n \"\"\"\n Attributes:\n - success\n \"\"\"\n\n thrift_spec = (\n (0, TType.STRUCT, 'success', (VersionInfo, VersionInfo.thrift_spec), None, ), # 0\n )\n\n\n\n\n\n\n\n", "metadata": "root.GetVersion_result", "header": "['module', '___EOS___']", "index": 3607 }, { "content": " def __init__(self, success=None,):\n self.success = success", "metadata": "root.GetVersion_result.__init__", "header": "['class', 'GetVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3617 }, { "content": " def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 0:\n if ftype == TType.STRUCT:\n self.success = VersionInfo()\n self.success.read(iprot)\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()", "metadata": "root.GetVersion_result.read", "header": "['class', 'GetVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3620 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('GetVersion_result')\n if self.success is not None:\n oprot.writeFieldBegin('success', TType.STRUCT, 0)\n self.success.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()", "metadata": "root.GetVersion_result.write", "header": "['class', 'GetVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3640 }, { "content": " def validate(self):\n return", "metadata": "root.GetVersion_result.validate", "header": "['class', 'GetVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3652 }, { "content": " def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))", "metadata": "root.GetVersion_result.__repr__", "header": "['class', 'GetVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3656 }, { "content": " def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__", "metadata": "root.GetVersion_result.__eq__", "header": "['class', 'GetVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3661 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.GetVersion_result.__ne__", "header": "['class', 'GetVersion_result', '(', 'object', ')', ':', '___EOS___']", "index": 3664 } ]
[ { "span": "from thrift.Thrift import TType, TMessageType, TException, TApplicationException", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 80 }, { "span": "from thrift.protocol import TBinaryProtocol, TProtocol", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 54 }, { "span": "from thrift.transport import TTwisted", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 37 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Auto", "generat", "ed", " ", "by", " ", "Thri", "ft", " ", "Compil", "er", " ", "(", "0.", "9.0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DO", " ", "NOT", " ", "EDIT", " ", "UNL", "ESS", " ", "YOU", " ", "ARE", " ", "SUR", "E", " ", "THA", "T", " ", "YOU", " ", "KN", "OW", " ", "WH", "AT", " ", "YOU", " ", "ARE", " ", "DOI", "NG_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "options", " ", "string", ":", " ", "py", ":", "twist", "ed", ",", "new", "\\u", "style_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "thrift", "_", "._", "Thri", "ft_", "import_", "TT", "ype_", ",_", "TM", "essage", "Type_", ",_", "TE", "xcept", "ion_", ",_", "TA", "ppl", "ication", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ttype", "s_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "_", "._", "Thri", "ft_", "import_", "TP", "rocess", "or_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "_", "._", "transport_", "import_", "TT", "rans", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "_", "._", "protocol_", "import_", "TB", "inary", "Protocol_", ",_", "TP", "roto", "col_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "thrift", "_", "._", "protocol_", "import_", "fastbinary_", "\\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 ", " _", "fastbinary_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "zope_", "._", "interface_", "import_", "Interface_", ",_", "implements_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twisted_", "._", "internet_", "import_", "defer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "_", "._", "transport_", "import_", "TT", "wis", "ted_", "\\u\\u\\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_", "#", " ", "HELP", "ER", " ", "FUNCTIONS", " ", "AND", " ", "STRUCTUR", "ES_", "\\u\\u\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\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_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "Ping", "CLI_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clos", "e", "Whe", "n", "Poss", "ible_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Logi", "n", "User_", "(_", "username_", ",_", "Pass_", ",_", "Reme", "mber", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "user", "name", "\\", "10", ";", " ", "-", " ", "Pass", "\\", "10", ";", " ", "-", " ", "Reme", "mber", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "User", "Is", "Log", "ged", "In_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Logo", "ut_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Caps", "ule", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Creat", "e", "Archive_", "(_", "file", "Paths_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "file", "Path", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Upload", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Upload", "To", "Caps", "ule_", "(_", "Archive", "Local", "ID_", ",_", "Caps", "ule", "ID_", ",_", "title_", ",_", "description_", ",_", "sandbox_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", "-", " ", "Caps", "ule", "ID", "\\", "10", ";", " ", "-", " ", "title", "\\", "10", ";", " ", "-", " ", "description", "\\", "10", ";", " ", "-", " ", "sand", "box", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Resu", "me", "Upload_", "(_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Query", "Archive", "Status_", "(_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Pause", "Upload_", "(_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Cancel", "Upload_", "(_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Certificat", "es_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Export", "Certificate_", "(_", "Archive", "ID_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "ID", "\\", "10", ";", " ", "-", " ", "format", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Decrypt", "_", "(_", "archive", "Path_", ",_", "key_", ",_", "destinat", "ion", "Path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "archive", "Path", "\\", "10", ";", " ", "-", " ", "key", "\\", "10", ";", " ", "-", " ", "destinat", "ion", "Path", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Settings_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Set", "Settings_", "(_", "settings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "settings", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Late", "st", "Version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Iface", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Version_", "(_", ")_", ":_", "\\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_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implements_", "(_", "Iface", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\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INE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "transport_", ",_", "opr", "ot", "\\u", "factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "transport_", "=_", "transport_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "=_", "opr", "ot", "\\u", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "reqs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Ping", "CLI_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Ping", "CLI_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Ping", "CLI_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Ping", "CLI", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Ping", "CLI", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Ping", "CLI_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Ping", "CLI", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Ping", "CLI", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Clos", "e", "Whe", "n", "Poss", "ible_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Clos", "e", "Whe", "n", "Poss", "ible_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Clos", "e", "Whe", "n", "Poss", "ible_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Clos", "e", "Whe", "n", "Poss", "ibl", "e", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Clos", "e", "Whe", "n", "Poss", "ible_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Logi", "n", "User_", "(_", "self_", ",_", "username_", ",_", "Pass_", ",_", "Reme", "mber", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "user", "name", "\\", "10", ";", " ", "-", " ", "Pass", "\\", "10", ";", " ", "-", " ", "Reme", "mber", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Logi", "n", "User_", "(_", "username_", ",_", "Pass_", ",_", "Reme", "mber", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Logi", "n", "User_", "(_", "self_", ",_", "username_", ",_", "Pass_", ",_", "Reme", "mber", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Logi", "n", "User", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Logi", "n", "User", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "username_", "=_", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Pass_", "=_", "Pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Reme", "mber", "_", "=_", "Reme", "mber", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Logi", "n", "User_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Logi", "n", "User", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Logi", "n", "User", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "User", "Is", "Log", "ged", "In_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "User", "Is", "Log", "ged", "In_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "User", "Is", "Log", "ged", "In_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "User", "Is", "Log", "ged", "In", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "User", "Is", "Log", "ged", "In_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "User", "Is", "Log", "ged", "In", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Logo", "ut_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Logo", "ut_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Logo", "ut_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Logo", "ut", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Logo", "ut", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Logo", "ut_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Logo", "ut", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Logo", "ut", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Caps", "ule", "s_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Get", "Caps", "ule", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Get", "Caps", "ule", "s_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Get", "Caps", "ule", "s", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Get", "Caps", "ule", "s_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Get", "Caps", "ule", "s", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Creat", "e", "Archive_", "(_", "self_", ",_", "file", "Paths_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "file", "Path", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Creat", "e", "Archive_", "(_", "file", "Paths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Creat", "e", "Archive_", "(_", "self_", ",_", "file", "Paths_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Creat", "e", "Archive", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Creat", "e", "Archive", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "file", "Paths_", "=_", "file", "Paths_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Creat", "e", "Archive_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Creat", "e", "Archive", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Creat", "e", "Archive", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Upload", "s_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Get", "Upload", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Get", "Upload", "s_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Get", "Upload", "s", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Get", "Upload", "s", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Get", "Upload", "s_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Get", "Upload", "s", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Get", "Upload", "s", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Upload", "To", "Caps", "ule_", "(_", "self_", ",_", "Archive", "Local", "ID_", ",_", "Caps", "ule", "ID_", ",_", "title_", ",_", "description_", ",_", "sandbox_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", "-", " ", "Caps", "ule", "ID", "\\", "10", ";", " ", "-", " ", "title", "\\", "10", ";", " ", "-", " ", "description", "\\", "10", ";", " ", "-", " ", "sand", "box", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Upload", "To", "Caps", "ule_", "(_", "Archive", "Local", "ID_", ",_", "Caps", "ule", "ID_", ",_", "title_", ",_", "description_", ",_", "sandbox_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Upload", "To", "Caps", "ule_", "(_", "self_", ",_", "Archive", "Local", "ID_", ",_", "Caps", "ule", "ID_", ",_", "title_", ",_", "description_", ",_", "sandbox_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Upload", "To", "Caps", "ule", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Caps", "ule", "ID_", "=_", "Caps", "ule", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "title_", "=_", "title_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "description_", "=_", "description_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "sandbox_", "=_", "sandbox_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Upload", "To", "Caps", "ule_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Resu", "me", "Upload_", "(_", "self_", ",_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Resu", "me", "Upload_", "(_", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Resu", "me", "Upload_", "(_", "self_", ",_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Resu", "me", "Upload", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Resu", "me", "Upload", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Resu", "me", "Upload_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Resu", "me", "Upload", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Query", "Archive", "Status_", "(_", "self_", ",_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Query", "Archive", "Status_", "(_", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Query", "Archive", "Status_", "(_", "self_", ",_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Query", "Archive", "Status", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Query", "Archive", "Status", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Query", "Archive", "Status_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Query", "Archive", "Status", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Query", "Archive", "Status", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Pause", "Upload_", "(_", "self_", ",_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Pause", "Upload_", "(_", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Pause", "Upload_", "(_", "self_", ",_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Pause", "Upload", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Pause", "Upload", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Pause", "Upload_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Pause", "Upload", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Cancel", "Upload_", "(_", "self_", ",_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Cancel", "Upload_", "(_", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Cancel", "Upload_", "(_", "self_", ",_", "Archive", "Local", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Cancel", "Upload", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Cancel", "Upload", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Cancel", "Upload_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Cancel", "Upload", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Certificat", "es_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Get", "Certificat", "es_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Get", "Certificat", "es_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Get", "Certificat", "es", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Get", "Certificat", "es", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Get", "Certificat", "es_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Get", "Certificat", "es", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Get", "Certificat", "es", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Export", "Certificate_", "(_", "self_", ",_", "Archive", "ID_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "Archive", "ID", "\\", "10", ";", " ", "-", " ", "format", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Export", "Certificate_", "(_", "Archive", "ID_", ",_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Export", "Certificate_", "(_", "self_", ",_", "Archive", "ID_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Export", "Certificat", "e", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Export", "Certificat", "e\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "Archive", "ID_", "=_", "Archive", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "format_", "=_", "format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Export", "Certificate_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Export", "Certificat", "e\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Export", "Certificat", "e", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Decrypt", "_", "(_", "self_", ",_", "archive", "Path_", ",_", "key_", ",_", "destinat", "ion", "Path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "archive", "Path", "\\", "10", ";", " ", "-", " ", "key", "\\", "10", ";", " ", "-", " ", "destinat", "ion", "Path", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Decrypt", "_", "(_", "archive", "Path_", ",_", "key_", ",_", "destinat", "ion", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Decrypt", "_", "(_", "self_", ",_", "archive", "Path_", ",_", "key_", ",_", "destinat", "ion", "Path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Decrypt", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Decrypt", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "archive", "Path_", "=_", "archive", "Path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "key_", "=_", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "destinat", "ion", "Path_", "=_", "destinat", "ion", "Path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Decrypt", "_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Decrypt", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "errback", "_", "(_", "result_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Settings_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Get", "Settings_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Get", "Settings_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Get", "Sett", "ings", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Get", "Sett", "ings", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Get", "Settings_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Get", "Sett", "ings", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Get", "Sett", "ings", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Set", "Settings_", "(_", "self_", ",_", "settings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "settings", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Set", "Settings_", "(_", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Set", "Settings_", "(_", "self_", ",_", "settings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Set", "Sett", "ings", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Set", "Sett", "ings", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "settings_", "=_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Set", "Settings_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Set", "Sett", "ings", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Late", "st", "Version_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Get", "Late", "st", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Get", "Late", "st", "Version_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Get", "Late", "st", "Version", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Get", "Late", "st", "Version_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Get", "Late", "st", "Version", " ", "fail", "ed", ":", " ", "unknown", " ", "result", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Version_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "seqid_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "reqs_", "[_", "self_", "._", "\\u", "seqid_", "]_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "Get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "Get", "Version_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "=_", "self_", "._", "\\u", "opr", "ot", "\\u", "factory_", "._", "get", "Protocol_", "(_", "self_", "._", "\\u", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "'", "Get", "Version", "'_", ",_", "TM", "essage", "Type_", "._", "CALL_", ",_", "self_", "._", "\\u", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "Get", "Version", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recv", "\\u", "Get", "Version_", "(_", "self_", ",_", "iprot_", ",_", "mtype_", ",_", "rse", "qid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "reqs_", "._", "pop_", "(_", "rse", "qid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtype_", "==_", "TM", "essage", "Type_", "._", "EXCEPTION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Get", "Version", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "callback_", "(_", "result_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "._", "errback", "_", "(_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "MISSING", "\\u", "RESULT_", ",_", "\"", "Get", "Version", " ", "fail", "ed", ":", " ", "unknown", " ", "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_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implements_", "(_", "Iface", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "handler_", "=_", "Iface", "_", "(_", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Ping", "CLI", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Ping", "CLI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Clos", "e", "Whe", "n", "Poss", "ibl", "e", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Clos", "e", "Whe", "n", "Poss", "ible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Logi", "n", "User", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Logi", "n", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "User", "Is", "Log", "ged", "In", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "User", "Is", "Log", "ged", "In_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Logo", "ut", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Logo", "ut_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Get", "Caps", "ule", "s", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Get", "Caps", "ule", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Creat", "e", "Archive", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Creat", "e", "Archive_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Get", "Upload", "s", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Get", "Upload", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Upload", "To", "Caps", "ule", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Upload", "To", "Caps", "ule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Resu", "me", "Upload", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Resu", "me", "Upload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Query", "Archive", "Status", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Query", "Archive", "Status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Pause", "Upload", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Pause", "Upload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Cancel", "Upload", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Cancel", "Upload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Get", "Certificat", "es", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Get", "Certificat", "es_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Export", "Certificat", "e", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Export", "Certificate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Decrypt", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Decrypt", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Get", "Sett", "ings", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Get", "Settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Set", "Sett", "ings", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Set", "Settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Get", "Late", "st", "Version", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Get", "Late", "st", "Version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "Map_", "[_", "\"", "Get", "Version", "\"_", "]_", "=_", "Processor_", "._", "process", "\\u", "Get", "Version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process_", "(_", "self_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "name_", ",_", "type_", ",_", "seqid_", ")_", "=_", "iprot_", "._", "read", "Messag", "e", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "not_", "in_", "self_", "._", "\\u", "process", "Map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "TT", "ype_", "._", "STRUCT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "TA", "ppl", "ication", "Exception_", "(_", "TA", "ppl", "ication", "Exception_", "._", "UNK", "NOW", "N", "\\u", "METHOD_", ",_", "'", "Un", "know", "n", " ", "function", " ", "%", "s", "'_", "%_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "name_", ",_", "TM", "essage", "Type_", "._", "EXCEPTION_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "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_", "self_", "._", "\\u", "process", "Map_", "[_", "name_", "]_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Ping", "CLI_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Ping", "CLI", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Ping", "CLI", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Ping", "CLI_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Ping", "CLI_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Ping", "CLI_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Ping", "CLI", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Clos", "e", "Whe", "n", "Poss", "ible_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Clos", "e", "Whe", "n", "Poss", "ible_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Clos", "e", "Whe", "n", "Poss", "ible_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Clos", "e", "Whe", "n", "Poss", "ible_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Clos", "e", "Whe", "n", "Poss", "ibl", "e", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Logi", "n", "User_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Logi", "n", "User", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Logi", "n", "User", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Logi", "n", "User_", ",_", "args_", "._", "username_", ",_", "args_", "._", "Pass_", ",_", "args_", "._", "Reme", "mber", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Logi", "n", "User_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Logi", "n", "User_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Logi", "n", "User_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Logi", "n", "User", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Logi", "n", "User_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Logi", "n", "User", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "User", "Is", "Log", "ged", "In_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "User", "Is", "Log", "ged", "In_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "User", "Is", "Log", "ged", "In_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "User", "Is", "Log", "ged", "In_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "User", "Is", "Log", "ged", "In", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Logo", "ut_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Logo", "ut", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Logo", "ut", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Logo", "ut_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Logo", "ut_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Logo", "ut_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Logo", "ut_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Logo", "ut", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Logo", "ut_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Logo", "ut", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Get", "Caps", "ule", "s_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Get", "Caps", "ule", "s_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Caps", "ule", "s_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Get", "Caps", "ule", "s_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Caps", "ule", "s_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Get", "Caps", "ule", "s", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Get", "Caps", "ule", "s_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Get", "Caps", "ule", "s", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Creat", "e", "Archive_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Creat", "e", "Archive", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Creat", "e", "Archive", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Creat", "e", "Archive_", ",_", "args_", "._", "file", "Paths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Creat", "e", "Archive_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Creat", "e", "Archive_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Creat", "e", "Archive_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Creat", "e", "Archive", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Creat", "e", "Archive_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Creat", "e", "Archive", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Get", "Upload", "s_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Get", "Upload", "s", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Get", "Upload", "s", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Get", "Upload", "s_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Upload", "s_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Upload", "s_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Get", "Upload", "s", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Upload", "To", "Caps", "ule_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Upload", "To", "Caps", "ule_", ",_", "args_", "._", "Archive", "Local", "ID_", ",_", "args_", "._", "Caps", "ule", "ID_", ",_", "args_", "._", "title_", ",_", "args_", "._", "description_", ",_", "args_", "._", "sandbox_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Upload", "To", "Caps", "ule_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Upload", "To", "Caps", "ule_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Upload", "To", "Caps", "ule_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Upload", "To", "Caps", "ule", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Upload", "To", "Caps", "ule_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Upload", "To", "Caps", "ule", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Resu", "me", "Upload_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Resu", "me", "Upload", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Resu", "me", "Upload", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Resu", "me", "Upload_", ",_", "args_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Resu", "me", "Upload_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Resu", "me", "Upload_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Resu", "me", "Upload_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Resu", "me", "Upload", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Resu", "me", "Upload_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Resu", "me", "Upload", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Query", "Archive", "Status_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Query", "Archive", "Status", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Query", "Archive", "Status", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Query", "Archive", "Status_", ",_", "args_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Query", "Archive", "Status_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Query", "Archive", "Status_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Query", "Archive", "Status_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Query", "Archive", "Status", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Query", "Archive", "Status_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Query", "Archive", "Status", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Pause", "Upload_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Pause", "Upload", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Pause", "Upload", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Pause", "Upload_", ",_", "args_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Pause", "Upload_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Pause", "Upload_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Pause", "Upload_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Pause", "Upload", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Pause", "Upload_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Pause", "Upload", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Cancel", "Upload_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Cancel", "Upload", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Cancel", "Upload", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Cancel", "Upload_", ",_", "args_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Cancel", "Upload_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Cancel", "Upload_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Cancel", "Upload_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Cancel", "Upload", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Cancel", "Upload_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Cancel", "Upload", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Get", "Certificat", "es_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Get", "Certificat", "es", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Get", "Certificat", "es", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Get", "Certificat", "es_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Certificat", "es_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Certificat", "es_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Get", "Certificat", "es", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Export", "Certificate_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Export", "Certificat", "e\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Export", "Certificat", "e\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Export", "Certificate_", ",_", "args_", "._", "Archive", "ID_", ",_", "args_", "._", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Export", "Certificate_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Export", "Certificate_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Export", "Certificate_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Export", "Certificat", "e", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Export", "Certificate_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Export", "Certificat", "e", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Decrypt", "_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Decrypt", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Decrypt", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Decrypt", "_", ",_", "args_", "._", "archive", "Path_", ",_", "args_", "._", "key_", ",_", "args_", "._", "destinat", "ion", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Decrypt", "_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "exception", "\\u", "Decrypt", "_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Decrypt", "_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Decrypt", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "exception", "\\u", "Decrypt", "_", "(_", "self_", ",_", "error_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\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 ", " _", "error_", "._", "raise", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Operation_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Decrypt", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Get", "Settings_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Get", "Sett", "ings", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Get", "Sett", "ings", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Get", "Settings_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Settings_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Settings_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Get", "Sett", "ings", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Set", "Settings_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Set", "Sett", "ings", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Set", "Sett", "ings", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Set", "Settings_", ",_", "args_", "._", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Set", "Settings_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Set", "Settings_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Set", "Sett", "ings", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Get", "Late", "st", "Version_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Get", "Late", "st", "Version_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Late", "st", "Version_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Late", "st", "Version_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Get", "Late", "st", "Version", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "Get", "Version_", "(_", "self_", ",_", "seqid_", ",_", "iprot_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "Get", "Version", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iprot_", "._", "read", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Get", "Version", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "self_", "._", "\\u", "handler_", "._", "Get", "Version_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Version_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processor_", "(_", "TP", "rocess", "or_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "results", "\\u", "success", "\\u", "Get", "Version_", "(_", "self_", ",_", "success_", ",_", "result_", ",_", "seqid_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "Begin_", "(_", "\"", "Get", "Version", "\"_", ",_", "TM", "essage", "Type_", "._", "REPLY_", ",_", "seqid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Messag", "e", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "trans_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ping", "CLI", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Ping", "CLI", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Ping", "CLI", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ping", "CLI", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "'", "success", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Ping", "CLI", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "BOOL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "iprot_", "._", "read", "Bool_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Ping", "CLI", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Bool_", "(_", "self_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ping", "CLI", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clos", "e", "Whe", "n", "Poss", "ibl", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Logi", "n", "User", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "user", "name", "\\", "10", ";", " ", " ", " ", "-", " ", "Pass", "\\", "10", ";", " ", " ", " ", "-", " ", "Reme", "mber", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "user", "name", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "Pass", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "3_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "'", "Reme", "mber", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Logi", "n", "User", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "username_", "=_", "None_", ",_", "Pass_", "=_", "None_", ",_", "Reme", "mber", "_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "username_", "=_", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Pass_", "=_", "Pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Reme", "mber", "_", "=_", "Reme", "mber", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "username_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Pass_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "BOOL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Reme", "mber", "_", "=_", "iprot_", "._", "read", "Bool_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Logi", "n", "User", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "username_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "user", "name", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Pass_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Pass", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "Pass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Reme", "mber", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Reme", "mber", "'_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Bool_", "(_", "self_", "._", "Reme", "mber", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Logi", "n", "User", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "'", "success", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Logi", "n", "User", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "BOOL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "iprot_", "._", "read", "Bool_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Logi", "n", "User", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Bool_", "(_", "self_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logi", "n", "User", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "User", "Is", "Log", "ged", "In", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "'", "success", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "BOOL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "iprot_", "._", "read", "Bool_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "User", "Is", "Log", "ged", "In", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Bool_", "(_", "self_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Is", "Log", "ged", "In", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Logo", "ut", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Logo", "ut", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Logo", "ut", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Logo", "ut", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "'", "success", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Logo", "ut", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "BOOL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "iprot_", "._", "read", "Bool_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Logo", "ut", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Bool_", "(_", "self_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Caps", "ule", "s", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "LIST_", ",_", "'", "success", "'_", ",_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "(_", "Caps", "ule_", ",_", "Caps", "ule_", "._", "thrift", "\\u", "spec_", ")_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "LIST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "\\u", "etype", "10_", ",_", "\\u", "size", "7_", ")_", "=_", "iprot_", "._", "read", "List", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "i1", "1_", "in_", "xrange_", "(_", "\\u", "size", "7_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "elem", "12_", "=_", "Caps", "ule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "elem", "12_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "append_", "(_", "\\u", "elem", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Caps", "ule", "s", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "len_", "(_", "self_", "._", "success_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "13_", "in_", "self_", "._", "success_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "13_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Caps", "ule", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Creat", "e", "Archive", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "file", "Path", "s", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "LIST_", ",_", "'", "file", "Path", "s", "'_", ",_", "(_", "TT", "ype_", "._", "STRING_", ",_", "None_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Creat", "e", "Archive", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "file", "Paths_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "file", "Paths_", "=_", "file", "Paths_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "LIST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "file", "Paths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "\\u", "etype", "17_", ",_", "\\u", "size", "14_", ")_", "=_", "iprot_", "._", "read", "List", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "i1", "8_", "in_", "xrange_", "(_", "\\u", "size", "14_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "elem", "19_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "file", "Paths_", "._", "append_", "(_", "\\u", "elem", "19_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Creat", "e", "Archive", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "file", "Paths_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "file", "Path", "s", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRING_", ",_", "len_", "(_", "self_", "._", "file", "Paths_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "20_", "in_", "self_", "._", "file", "Paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "String_", "(_", "iter", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Creat", "e", "Archive", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "success", "'_", ",_", "(_", "Archive_", ",_", "Archive_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Creat", "e", "Archive", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "Archive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Creat", "e", "Archive", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Archive", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Upload", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Upload", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Upload", "s", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Upload", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "LIST_", ",_", "'", "success", "'_", ",_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "(_", "Archive_", ",_", "Archive_", "._", "thrift", "\\u", "spec_", ")_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Upload", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "LIST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "\\u", "etype", "24_", ",_", "\\u", "size", "21_", ")_", "=_", "iprot_", "._", "read", "List", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "i2", "5_", "in_", "xrange_", "(_", "\\u", "size", "21_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "elem", "26_", "=_", "Archive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "elem", "26_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "append_", "(_", "\\u", "elem", "26_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Upload", "s", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "len_", "(_", "self_", "._", "success_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "27_", "in_", "self_", "._", "success_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "27_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Upload", "s", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", " ", "-", " ", "Caps", "ule", "ID", "\\", "10", ";", " ", " ", " ", "-", " ", "title", "\\", "10", ";", " ", " ", " ", "-", " ", "description", "\\", "10", ";", " ", " ", " ", "-", " ", "sand", "box", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "Archive", "Local", "ID", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "Caps", "ule", "ID", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "3_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "title", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "4_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "description", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "4_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "5_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "'", "sand", "box", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "5_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "Archive", "Local", "ID_", "=_", "None_", ",_", "Caps", "ule", "ID_", "=_", "None_", ",_", "title_", "=_", "None_", ",_", "description_", "=_", "None_", ",_", "sandbox_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Caps", "ule", "ID_", "=_", "Caps", "ule", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "title_", "=_", "title_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "description_", "=_", "description_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sandbox_", "=_", "sandbox_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Caps", "ule", "ID_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "title_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "description_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "BOOL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sandbox_", "=_", "iprot_", "._", "read", "Bool_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Upload", "To", "Caps", "ule", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "Archive", "Local", "ID_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Archive", "Local", "ID", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Caps", "ule", "ID_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Caps", "ule", "ID", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "Caps", "ule", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "title_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "title", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "description_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "description", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "sandbox_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "sand", "box", "'_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Bool_", "(_", "self_", "._", "sandbox_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Upload", "To", "Caps", "ule", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Upload", "To", "Caps", "ule", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Resu", "me", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "Archive", "Local", "ID", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Resu", "me", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "Archive", "Local", "ID_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Resu", "me", "Upload", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "Archive", "Local", "ID_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Archive", "Local", "ID", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Resu", "me", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Resu", "me", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Resu", "me", "Upload", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resu", "me", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Query", "Archive", "Status", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "Archive", "Local", "ID", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Query", "Archive", "Status", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "Archive", "Local", "ID_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Query", "Archive", "Status", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "Archive", "Local", "ID_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Archive", "Local", "ID", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Query", "Archive", "Status", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "success", "'_", ",_", "(_", "Transfer", "Status_", ",_", "Transfer", "Status_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Query", "Archive", "Status", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "Transfer", "Status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Query", "Archive", "Status", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query", "Archive", "Status", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Pause", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "Archive", "Local", "ID", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Pause", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "Archive", "Local", "ID_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Pause", "Upload", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "Archive", "Local", "ID_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Archive", "Local", "ID", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Pause", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Pause", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Pause", "Upload", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pause", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Cancel", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "Archive", "Local", "ID", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "Archive", "Local", "ID", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Cancel", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "Archive", "Local", "ID_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "Archive", "Local", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "Local", "ID_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Cancel", "Upload", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "Archive", "Local", "ID_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Archive", "Local", "ID", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "Archive", "Local", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Cancel", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Cancel", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Cancel", "Upload", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cancel", "Upload", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Certificat", "es", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Certificat", "es", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Certificat", "es", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Certificat", "es", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "LIST_", ",_", "'", "success", "'_", ",_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "(_", "Certificate_", ",_", "Certificate_", "._", "thrift", "\\u", "spec_", ")_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Certificat", "es", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "LIST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "\\u", "etype", "31_", ",_", "\\u", "size", "28_", ")_", "=_", "iprot_", "._", "read", "List", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "i3", "2_", "in_", "xrange_", "(_", "\\u", "size", "28_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "elem", "33_", "=_", "Certificate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "elem", "33_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "append_", "(_", "\\u", "elem", "33_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Certificat", "es", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "len_", "(_", "self_", "._", "success_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "34_", "in_", "self_", "._", "success_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "34_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Certificat", "es", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Export", "Certificat", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "Archive", "ID", "\\", "10", ";", " ", " ", " ", "-", " ", "format", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "Archive", "ID", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", ",_", "TT", "ype_", "._", "I32_", ",_", "'", "format", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Export", "Certificat", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "Archive", "ID_", "=_", "None_", ",_", "format_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "ID_", "=_", "Archive", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "format_", "=_", "format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Archive", "ID_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "I32_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "format_", "=_", "iprot_", "._", "read", "I32_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Export", "Certificat", "e\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "Archive", "ID_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "Archive", "ID", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "Archive", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "format_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "format", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Export", "Certificat", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "success", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Export", "Certificat", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Export", "Certificat", "e\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Certificat", "e\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Decrypt", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "archive", "Path", "\\", "10", ";", " ", " ", " ", "-", " ", "key", "\\", "10", ";", " ", " ", " ", "-", " ", "destinat", "ion", "Path", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "archive", "Path", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "key", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "3_", ",_", "TT", "ype_", "._", "STRING_", ",_", "'", "destinat", "ion", "Path", "'_", ",_", "None_", ",_", "None_", ",_", ")_", ",_", "#", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Decrypt", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "archive", "Path_", "=_", "None_", ",_", "key_", "=_", "None_", ",_", "destinat", "ion", "Path_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "archive", "Path_", "=_", "archive", "Path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "key_", "=_", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "destinat", "ion", "Path_", "=_", "destinat", "ion", "Path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "archive", "Path_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "key_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fid_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "destinat", "ion", "Path_", "=_", "iprot_", "._", "read", "String_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Decrypt", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "archive", "Path_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "archive", "Path", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "archive", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "key_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "key", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "destinat", "ion", "Path_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "destinat", "ion", "Path", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "destinat", "ion", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Decrypt", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "error", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "error", "'_", ",_", "(_", "Inva", "lid", "Operation_", ",_", "Inva", "lid", "Operation_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Decrypt", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "error_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "=_", "Inva", "lid", "Operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Decrypt", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "error_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "error", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decrypt", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Sett", "ings", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "success", "'_", ",_", "(_", "Settings_", ",_", "Settings_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "Settings_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Sett", "ings", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Set", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "settings", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "settings", "'_", ",_", "(_", "Settings_", ",_", "Settings_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Set", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "settings_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "settings_", "=_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "settings_", "=_", "Settings_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "settings_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Set", "Sett", "ings", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "settings_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "settings", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "settings_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Set", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Set", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Set", "Sett", "ings", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Sett", "ings", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Late", "st", "Version", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "success", "'_", ",_", "(_", "Version", "Info_", ",_", "Version", "Info_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "Version", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Late", "st", "Version", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Late", "st", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Version", "\\u", "args", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "args_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", "-", " ", "success", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "thrift", "\\u", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "'", "success", "'_", ",_", "(_", "Version", "Info_", ",_", "Version", "Info_", "._", "thrift", "\\u", "spec_", ")_", ",_", "None_", ",_", ")_", ",_", "#", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Get", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "success_", "=_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "iprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "iprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "isinstance_", "(_", "iprot_", "._", "trans_", ",_", "TT", "rans", "port_", "._", "CR", "ead", "able", "Transport_", ")_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "._", "decode", "\\u", "binary_", "(_", "self_", ",_", "iprot_", "._", "trans_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fname_", ",_", "ftype_", ",_", "fid_", ")_", "=_", "iprot_", "._", "read", "Field", "Begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ftype_", "==_", "TT", "ype_", "._", "STOP_", ":_", "\\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_", "if_", "fid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "==_", "TT", "ype_", "._", "STRUCT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "success_", "=_", "Version", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "read_", "(_", "iprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\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 ", " _", "iprot_", "._", "skip_", "(_", "ftype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iprot_", "._", "read", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Get", "Version", "\\u", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "success_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "success", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "success_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "'%", "s", "=", "%", "r", "'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "iteritems_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "',", " ", "'_", "._", "join_", "(_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "self_", "._", "\\u\\u", "dict\\u\\u_", "==_", "other_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Version", "\\u", "result_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "other_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 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,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 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 ]
Imprecise assert
lonetwin/supycache/tests/test_supycache.py
[ { "content": " def test_methods(self):\n \"\"\"Testing DictCache methods\"\"\"\n self.cache.set('key', 'value')\n self.assertTrue(self.cache.get('key') == 'value')\n self.assertTrue(bool(self.cache.get('non-existent')) == False)\n self.assertTrue(self.cache.clear() == None)\n self.assertTrue(len(self.cache._data) == 0)", "metadata": "root.TestDictCache.test_methods", "header": "['class', 'TestDictCache', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": " def test_missing_options(self):\n \"\"\" missing option\n \"\"\"\n with self.assertRaises(KeyError) as context:\n @supycache.supycache()\n def simple_function():\n return 'dummy'\n\n self.assertTrue('expecting one of' in context.exception.message)", "metadata": "root.TestCacheDecorators.test_missing_options", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_decorator_for_cache_key_cache_miss(self):\n \"\"\" caching a simple key on a cache miss\n \"\"\"\n @supycache.supycache(cache_key='simple_key')\n def simple_function():\n return 'simple_value'\n\n simple_function()\n self.assertTrue(self.backend.get('simple_key') == 'simple_value')", "metadata": "root.TestCacheDecorators.test_decorator_for_cache_key_cache_miss", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 106 }, { "content": " def test_decorator_for_cache_key_cached(self):\n \"\"\" caching a simple key and return from cache\n \"\"\"\n\n @supycache.supycache(cache_key='simple_key')\n def simple_function(call_count):\n return '%d:cached_value' % call_count\n\n simple_function(1)\n self.assertTrue(self.backend.get('simple_key') == '1:cached_value')\n\n simple_function(2)\n self.assertTrue(self.backend.get('simple_key') == '1:cached_value')\n\n simple_function(3)\n self.assertTrue(self.backend.get('simple_key') == '1:cached_value')", "metadata": "root.TestCacheDecorators.test_decorator_for_cache_key_cached", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 116 }, { "content": " def test_decorator_for_cache_key_positional_args(self):\n \"\"\" caching a key built from positional arguments and returning from cache\n \"\"\"\n\n @supycache.supycache(cache_key='{0}')\n def simple_function(x, y):\n return '%d:cached_value' % y\n\n simple_function('key', 1)\n self.assertTrue(self.backend.get('key') == '1:cached_value')\n\n simple_function('key', 2)\n self.assertTrue(self.backend.get('key') == '1:cached_value')\n\n simple_function('new_key', 3)\n self.assertTrue(self.backend.get('new_key') == '3:cached_value')", "metadata": "root.TestCacheDecorators.test_decorator_for_cache_key_positional_args", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 134 }, { "content": " def test_decorator_for_cache_key_keyword_args(self):\n \"\"\" caching a key built from keyword arguments and returning from cache\n \"\"\"\n\n @supycache.supycache(cache_key='{somearg}')\n def simple_function(call_count, somearg):\n return '%d:cached_value' % call_count\n\n simple_function(1, somearg='key')\n self.assertTrue(self.backend.get('key') == '1:cached_value')\n\n simple_function(2, somearg='key')\n self.assertTrue(self.backend.get('key') == '1:cached_value')\n\n simple_function(3, somearg='new_key')\n self.assertTrue(self.backend.get('new_key') == '3:cached_value')", "metadata": "root.TestCacheDecorators.test_decorator_for_cache_key_keyword_args", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 152 }, { "content": " def test_decorator_for_cache_key_multi_args_simple(self):\n \"\"\" caching a key built from both positional and keyword arguments and returning from cache\n \"\"\"\n\n @supycache.supycache(cache_key='{0}_{keyword}')\n def simple_function(positional, call_count, keyword=''):\n return '%d:cached_value' % call_count\n\n simple_function('some', 1, keyword='key')\n self.assertTrue(self.backend.get('some_key') == '1:cached_value')\n\n simple_function('some', 2, keyword='key')\n self.assertTrue(self.backend.get('some_key') == '1:cached_value')\n\n simple_function('some_other', 1, keyword='new_key')\n self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')", "metadata": "root.TestCacheDecorators.test_decorator_for_cache_key_multi_args_simple", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 170 }, { "content": " def test_decorator_for_cache_key_multi_args_complex_list(self):\n \"\"\" caching a key built from elements of a list passed as an argument\n \"\"\"\n\n @supycache.supycache(cache_key='{0}_{arglist[0]}')\n def simple_function(positional, call_count, arglist=None):\n return '%d:cached_value' % call_count\n\n simple_function('some', 1, arglist=['key', 'dummy'])\n self.assertTrue(self.backend.get('some_key') == '1:cached_value')\n\n simple_function('some', 2, arglist=['key', 'changed'])\n self.assertTrue(self.backend.get('some_key') == '1:cached_value')\n\n simple_function('some_other', 1, arglist=['new_key', 'dummy'])\n self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')\n\n simple_function('yet_another', 1, arglist=['new_key', 'dummy'])\n self.assertTrue(self.backend.get('yet_another_new_key') == '1:cached_value')", "metadata": "root.TestCacheDecorators.test_decorator_for_cache_key_multi_args_complex_list", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 188 }, { "content": " def test_decorator_for_cache_key_multi_args_complex_dict(self):\n \"\"\" caching a key built from elements of a dict passed as an argument\n \"\"\"\n\n @supycache.supycache(cache_key='{0}_{argdict[lookup]}')\n def simple_function(positional, call_count, argdict=None):\n return '%d:cached_value' % call_count\n\n simple_function('some', 1, argdict={'lookup' : 'key'})\n self.assertTrue(self.backend.get('some_key') == '1:cached_value')\n\n simple_function('some', 2, argdict={'lookup' : 'key'})\n self.assertTrue(self.backend.get('some_key') == '1:cached_value')\n\n simple_function('some_other', 1, argdict={'lookup' : 'new_key'})\n self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')", "metadata": "root.TestCacheDecorators.test_decorator_for_cache_key_multi_args_complex_dict", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 209 }, { "content": " def test_decorator_for_cache_key_multi_args_complex_object(self):\n \"\"\" caching a key built from attributes of an object passed as an argument\n \"\"\"\n\n @supycache.supycache(cache_key='{0}_{arg.name}')\n def simple_function(positional, call_count, arg):\n return '%d:cached_value' % call_count\n\n class DummyArg:\n def __init__(self, value):\n self.name = value\n\n simple_function('some', 1, arg=DummyArg('key'))\n self.assertTrue(self.backend.get('some_key') == '1:cached_value')\n\n simple_function('some', 2, arg=DummyArg('key'))\n self.assertTrue(self.backend.get('some_key') == '1:cached_value')\n\n simple_function('some_other', 1, arg=DummyArg('new_key'))\n self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')", "metadata": "root.TestCacheDecorators.test_decorator_for_cache_key_multi_args_complex_object", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 227 }, { "content": " def test_decorator_for_expire_key_with_cached_key(self):\n \"\"\" expire a simple key which exists in cache\n \"\"\"\n @supycache.supycache(cache_key='simple_key')\n def simple_function():\n return 'simple_value'\n\n @supycache.supycache(expire_key='simple_key')\n def simple_expiry():\n return 'ignored_value'\n\n simple_function()\n self.assertTrue(self.backend.get('simple_key') == 'simple_value')\n\n simple_expiry()\n self.assertFalse(bool(self.backend.get('simple_key')))", "metadata": "root.TestCacheDecorators.test_decorator_for_expire_key_with_cached_key", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 249 }, { "content": " def test_decorator_for_expire_key_with_non_cached_key(self):\n \"\"\" expire a simple key with does not exist in cache\n \"\"\"\n\n @supycache.supycache(cache_key='simple_key')\n def simple_function():\n return 'simple_value'\n\n @supycache.supycache(expire_key='simple_key')\n def simple_expiry():\n return 'ignored_value'\n\n simple_function()\n self.assertTrue(self.backend.get('simple_key') == 'simple_value')\n\n simple_expiry()\n self.assertFalse(bool(self.backend.get('simple_key')))\n self.assertFalse(bool(self.backend.get('simple_key')))", "metadata": "root.TestCacheDecorators.test_decorator_for_expire_key_with_non_cached_key", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 267 }, { "content": " def test_decorator_for_expire_key_positional_args(self):\n \"\"\" expire a key built from positional arguments\n \"\"\"\n\n @supycache.supycache(cache_key='{0}')\n def simple_function(x, y):\n return 'cached_value'\n\n @supycache.supycache(expire_key='{0}')\n def simple_expiry(x, y):\n return 'ignored_value'\n\n simple_function('simple_key', 1)\n self.assertTrue(self.backend.get('simple_key') == 'cached_value')\n\n simple_expiry('simple_key', 'dummy')\n self.assertFalse(bool(self.backend.get('simple_key')))", "metadata": "root.TestCacheDecorators.test_decorator_for_expire_key_positional_args", "header": "['class', 'TestCacheDecorators', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 287 } ]
[ { "span": "self.assertTrue(self.cache.get('key') == 'value')", "start_line": 26, "start_column": 8, "end_line": 26, "end_column": 57 }, { "span": "self.assertTrue(bool(self.cache.get('non-existent')) == False)", "start_line": 27, "start_column": 8, "end_line": 27, "end_column": 70 }, { "span": "self.assertTrue(self.cache.clear() == None)", "start_line": 28, "start_column": 8, "end_line": 28, "end_column": 51 }, { "span": "self.assertTrue(len(self.cache._data) == 0)", "start_line": 29, "start_column": 8, "end_line": 29, "end_column": 51 }, { "span": "self.assertTrue('expecting one of' in context.exception.message)", "start_line": 64, "start_column": 8, "end_line": 64, "end_column": 72 }, { "span": "self.assertTrue(self.backend.get('simple_key') == 'simple_value')", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('simple_key') == '1:cached_value')", "start_line": 125, "start_column": 8, "end_line": 125, "end_column": 75 }, { "span": "self.assertTrue(self.backend.get('simple_key') == '1:cached_value')", "start_line": 128, "start_column": 8, "end_line": 128, "end_column": 75 }, { "span": "self.assertTrue(self.backend.get('simple_key') == '1:cached_value')", "start_line": 131, "start_column": 8, "end_line": 131, "end_column": 75 }, { "span": "self.assertTrue(self.backend.get('key') == '1:cached_value')", "start_line": 143, "start_column": 8, "end_line": 143, "end_column": 68 }, { "span": "self.assertTrue(self.backend.get('key') == '1:cached_value')", "start_line": 146, "start_column": 8, "end_line": 146, "end_column": 68 }, { "span": "self.assertTrue(self.backend.get('new_key') == '3:cached_value')", "start_line": 149, "start_column": 8, "end_line": 149, "end_column": 72 }, { "span": "self.assertTrue(self.backend.get('key') == '1:cached_value')", "start_line": 161, "start_column": 8, "end_line": 161, "end_column": 68 }, { "span": "self.assertTrue(self.backend.get('key') == '1:cached_value')", "start_line": 164, "start_column": 8, "end_line": 164, "end_column": 68 }, { "span": "self.assertTrue(self.backend.get('new_key') == '3:cached_value')", "start_line": 167, "start_column": 8, "end_line": 167, "end_column": 72 }, { "span": "self.assertTrue(self.backend.get('some_key') == '1:cached_value')", "start_line": 179, "start_column": 8, "end_line": 179, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('some_key') == '1:cached_value')", "start_line": 182, "start_column": 8, "end_line": 182, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')", "start_line": 185, "start_column": 8, "end_line": 185, "end_column": 83 }, { "span": "self.assertTrue(self.backend.get('some_key') == '1:cached_value')", "start_line": 197, "start_column": 8, "end_line": 197, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('some_key') == '1:cached_value')", "start_line": 200, "start_column": 8, "end_line": 200, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')", "start_line": 203, "start_column": 8, "end_line": 203, "end_column": 83 }, { "span": "self.assertTrue(self.backend.get('yet_another_new_key') == '1:cached_value')", "start_line": 206, "start_column": 8, "end_line": 206, "end_column": 84 }, { "span": "self.assertTrue(self.backend.get('some_key') == '1:cached_value')", "start_line": 218, "start_column": 8, "end_line": 218, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('some_key') == '1:cached_value')", "start_line": 221, "start_column": 8, "end_line": 221, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')", "start_line": 224, "start_column": 8, "end_line": 224, "end_column": 83 }, { "span": "self.assertTrue(self.backend.get('some_key') == '1:cached_value')", "start_line": 240, "start_column": 8, "end_line": 240, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('some_key') == '1:cached_value')", "start_line": 243, "start_column": 8, "end_line": 243, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')", "start_line": 246, "start_column": 8, "end_line": 246, "end_column": 83 }, { "span": "self.assertTrue(self.backend.get('simple_key') == 'simple_value')", "start_line": 261, "start_column": 8, "end_line": 261, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('simple_key') == 'simple_value')", "start_line": 280, "start_column": 8, "end_line": 280, "end_column": 73 }, { "span": "self.assertTrue(self.backend.get('simple_key') == 'cached_value')", "start_line": 300, "start_column": 8, "end_line": 300, "end_column": 73 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Dict", "Cache_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "methods_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "ing", " ", "Dict", "Cache", " ", "method", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cache_", "._", "set_", "(_", "'", "key", "'_", ",_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cache_", "._", "get_", "(_", "'", "key", "'_", ")_", "==_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "bool_", "(_", "self_", "._", "cache_", "._", "get_", "(_", "'", "non", "-", "existen", "t", "'_", ")_", ")_", "==_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cache_", "._", "clear_", "(_", ")_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "self_", "._", "cache_", "._", "\\u", "data_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "missi", "ng", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "missi", "ng", " ", "option", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ")_", "as_", "context_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "dummy", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "expect", "ing", " ", "one", " ", "of", "'_", "in_", "context_", "._", "exception_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "cache", "\\u", "key", "\\u", "cache", "\\u", "miss", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "caching", " ", "a", " ", "simple", " ", "key", " ", "on", " ", "a", " ", "cache", " ", "miss", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'", "simple", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "simple", "\\u", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", "==_", "'", "simple", "\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "cache", "\\u", "key", "\\u", "cached_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "caching", " ", "a", " ", "simple", " ", "key", " ", "and", " ", "return", " ", "from", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'", "simple", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", "call", "\\u", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "d", ":", "cache", "d\\u", "value", "'_", "%_", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "cache", "\\u", "key", "\\u", "positional", "\\u", "args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "caching", " ", "a", " ", "key", " ", "bui", "lt", " ", "from", " ", "positional", " ", "argu", "ment", "s", " ", "and", " ", "return", "ing", " ", "from", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'{", "0", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "d", ":", "cache", "d\\u", "value", "'_", "%_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "key", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "key", "'_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "new", "\\u", "key", "'_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "new", "\\u", "key", "'_", ")_", "==_", "'", "3", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "cache", "\\u", "key", "\\u", "keyw", "ord", "\\u", "args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "caching", " ", "a", " ", "key", " ", "bui", "lt", " ", "from", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "and", " ", "return", "ing", " ", "from", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'{", "some", "arg", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", "call", "\\u", "count_", ",_", "some", "arg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "d", ":", "cache", "d\\u", "value", "'_", "%_", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", "1_", ",_", "some", "arg_", "=_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "2_", ",_", "some", "arg_", "=_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "3_", ",_", "some", "arg_", "=_", "'", "new", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "new", "\\u", "key", "'_", ")_", "==_", "'", "3", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "cache", "\\u", "key", "\\u", "multi", "\\u", "args", "\\u", "simple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "caching", " ", "a", " ", "key", " ", "bui", "lt", " ", "from", " ", "bot", "h", " ", "positional", " ", "and", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "and", " ", "return", "ing", " ", "from", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'{", "0", "}\\u", "{", "keyw", "ord", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", "positional", "_", ",_", "call", "\\u", "count_", ",_", "keyword_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "d", ":", "cache", "d\\u", "value", "'_", "%_", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "'_", ",_", "1_", ",_", "keyword_", "=_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "'_", ",_", "2_", ",_", "keyword_", "=_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "\\u", "other", "'_", ",_", "1_", ",_", "keyword_", "=_", "'", "new", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "other", "\\u", "new", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "cache", "\\u", "key", "\\u", "multi", "\\u", "args", "\\u", "complex", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "caching", " ", "a", " ", "key", " ", "bui", "lt", " ", "from", " ", "element", "s", " ", "of", " ", "a", " ", "list", " ", "pass", "ed", " ", "as", " ", "an", " ", "argu", "ment", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'{", "0", "}\\u", "{", "argl", "ist", "[", "0", "]}", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", "positional", "_", ",_", "call", "\\u", "count_", ",_", "arglist_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "d", ":", "cache", "d\\u", "value", "'_", "%_", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "'_", ",_", "1_", ",_", "arglist_", "=_", "[_", "'", "key", "'_", ",_", "'", "dummy", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "'_", ",_", "2_", ",_", "arglist_", "=_", "[_", "'", "key", "'_", ",_", "'", "change", "d", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "\\u", "other", "'_", ",_", "1_", ",_", "arglist_", "=_", "[_", "'", "new", "\\u", "key", "'_", ",_", "'", "dummy", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "other", "\\u", "new", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "ye", "t", "\\u", "anot", "her", "'_", ",_", "1_", ",_", "arglist_", "=_", "[_", "'", "new", "\\u", "key", "'_", ",_", "'", "dummy", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "ye", "t", "\\u", "anot", "her", "\\u", "new", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "cache", "\\u", "key", "\\u", "multi", "\\u", "args", "\\u", "complex", "\\u", "dict_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "caching", " ", "a", " ", "key", " ", "bui", "lt", " ", "from", " ", "element", "s", " ", "of", " ", "a", " ", "dict", " ", "pass", "ed", " ", "as", " ", "an", " ", "argu", "ment", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'{", "0", "}\\u", "{", "arg", "dict", "[", "look", "up", "]}", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", "positional", "_", ",_", "call", "\\u", "count_", ",_", "arg", "dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "d", ":", "cache", "d\\u", "value", "'_", "%_", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "'_", ",_", "1_", ",_", "arg", "dict_", "=_", "{_", "'", "look", "up", "'_", ":_", "'", "key", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "'_", ",_", "2_", ",_", "arg", "dict_", "=_", "{_", "'", "look", "up", "'_", ":_", "'", "key", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "\\u", "other", "'_", ",_", "1_", ",_", "arg", "dict_", "=_", "{_", "'", "look", "up", "'_", ":_", "'", "new", "\\u", "key", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "other", "\\u", "new", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "cache", "\\u", "key", "\\u", "multi", "\\u", "args", "\\u", "complex", "\\u", "object_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "caching", " ", "a", " ", "key", " ", "bui", "lt", " ", "from", " ", "attribute", "s", " ", "of", " ", "an", " ", "object", " ", "pass", "ed", " ", "as", " ", "an", " ", "argu", "ment", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'{", "0", "}\\u", "{", "arg", ".", "name", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", "positional", "_", ",_", "call", "\\u", "count_", ",_", "arg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "d", ":", "cache", "d\\u", "value", "'_", "%_", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Du", "mm", "y", "Arg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "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_", "simple", "\\u", "function_", "(_", "'", "some", "'_", ",_", "1_", ",_", "arg_", "=_", "Du", "mm", "y", "Arg_", "(_", "'", "key", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "'_", ",_", "2_", ",_", "arg_", "=_", "Du", "mm", "y", "Arg_", "(_", "'", "key", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "some", "\\u", "other", "'_", ",_", "1_", ",_", "arg_", "=_", "Du", "mm", "y", "Arg_", "(_", "'", "new", "\\u", "key", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "some", "\\u", "other", "\\u", "new", "\\u", "key", "'_", ")_", "==_", "'", "1", ":", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "expir", "e\\u", "key", "\\u", "with", "\\u", "cache", "d\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "expir", "e", " ", "a", " ", "simple", " ", "key", " ", "whi", "ch", " ", "exist", "s", " ", "in", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'", "simple", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "simple", "\\u", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "expir", "e\\u", "key_", "=_", "'", "simple", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "expiry_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "ignore", "d\\u", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", "==_", "'", "simple", "\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "expiry_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "bool_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "expir", "e\\u", "key", "\\u", "with", "\\u", "non", "\\u", "cache", "d\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "expir", "e", " ", "a", " ", "simple", " ", "key", " ", "with", " ", "doe", "s", " ", "not", " ", "exist", " ", "in", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'", "simple", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "simple", "\\u", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "expir", "e\\u", "key_", "=_", "'", "simple", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "expiry_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "ignore", "d\\u", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", "==_", "'", "simple", "\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "expiry_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "bool_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "bool_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cache", "Decorat", "ors_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decorat", "or", "\\u", "for", "\\u", "expir", "e\\u", "key", "\\u", "positional", "\\u", "args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "expir", "e", " ", "a", " ", "key", " ", "bui", "lt", " ", "from", " ", "positional", " ", "argu", "ment", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "cache", "\\u", "key_", "=_", "'{", "0", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "function_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "cache", "d\\u", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "sup", "yc", "ache_", "._", "sup", "yc", "ache_", "(_", "expir", "e\\u", "key_", "=_", "'{", "0", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "\\u", "expiry_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "ignore", "d\\u", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "\\u", "function_", "(_", "'", "simple", "\\u", "key", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", "==_", "'", "cache", "d\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simple", "\\u", "expiry_", "(_", "'", "simple", "\\u", "key", "'_", ",_", "'", "dummy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "bool_", "(_", "self_", "._", "backend_", "._", "get_", "(_", "'", "simple", "\\u", "key", "'_", ")_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
amrdraz/kodr/app/brython/www/src/Lib/test/test_argparse.py
[ { "content": " def test_equality(self):\n ns1 = argparse.Namespace(a=1, b=2)\n ns2 = argparse.Namespace(b=2, a=1)\n ns3 = argparse.Namespace(a=1)\n ns4 = argparse.Namespace(b=2)\n\n self.assertEqual(ns1, ns2)\n self.assertNotEqual(ns1, ns3)\n self.assertNotEqual(ns1, ns4)\n self.assertNotEqual(ns2, ns3)\n self.assertNotEqual(ns2, ns4)\n self.assertTrue(ns1 != ns3)\n self.assertTrue(ns1 != ns4)\n self.assertTrue(ns2 != ns3)\n self.assertTrue(ns2 != ns4)", "metadata": "root.TestNamespace.test_equality", "header": "['class', 'TestNamespace', '(', 'TestCase', ')', ':', '___EOS___']", "index": 4448 } ]
[ { "span": "self.assertTrue(ns1 != ns3)", "start_line": 4459, "start_column": 8, "end_line": 4459, "end_column": 35 }, { "span": "self.assertTrue(ns1 != ns4)", "start_line": 4460, "start_column": 8, "end_line": 4460, "end_column": 35 }, { "span": "self.assertTrue(ns2 != ns3)", "start_line": 4461, "start_column": 8, "end_line": 4461, "end_column": 35 }, { "span": "self.assertTrue(ns2 != ns4)", "start_line": 4462, "start_column": 8, "end_line": 4462, "end_column": 35 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Namespace_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "equality", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ns", "1_", "=_", "argparse_", "._", "Namespace_", "(_", "a_", "=_", "1_", ",_", "b_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns", "2_", "=_", "argparse_", "._", "Namespace_", "(_", "b_", "=_", "2_", ",_", "a_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns", "3_", "=_", "argparse_", "._", "Namespace_", "(_", "a_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns", "4_", "=_", "argparse_", "._", "Namespace_", "(_", "b_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ns", "1_", ",_", "ns", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "ns", "1_", ",_", "ns", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "ns", "1_", ",_", "ns", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "ns", "2_", ",_", "ns", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "ns", "2_", ",_", "ns", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ns", "1_", "!=_", "ns", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ns", "1_", "!=_", "ns", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ns", "2_", "!=_", "ns", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ns", "2_", "!=_", "ns", "4_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Except block handles 'BaseException'
hatRiot/clusterd/src/module/deploy_utils.py
[ { "content": "def _serve(war_file = None):\n \"\"\" Launch a SimpleHTTPServer listener to serve up our WAR file\n to the requesting host. This is used primarily to serve a WAR\n to JBoss' jmx_deployer.\n\n If war_file is provided, this will make a copy of this file into\n our temp dir and remove it once its been completed.\n \"\"\"\n\n try:\n if war_file:\n try:\n # rand payloads will already be moved, catch those errors\n copy(war_file, state.serve_dir)\n except: pass\n\n proc = Popen([\"python\", \"-m\", \"SimpleHTTPServer\", str(state.external_port)],\n stdout=PIPE, stderr=PIPE, cwd=state.serve_dir)\n\n while 'GET' not in proc.stderr.readline():\n sleep(1.0)\n\n # this might be too short for huge files\n sleep(3.0)\n\n except Exception, e:\n utility.Msg(e, LOG.DEBUG)\n finally:\n kill(proc.pid, SIGINT)\n\n if war_file:\n war_name = parse_war_path(war_file, True)\n # remove our copied file\n remove(\"%s/%s\" % (state.serve_dir, war_name))", "metadata": "root._serve", "header": "['module', '___EOS___']", "index": 15 }, { "content": "def waitServe(servert):\n \"\"\" Small function used to wait for a _serve thread to receive\n a GET request. See _serve for more information.\n\n servert should be a running thread.\n \"\"\"\n\n timeout = 10\n status = False\n\n try:\n while servert.is_alive() and timeout > 0:\n stdout.flush()\n stdout.write(\"\\r\\033[32m [%s] Waiting for remote server to \"\n \"download file [%ds]\" % (utility.timestamp(), timeout))\n sleep(1.0)\n timeout -= 1\n except:\n timeout = 0\n\n if timeout is not 10:\n print ''\n\n if timeout is 0:\n utility.Msg(\"Remote server failed to retrieve file.\", LOG.ERROR)\n else:\n status = True\n\n return status", "metadata": "root.waitServe", "header": "['module', '___EOS___']", "index": 51 }, { "content": "def auxiliary_list(usr_platform = None):\n \"\"\" Lists all platform auxiliary modules\n \"\"\"\n\n for platform in state.supported_platforms:\n\n # if they've specified a specific platform, check for it\n if usr_platform != 'All' and usr_platform != platform:\n continue\n\n utility.Msg(\"Auxiliary modules for '%s'\" % platform, LOG.UPDATE)\n load = importlib.import_module('src.platform.%s.auxiliary' % platform)\n\n modules = list(pkgutil.iter_modules(load.__path__))\n if len(modules) <= 0:\n utility.Msg(\"\\tNo auxiliarys found.\")\n continue\n\n for auxiliary in modules:\n \n try:\n aux = auxiliary[0].find_module(auxiliary[1]).load_module(auxiliary[1]).Auxiliary()\n except:\n utility.Msg(\"Could not load auxiliary module '%s'\" % \n auxiliary[1], LOG.DEBUG)\n\n utility.Msg(\"\\t%s ([%s] --%s)\" % (aux.name,\n '|'.join(aux.versions), aux.flag))", "metadata": "root.auxiliary_list", "header": "['module', '___EOS___']", "index": 171 }, { "content": "def killServe():\n \"\"\" In the event that our local server does not get\n invoked, we need to kill it tenderly\n \"\"\"\n\n try:\n get(\"http://localhost:%s\" % state.external_port, timeout=1.0)\n except:\n pass", "metadata": "root.killServe", "header": "['module', '___EOS___']", "index": 214 } ]
[ { "span": "except: ", "start_line": 29, "start_column": 12, "end_line": 29, "end_column": 19 }, { "span": "except:", "start_line": 68, "start_column": 4, "end_line": 68, "end_column": 11 }, { "span": "except:", "start_line": 193, "start_column": 12, "end_line": 193, "end_column": 19 }, { "span": "except:", "start_line": 221, "start_column": 4, "end_line": 221, "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_", "\\u", "serve_", "(_", "war", "\\u", "file_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Launch", " ", "a", " ", "Simple", "HTTP", "Server", " ", "listen", "er", " ", "to", " ", "serve", " ", "up", " ", "our", " ", "WAR", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "request", "ing", " ", "host", ".", " ", " ", "Thi", "s", " ", "is", " ", "used", " ", "prima", "ri", "ly", " ", "to", " ", "serve", " ", "a", " ", "WAR", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "JB", "oss", "'", " ", "jm", "x", "\\u", "deploye", "r", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "war", "\\u", "file", " ", "is", " ", "provided", ",", " ", "this", " ", "will", " ", "make", " ", "a", " ", "copy", " ", "of", " ", "this", " ", "file", " ", "int", "o", "\\", "10", ";", " ", " ", " ", " ", "our", " ", "temp", " ", "dir", " ", "and", " ", "remove", " ", "it", " ", "onc", "e", " ", "its", " ", "bee", "n", " ", "complete", "d", ".", "\\", "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 ", " _", "if_", "war", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "rand", " ", "payload", "s", " ", "will", " ", "alr", "ead", "y", " ", "be", " ", "moved", ",", " ", "catch", " ", "tho", "se", " ", "errors_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "copy_", "(_", "war", "\\u", "file_", ",_", "state_", "._", "serve", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "proc_", "=_", "Popen_", "(_", "[_", "\"", "python", "\"_", ",_", "\"-", "m", "\"_", ",_", "\"", "Simple", "HTTP", "Server", "\"_", ",_", "str_", "(_", "state_", "._", "external", "\\u", "port_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "PIPE_", ",_", "stderr_", "=_", "PIPE_", ",_", "cwd_", "=_", "state_", "._", "serve", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "'", "GET", "'_", "not_", "in_", "proc_", "._", "stderr_", "._", "readline_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sleep_", "(_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "mig", "ht", " ", "be", " ", "too", " ", "short", " ", "for", " ", "huge", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sleep_", "(_", "3.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "utility_", "._", "Msg_", "(_", "e_", ",_", "LOG_", "._", "DEBUG_", ")_", "\\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 ", " _", "kill_", "(_", "proc_", "._", "pid_", ",_", "SIGINT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "war", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "war", "\\u", "name_", "=_", "parse", "\\u", "war", "\\u", "path_", "(_", "war", "\\u", "file_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "remove", " ", "our", " ", "copie", "d", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "remove_", "(_", "\"%", "s", "/", "%", "s", "\"_", "%_", "(_", "state_", "._", "serve", "\\u", "dir_", ",_", "war", "\\u", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait", "Serv", "e_", "(_", "server", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Small", " ", "function", " ", "used", " ", "to", " ", "wait", " ", "for", " ", "a", " ", "\\u", "serve", " ", "thread", " ", "to", " ", "receive", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "GET", " ", "request", ".", " ", " ", "See", " ", "\\u", "serve", " ", "for", " ", "more", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "server", "t", " ", "shou", "ld", " ", "be", " ", "a", " ", "runn", "ing", " ", "thread", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "False_", "\\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 ", " _", "while_", "server", "t_", "._", "is", "\\u", "alive_", "(_", ")_", "and_", "timeout_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "._", "write_", "(_", "\"\\\\", "r", "\\\\", "033", "[", "32", "m", " ", "[", "%", "s", "]", " ", "Wait", "ing", " ", "for", " ", "remote", " ", "server", " ", "to", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "download", " ", "file", " ", "[", "%", "ds", "]\"_", "%_", "(_", "utility_", "._", "timestamp_", "(_", ")_", ",_", "timeout_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timeout_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "timeout_", "is_", "not_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "timeout_", "is_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "utility_", "._", "Msg_", "(_", "\"", "Remo", "te", " ", "server", " ", "fail", "ed", " ", "to", " ", "retrieve", " ", "file", ".\"_", ",_", "LOG_", "._", "ERROR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "auxiliary", "\\u", "list_", "(_", "usr", "\\u", "platform_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "List", "s", " ", "all", " ", "platform", " ", "auxiliary", " ", "module", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "platform_", "in_", "state_", "._", "support", "ed", "\\u", "platforms_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", "y", "'", "ve", " ", "specified", " ", "a", " ", "specific", " ", "platform", ",", " ", "check", " ", "for", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "usr", "\\u", "platform_", "!=_", "'", "All", "'_", "and_", "usr", "\\u", "platform_", "!=_", "platform_", ":_", "\\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_", "utility_", "._", "Msg_", "(_", "\"", "Aux", "iliar", "y", " ", "module", "s", " ", "for", " ", "'%", "s", "'\"_", "%_", "platform_", ",_", "LOG_", "._", "UPDATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "load_", "=_", "importlib_", "._", "import", "\\u", "module_", "(_", "'", "src", ".", "platform", ".", "%", "s", ".", "auxiliary", "'_", "%_", "platform_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "modules_", "=_", "list_", "(_", "pkg", "util_", "._", "iter", "\\u", "modules_", "(_", "load_", "._", "\\u\\u", "path\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "modules_", ")_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "utility_", "._", "Msg_", "(_", "\"\\\\", "t", "No", " ", "auxiliary", "s", " ", "found", ".\"_", ")_", "\\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_", "for_", "auxiliary", "_", "in_", "modules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "aux_", "=_", "auxiliary", "_", "[_", "0_", "]_", "._", "find", "\\u", "module_", "(_", "auxiliary", "_", "[_", "1_", "]_", ")_", "._", "load", "\\u", "module_", "(_", "auxiliary", "_", "[_", "1_", "]_", ")_", "._", "Aux", "iliar", "y_", "(_", ")_", "\\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 ", " _", "utility_", "._", "Msg_", "(_", "\"", "Cou", "ld", " ", "not", " ", "load", " ", "auxiliary", " ", "module", " ", "'%", "s", "'\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "auxiliary", "_", "[_", "1_", "]_", ",_", "LOG_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "utility_", "._", "Msg_", "(_", "\"\\\\", "t", "%", "s", " ", "([", "%", "s", "]", " ", "--", "%", "s", ")\"_", "%_", "(_", "aux_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'|'_", "._", "join_", "(_", "aux_", "._", "versions_", ")_", ",_", "aux_", "._", "flag_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "kill", "Serv", "e_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "In", " ", "the", " ", "event", " ", "tha", "t", " ", "our", " ", "local", " ", "server", " ", "doe", "s", " ", "not", " ", "get", "\\", "10", ";", " ", " ", " ", " ", "invoke", "d", ",", " ", "we", " ", "need", " ", "to", " ", "kill", " ", "it", " ", "tender", "ly", "\\", "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 ", " _", "get_", "(_", "\"", "http", "://", "local", "host", ":", "%", "s", "\"_", "%_", "state_", "._", "external", "\\u", "port_", ",_", "timeout_", "=_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_" ]
[ 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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Redundant assignment
uwdata/termite-data-server/web2py/gluon/contrib/markmin/markmin2pdf.py
[ { "content": "def latex2pdf(latex, pdflatex='pdflatex', passes=3):\n \"\"\"\n calls pdflatex in a tempfolder\n\n Arguments:\n\n - pdflatex: path to the pdflatex command. Default is just 'pdflatex'.\n - passes: defines how often pdflates should be run in the texfile.\n \"\"\"\n\n pdflatex=pdflatex\n passes=passes\n warnings=[]\n\n # setup the envoriment\n tmpdir = mkdtemp()\n texfile = open(tmpdir+'/test.tex','wb')\n texfile.write(latex)\n texfile.seek(0)\n texfile.close()\n texfile = os.path.abspath(texfile.name)\n\n # start doing some work\n for i in range(0, passes):\n logfd,logname = mkstemp()\n outfile=os.fdopen(logfd)\n try:\n ret = subprocess.call([pdflatex,\n '-interaction=nonstopmode',\n '-output-format', 'pdf',\n '-output-directory', tmpdir,\n texfile],\n cwd=os.path.dirname(texfile), stdout=outfile,\n stderr=subprocess.PIPE)\n finally:\n outfile.close()\n re_errors=re.compile('^\\!(.*)$',re.M)\n re_warnings=re.compile('^LaTeX Warning\\:(.*)$',re.M)\n flog = open(logname)\n try:\n loglines = flog.read()\n finally:\n flog.close()\n errors=re_errors.findall(loglines)\n warnings=re_warnings.findall(loglines)\n os.unlink(logname)\n\n pdffile=texfile.rsplit('.',1)[0]+'.pdf'\n if os.path.isfile(pdffile):\n fpdf = open(pdffile, 'rb')\n try:\n data = fpdf.read()\n finally:\n fpdf.close()\n else:\n data = None\n removeall(tmpdir)\n return data, warnings, errors", "metadata": "root.latex2pdf", "header": "['module', '___EOS___']", "index": 41 } ]
[ { "span": "pdflatex=pdflatex", "start_line": 51, "start_column": 4, "end_line": 51, "end_column": 21 }, { "span": "passes=passes", "start_line": 52, "start_column": 4, "end_line": 52, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "assignment_", "[SEP]_", "module_", "\\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_", "late", "x2", "pdf_", "(_", "latex_", ",_", "pdf", "latex_", "=_", "'", "pdf", "late", "x", "'_", ",_", "passes_", "=_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "calls", " ", "pdf", "late", "x", " ", "in", " ", "a", " ", "temp", "folder", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "pdf", "late", "x", ":", " ", "path", " ", "to", " ", "the", " ", "pdf", "late", "x", " ", "command", ".", " ", "Default", " ", "is", " ", "just", " ", "'", "pdf", "late", "x", "'.", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "pass", "es", ":", " ", " ", " ", "defin", "es", " ", "how", " ", "oft", "en", " ", "pdf", "late", "s", " ", "shou", "ld", " ", "be", " ", "run", " ", "in", " ", "the", " ", "tex", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pdf", "latex_", "=_", "pdf", "latex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "passes_", "=_", "passes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "setup", " ", "the", " ", "envo", "rime", "nt_", "\\u\\u\\uNL\\u\\u\\u_", "tmpdir_", "=_", "mkdtemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tex", "file_", "=_", "open_", "(_", "tmpdir_", "+_", "'/", "test", ".", "tex", "'_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tex", "file_", "._", "write_", "(_", "latex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tex", "file_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tex", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tex", "file_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "tex", "file_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "doi", "ng", " ", "some", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "passes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logf", "d_", ",_", "logn", "ame_", "=_", "mkstemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "=_", "os_", "._", "fdo", "pen_", "(_", "logf", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "subprocess_", "._", "call_", "(_", "[_", "pdf", "latex_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'-", "interacti", "on", "=", "nons", "top", "mode", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'-", "output", "-", "format", "'_", ",_", "'", "pdf", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'-", "output", "-", "director", "y", "'_", ",_", "tmpdir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tex", "file_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "tex", "file_", ")_", ",_", "stdout_", "=_", "outfile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stderr_", "=_", "subprocess_", "._", "PIPE_", ")_", "\\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 ", " _", "outfile_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "re", "\\u", "errors_", "=_", "re_", "._", "compile_", "(_", "'", "^", "\\\\", "!(", ".*)", "$'_", ",_", "re_", "._", "M_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "\\u", "warnings_", "=_", "re_", "._", "compile_", "(_", "'", "^", "La", "Te", "X", " ", "Warn", "ing", "\\\\:", "(.*)", "$'_", ",_", "re_", "._", "M_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flo", "g_", "=_", "open_", "(_", "logn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logl", "ines_", "=_", "flo", "g_", "._", "read_", "(_", ")_", "\\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 ", " _", "flo", "g_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "errors_", "=_", "re", "\\u", "errors_", "._", "findall_", "(_", "logl", "ines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "=_", "re", "\\u", "warnings_", "._", "findall_", "(_", "logl", "ines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "unlink_", "(_", "logn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pdf", "file_", "=_", "tex", "file_", "._", "rsplit_", "(_", "'.'_", ",_", "1_", ")_", "[_", "0_", "]_", "+_", "'.", "pdf", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "pdf", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp", "df_", "=_", "open_", "(_", "pdf", "file_", ",_", "'", "rb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "fp", "df_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp", "df_", "._", "close_", "(_", ")_", "\\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 ", " _", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "remove", "all_", "(_", "tmpdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", ",_", "warnings_", ",_", "errors_", "\\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, 0, 1, 1, 1, 1, 2, 0, 1, 1, 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 ]
Unused import
PythonCharmers/python-future/docs/futureext.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"\n Python-Future Documentation Extensions\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Support for automatically documenting filters and tests.\n\n Based on the Jinja2 documentation extensions.\n\n :copyright: Copyright 2008 by Armin Ronacher.\n :license: BSD.\n\"\"\"\nimport collections\nimport os\nimport re\nimport inspect\nfrom itertools import islice\nfrom types import BuiltinFunctionType\nfrom docutils import nodes\nfrom docutils.statemachine import ViewList\nfrom sphinx.ext.autodoc import prepare_docstring\nfrom sphinx.application import TemplateBridge\nfrom pygments.style import Style\nfrom pygments.token import Keyword, Name, Comment, String, Error, \\\n Number, Operator, Generic\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def parse_rst(state, content_offset, doc):\n node = nodes.section()\n # hack around title style bookkeeping\n surrounding_title_styles = state.memo.title_styles\n surrounding_section_level = state.memo.section_level\n state.memo.title_styles = []\n state.memo.section_level = 0\n state.nested_parse(doc, content_offset, node, match_titles=1)\n state.memo.title_styles = surrounding_title_styles\n state.memo.section_level = surrounding_section_level\n return node.children", "metadata": "root.parse_rst", "header": "['module', '___EOS___']", "index": 27 }, { "content": "class FutureStyle(Style):\n title = 'Future Style'\n default_style = \"\"\n styles = {\n Comment: 'italic #0B6A94', # was: #0066ff',\n Comment.Preproc: 'noitalic #B11414',\n Comment.Special: 'italic #505050',\n\n Keyword: 'bold #D15E27',\n Keyword.Type: '#D15E27',\n\n Operator.Word: 'bold #B80000',\n\n Name.Builtin: '#333333',\n Name.Function: '#333333',\n Name.Class: 'bold #333333',\n Name.Namespace: 'bold #333333',\n Name.Entity: 'bold #363636',\n Name.Attribute: '#686868',\n Name.Tag: 'bold #686868',\n Name.Decorator: '#686868',\n\n String: '#AA891C',\n Number: '#444444',\n\n Generic.Heading: 'bold #000080',\n Generic.Subheading: 'bold #800080',\n Generic.Deleted: '#aa0000',\n Generic.Inserted: '#00aa00',\n Generic.Error: '#aa0000',\n Generic.Emph: 'italic',\n Generic.Strong: 'bold',\n Generic.Prompt: '#555555',\n Generic.Output: '#888888',\n Generic.Traceback: '#aa0000',\n\n Error: '#F00 bg:#FAA'\n }", "metadata": "root.FutureStyle", "header": "['module', '___EOS___']", "index": 40 }, { "content": "def setup(app):\n pass\n # uncomment for inline toc. links are broken unfortunately\n ##app.connect('doctree-resolved', inject_toc)", "metadata": "root.setup", "header": "['module', '___EOS___']", "index": 79 } ]
[ { "span": "import collections", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 18 }, { "span": "import os", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 9 }, { "span": "import re", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 9 }, { "span": "import inspect", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 14 }, { "span": "from itertools import islice", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 28 }, { "span": "from types import BuiltinFunctionType", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 37 }, { "span": "from docutils.statemachine import ViewList", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 42 }, { "span": "from sphinx.ext.autodoc import prepare_docstring", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 48 }, { "span": "from sphinx.application import TemplateBridge", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 45 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pyth", "on", "-", "Fu", "ture", " ", "Document", "ation", " ", "Ext", "ensi", "ons", "\\", "10", ";", " ", " ", " ", " ", "~~~~~~~~~~~", "~~~~~~~~~~~", "~~~~~~~~~~~", "~~~~~", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Supp", "ort", " ", "for", " ", "automati", "call", "y", " ", "document", "ing", " ", "filter", "s", " ", "and", " ", "tests", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Base", "d", " ", "on", " ", "the", " ", "Jin", "ja", "2", " ", "documentation", " ", "extensi", "ons", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "copyr", "ight", ":", " ", "Copy", "right", " ", "2008", " ", "by", " ", "Arm", "in", " ", "Ro", "nac", "her", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "license", ":", " ", "BS", "D", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "inspect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "islice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "Bu", "ilt", "in", "Function", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "docutils_", "import_", "nodes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "docutils_", "._", "statem", "achi", "ne_", "import_", "View", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sphinx_", "._", "ext_", "._", "autod", "oc_", "import_", "prepar", "e\\u", "docstring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sphinx_", "._", "application_", "import_", "Templa", "te", "Bridge", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygments_", "._", "style_", "import_", "Style_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygments_", "._", "token_", "import_", "Keyword_", ",_", "Name_", ",_", "Comment_", ",_", "String_", ",_", "Error_", ",_", "Number_", ",_", "Operator_", ",_", "Generic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "parse", "\\u", "rst_", "(_", "state_", ",_", "content", "\\u", "offset_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "=_", "nodes_", "._", "section_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "hack", " ", "aro", "und", " ", "title", " ", "style", " ", "book", "keep", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "surround", "ing", "\\u", "title", "\\u", "styles_", "=_", "state_", "._", "memo_", "._", "title", "\\u", "styles_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "surround", "ing", "\\u", "section", "\\u", "level_", "=_", "state_", "._", "memo_", "._", "section", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "memo_", "._", "title", "\\u", "styles_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "memo_", "._", "section", "\\u", "level_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "nest", "ed", "\\u", "parse_", "(_", "doc_", ",_", "content", "\\u", "offset_", ",_", "node_", ",_", "match", "\\u", "titles_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "memo_", "._", "title", "\\u", "styles_", "=_", "surround", "ing", "\\u", "title", "\\u", "styles_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "memo_", "._", "section", "\\u", "level_", "=_", "surround", "ing", "\\u", "section", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "node_", "._", "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_", "class_", "Fu", "ture", "Style_", "(_", "Style_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "'", "Fu", "ture", " ", "Style", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "style_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "styles_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "Comment_", ":_", "'", "italic", " ", "#", "0", "B6", "A9", "4", "'_", ",_", "#", " ", "was", ":", " ", "#", "006", "6f", "f", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "Comment_", "._", "Prep", "roc_", ":_", "'", "noi", "tali", "c", " ", "#", "B1", "141", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comment_", "._", "Special", "_", ":_", "'", "italic", " ", "#", "505", "050", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Keyword_", ":_", "'", "bold", " ", "#", "D1", "5", "E2", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Keyword_", "._", "Type_", ":_", "'#", "D1", "5", "E2", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Operator_", "._", "Word_", ":_", "'", "bold", " ", "#", "B8", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Name_", "._", "Builtin_", ":_", "'#", "33333", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Name_", "._", "Function_", ":_", "'#", "33333", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Name_", "._", "Class_", ":_", "'", "bold", " ", "#", "33333", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Name_", "._", "Namespace_", ":_", "'", "bold", " ", "#", "33333", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Name_", "._", "Entity_", ":_", "'", "bold", " ", "#", "3636", "3", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Name_", "._", "Attribute_", ":_", "'#", "686", "868", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Name_", "._", "Tag_", ":_", "'", "bold", " ", "#", "686", "868", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Name_", "._", "Decorator_", ":_", "'#", "686", "868", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "String_", ":_", "'#", "AA", "891", "C", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Number_", ":_", "'#", "444444", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Head", "ing_", ":_", "'", "bold", " ", "#", "0000", "80", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Sub", "heading_", ":_", "'", "bold", " ", "#", "800", "080", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Delete", "d_", ":_", "'#", "aa", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Insert", "ed_", ":_", "'#", "00", "aa", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Error_", ":_", "'#", "aa", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Emp", "h_", ":_", "'", "italic", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Strong", "_", ":_", "'", "bold", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Prompt_", ":_", "'#", "555555", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Output_", ":_", "'#", "888888", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Generic_", "._", "Trace", "back_", ":_", "'#", "aa", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Error_", ":_", "'#", "F0", "0", " ", "bg", ":", "#", "FA", "A", "'_", "\\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_", "setup_", "(_", "app_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "uncomm", "ent", " ", "for", " ", "inline", " ", "toc", ".", " ", " ", "link", "s", " ", "are", " ", "broken", " ", "unfo", "rtu", "nat", "el", "y_", "\\u\\u\\uNL\\u\\u\\u_", "##", "app", ".", "connect", "('", "doct", "ree", "-", "resolve", "d", "',", " ", "inject", "\\u", "toc", ")_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
nigma/django-easy-pdf/tests/tests.py
[ { "content": "#-*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom django.conf import settings\nfrom django.test.testcases import TestCase\nfrom django.test.client import RequestFactory, Client\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class EasyPDFTestCase(TestCase):\n", "metadata": "root.EasyPDFTestCase", "header": "['module', '___EOS___']", "index": 9 }, { "content": " def test_pdf_rendering(self):\n response = self.client.get(\"/simple/\")\n content = response.content\n self.assertEqual(content[:4], \"%PDF\")", "metadata": "root.EasyPDFTestCase.test_pdf_rendering", "header": "['class', 'EasyPDFTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 11 } ]
[ { "span": "from django.conf import settings", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 32 }, { "span": "from django.test.client import RequestFactory, Client", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 53 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#-", "*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "division_", ",_", "print", "\\u", "function_", ",_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "._", "testcases", "_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "._", "client_", "import_", "Request", "Factory_", ",_", "Client_", "\\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_", "Eas", "y", "PD", "FT", "est", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Eas", "y", "PD", "FT", "est", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "pdf", "\\u", "render", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "\"/", "simple", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "response_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "content_", "[_", ":_", "4_", "]_", ",_", "\"%", "PD", "F", "\"_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
wehriam/awspider/tests/awspidertestsuite.py
[ { "content": "from amazons3test import AmazonS3TestCase\nfrom amazonsdbtest import AmazonSDBTestCase\nfrom amazonsqstest import AmazonSQSTestCase\nfrom dataservertest import DataServerStartTestCase, DataServerTestCase\n#from encodingtest import EncodingTestCase\nfrom evaluatebooleantest import EvaluateBooleanTestCase\nfrom executionservertest import ExecutionServerStartTestCase, ExecutionTestCase\nfrom interfaceservertest import InterfaceTestCase, InterfaceServerStartTestCase\nfrom networkaddresstest import NetworkAddressTestCase\nfrom pagegettertest import PageGetterTestCase\nfrom requestqueuertest import RequestQueuerTestCase\nfrom timeoffsettest import TimeOffsetTestCase", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from amazons3test import AmazonS3TestCase", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 41 }, { "span": "from amazonsdbtest import AmazonSDBTestCase", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 43 }, { "span": "from amazonsqstest import AmazonSQSTestCase", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 43 }, { "span": "from dataservertest import DataServerStartTestCase, DataServerTestCase", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 70 }, { "span": "from evaluatebooleantest import EvaluateBooleanTestCase", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 55 }, { "span": "from executionservertest import ExecutionServerStartTestCase, ExecutionTestCase", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 79 }, { "span": "from interfaceservertest import InterfaceTestCase, InterfaceServerStartTestCase", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 79 }, { "span": "from networkaddresstest import NetworkAddressTestCase", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 53 }, { "span": "from pagegettertest import PageGetterTestCase", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 45 }, { "span": "from requestqueuertest import RequestQueuerTestCase", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 51 }, { "span": "from timeoffsettest import TimeOffsetTestCase", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 45 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "amaz", "ons", "3", "test_", "import_", "Ama", "zon", "S", "3", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "amaz", "ons", "dbt", "est_", "import_", "Ama", "zon", "SD", "BT", "est", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "amaz", "ons", "qst", "est_", "import_", "Ama", "zon", "SQ", "ST", "est", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datas", "erver", "test_", "import_", "Data", "Server", "Start", "Test", "Case_", ",_", "Data", "Server", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "from", " ", "encoding", "test", " ", "import", " ", "Enco", "ding", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "evaluate", "boolean", "test_", "import_", "Evaluate", "Boo", "lean", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "executions", "erver", "test_", "import_", "Execut", "ion", "Server", "Start", "Test", "Case_", ",_", "Execut", "ion", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "interface", "server", "test_", "import_", "Interface", "Test", "Case_", ",_", "Interface", "Server", "Start", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "network", "address", "test_", "import_", "Network", "Address", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "page", "getter", "test_", "import_", "Page", "Getter", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "request", "queue", "rte", "st_", "import_", "Request", "Queue", "r", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "timeo", "ffset", "test_", "import_", "Time", "Off", "set", "Test", "Case_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused local variable
openstack/proliantutils/proliantutils/ilo/firmware_controller.py
[ { "content": "def _extract_scexe_file(self, target_file, extract_path):\n \"\"\"Extracts the scexe file.\n\n :param target_file: the firmware file to be extracted from\n :param extract_path: the path where extraction is supposed to happen\n \"\"\"\n # Command to extract the smart component file.\n unpack_cmd = '--unpack=' + extract_path\n # os.path.isfile(target_file)\n cmd = [target_file, unpack_cmd]\n out, err = utils.trycmd(*cmd)", "metadata": "root._extract_scexe_file", "header": "['module', '___EOS___']", "index": 316 }, { "content": "def _extract_rpm_file(self, target_file, extract_path):\n \"\"\"Extracts the rpm file.\n\n :param target_file: the firmware file to be extracted from\n :param extract_path: the path where extraction is supposed to happen\n :raises: ImageExtractionFailed, if any issue with extraction\n \"\"\"\n if not os.path.exists(extract_path):\n os.makedirs(extract_path)\n os.chdir(extract_path)\n\n try:\n rpm2cpio = subprocess.Popen('rpm2cpio ' + target_file,\n shell=True,\n stdout=subprocess.PIPE)\n cpio = subprocess.Popen('cpio -idm', shell=True,\n stdin=rpm2cpio.stdout)\n out, err = cpio.communicate()\n except Exception:\n raise exception.ImageExtractionFailed(\n image_ref=target_file,\n reason='Unexpected error in extracting file.')", "metadata": "root._extract_rpm_file", "header": "['module', '___EOS___']", "index": 329 } ]
[ { "span": "out,", "start_line": 326, "start_column": 4, "end_line": 326, "end_column": 7 }, { "span": "err ", "start_line": 326, "start_column": 9, "end_line": 326, "end_column": 12 }, { "span": "out,", "start_line": 346, "start_column": 8, "end_line": 346, "end_column": 11 }, { "span": "err ", "start_line": 346, "start_column": 13, "end_line": 346, "end_column": 16 } ]
[]
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_", "\\u", "extract", "\\u", "sce", "xe", "\\u", "file_", "(_", "self_", ",_", "target", "\\u", "file_", ",_", "extract", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Extract", "s", " ", "the", " ", "sce", "xe", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "target", "\\u", "file", ":", " ", "the", " ", "firmware", " ", "file", " ", "to", " ", "be", " ", "extracted", " ", "from", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "extract", "\\u", "path", ":", " ", "the", " ", "path", " ", "where", " ", "extracti", "on", " ", "is", " ", "supposed", " ", "to", " ", "happ", "en", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Command", " ", "to", " ", "extract", " ", "the", " ", "smart", " ", "component", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "unpack", "\\u", "cmd_", "=_", "'--", "unpack", "='_", "+_", "extract", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "os", ".", "path", ".", "isfi", "le", "(", "target", "\\u", "file", ")_", "\\u\\u\\uNL\\u\\u\\u_", "cmd_", "=_", "[_", "target", "\\u", "file_", ",_", "unpack", "\\u", "cmd_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "utils_", "._", "try", "cmd_", "(_", "*_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "extract", "\\u", "rpm", "\\u", "file_", "(_", "self_", ",_", "target", "\\u", "file_", ",_", "extract", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Extract", "s", " ", "the", " ", "rpm", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "target", "\\u", "file", ":", " ", "the", " ", "firmware", " ", "file", " ", "to", " ", "be", " ", "extracted", " ", "from", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "extract", "\\u", "path", ":", " ", "the", " ", "path", " ", "where", " ", "extracti", "on", " ", "is", " ", "supposed", " ", "to", " ", "happ", "en", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", ":", " ", "Image", "Extraction", "Fail", "ed", ",", " ", "if", " ", "any", " ", "issue", " ", "with", " ", "extracti", "on", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "extract", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "extract", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chdir_", "(_", "extract", "\\u", "path_", ")_", "\\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 ", " _", "rpm", "2c", "pio", "_", "=_", "subprocess_", "._", "Popen_", "(_", "'", "rpm", "2c", "pio", " ", "'_", "+_", "target", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shell_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cpi", "o_", "=_", "subprocess_", "._", "Popen_", "(_", "'", "cpi", "o", " ", "-", "idm", "'_", ",_", "shell_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdin_", "=_", "rpm", "2c", "pio", "_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "cpi", "o_", "._", "communicate_", "(_", ")_", "\\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 ", " _", "raise_", "exception_", "._", "Image", "Extraction", "Failed_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "ref_", "=_", "target", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "'", "Une", "xpe", "cte", "d", " ", "error", " ", "in", " ", "extracti", "ng", " ", "file", ".'_", ")_", "\\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, 0, 2, 0, 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, 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 ]
Unused local variable
amitu/gitology/src/gitology/blog.py
[ { "content": "def create_label(blog, author, label_name, label_slug, label_description=None):\n if label_description is None:\n label_description = label_name\n # create label document\n document = Document(\n \"blogs@%s@label@%s\" % (blog, label_slug)\n )\n if not document.exists():\n document.create(\n index_content = label_name,\n format = \"html\", author = author,\n )\n else:\n document.set_raw_index(label_name, \"html\")\n document.meta.author = author\n document.meta.title = label_name\n document.meta.description = label_descrption\n document.meta.slug = label_slug\n document.meta.type = \"blog_label\"\n document.meta.save()", "metadata": "root.create_label", "header": "['module', '___EOS___']", "index": 33 } ]
[ { "span": "label_description ", "start_line": 35, "start_column": 8, "end_line": 35, "end_column": 25 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "label_", "(_", "blog_", ",_", "author_", ",_", "label", "\\u", "name_", ",_", "label", "\\u", "slug_", ",_", "label", "\\u", "description_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "label", "\\u", "description_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "\\u", "description_", "=_", "label", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "label", " ", "document_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "document_", "=_", "Document_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "blogs", "@", "%", "s", "@", "label", "@", "%", "s", "\"_", "%_", "(_", "blog_", ",_", "label", "\\u", "slug_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "document_", "._", "exists_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "document_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "index", "\\u", "content_", "=_", "label", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "format_", "=_", "\"", "html", "\"_", ",_", "author_", "=_", "author_", ",_", "\\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 ", " _", "document_", "._", "set\\u", "raw", "\\u", "index_", "(_", "label", "\\u", "name_", ",_", "\"", "html", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "document_", "._", "meta_", "._", "author_", "=_", "author_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "document_", "._", "meta_", "._", "title_", "=_", "label", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "document_", "._", "meta_", "._", "description_", "=_", "label", "\\u", "descr", "ption_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "document_", "._", "meta_", "._", "slug_", "=_", "label", "\\u", "slug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "document_", "._", "meta_", "._", "type_", "=_", "\"", "blog", "\\u", "label", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "document_", "._", "meta_", "._", "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, 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 ]
Unused import
zoofIO/flexx/flexx/event/tests/test_handlers.py
[ { "content": "\"\"\" Tests for the bare handlers.\n\nDoes not test dynamism currently, as we will test that extensively in\ntest_both.\n\"\"\"\n\nimport gc\nimport sys\nimport weakref\n\nfrom flexx.util.testing import run_tests_if_main, skipif, skip, raises\n\nfrom flexx import event\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nrun_tests_if_main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test_method_handlers():\n \n events1 = []\n events2 = []\n class Foo(event.HasEvents):\n \n @event.connect('x1')\n def handle1(self, *events):\n events1.extend(events)\n \n @event.connect('x1', 'x2')\n def handle2(self, *events):\n events2.extend(events)\n \n foo = Foo()\n with event.loop:\n foo.emit('x1', {})\n foo.emit('x2', {})\n \n assert len(events1) == 1\n assert len(events2) == 2\n \n assert isinstance(foo.handle1, event._handler.Handler)\n assert repr(foo.handle1)\n assert hasattr(foo.handle1, 'dispose')\n assert foo.handle1.get_name() == 'handle1'\n assert foo.handle1.get_connection_info() == [('x1', ['x1', ])]\n assert foo.handle2.get_connection_info() == [('x1', ['x1', ]), ('x2', ['x2', ])]\n \n # Can't touch this\n with raises(AttributeError):\n foo.handle1 = 3\n with raises(AttributeError):\n del foo.handle1", "metadata": "root.test_method_handlers", "header": "['module', '___EOS___']", "index": 15 }, { "content": "def test_method_handlers_nodecorator():\n \n events1 = []\n events2 = []\n class Foo(event.HasEvents):\n \n def _handle1(self, *events):\n events1.extend(events)\n handle1 = event.connect(_handle1, 'x1')\n \n def _handle2(self, *events):\n events2.extend(events)\n handle2 = event.connect(_handle2, 'x1', 'x2')\n \n foo = Foo()\n with event.loop:\n foo.emit('x1', {})\n foo.emit('x2', {})\n \n assert len(events1) == 1\n assert len(events2) == 2\n \n assert isinstance(foo.handle1, event._handler.Handler)\n assert repr(foo.handle1)\n assert hasattr(foo.handle1, 'dispose')\n assert foo.handle1.get_name() == '_handle1' # note the name ...\n \n # Can't touch this\n with raises(AttributeError):\n foo.handle1 = 3\n with raises(AttributeError):\n del foo.handle1", "metadata": "root.test_method_handlers_nodecorator", "header": "['module', '___EOS___']", "index": 51 }, { "content": "def test_func_handlers():\n \n events1 = []\n events2 = []\n class Foo(event.HasEvents):\n pass\n \n foo = Foo()\n \n @foo.connect('x1')\n def handle1(*events):\n events1.extend(events)\n \n @foo.connect('x1', 'x2')\n def handle2(*events):\n events2.extend(events)\n \n with event.loop:\n foo.emit('x1', {})\n foo.emit('x2', {})\n \n assert len(events1) == 1\n assert len(events2) == 2\n \n assert isinstance(handle1, event._handler.Handler)\n assert repr(handle1)\n assert hasattr(handle1, 'dispose')\n assert handle1.get_name() == 'handle1'\n assert handle1.get_connection_info() == [('x1', ['x1', ])]\n assert handle2.get_connection_info() == [('x1', ['x1', ]), ('x2', ['x2', ])]", "metadata": "root.test_func_handlers", "header": "['module', '___EOS___']", "index": 85 }, { "content": "def test_func_handlers_nodecorator():\n \n events1 = []\n events2 = []\n class Foo(event.HasEvents):\n pass\n \n foo = Foo()\n \n def _handle1(*events):\n events1.extend(events)\n handle1 = foo.connect(_handle1, 'x1')\n \n def _handle2(*events):\n events2.extend(events)\n handle2 = foo.connect(_handle2, 'x1', 'x2')\n \n with event.loop:\n foo.emit('x1', {})\n foo.emit('x2', {})\n \n assert len(events1) == 1\n assert len(events2) == 2\n \n assert isinstance(handle1, event._handler.Handler)\n assert repr(handle1)\n assert hasattr(handle1, 'dispose')\n assert handle1.get_name() == '_handle1' # note the name", "metadata": "root.test_func_handlers_nodecorator", "header": "['module', '___EOS___']", "index": 117 }, { "content": "def test_func_handlers_with_method_decorator():\n\n @event.connect('x')\n def foo(*events):\n pass\n \n assert isinstance(foo, event._handler.HandlerDescriptor)\n assert repr(foo)\n # too bad we cannot raise an error when a function in decorated this way", "metadata": "root.test_func_handlers_with_method_decorator", "header": "['module', '___EOS___']", "index": 147 }, { "content": "def test_method_handler_invoking():\n called = []\n \n class MyObject(event.HasEvents):\n \n @event.connect('x1', 'x2')\n def handler(*events):\n called.append(len(events))\n \n @event.connect('x3')\n def handler3(self, *events):\n called.append(len(events))\n \n h = MyObject()\n handler = h.handler\n \n handler()\n handler.handle_now()\n \n h.emit('x1', {})\n handler.handle_now()\n \n h.emit('x1', {})\n h.emit('x1', {})\n handler.handle_now()\n \n h.emit('x1', {})\n h.emit('x2', {})\n handler.handle_now()\n \n handler()\n handler.handle_now()\n \n h.handler3()\n handler.handle_now()\n \n assert called == [0, 1, 2, 2, 0, 0]", "metadata": "root.test_method_handler_invoking", "header": "['module', '___EOS___']", "index": 158 }, { "content": "def test_func_handler_invoking():\n called = []\n \n h = event.HasEvents()\n \n @h.connect('x1', 'x2')\n def handler(*events):\n called.append(len(events))\n \n handler()\n handler.handle_now()\n \n h.emit('x1', {})\n handler.handle_now()\n \n h.emit('x1', {})\n h.emit('x1', {})\n handler.handle_now()\n \n h.emit('x1', {})\n h.emit('x2', {})\n handler.handle_now()\n \n handler()\n handler.handle_now()\n \n assert called == [0, 1, 2, 2, 0]", "metadata": "root.test_func_handler_invoking", "header": "['module', '___EOS___']", "index": 197 }, { "content": "def test_connecting():\n \n # We've done all the normal connections. We test mosly fails here\n \n h = event.HasEvents()\n \n with raises(RuntimeError): # connect() needs args\n @event.connect\n def foo(*events):\n pass\n with raises(RuntimeError):\n @h.connect\n def foo(*events):\n pass\n \n with raises(ValueError): # connect() needs strings\n @event.connect(3)\n def foo(*events):\n pass\n with raises(ValueError):\n @h.connect(3)\n def foo(*events):\n pass\n \n with raises(TypeError): # connect() needs callable\n event.connect('x')(3)\n with raises(TypeError): # connect() needs callable\n h.connect('x')(3)\n \n with raises(RuntimeError): # cannot connect\n h.xx = None\n @h.connect('xx.foobar')\n def foo(*events):\n pass", "metadata": "root.test_connecting", "header": "['module', '___EOS___']", "index": 226 }, { "content": "def test_exceptions():\n h = event.HasEvents()\n \n @h.connect('foo')\n def handle_foo(*events):\n 1/0\n \n h.emit('foo', {})\n \n sys.last_traceback = None\n assert sys.last_traceback is None\n \n # No exception should be thrown here\n event.loop.iter()\n event.loop.iter()\n \n # But we should have prepared for PM debugging\n assert sys.last_traceback\n \n # Its different for a direct call\n with raises(ZeroDivisionError):\n handle_foo()", "metadata": "root.test_exceptions", "header": "['module', '___EOS___']", "index": 262 }, { "content": "def test_dispose1():\n \n h = event.HasEvents()\n \n @h.connect('x1', 'x2')\n def handler(*events):\n pass\n \n handler_ref = weakref.ref(handler)\n del handler\n gc.collect()\n assert handler_ref() is not None # h is holding on\n \n handler_ref().dispose()\n gc.collect()\n assert handler_ref() is None", "metadata": "root.test_dispose1", "header": "['module', '___EOS___']", "index": 286 }, { "content": "def test_dispose2():\n \n h = event.HasEvents()\n \n @h.connect('x1', 'x2')\n def handler(*events):\n pass\n \n handler_ref = weakref.ref(handler)\n del handler\n gc.collect()\n assert handler_ref() is not None # h is holding on\n \n h.dispose() # <=== only this line is different from test_dispose1()\n gc.collect()\n assert handler_ref() is None", "metadata": "root.test_dispose2", "header": "['module', '___EOS___']", "index": 304 } ]
[ { "span": "from flexx.util.testing import run_tests_if_main, skipif, skip, raises", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 70 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", " ", "Test", "s", " ", "for", " ", "the", " ", "bare", " ", "handler", "s", ".", "\\", "10", ";", "\\", "10", ";", "Do", "es", " ", "not", " ", "test", " ", "dynami", "sm", " ", "currentl", "y", ",", " ", "as", " ", "we", " ", "will", " ", "test", " ", "tha", "t", " ", "extensi", "vel", "y", " ", "in", "\\", "10", ";", "test\\u", "bot", "h", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "gc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "weakref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flex", "x_", "._", "util_", "._", "testing_", "import_", "run", "\\u", "tests", "\\u", "if", "\\u", "main_", ",_", "skipif_", ",_", "skip_", ",_", "raises_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flex", "x_", "import_", "event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "run", "\\u", "tests", "\\u", "if", "\\u", "main_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "method", "\\u", "handlers_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "1_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events", "2_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "event_", "._", "Has", "Events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "event_", "._", "connect_", "(_", "'", "x1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handle", "1_", "(_", "self_", ",_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "1_", "._", "extend_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "event_", "._", "connect_", "(_", "'", "x1", "'_", ",_", "'", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handle", "2_", "(_", "self_", ",_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "2_", "._", "extend_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "foo_", "=_", "Foo_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "event_", "._", "loop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "._", "emit_", "(_", "'", "x2", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "events", "1_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "events", "2_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "isinstance_", "(_", "foo_", "._", "handle", "1_", ",_", "event_", "._", "\\u", "handler_", "._", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "repr_", "(_", "foo_", "._", "handle", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "hasattr_", "(_", "foo_", "._", "handle", "1_", ",_", "'", "dispose", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "foo_", "._", "handle", "1_", "._", "get", "\\u", "name_", "(_", ")_", "==_", "'", "handle", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "foo_", "._", "handle", "1_", "._", "get", "\\u", "connecti", "on", "\\u", "info_", "(_", ")_", "==_", "[_", "(_", "'", "x1", "'_", ",_", "[_", "'", "x1", "'_", ",_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "foo_", "._", "handle", "2_", "._", "get", "\\u", "connecti", "on", "\\u", "info_", "(_", ")_", "==_", "[_", "(_", "'", "x1", "'_", ",_", "[_", "'", "x1", "'_", ",_", "]_", ")_", ",_", "(_", "'", "x2", "'_", ",_", "[_", "'", "x2", "'_", ",_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Can", "'", "t", " ", "touch", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "._", "handle", "1_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "foo_", "._", "handle", "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_", "test\\u", "method", "\\u", "handler", "s", "\\u", "node", "cora", "tor_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "1_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events", "2_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "event_", "._", "Has", "Events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "handle", "1_", "(_", "self_", ",_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "1_", "._", "extend_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "handle", "1_", "=_", "event_", "._", "connect_", "(_", "\\u", "handle", "1_", ",_", "'", "x1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "handle", "2_", "(_", "self_", ",_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "2_", "._", "extend_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "handle", "2_", "=_", "event_", "._", "connect_", "(_", "\\u", "handle", "2_", ",_", "'", "x1", "'_", ",_", "'", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "foo_", "=_", "Foo_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "event_", "._", "loop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "._", "emit_", "(_", "'", "x2", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "events", "1_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "events", "2_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "isinstance_", "(_", "foo_", "._", "handle", "1_", ",_", "event_", "._", "\\u", "handler_", "._", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "repr_", "(_", "foo_", "._", "handle", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "hasattr_", "(_", "foo_", "._", "handle", "1_", ",_", "'", "dispose", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "foo_", "._", "handle", "1_", "._", "get", "\\u", "name_", "(_", ")_", "==_", "'\\u", "handle", "1", "'_", "#", " ", "note", " ", "the", " ", "name", " ", "..._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Can", "'", "t", " ", "touch", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "._", "handle", "1_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "foo_", "._", "handle", "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_", "test\\u", "func", "\\u", "handlers_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "1_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events", "2_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "event_", "._", "Has", "Events_", ")_", ":_", "\\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_", "foo_", "=_", "Foo_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "foo_", "._", "connect_", "(_", "'", "x1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handle", "1_", "(_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "1_", "._", "extend_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "foo_", "._", "connect_", "(_", "'", "x1", "'_", ",_", "'", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handle", "2_", "(_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "2_", "._", "extend_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "event_", "._", "loop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "._", "emit_", "(_", "'", "x2", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "events", "1_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "events", "2_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "isinstance_", "(_", "handle", "1_", ",_", "event_", "._", "\\u", "handler_", "._", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "repr_", "(_", "handle", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "hasattr_", "(_", "handle", "1_", ",_", "'", "dispose", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handle", "1_", "._", "get", "\\u", "name_", "(_", ")_", "==_", "'", "handle", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handle", "1_", "._", "get", "\\u", "connecti", "on", "\\u", "info_", "(_", ")_", "==_", "[_", "(_", "'", "x1", "'_", ",_", "[_", "'", "x1", "'_", ",_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handle", "2_", "._", "get", "\\u", "connecti", "on", "\\u", "info_", "(_", ")_", "==_", "[_", "(_", "'", "x1", "'_", ",_", "[_", "'", "x1", "'_", ",_", "]_", ")_", ",_", "(_", "'", "x2", "'_", ",_", "[_", "'", "x2", "'_", ",_", "]_", ")_", "]_", "\\u\\u\\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", "func", "\\u", "handler", "s", "\\u", "node", "cora", "tor_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "1_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events", "2_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "event_", "._", "Has", "Events_", ")_", ":_", "\\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_", "foo_", "=_", "Foo_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "handle", "1_", "(_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "1_", "._", "extend_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "handle", "1_", "=_", "foo_", "._", "connect_", "(_", "\\u", "handle", "1_", ",_", "'", "x1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "handle", "2_", "(_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events", "2_", "._", "extend_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "handle", "2_", "=_", "foo_", "._", "connect_", "(_", "\\u", "handle", "2_", ",_", "'", "x1", "'_", ",_", "'", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "event_", "._", "loop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "._", "emit_", "(_", "'", "x2", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "events", "1_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "events", "2_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "isinstance_", "(_", "handle", "1_", ",_", "event_", "._", "\\u", "handler_", "._", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "repr_", "(_", "handle", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "hasattr_", "(_", "handle", "1_", ",_", "'", "dispose", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handle", "1_", "._", "get", "\\u", "name_", "(_", ")_", "==_", "'\\u", "handle", "1", "'_", "#", " ", "note", " ", "the", " ", "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", "func", "\\u", "handler", "s", "\\u", "with", "\\u", "method", "\\u", "decorator_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "event_", "._", "connect_", "(_", "'", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo_", "(_", "*_", "events_", ")_", ":_", "\\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_", "assert_", "isinstance_", "(_", "foo_", ",_", "event_", "._", "\\u", "handler_", "._", "Handle", "r", "Descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "repr_", "(_", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "too", " ", "bad", " ", "we", " ", "cann", "ot", " ", "raise", " ", "an", " ", "error", " ", "whe", "n", " ", "a", " ", "function", " ", "in", " ", "decorated", " ", "this", " ", "way_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "method", "\\u", "handler", "\\u", "inv", "oki", "ng_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "called_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "My", "Object_", "(_", "event_", "._", "Has", "Events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "event_", "._", "connect_", "(_", "'", "x1", "'_", ",_", "'", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handler_", "(_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "called_", "._", "append_", "(_", "len_", "(_", "events_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "event_", "._", "connect_", "(_", "'", "x3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handler", "3_", "(_", "self_", ",_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "called_", "._", "append_", "(_", "len_", "(_", "events_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h_", "=_", "My", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "h_", "._", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x2", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "handler", "3_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "called_", "==_", "[_", "0_", ",_", "1_", ",_", "2_", ",_", "2_", ",_", "0_", ",_", "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", "func", "\\u", "handler", "\\u", "inv", "oki", "ng_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "called_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "=_", "event_", "._", "Has", "Events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "h_", "._", "connect_", "(_", "'", "x1", "'_", ",_", "'", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handler_", "(_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "called_", "._", "append_", "(_", "len_", "(_", "events_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x1", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "x2", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "handle", "\\u", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "called_", "==_", "[_", "0_", ",_", "1_", ",_", "2_", ",_", "2_", ",_", "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", "connecti", "ng_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "ve", " ", "don", "e", " ", "all", " ", "the", " ", "normal", " ", "connections", ".", " ", "We", " ", "test", " ", "mos", "ly", " ", "fail", "s", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "event_", "._", "Has", "Events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "raises_", "(_", "Run", "time", "Error_", ")_", ":_", "#", " ", "connect", "()", " ", "need", "s", " ", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "event_", "._", "connect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo_", "(_", "*_", "events_", ")_", ":_", "\\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_", "with_", "raises_", "(_", "Run", "time", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "h_", "._", "connect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo_", "(_", "*_", "events_", ")_", ":_", "\\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_", "with_", "raises_", "(_", "Value", "Error_", ")_", ":_", "#", " ", "connect", "()", " ", "need", "s", " ", "strings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "event_", "._", "connect_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo_", "(_", "*_", "events_", ")_", ":_", "\\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_", "with_", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "h_", "._", "connect_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo_", "(_", "*_", "events_", ")_", ":_", "\\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_", "with_", "raises_", "(_", "Type", "Error_", ")_", ":_", "#", " ", "connect", "()", " ", "need", "s", " ", "callable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event_", "._", "connect_", "(_", "'", "x", "'_", ")_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "raises_", "(_", "Type", "Error_", ")_", ":_", "#", " ", "connect", "()", " ", "need", "s", " ", "callable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "connect_", "(_", "'", "x", "'_", ")_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "raises_", "(_", "Run", "time", "Error_", ")_", ":_", "#", " ", "cann", "ot", " ", "connect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "xx_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "h_", "._", "connect_", "(_", "'", "xx", ".", "fooba", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo_", "(_", "*_", "events_", ")_", ":_", "\\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_", "test\\u", "exceptions_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "event_", "._", "Has", "Events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "h_", "._", "connect_", "(_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handle", "\\u", "foo_", "(_", "*_", "events_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h_", "._", "emit_", "(_", "'", "foo", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "last", "\\u", "traceback_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "last", "\\u", "traceback_", "is_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", " ", "exception", " ", "shou", "ld", " ", "be", " ", "throw", "n", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "event_", "._", "loop_", "._", "iter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event_", "._", "loop_", "._", "iter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bu", "t", " ", "we", " ", "shou", "ld", " ", "have", " ", "prepared", " ", "for", " ", "PM", " ", "debugg", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "sys_", "._", "last", "\\u", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", "s", " ", "different", " ", "for", " ", "a", " ", "direct", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "raises_", "(_", "Zero", "Divis", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handle", "\\u", "foo_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "dispose", "1_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "event_", "._", "Has", "Events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "h_", "._", "connect_", "(_", "'", "x1", "'_", ",_", "'", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handler_", "(_", "*_", "events_", ")_", ":_", "\\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_", "handler", "\\u", "ref_", "=_", "weakref_", "._", "ref_", "(_", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handler", "\\u", "ref_", "(_", ")_", "is_", "not_", "None_", "#", " ", "h", " ", "is", " ", "holding", " ", "on_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "handler", "\\u", "ref_", "(_", ")_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handler", "\\u", "ref_", "(_", ")_", "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_", "def_", "test\\u", "dispose", "2_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "event_", "._", "Has", "Events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "h_", "._", "connect_", "(_", "'", "x1", "'_", ",_", "'", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "handler_", "(_", "*_", "events_", ")_", ":_", "\\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_", "handler", "\\u", "ref_", "=_", "weakref_", "._", "ref_", "(_", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handler", "\\u", "ref_", "(_", ")_", "is_", "not_", "None_", "#", " ", "h", " ", "is", " ", "holding", " ", "on_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "dispose", "_", "(_", ")_", "#", " ", "<=", "==", " ", "only", " ", "this", " ", "line", " ", "is", " ", "different", " ", "from", " ", "test\\u", "dispose", "1", "()", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "handler", "\\u", "ref_", "(_", ")_", "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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unnecessary pass
rackerlabs/python-cloudservers/com/rackspace/cloud/servers/api/client/tests/cloud_servers_console.py
[ { "content": "def addServerToIpGroup():\n \"\"\"\n Add server to IP Group by id\n \"\"\"\n serverId = getServerId()\n server = serverManager.find(serverId)\n print \"server: \", server\n sharedIpGroupId = getSharedIpGroupId()\n sharedIpGroup = sharedIpGroupManager.find(sharedIpGroupId)\n print \"shared ip group: \", sharedIpGroup\n ipAddress = getIpAddress()\n serverManager.shareIp(server, ipAddress, sharedIpGroupId, True)\n pass", "metadata": "root.addServerToIpGroup", "header": "['module', '___EOS___']", "index": 327 } ]
[ { "span": "pass", "start_line": 339, "start_column": 4, "end_line": 339, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Server", "To", "Ip", "Group_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "server", " ", "to", " ", "IP", " ", "Group", " ", "by", " ", "id", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server", "Id_", "=_", "get", "Server", "Id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "=_", "server", "Manager_", "._", "find_", "(_", "server", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "server", ":", " ", "\"_", ",_", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shared", "Ip", "Group", "Id_", "=_", "get", "Share", "d", "Ip", "Group", "Id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shared", "Ip", "Group_", "=_", "shared", "Ip", "Group", "Manager_", "._", "find_", "(_", "shared", "Ip", "Group", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "shared", " ", "ip", " ", "group", ":", " ", "\"_", ",_", "shared", "Ip", "Group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "Address_", "=_", "get", "Ip", "Address_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server", "Manager_", "._", "share", "Ip_", "(_", "server_", ",_", "ip", "Address_", ",_", "shared", "Ip", "Group", "Id_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
CGATOxford/cgat/legacy/ScopTester.py
[ { "content": "################################################################################\n#\n# MRC FGU Computational Genomics Group\n#\n# $Id$\n#\n# Copyright (C) 2009 Andreas Heger\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n#################################################################################\n'''\nScopTester.py - \n======================================================\n\n:Author: Andreas Heger\n:Release: $Id$\n:Date: |today|\n:Tags: Python\n\nCode\n----\n\n'''\nimport sys\nimport re\nimport string\nimport os\nimport time \n\nfrom Pairsdb import *\n\nimport alignlib\nimport pairsdblib\n\nfrom MessagePairsdb import MessagePairsdb\nfrom TableDomainsScopTest import TableDomainsScopTest\nfrom TablePairsdbNeighbours import TablePairsdbNeighbours\nfrom Pairsdb import *\nimport Tools\n\n#-------------------------------------------\n# Class:\t ScopTest\n# Superclasses: Message\n# Subclasses: \n# Function: update ScopTest-database\n#\n# Author:\t Andreas Heger\n#-------------------------------------------\n\n \n##-------------------------------------------------------------------------------------- \n\n##-------------------------------------------------------------------------------------- \n\n##-------------------------------------------------------------------------------------- \n\n##--------------------------------------------------------------------------------------\n \n##--------------------------------------------------------------------------------------\n \n##--------------------------------------------------------------------------------------\n \nif __name__ == '__main__':\n\n dbhandle = Pairsdb()\n if not dbhandle.Connect():\n\tprint \"Connection failed\"\n\tsys.exit(1)\n \n a = alignlib.makeFullDP( -10.0, -2.0 )\n alignator = Alignator( a )\n\n x = ScopTesterSequences( dbhandle, alignator )\n \n x.Process()\n\n if param_alignator == 0:\n a = alignlib.makeFullDP( param_gop, param_gep)\n\n alignator = Alignator( a )\n if param_entities == 0:\n tester = ScopTesterSequences( dbhandle, alignator )\n\n tester.mLogLevel = param_loglevel\n\n matches = a.CalculateMatches()\n \n\n \n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ScopTester:\n \n \n ##--------------------------------------------------------------------------------------\n\n ##-------------------------------------------------------------------------------------- \n\n ##--------------------------------------------------------------------------------------", "metadata": "root.ScopTester", "header": "['module', '___EOS___']", "index": 61 }, { "content": " def __init__ (self, dbhandle, alignator, table_scop_test ):\n\n self.mLogLevel = 1\n \n self.dbhandle = dbhandle \n # C++ connection to pairsdb\n self.mDatabaseNamePairsdb = dbhandle.GetDatabase()\n\n self.mConnectionPairsdb = pairsdblib.Connection( dbhandle.GetHost(),\n dbhandle.GetUser(),\n dbhandle.GetPassword(),\n dbhandle.GetPort())\n \n self.mConnectionPairsdb.Connect( self.mDatabaseNamePairsdb )\n\n self.mTableScopTest = table_scop_test\n \n self.mAlignanda = []\n self.mInformation = []\n \n self.mAlignator = alignator\n\n self.startAt = 0", "metadata": "root.ScopTester.__init__", "header": "['class', 'ScopTester', ':', '___EOS___']", "index": 63 }, { "content": " def CalculateMatches( self ):\n \"\"\"calculate all-vs-all alignments.\n \"\"\"\n\n if not self.mAlignanda:\n self.GetAlignanda()\n \n if self.mLogLevel >= 1:\n print \"# --> calculating alignments for %i entries\" % len(self.mAlignanda)\n print \"# --> starting at:\", Tools.GetTimeStamp()\n\n nalignanda = len(self.mAlignanda)\n \n for a1 in range(self.startAt, nalignanda-1):\n if self.mLogLevel >= 1:\n print \"# %5i/%5i at %s\" % (a1, nalignanda, Tools.GetTimeStamp())\n sys.stdout.flush()\n \n for a2 in range(a1+1,nalignanda):\n \n if self.mLogLevel >= 3:\n print \"# aligning to %i\" % (a2), self.mInformation[a2]\n sys.stdout.flush()\n\n result = alignlib.makeAlignataVector()\n\n self.mAlignator.Align( self.mAlignanda[a1], self.mAlignanda[a2], result )\n\n info = self.mAlignator.CheckResult( result, self.mInformation[a1], self.mInformation[a2] )\n \n if info:\n r = tuple(self.mInformation[a1]) + tuple(self.mInformation[a2]) + tuple(info)\n print string.join(r, \"\\t\" )\n \n sys.stdout.flush()\n \n self.mAlignanda[a1].Release()\n self.mAlignanda[a1] = None\n \n if self.mLogLevel >= 1:\n print \"# --> finished at:\", Tools.GetTimeStamp()", "metadata": "root.ScopTester.CalculateMatches", "header": "['class', 'ScopTester', ':', '___EOS___']", "index": 88 }, { "content": " def SetAlignator( self, alignator ):\n self.mAlignator = alignator", "metadata": "root.ScopTester.SetAlignator", "header": "['class', 'ScopTester', ':', '___EOS___']", "index": 131 }, { "content": " def GetAlignanda( self ):\n \"\"\"retrieve alignandum-objects.\n \"\"\"\n\n ## do not get additional info so that non-redundant table can be used.\n domains = self.mTableScopTest.GetAllDomains( all = 0 )\n\n if self.mLogLevel >= 1:\n print \"# --> retrieving %i entries at %s\" % (len(domains), Tools.GetTimeStamp())\n sys.stdout.flush()\n \n for domain in domains:\n\n if self.mLogLevel >= 2:\n print \"# retrieving\", domain\n sys.stdout.flush()\n\n (nid, nrdb_from, nrdb_to, scop_class) = domain\n \n ## dummy values\n pdb_id = \"test\"\n region_nr = 0\n \n if scop_class[0:3] not in (\"00a\", \"00b\", \"00c\", \"00d\"):\n if self.mLogLevel >= 2:\n print \"# skipped because not in first four classes\"\n sys.stdout.flush()\n continue\n \n # if nid not in (47268, 74355): continue\n # if nid not in (36388, 148361): continue\n # if nid not in (3503, 115681): continue\n # if nid not in (17, 1011060): continue \n alignandum, info = self.GetAlignandum( nid, nrdb_from, nrdb_to )\n\n if alignandum:\n if info:\n self.mInformation.append( ( \"%i_%i_%i\" % (nid, nrdb_from, nrdb_to),\n scop_class, pdb_id, str(region_nr)) + tuple(info) )\n \n else:\n self.mInformation.append( ( \"%i_%i_%i\" % (nid, nrdb_from, nrdb_to),\n scop_class, pdb_id, str(region_nr)) )\n \n self.mAlignanda.append(alignandum)\n else:\n if self.mLogLevel >= 2:\n print \"# skipped because no alignandum found\"\n sys.stdout.flush()\n\n if self.mLogLevel >= 1:\n print \"# --> retrieved %i entries at %s\" % (len(self.mAlignanda), Tools.GetTimeStamp())\n sys.stdout.flush()", "metadata": "root.ScopTester.GetAlignanda", "header": "['class', 'ScopTester', ':', '___EOS___']", "index": 135 }, { "content": "class ScopTesterSequences( ScopTester ):\n ", "metadata": "root.ScopTesterSequences", "header": "['module', '___EOS___']", "index": 190 }, { "content": " def GetAlignandum( self, nid, nrdb_from, nrdb_to ):\n\n alignandum = pairsdblib.makeSequenceFromPairsdb( self.mConnectionPairsdb, nid )\n alignandum.useSegment( nrdb_from, nrdb_to )\n\n return alignandum, None", "metadata": "root.ScopTesterSequences.GetAlignandum", "header": "['class', 'ScopTesterSequences', '(', 'ScopTester', ')', ':', '___EOS___']", "index": 192 }, { "content": "class ScopTesterProfiles( ScopTester ):\n\n", "metadata": "root.ScopTesterProfiles", "header": "['module', '___EOS___']", "index": 200 }, { "content": " def __init__(self,\n dbhandle,\n alignator,\n table_scop_test,\n min_profile_size = 20,\n min_level = 30,\n max_level = 90,\n neighbours = \"pairsdb_90x90\"):\n \n self.mMinProfileSize = min_profile_size\n self.mMinLevel = min_level\n self.mMaxLevel = max_level\n self.mTableNameNeighbours = neighbours\n \n ScopTester.__init__( self, dbhandle, alignator, table_scop_test )\n\n self.mTableNeighbours = TablePairsdbNeighbours( self.dbhandle )\n self.mTableNeighbours.SetName( self.mTableNameNeighbours)\n\n self.mBlastL = 0.3 # lambda \n self.mLogOddorScaleFactor = self.mBlastL\n self.mLogOddor = alignlib.makeLogOddorDirichlet( self.mLogOddorScaleFactor )\n self.mMaxLinesMali = 1000\n self.mRegularizor = alignlib.makeRegularizorDirichletPrecomputed() ", "metadata": "root.ScopTesterProfiles.__init__", "header": "['class', 'ScopTesterProfiles', '(', 'ScopTester', ')', ':', '___EOS___']", "index": 202 }, { "content": " def GetAlignandum( self, nid, nrdb_from, nrdb_to ):\n\n n = self.mTableNeighbours.GetNumNeighbours( nid )\n \n if n >= self.mMinProfileSize:\n \n profile = alignlib.makeEmptyProfile( self.mRegularizor, self.mLogOddor )\n\n pairsdblib.fillProfileNeighbours( profile,\n self.mConnectionPairsdb,\n nid,\n self.mTableNameNeighbours,\n self.mMaxLinesMali,\n 0,\n self.mMaxLevel,\n self.mMinLevel )\n if self.mLogLevel >= 3:\n print \"# ------> using profile for rep %i\" % nid\n \n else:\n profile = pairsdblib.makeSequenceFromPicasso( self.mConnectionPairsdb, nid )\n if self.mLogLevel >= 3:\n print \"# ------> using sequence for rep %i\" % nid\n \n profile.useSegment( nrdb_from, nrdb_to )\n \n return profile, (str(n),)", "metadata": "root.ScopTesterProfiles.GetAlignandum", "header": "['class', 'ScopTesterProfiles', '(', 'ScopTester', ')', ':', '___EOS___']", "index": 227 }, { "content": "class ScopTesterFullProfiles( ScopTesterProfiles ):\n \"\"\"use full length profiles.\n beware of multidomain-proteins, use iterative multiple alignment\n method.\n \"\"\"\n ", "metadata": "root.ScopTesterFullProfiles", "header": "['module', '___EOS___']", "index": 256 }, { "content": " def __init__(self,\n dbhandle,\n alignator,\n table_scop_test,\n min_profile_size = 20,\n min_level = 30,\n max_level = 90,\n neighbours = \"pairsdb_90x90\"):\n\n ScopTesterProfiles.__init__( self,dbhandle, alignator, table_scop_test,\n min_profile_size, min_level, max_level, neighbours)\n\n self.mAddLength = 500\n self.mMaxLength = 2000", "metadata": "root.ScopTesterFullProfiles.__init__", "header": "['class', 'ScopTesterFullProfiles', '(', 'ScopTesterProfiles', ')', ':', '___EOS___']", "index": 261 }, { "content": " def GetAlignandum( self, nid, nrdb_from, nrdb_to ):\n\n profile, x = ScopTesterProfiles.GetAlignandum( self, nid, nrdb_from, nrdb_to)\n\n profile.useFullLength()\n\n # add some context around\n xfrom = max( 1, nrdb_from - self.mAddLength)\n xto = min( profile.getLength(), nrdb_to + self.mAddLength)\n\n if self.mLogLevel >= 3:\n print \"using segment %i-%i\" % (xfrom, xto)\n sys.stdout.flush()\n \n profile.useSegment( xfrom, xto)\n\n return profile, x", "metadata": "root.ScopTesterFullProfiles.GetAlignandum", "header": "['class', 'ScopTesterFullProfiles', '(', 'ScopTesterProfiles', ')', ':', '___EOS___']", "index": 276 }, { "content": "class Alignator:\n \"\"\"\n aligns two sequences and returns result.\n \"\"\"\n \n\n ##--------------------------------------------------------------------------------------\n \n ##--------------------------------------------------------------------------------------", "metadata": "root.Alignator", "header": "['module', '___EOS___']", "index": 295 }, { "content": " def __init__( self, alignator ):\n self.mAlignator = alignator", "metadata": "root.Alignator.__init__", "header": "['class', 'Alignator', ':', '___EOS___']", "index": 300 }, { "content": " def Align( self, a1, a2, result ):\n self.mAlignator.Align( a1, a2, result )", "metadata": "root.Alignator.Align", "header": "['class', 'Alignator', ':', '___EOS___']", "index": 304 }, { "content": " def CheckResult( self,\n result,\n info1 = None,\n info2 = None):\n \"\"\"check if result is ok. The function below returns everything.\n return tuple of strings as result.\n \"\"\"\n\n if (result.getLength() > 0):\n row_ali, col_ali = alignlib.writeAlignataCompressed( result )\n return map(str, (result.getScore(),\n result.getLength(),\n result.getNumGaps(),\n alignlib.calculatePercentSimilarity( result ),\n result.getRowFrom(), result.getRowTo(), row_ali,\n result.getColFrom(), result.getColTo(), col_ali ) )\n else:\n return (\"0\",) * 12", "metadata": "root.Alignator.CheckResult", "header": "['class', 'Alignator', ':', '___EOS___']", "index": 308 }, { "content": "class AlignatorIterative(Alignator):\n \"\"\"\n aligns two sequences iteratively, checks if alignment regions are overlapping with\n domain regions and returns result only for those overlapping. This is useful if you have\n several domains in a sequence, but you need only compare to one.\n \"\"\"\n\n\n ##--------------------------------------------------------------------------------------\n \n## alignlib.performIterativeAlignmentNonConst( result,\n## a1, a2,\n## self.mAlignator,\n## self.mMinScore )\n \n ##--------------------------------------------------------------------------------------", "metadata": "root.AlignatorIterative", "header": "['module', '___EOS___']", "index": 328 }, { "content": " def __init__( self, alignator, min_score, min_overlap, gop, gep ):\n self.mAlignator = alignator\n self.mMinScore = float(min_score)\n self.mMinOverlap = min_overlap\n self.mGop = gop\n self.mGep = gep", "metadata": "root.AlignatorIterative.__init__", "header": "['class', 'AlignatorIterative', '(', 'Alignator', ')', ':', '___EOS___']", "index": 335 }, { "content": " def Align( self, a1, a2, result ):\n \"\"\"align repetetively. Take highest scoring alignment, that overlaps with domains\n and put it in result. Note: performIterativeAlignment does not work, as it is linear.\n It requires domains to be in the same order.\n\n Result is empty, fragments are saved in object.\n \"\"\"\n \n fragmentor = alignlib.makeFragmentorRepetitive( self.mAlignator, self.mMinScore )\n\n ## align iteratively and convert fragments to Alignata-objects\n val = fragmentor.Fragment( a1, a2, result)\n \n self.mFragments = map( lambda x: alignlib.AlignataPtr(x), val)\n\n for fragment in self.mFragments:\n fragment.thisown = 1", "metadata": "root.AlignatorIterative.Align", "header": "['class', 'AlignatorIterative', '(', 'Alignator', ')', ':', '___EOS___']", "index": 343 }, { "content": " def CheckResult( self,\n result,\n info1, info2):\n \"\"\"check if result is ok. Check for each fragment, if it overlaps\n with the domains to be tested and dump if ok. This simulates\n psiblast.\n \"\"\"\n\n row_from, row_to = map(string.atoi, info1[1:3])\n col_from, col_to = map(string.atoi, info2[1:3])\n\n ## check for overlap\n for fragment in self.mFragments:\n \n # print alignlib.writeAlignataTable( fragment, 8, 1)\n \n xcol_from = Tools.MapRight(fragment, row_from )\n xcol_to = Tools.MapLeft(fragment, row_to )\n\n overlap = min(col_to, xcol_to) - max(col_from, xcol_from)\n\n # print self.mMinOverlap, overlap, xcol_from, xcol_to, col_from, col_to\n\n if overlap > self.mMinOverlap:\n \n return map(str, (fragment.getScore(),\n fragment.getLength(),\n fragment.getNumGaps(),\n alignlib.calculatePercentSimilarity( fragment ),\n fragment.getRowFrom(), fragment.getRowTo(),\n fragment.getColFrom(), fragment.getColTo(),\n overlap, xcol_from, xcol_to,\n (xcol_to - xcol_from) - (col_to - col_from)) )\n \n return (\"0\",) * 12", "metadata": "root.AlignatorIterative.CheckResult", "header": "['class', 'AlignatorIterative', '(', 'Alignator', ')', ':', '___EOS___']", "index": 367 } ]
[ { "span": "import re", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 9 }, { "span": "import os", "start_line": 38, "start_column": 0, "end_line": 38, "end_column": 9 }, { "span": "import time ", "start_line": 39, "start_column": 0, "end_line": 39, "end_column": 11 }, { "span": "from MessagePairsdb import MessagePairsdb", "start_line": 46, "start_column": 0, "end_line": 46, "end_column": 41 }, { "span": "from TableDomainsScopTest import TableDomainsScopTest", "start_line": 47, "start_column": 0, "end_line": 47, "end_column": 53 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "MR", "C", " ", "FG", "U", " ", "Computation", "al", " ", "Geno", "mic", "s", " ", "Group_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "$", "Id", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Copy", "right", " ", "(", "C", ")", " ", "200", "9", " ", "Andre", "as", " ", "He", "ger_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Thi", "s", " ", "program", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "modif", "y", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "as", " ", "publi", "shed", " ", "by", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her", " ", "version", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "of", " ", "the", " ", "License", ",", " ", "or", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Thi", "s", " ", "program", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "You", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "along", " ", "with", " ", "this", " ", "program", ";", " ", "if", " ", "not", ",", " ", "write", " ", "to", " ", "the", " ", "Free", " ", "Sof", "twa", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Foun", "dati", "on", ",", " ", "Inc", ".,", " ", "5", "9", " ", "Temp", "le", " ", "Place", " ", "-", " ", "Suit", "e", " ", "330", ",", " ", "Bo", "ston", ",", " ", "MA", " ", " ", "0211", "1", "-1", "307", ",", " ", "USA", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", "Sco", "p", "Tester", ".", "py", " ", "-", " ", "\\", "10", ";", "==============", "==============", "==============", "============", "\\", "10", ";", "\\", "10", ";", ":", "Author", ":", " ", "Andre", "as", " ", "He", "ger", "\\", "10", ";", ":", "Release", ":", " ", "$", "Id", "$", "\\", "10", ";", ":", "Date", ":", " ", "|", "toda", "y", "|", "\\", "10", ";", ":", "Ta", "gs", ":", " ", "Pyth", "on", "\\", "10", ";", "\\", "10", ";", "Code", "\\", "10", ";", "----", "\\", "10", ";", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Pair", "sdb", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "align", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pair", "sdb", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Messag", "e", "Pair", "sdb", "_", "import_", "Messag", "e", "Pair", "sdb", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Table", "Doma", "ins", "Sco", "p", "Test_", "import_", "Table", "Doma", "ins", "Sco", "p", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Table", "Pair", "sdb", "Neigh", "bour", "s_", "import_", "Table", "Pair", "sdb", "Neigh", "bour", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Pair", "sdb", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Tools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Class", ":", "\t ", " ", " ", " ", " ", "Sco", "p", "Test_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Super", "classe", "s", ":", " ", " ", "Message_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Subc", "lasse", "s", ":", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Function", ":", " ", " ", "update", " ", "Sco", "p", "Test", "-", "database_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", "\t ", " ", " ", " ", " ", "Andre", "as", " ", "He", "ger_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbh", "andle", "_", "=_", "Pair", "sdb", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "dbh", "andle", "_", "._", "Connect_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "\"", "Connect", "ion", " ", "fail", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "a_", "=_", "align", "lib_", "._", "make", "Full", "DP_", "(_", "-_", "10.0_", ",_", "-_", "2.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "align", "ator_", "=_", "Align", "ator_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "Sco", "p", "Tester", "Sequences", "_", "(_", "dbh", "andle", "_", ",_", "align", "ator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "._", "Process_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "param", "\\u", "align", "ator_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "align", "lib_", "._", "make", "Full", "DP_", "(_", "param", "\\u", "gop", "_", ",_", "param", "\\u", "ge", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "align", "ator_", "=_", "Align", "ator_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "param", "\\u", "entities_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tester_", "=_", "Sco", "p", "Tester", "Sequences", "_", "(_", "dbh", "andle", "_", ",_", "align", "ator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tester_", "._", "m", "Log", "Level_", "=_", "param", "\\u", "loglevel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "matches_", "=_", "a_", "._", "Calculat", "e", "Matches_", "(_", ")_", "\\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_", "Sco", "p", "Tester_", ":_", "\\u\\u\\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_", "[SEP]_", "class_", "Sco", "p", "Tester_", ":_", "\\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_", ",_", "dbh", "andle", "_", ",_", "align", "ator_", ",_", "table", "\\u", "scop", "\\u", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Log", "Level_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dbh", "andle", "_", "=_", "dbh", "andle", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "C", "++", " ", "connecti", "on", " ", "to", " ", "pair", "sdb", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Databa", "se", "Name", "Pair", "sdb", "_", "=_", "dbh", "andle", "_", "._", "Get", "Database_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Connect", "ion", "Pair", "sdb", "_", "=_", "pair", "sdb", "lib_", "._", "Connection_", "(_", "dbh", "andle", "_", "._", "Get", "Host_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dbh", "andle", "_", "._", "Get", "User_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dbh", "andle", "_", "._", "Get", "Password_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dbh", "andle", "_", "._", "Get", "Port_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Connect", "ion", "Pair", "sdb", "_", "._", "Connect_", "(_", "self_", "._", "m", "Databa", "se", "Name", "Pair", "sdb", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Table", "Sco", "p", "Test_", "=_", "table", "\\u", "scop", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Align", "anda", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Information_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Align", "ator_", "=_", "align", "ator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "start", "At_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sco", "p", "Tester_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Matches_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "calcul", "ate", " ", "all", "-", "vs", "-", "all", " ", "alignme", "nts", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "m", "Align", "anda", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Get", "Align", "anda", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "-->", " ", "calculati", "ng", " ", "alignme", "nts", " ", "for", " ", "%", "i", " ", "entri", "es", "\"_", "%_", "len_", "(_", "self_", "._", "m", "Align", "anda", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"#", " ", "-->", " ", "startin", "g", " ", "at", ":\"_", ",_", "Tools_", "._", "Get", "Time", "Stamp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nali", "gna", "nda", "_", "=_", "len_", "(_", "self_", "._", "m", "Align", "anda", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "a1_", "in_", "range_", "(_", "self_", "._", "start", "At_", ",_", "nali", "gna", "nda", "_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "%", "5", "i", "/", "%", "5", "i", " ", "at", " ", "%", "s", "\"_", "%_", "(_", "a1_", ",_", "nali", "gna", "nda", "_", ",_", "Tools_", "._", "Get", "Time", "Stamp_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "a2_", "in_", "range_", "(_", "a1_", "+_", "1_", ",_", "nali", "gna", "nda", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "\"#", " ", " ", " ", " ", "align", "ing", " ", "to", " ", "%", "i", "\"_", "%_", "(_", "a2_", ")_", ",_", "self_", "._", "m", "Information_", "[_", "a2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "align", "lib_", "._", "make", "Align", "ata", "Vector_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Align", "ator_", "._", "Align_", "(_", "self_", "._", "m", "Align", "anda", "_", "[_", "a1_", "]_", ",_", "self_", "._", "m", "Align", "anda", "_", "[_", "a2_", "]_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "info_", "=_", "self_", "._", "m", "Align", "ator_", "._", "Check", "Result_", "(_", "result_", ",_", "self_", "._", "m", "Information_", "[_", "a1_", "]_", ",_", "self_", "._", "m", "Information_", "[_", "a2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "=_", "tuple_", "(_", "self_", "._", "m", "Information_", "[_", "a1_", "]_", ")_", "+_", "tuple_", "(_", "self_", "._", "m", "Information_", "[_", "a2_", "]_", ")_", "+_", "tuple_", "(_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "string_", "._", "join_", "(_", "r_", ",_", "\"\\\\", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Align", "anda", "_", "[_", "a1_", "]_", "._", "Release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Align", "anda", "_", "[_", "a1_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "-->", " ", "finish", "ed", " ", "at", ":\"_", ",_", "Tools_", "._", "Get", "Time", "Stamp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sco", "p", "Tester_", ":_", "\\u\\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", "Align", "ator_", "(_", "self_", ",_", "align", "ator_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Align", "ator_", "=_", "align", "ator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sco", "p", "Tester_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Align", "anda", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "retrieve", " ", "align", "and", "um", "-", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "do", " ", "not", " ", "get", " ", "addition", "al", " ", "info", " ", "so", " ", "tha", "t", " ", "non", "-", "redundant", " ", "table", " ", "can", " ", "be", " ", "used", "._", "\\u\\u\\uNL\\u\\u\\u_", "domains_", "=_", "self_", "._", "m", "Table", "Sco", "p", "Test_", "._", "Get", "All", "Doma", "ins_", "(_", "all_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "-->", " ", "retrie", "ving", " ", "%", "i", " ", "entri", "es", " ", "at", " ", "%", "s", "\"_", "%_", "(_", "len_", "(_", "domains_", ")_", ",_", "Tools_", "._", "Get", "Time", "Stamp_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "domain_", "in_", "domains_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "retrie", "ving", "\"_", ",_", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ",_", "scop", "\\u", "class_", ")_", "=_", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "dummy", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "pdb", "\\u", "id_", "=_", "\"", "test", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "region", "\\u", "nr_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "scop", "\\u", "class_", "[_", "0_", ":_", "3_", "]_", "not_", "in_", "(_", "\"", "00", "a", "\"_", ",_", "\"", "00", "b", "\"_", ",_", "\"", "00", "c", "\"_", ",_", "\"", "00", "d", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "\"#", " ", "skip", "ped", " ", "bec", "aus", "e", " ", "not", " ", "in", " ", "first", " ", "four", " ", "classe", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "nid", " ", "not", " ", "in", " ", "(", "472", "6", "8", ",", " ", "743", "5", "5", "):", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "nid", " ", "not", " ", "in", " ", "(", "363", "88", ",", " ", "148", "361", "):", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "nid", " ", "not", " ", "in", " ", "(", "350", "3", ",", " ", "115", "681", "):", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "nid", " ", "not", " ", "in", " ", "(", "1", "7", ",", " ", "1011", "060", "):", " ", "continue", " ", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "align", "and", "um_", ",_", "info_", "=_", "self_", "._", "Get", "Align", "and", "um_", "(_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "align", "and", "um_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "m", "Information_", "._", "append_", "(_", "(_", "\"%", "i", "\\u", "%", "i", "\\u", "%", "i", "\"_", "%_", "(_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scop", "\\u", "class_", ",_", "pdb", "\\u", "id_", ",_", "str_", "(_", "region", "\\u", "nr_", ")_", ")_", "+_", "tuple_", "(_", "info_", ")_", ")_", "\\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 ", " ", "_", "self_", "._", "m", "Information_", "._", "append_", "(_", "(_", "\"%", "i", "\\u", "%", "i", "\\u", "%", "i", "\"_", "%_", "(_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scop", "\\u", "class_", ",_", "pdb", "\\u", "id_", ",_", "str_", "(_", "region", "\\u", "nr_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Align", "anda", "_", "._", "append_", "(_", "align", "and", "um_", ")_", "\\u\\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_", "._", "m", "Log", "Level_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "\"#", " ", "skip", "ped", " ", "bec", "aus", "e", " ", "no", " ", "align", "and", "um", " ", "found", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "-->", " ", "retrieved", " ", "%", "i", " ", "entri", "es", " ", "at", " ", "%", "s", "\"_", "%_", "(_", "len_", "(_", "self_", "._", "m", "Align", "anda", "_", ")_", ",_", "Tools_", "._", "Get", "Time", "Stamp_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Sco", "p", "Tester", "Sequences", "_", "(_", "Sco", "p", "Tester_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sco", "p", "Tester", "Sequences", "_", "(_", "Sco", "p", "Tester_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "Get", "Align", "and", "um_", "(_", "self_", ",_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "align", "and", "um_", "=_", "pair", "sdb", "lib_", "._", "make", "Sequ", "ence", "Fro", "m", "Pair", "sdb", "_", "(_", "self_", "._", "m", "Connect", "ion", "Pair", "sdb", "_", ",_", "nid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "align", "and", "um_", "._", "use", "Segment_", "(_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "align", "and", "um_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Sco", "p", "Tester", "Profil", "es_", "(_", "Sco", "p", "Tester_", ")_", ":_", "\\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_", "Sco", "p", "Tester", "Profil", "es_", "(_", "Sco", "p", "Tester_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dbh", "andle", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "align", "ator_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "scop", "\\u", "test_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "profile", "\\u", "size_", "=_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "level_", "=_", "30_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "level_", "=_", "90_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "neighbours_", "=_", "\"", "pair", "sdb", "\\u", "90", "x", "90", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Min", "Profil", "e", "Size_", "=_", "min", "\\u", "profile", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Min", "Level_", "=_", "min", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Max", "Level_", "=_", "max", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Table", "Name", "Neigh", "bour", "s_", "=_", "neighbours_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Sco", "p", "Tester_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dbh", "andle", "_", ",_", "align", "ator_", ",_", "table", "\\u", "scop", "\\u", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Table", "Neigh", "bour", "s_", "=_", "Table", "Pair", "sdb", "Neigh", "bour", "s_", "(_", "self_", "._", "dbh", "andle", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Table", "Neigh", "bour", "s_", "._", "Set", "Name_", "(_", "self_", "._", "m", "Table", "Name", "Neigh", "bour", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Blast", "L_", "=_", "0.3_", "#", " ", "lambda", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Log", "Od", "dor", "Scale", "Factor_", "=_", "self_", "._", "m", "Blast", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Log", "Od", "dor_", "=_", "align", "lib_", "._", "make", "Log", "Od", "dor", "Dir", "ich", "let_", "(_", "self_", "._", "m", "Log", "Od", "dor", "Scale", "Factor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Max", "Line", "s", "Mal", "i_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Regula", "riz", "or_", "=_", "align", "lib_", "._", "make", "Regula", "riz", "or", "Dir", "ich", "let", "Prec", "omp", "ute", "d_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sco", "p", "Tester", "Profil", "es_", "(_", "Sco", "p", "Tester_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Align", "and", "um_", "(_", "self_", ",_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "self_", "._", "m", "Table", "Neigh", "bour", "s_", "._", "Get", "Num", "Neigh", "bour", "s_", "(_", "nid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "n_", ">=_", "self_", "._", "m", "Min", "Profil", "e", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "profile_", "=_", "align", "lib_", "._", "make", "Emp", "ty", "Profile_", "(_", "self_", "._", "m", "Regula", "riz", "or_", ",_", "self_", "._", "m", "Log", "Od", "dor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pair", "sdb", "lib_", "._", "fill", "Profil", "e", "Neigh", "bour", "s_", "(_", "profile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Connect", "ion", "Pair", "sdb", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Table", "Name", "Neigh", "bour", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Max", "Line", "s", "Mal", "i_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Max", "Level_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Min", "Level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "------", ">", " ", "usi", "ng", " ", "profile", " ", "for", " ", "rep", " ", "%", "i", "\"_", "%_", "nid_", "\\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 ", " _", "profile_", "=_", "pair", "sdb", "lib_", "._", "make", "Sequ", "ence", "Fro", "m", "Pic", "ass", "o_", "(_", "self_", "._", "m", "Connect", "ion", "Pair", "sdb", "_", ",_", "nid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "------", ">", " ", "usi", "ng", " ", "sequence", " ", "for", " ", "rep", " ", "%", "i", "\"_", "%_", "nid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "profile_", "._", "use", "Segment_", "(_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "profile_", ",_", "(_", "str_", "(_", "n_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Sco", "p", "Tester", "Full", "Profil", "es_", "(_", "Sco", "p", "Tester", "Profil", "es_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "use", " ", "full", " ", "length", " ", "profile", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "be", "ware", " ", "of", " ", "multid", "omain", "-", "proteins", ",", " ", "use", " ", "iterative", " ", "multiple", " ", "alignme", "nt", "\\", "10", ";", " ", " ", " ", " ", "method", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sco", "p", "Tester", "Full", "Profil", "es_", "(_", "Sco", "p", "Tester", "Profil", "es_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dbh", "andle", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "align", "ator_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "scop", "\\u", "test_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "profile", "\\u", "size_", "=_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "level_", "=_", "30_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "level_", "=_", "90_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "neighbours_", "=_", "\"", "pair", "sdb", "\\u", "90", "x", "90", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Sco", "p", "Tester", "Profil", "es_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dbh", "andle", "_", ",_", "align", "ator_", ",_", "table", "\\u", "scop", "\\u", "test_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "profile", "\\u", "size_", ",_", "min", "\\u", "level_", ",_", "max", "\\u", "level_", ",_", "neighbours_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Add", "Length_", "=_", "500_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Max", "Length_", "=_", "2000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sco", "p", "Tester", "Full", "Profil", "es_", "(_", "Sco", "p", "Tester", "Profil", "es_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Align", "and", "um_", "(_", "self_", ",_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "profile_", ",_", "x_", "=_", "Sco", "p", "Tester", "Profil", "es_", "._", "Get", "Align", "and", "um_", "(_", "self_", ",_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "profile_", "._", "use", "Full", "Length_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "some", " ", "context", " ", "around_", "\\u\\u\\uNL\\u\\u\\u_", "xf", "rom_", "=_", "max_", "(_", "1_", ",_", "nr", "db", "\\u", "from_", "-_", "self_", "._", "m", "Add", "Length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xt", "o_", "=_", "min_", "(_", "profile_", "._", "get", "Length_", "(_", ")_", ",_", "nr", "db", "\\u", "to_", "+_", "self_", "._", "m", "Add", "Length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "usi", "ng", " ", "segment", " ", "%", "i", "-%", "i", "\"_", "%_", "(_", "xf", "rom_", ",_", "xt", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "profile_", "._", "use", "Segment_", "(_", "xf", "rom_", ",_", "xt", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "profile_", ",_", "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_", "class_", "Align", "ator_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "align", "s", " ", "two", " ", "sequence", "s", " ", "and", " ", "return", "s", " ", "result", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Align", "ator_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "align", "ator_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Align", "ator_", "=_", "align", "ator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Align", "ator_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Align_", "(_", "self_", ",_", "a1_", ",_", "a2_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Align", "ator_", "._", "Align_", "(_", "a1_", ",_", "a2_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Align", "ator_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Check", "Result_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "info", "1_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "info", "2_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "check", " ", "if", " ", "result", " ", "is", " ", "ok", ".", " ", "The", " ", "function", " ", "belo", "w", " ", "return", "s", " ", "every", "thing", ".", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "tuple", " ", "of", " ", "string", "s", " ", "as", " ", "result", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "result_", "._", "get", "Length_", "(_", ")_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row", "\\u", "ali", "_", ",_", "col", "\\u", "ali", "_", "=_", "align", "lib_", "._", "write", "Align", "ata", "Compress", "ed_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "map_", "(_", "str_", ",_", "(_", "result_", "._", "get", "Score_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "get", "Length_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "get", "Num", "Gap", "s_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "align", "lib_", "._", "calcul", "ate", "Perce", "nt", "Simil", "arity_", "(_", "result_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "get", "Row", "From_", "(_", ")_", ",_", "result_", "._", "get", "Row", "To_", "(_", ")_", ",_", "row", "\\u", "ali", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "get", "Col", "From_", "(_", ")_", ",_", "result_", "._", "get", "Col", "To_", "(_", ")_", ",_", "col", "\\u", "ali", "_", ")_", ")_", "\\u\\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", "\"_", ",_", ")_", "*_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Align", "ator", "Iterat", "ive_", "(_", "Align", "ator_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "align", "s", " ", "two", " ", "sequence", "s", " ", "iterative", "ly", ",", " ", "checks", " ", "if", " ", "alignme", "nt", " ", "regions", " ", "are", " ", "overlapping", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "domain", " ", "regions", " ", "and", " ", "return", "s", " ", "result", " ", "only", " ", "for", " ", "tho", "se", " ", "overlapping", ".", " ", "Thi", "s", " ", "is", " ", "usef", "ul", " ", "if", " ", "you", " ", "have", "\\", "10", ";", " ", " ", " ", " ", "sever", "al", " ", "domains", " ", "in", " ", "a", " ", "sequence", ",", " ", "but", " ", "you", " ", "need", " ", "only", " ", "compare", " ", "to", " ", "one", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", " ", "align", "lib", ".", "perform", "Iterat", "ive", "Align", "ment", "Non", "Const", "(", " ", "result", ",_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", " ", "a1", ",", " ", "a2", ",_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", " ", "self", ".", "m", "Align", "ator", ",_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", " ", "self", ".", "m", "Min", "Score", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Align", "ator", "Iterat", "ive_", "(_", "Align", "ator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "align", "ator_", ",_", "min", "\\u", "score_", ",_", "min", "\\u", "overlap_", ",_", "gop", "_", ",_", "ge", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Align", "ator_", "=_", "align", "ator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Min", "Score_", "=_", "float_", "(_", "min", "\\u", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Min", "Overlap", "_", "=_", "min", "\\u", "overlap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Go", "p_", "=_", "gop", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Ge", "p_", "=_", "ge", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Align", "ator", "Iterat", "ive_", "(_", "Align", "ator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Align_", "(_", "self_", ",_", "a1_", ",_", "a2_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "align", " ", "repe", "tet", "ively", ".", " ", "Tak", "e", " ", "high", "est", " ", "scor", "ing", " ", "alignme", "nt", ",", " ", "tha", "t", " ", "overlaps", " ", "with", " ", "domains", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "put", " ", "it", " ", "in", " ", "result", ".", " ", "Not", "e", ":", " ", "perform", "Iterat", "ive", "Align", "ment", " ", "doe", "s", " ", "not", " ", "work", ",", " ", "as", " ", "it", " ", "is", " ", "linear", ".", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "require", "s", " ", "domains", " ", "to", " ", "be", " ", "in", " ", "the", " ", "same", " ", "order", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Result", " ", "is", " ", "empty", ",", " ", "fragment", "s", " ", "are", " ", "saved", " ", "in", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fragment", "or_", "=_", "align", "lib_", "._", "make", "Fragment", "or", "Rep", "eti", "tive_", "(_", "self_", "._", "m", "Align", "ator_", ",_", "self_", "._", "m", "Min", "Score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "align", " ", "iterative", "ly", " ", "and", " ", "convert", " ", "fragment", "s", " ", "to", " ", "Align", "ata", "-", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "val_", "=_", "fragment", "or_", "._", "Fragment_", "(_", "a1_", ",_", "a2_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Fragment", "s_", "=_", "map_", "(_", "lambda_", "x_", ":_", "align", "lib_", "._", "Align", "ata", "Ptr_", "(_", "x_", ")_", ",_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "fragment_", "in_", "self_", "._", "m", "Fragment", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fragment_", "._", "thisown", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Align", "ator", "Iterat", "ive_", "(_", "Align", "ator_", ")_", ":_", "\\u\\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", "Result_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "info", "1_", ",_", "info", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "check", " ", "if", " ", "result", " ", "is", " ", "ok", ".", " ", "Check", " ", "for", " ", "each", " ", "fragment", ",", " ", "if", " ", "it", " ", "overlaps", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "the", " ", "domains", " ", "to", " ", "be", " ", "tested", " ", "and", " ", "dump", " ", "if", " ", "ok", ".", " ", "Thi", "s", " ", "simulat", "es", "\\", "10", ";", " ", " ", " ", " ", "psi", "blast", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "row", "\\u", "from_", ",_", "row", "\\u", "to_", "=_", "map_", "(_", "string_", "._", "ato", "i_", ",_", "info", "1_", "[_", "1_", ":_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "\\u", "from_", ",_", "col", "\\u", "to_", "=_", "map_", "(_", "string_", "._", "ato", "i_", ",_", "info", "2_", "[_", "1_", ":_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "check", " ", "for", " ", "overlap_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "fragment_", "in_", "self_", "._", "m", "Fragment", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "align", "lib", ".", "write", "Align", "ata", "Table", "(", " ", "fragment", ",", " ", "8", ",", " ", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xco", "l\\u", "from_", "=_", "Tools_", "._", "Map", "Right_", "(_", "fragment_", ",_", "row", "\\u", "from_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xco", "l\\u", "to_", "=_", "Tools_", "._", "Map", "Left_", "(_", "fragment_", ",_", "row", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "overlap_", "=_", "min_", "(_", "col", "\\u", "to_", ",_", "xco", "l\\u", "to_", ")_", "-_", "max_", "(_", "col", "\\u", "from_", ",_", "xco", "l\\u", "from_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "self", ".", "m", "Min", "Overlap", ",", " ", "overl", "ap", ",", " ", "xco", "l\\u", "from", ",", " ", "xco", "l\\u", "to", ",", " ", "col", "\\u", "from", ",", " ", "col", "\\u", "to_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "overlap_", ">_", "self_", "._", "m", "Min", "Overlap", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "map_", "(_", "str_", ",_", "(_", "fragment_", "._", "get", "Score_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fragment_", "._", "get", "Length_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fragment_", "._", "get", "Num", "Gap", "s_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "align", "lib_", "._", "calcul", "ate", "Perce", "nt", "Simil", "arity_", "(_", "fragment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fragment_", "._", "get", "Row", "From_", "(_", ")_", ",_", "fragment_", "._", "get", "Row", "To_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fragment_", "._", "get", "Col", "From_", "(_", ")_", ",_", "fragment_", "._", "get", "Col", "To_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "overlap_", ",_", "xco", "l\\u", "from_", ",_", "xco", "l\\u", "to_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "xco", "l\\u", "to_", "-_", "xco", "l\\u", "from_", ")_", "-_", "(_", "col", "\\u", "to_", "-_", "col", "\\u", "from_", ")_", ")_", ")_", "\\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_", "(_", "\"", "0", "\"_", ",_", ")_", "*_", "12_", "\\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, 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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 ]
Unused import
square/ghostunnel/tests/test-client-rejects-invalid-san-or-ca.py
[ { "content": "#!/usr/bin/env python3\n\n# Creates a ghostunnel. Ensures we can connect to a server signed by root1 but\n# not root2.\n\nfrom subprocess import Popen\nfrom test_common import *\nimport socket, ssl\n\nif __name__ == \"__main__\":\n ghostunnel = None\n try:\n # create certs\n root = RootCert('root')\n root.create_signed_cert('server1')\n root.create_signed_cert('client')\n root.create_signed_cert('server2', san=\"IP:127.0.0.1,IP:::1,DNS:foobar\")\n\n other_root = RootCert('other_root')\n other_root.create_signed_cert('other_server')\n\n # start ghostunnel\n ghostunnel = run_ghostunnel(['client', '--listen={0}:13001'.format(LOCALHOST),\n '--target=localhost:13002', '--keystore=client.p12', '--cacert=root.crt',\n '--status={0}:{1}'.format(LOCALHOST, STATUS_PORT)])\n\n # connect to server1, confirm that the tunnel is up\n pair = SocketPair(TcpClient(13001), TlsServer('server1', 'root', 13002))\n pair.validate_can_send_from_client(\"hello world\", \"1: client -> server\")\n pair.validate_can_send_from_server(\"hello world\", \"1: server -> client\")\n pair.validate_closing_client_closes_server(\"1: client closed -> server closed\")\n\n # connect to other_server, confirm that the tunnel isn't up\n try:\n pair = SocketPair(TcpClient(13001), TlsServer('other_server', 'other_root', 13002))\n raise Exception('failed to reject other_server')\n except ssl.SSLError:\n print_ok(\"other_server correctly rejected\")\n\n # connect to server2, confirm that the tunnel isn't up\n try:\n pair = SocketPair(TcpClient(13001), TlsServer('server2', 'root', 13002))\n raise Exception('failed to reject serve2')\n except ssl.SSLError:\n print_ok(\"other_server correctly rejected\")\n\n print_ok(\"OK\")\n finally:\n terminate(ghostunnel)\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from subprocess import Popen", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 28 }, { "span": "import socket, ssl", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 18 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "es", " ", "a", " ", "ghost", "unne", "l", ".", " ", "Ensur", "es", " ", "we", " ", "can", " ", "connect", " ", "to", " ", "a", " ", "server", " ", "sign", "ed", " ", "by", " ", "root", "1", " ", "but", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "root", "2._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "subprocess_", "import_", "Popen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test\\u", "common_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", ",_", "ssl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ghost", "unne", "l_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "certs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "Roo", "t", "Cert", "_", "(_", "'", "root", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "create", "\\u", "sign", "ed", "\\u", "cert_", "(_", "'", "server", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "create", "\\u", "sign", "ed", "\\u", "cert_", "(_", "'", "client", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "create", "\\u", "sign", "ed", "\\u", "cert_", "(_", "'", "server", "2", "'_", ",_", "san", "_", "=_", "\"", "IP", ":", "127", ".0", ".0", ".1", ",", "IP", ":::", "1", ",", "DNS", ":", "fooba", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "other", "\\u", "root_", "=_", "Roo", "t", "Cert", "_", "(_", "'", "other", "\\u", "root", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "root_", "._", "create", "\\u", "sign", "ed", "\\u", "cert_", "(_", "'", "other", "\\u", "server", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "ghost", "unne", "l_", "\\u\\u\\uNL\\u\\u\\u_", "ghost", "unne", "l_", "=_", "run", "\\u", "ghost", "unne", "l_", "(_", "[_", "'", "client", "'_", ",_", "'--", "listen", "={", "0", "}:", "1300", "1", "'_", "._", "format_", "(_", "LOCAL", "HOST_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "target", "=", "local", "host", ":", "1300", "2", "'_", ",_", "'--", "keystore", "=", "client", ".", "p1", "2", "'_", ",_", "'--", "cacert", "=", "root", ".", "crt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "status", "={", "0", "}:", "{", "1", "}'_", "._", "format_", "(_", "LOCAL", "HOST_", ",_", "STATUS", "\\u", "PORT_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connect", " ", "to", " ", "server", "1", ",", " ", "confirm", " ", "tha", "t", " ", "the", " ", "tunnel", " ", "is", " ", "up_", "\\u\\u\\uNL\\u\\u\\u_", "pair_", "=_", "Sock", "et", "Pair_", "(_", "Tc", "p", "Client_", "(_", "1300", "1_", ")_", ",_", "Tl", "s", "Server_", "(_", "'", "server", "1", "'_", ",_", "'", "root", "'_", ",_", "1300", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pair_", "._", "validat", "e\\u", "can", "\\u", "send", "\\u", "from", "\\u", "client_", "(_", "\"", "hell", "o", " ", "world", "\"_", ",_", "\"", "1", ":", " ", "client", " ", "->", " ", "server", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pair_", "._", "validat", "e\\u", "can", "\\u", "send", "\\u", "from", "\\u", "server_", "(_", "\"", "hell", "o", " ", "world", "\"_", ",_", "\"", "1", ":", " ", "server", " ", "->", " ", "client", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pair_", "._", "validat", "e\\u", "clos", "ing", "\\u", "client", "\\u", "closes", "\\u", "server_", "(_", "\"", "1", ":", " ", "client", " ", "close", "d", " ", "->", " ", "server", " ", "close", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connect", " ", "to", " ", "other", "\\u", "server", ",", " ", "confirm", " ", "tha", "t", " ", "the", " ", "tunnel", " ", "isn", "'", "t", " ", "up_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pair_", "=_", "Sock", "et", "Pair_", "(_", "Tc", "p", "Client_", "(_", "1300", "1_", ")_", ",_", "Tl", "s", "Server_", "(_", "'", "other", "\\u", "server", "'_", ",_", "'", "other", "\\u", "root", "'_", ",_", "1300", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", "'", "fail", "ed", " ", "to", " ", "reject", " ", "other", "\\u", "server", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "ssl_", "._", "SS", "LE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "\\u", "ok_", "(_", "\"", "other", "\\u", "server", " ", "correct", "ly", " ", "reject", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connect", " ", "to", " ", "server", "2", ",", " ", "confirm", " ", "tha", "t", " ", "the", " ", "tunnel", " ", "isn", "'", "t", " ", "up_", "\\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 ", " _", "pair_", "=_", "Sock", "et", "Pair_", "(_", "Tc", "p", "Client_", "(_", "1300", "1_", ")_", ",_", "Tl", "s", "Server_", "(_", "'", "server", "2", "'_", ",_", "'", "root", "'_", ",_", "1300", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", "'", "fail", "ed", " ", "to", " ", "reject", " ", "serve", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "ssl_", "._", "SS", "LE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "\\u", "ok_", "(_", "\"", "other", "\\u", "server", " ", "correct", "ly", " ", "reject", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print", "\\u", "ok_", "(_", "\"", "OK", "\"_", ")_", "\\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 ", " _", "terminate_", "(_", "ghost", "unne", "l_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 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,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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 ]
Unused local variable
OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/components/test/test_extcode.py
[ { "content": " def setUp(self):\n global TMPDIR\n self.startdir = os.getcwd()\n self.tempdir = tempfile.mkdtemp(prefix='test_extcode-')\n TMPDIR = self.tempdir\n os.chdir(self.tempdir)\n SimulationRoot.chroot(self.tempdir)\n shutil.copy(os.path.join(DIRECTORY, 'sleep.py'), \n os.path.join(self.tempdir, 'sleep.py'))\n with open(INP_FILE, 'w') as out:\n out.write(INP_DATA)\n dum = Assembly() # create this here to prevent any Assemblies in tests to be 'first'", "metadata": "root.TestCase.setUp", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 93 } ]
[ { "span": "dum ", "start_line": 104, "start_column": 8, "end_line": 104, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "TMP", "DIR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "startd", "ir_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tempdir_", "=_", "tempfile_", "._", "mkdtemp_", "(_", "prefix_", "=_", "'", "test\\u", "ext", "code", "-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TMP", "DIR_", "=_", "self_", "._", "tempdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "self_", "._", "tempdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Simul", "ation", "Root_", "._", "chroot", "_", "(_", "self_", "._", "tempdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "copy_", "(_", "os_", "._", "path_", "._", "join_", "(_", "DIRECTORY_", ",_", "'", "sleep", ".", "py", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "'", "sleep", ".", "py", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "IN", "P", "\\u", "FILE_", ",_", "'", "w", "'_", ")_", "as_", "out_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "write_", "(_", "IN", "P", "\\u", "DATA_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dum", "_", "=_", "Asse", "mbly", "_", "(_", ")_", "#", " ", "create", " ", "this", " ", "here", " ", "to", " ", "prevent", " ", "any", " ", "Asse", "mbl", "ies", " ", "in", " ", "tests", " ", "to", " ", "be", " ", "'", "first", "'_", "\\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, 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 ]
Unused local variable
benbaptist/minecraft-wrapper/example-plugins/SmallBrother.py
[ { "content": "\tdef breakBlock(self, payload):#\t\tprint self.minecraft.getServer().world.getBlock(payload[\"position\"])\n\t\tplayer = payload[\"player\"]\n\t\tx, y, z = payload[\"position\"]\n\t\tuuid = player.uuid\n\t\tif player.name in self.toggled:\n\t\t\tactions = self.lookupBlock(x, y, z)\n\t\t\tfound = False\n\t\t\tfor action in actions:\n\t\t\t\tself.displayEntry(player, action)\n\t\t\tif len(actions) < 1:\n\t\t\t\tplayer.message({\"text\": \"Could not find any actions in the specified area.\", \"color\": \"red\"})\n\t\t\telse:\n\t\t\t\tplayer.message({\"text\": \"End of list.\", \"color\": \"red\", \"bold\": True})\n\t\t\treturn False\n\t\telse:\n\t\t\tself.logger.dig_block(uuid, x, y, z, -1, 0)", "metadata": "root.Main.breakBlock", "header": "['class', 'Main', ':', '___EOS___']", "index": 36 }, { "content": "\tdef placeBlock(self, payload):\n\t\tif payload[\"item\"] == None: return\n\t\tplayer = payload[\"player\"]\n\t\tx, y, z = payload[\"position\"]\n\t\tuuid = player.uuid\n\t\tif player.name in self.toggled:\n\t\t\tactions = self.lookupBlock(x, y, z)\n\t\t\tfound = False\n\t\t\tfor action in actions:\n\t\t\t\tself.displayEntry(player, action)\n\t\t\tif len(actions) < 1:\n\t\t\t\tplayer.message({\"text\": \"Could not find any actions in the specified area.\", \"color\": \"red\"})\n\t\t\telse:\n\t\t\t\tplayer.message({\"text\": \"End of list.\", \"color\": \"red\", \"bold\": True})\n\t\t\treturn False\n\t\telse:\n\t\t\tif payload[\"item\"][\"id\"] < 255:\n\t\t\t\tself.logger.place_block(uuid, x, y, z, payload[\"item\"][\"id\"], payload[\"item\"][\"damage\"])", "metadata": "root.Main.placeBlock", "header": "['class', 'Main', ':', '___EOS___']", "index": 52 }, { "content": "\tdef _sb(self, player, args):\n\t\tif not self.deny(player): return\n\t\tif len(args) > 0:\n\t\t\tsubcommand = args[0]\n\t\t\tif subcommand == \"area\":\n\t\t\t\tradius = args[1] # squareRadius, not circular. not really a true radius.\n\t\t\t\t\n\t\t\t\tplayer.message(\"&cApologies, but this command has not been implemented yet.\")\n\t\t\telif subcommand == \"toggle\":\n\t\t\t\tif player.username in self.toggled:\n\t\t\t\t\tself.toggled.remove(player.username)\n\t\t\t\t\tplayer.message(\"&c&lSmallBrother: &r&cTurned off check mode.\")\n\t\t\t\telse:\n\t\t\t\t\tself.toggled.append(player.username)\n\t\t\t\t\tplayer.message(\"&c&lSmallBrother: &r&bTurned on check mode. Left/right click on a block to check the history.\")\n\t\t\telif subcommand == \"block\":\n\t\t\t\tx, y, z = int(args[1]), int(args[2]), int(args[3])\n\t\t\t\tactions = self.lookupBlock(x, y, z)\n\t\t\t\tfound = False\n\t\t\t\tfor action in actions:\n\t\t\t\t\tself.displayEntry(player, action)\n\t\t\t\tif len(actions) < 1:\n\t\t\t\t\tplayer.message({\"text\": \"Could not find any actions in the specified area.\", \"color\": \"red\"})\n\t\t\t\telse:\n\t\t\t\t\tplayer.message({\"text\": \"End of list.\", \"color\": \"red\", \"bold\": True})\n\t\t\telif subcommand == \"_debug_parse_region_data\":\n\t\t\t\tx, y, z = player.getPosition()\n\t\t\t\tchunk = ChunkReader(int(x/1024), int(z/1024), self.logger.worldName)\n\t\t\t\tactions = chunk.load()\n\t\t\t\tfor i in actions:\n\t\t\t\t\tplayer.message(str(i))\n\t\t\telif subcommand == \"help\":\n\t\t\t\tplayer.message(\"&lSmallBrother's commands:\")\n\t\t\t\tcommands = {\"toggle\": {\"text\": \"Toggles breaking or placing blocks that check for events in the block that you placed or broke.\", \"args\": \"\"},\n\t\t\t\t\"area\": {\"text\": \"Scan the square radius around the player for events.\", \"args\": \"<squareRadius>\"},\n\t\t\t\t\t\"block\": {\"text\": \"Checks those specific coordinates for action.\", \"args\": \"<x> <y> <z>\"}}\n\t\t\t\tfor i in commands:\n\t\t\t\t\tcom = commands[i]\n\t\t\t\t\tplayer.message(\"&b&l/sb %s &r&c&o%s: &r&a%s\" % (i, com[\"args\"], com[\"text\"]))\n\t\t\telse:\n\t\t\t\tplayer.message(\"&c&lSmallBrother: &r&cUnknown sub-command '%s'. Please see /sb help for a list of sub-commands.\" % subcommand)\n\t\telse:\n\t\t\tplayer.message(\"&a&lSmallBrother v1.0\")\n\t\t\tplayer.message(\"&aFor help with SmallBrother's commands, run /sb help.\")", "metadata": "root.Main._sb", "header": "['class', 'Main', ':', '___EOS___']", "index": 77 } ]
[ { "span": "found ", "start_line": 42, "start_column": 3, "end_line": 42, "end_column": 8 }, { "span": "found ", "start_line": 59, "start_column": 3, "end_line": 59, "end_column": 8 }, { "span": "radius ", "start_line": 82, "start_column": 4, "end_line": 82, "end_column": 10 }, { "span": "found ", "start_line": 95, "start_column": 4, "end_line": 95, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Main_", ":_", "\\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_", "break", "Block_", "(_", "self_", ",_", "payload_", ")_", ":_", "#", "\t", "\t", "print", " ", "self", ".", "minecraft", ".", "get", "Server", "()", ".", "world", ".", "get", "Block", "(", "payload", "[\"", "position", "\"]", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "player_", "=_", "payload_", "[_", "\"", "player", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", ",_", "y_", ",_", "z_", "=_", "payload_", "[_", "\"", "position", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uuid_", "=_", "player_", "._", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "player_", "._", "name_", "in_", "self_", "._", "toggled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "actions_", "=_", "self_", "._", "look", "up", "Block_", "(_", "x_", ",_", "y_", ",_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "action_", "in_", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "display", "Entry_", "(_", "player_", ",_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "actions_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "player_", "._", "message_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "Cou", "ld", " ", "not", " ", "find", " ", "any", " ", "action", "s", " ", "in", " ", "the", " ", "specified", " ", "area", ".\"_", ",_", "\"", "color", "\"_", ":_", "\"", "red", "\"_", "}_", ")_", "\\u\\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_", "player_", "._", "message_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "End", " ", "of", " ", "list", ".\"_", ",_", "\"", "color", "\"_", ":_", "\"", "red", "\"_", ",_", "\"", "bold", "\"_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "logger_", "._", "dig", "\\u", "block_", "(_", "uuid_", ",_", "x_", ",_", "y_", ",_", "z_", ",_", "-_", "1_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Main_", ":_", "\\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_", "place", "Block_", "(_", "self_", ",_", "payload_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "payload_", "[_", "\"", "item", "\"_", "]_", "==_", "None_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player_", "=_", "payload_", "[_", "\"", "player", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", ",_", "y_", ",_", "z_", "=_", "payload_", "[_", "\"", "position", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uuid_", "=_", "player_", "._", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "player_", "._", "name_", "in_", "self_", "._", "toggled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "actions_", "=_", "self_", "._", "look", "up", "Block_", "(_", "x_", ",_", "y_", ",_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "action_", "in_", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "display", "Entry_", "(_", "player_", ",_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "actions_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "player_", "._", "message_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "Cou", "ld", " ", "not", " ", "find", " ", "any", " ", "action", "s", " ", "in", " ", "the", " ", "specified", " ", "area", ".\"_", ",_", "\"", "color", "\"_", ":_", "\"", "red", "\"_", "}_", ")_", "\\u\\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_", "player_", "._", "message_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "End", " ", "of", " ", "list", ".\"_", ",_", "\"", "color", "\"_", ":_", "\"", "red", "\"_", ",_", "\"", "bold", "\"_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "payload_", "[_", "\"", "item", "\"_", "]_", "[_", "\"", "id", "\"_", "]_", "<_", "255_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "logger_", "._", "place", "\\u", "block_", "(_", "uuid_", ",_", "x_", ",_", "y_", ",_", "z_", ",_", "payload_", "[_", "\"", "item", "\"_", "]_", "[_", "\"", "id", "\"_", "]_", ",_", "payload_", "[_", "\"", "item", "\"_", "]_", "[_", "\"", "damage", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Main_", ":_", "\\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_", "\\u", "sb_", "(_", "self_", ",_", "player_", ",_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "self_", "._", "deny", "_", "(_", "player_", ")_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "subcommand_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subcommand_", "==_", "\"", "area", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "radius_", "=_", "args_", "[_", "1_", "]_", "#", " ", "square", "Rad", "ius", ",", " ", "not", " ", "circular", ".", " ", "not", " ", "reall", "y", " ", "a", " ", "true", " ", "radi", "us", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "player_", "._", "message_", "(_", "\"&", "c", "Ap", "ologi", "es", ",", " ", "but", " ", "this", " ", "command", " ", "has", " ", "not", " ", "bee", "n", " ", "implemented", " ", "ye", "t", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "subcommand_", "==_", "\"", "toggle", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "player_", "._", "username_", "in_", "self_", "._", "toggled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "toggled_", "._", "remove_", "(_", "player_", "._", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player_", "._", "message_", "(_", "\"&", "c", "&", "l", "Small", "Bro", "ther", ":", " ", "&", "r", "&", "c", "Turn", "ed", " ", "off", " ", "check", " ", "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\t", "\t\t\t\t_", "self_", "._", "toggled_", "._", "append_", "(_", "player_", "._", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player_", "._", "message_", "(_", "\"&", "c", "&", "l", "Small", "Bro", "ther", ":", " ", "&", "r", "&", "b", "Turn", "ed", " ", "on", " ", "check", " ", "mode", ".", " ", "Le", "ft", "/", "right", " ", "click", " ", "on", " ", "a", " ", "block", " ", "to", " ", "check", " ", "the", " ", "histo", "ry", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "subcommand_", "==_", "\"", "block", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "x_", ",_", "y_", ",_", "z_", "=_", "int_", "(_", "args_", "[_", "1_", "]_", ")_", ",_", "int_", "(_", "args_", "[_", "2_", "]_", ")_", ",_", "int_", "(_", "args_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actions_", "=_", "self_", "._", "look", "up", "Block_", "(_", "x_", ",_", "y_", ",_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "action_", "in_", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "display", "Entry_", "(_", "player_", ",_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "actions_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "player_", "._", "message_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "Cou", "ld", " ", "not", " ", "find", " ", "any", " ", "action", "s", " ", "in", " ", "the", " ", "specified", " ", "area", ".\"_", ",_", "\"", "color", "\"_", ":_", "\"", "red", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "player_", "._", "message_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "End", " ", "of", " ", "list", ".\"_", ",_", "\"", "color", "\"_", ":_", "\"", "red", "\"_", ",_", "\"", "bold", "\"_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "subcommand_", "==_", "\"\\u", "debug", "\\u", "parse", "\\u", "region", "\\u", "data", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "x_", ",_", "y_", ",_", "z_", "=_", "player_", "._", "get", "Position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chunk_", "=_", "Chunk", "Reader_", "(_", "int_", "(_", "x_", "/_", "1024_", ")_", ",_", "int_", "(_", "z_", "/_", "1024_", ")_", ",_", "self_", "._", "logger_", "._", "world", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actions_", "=_", "chunk_", "._", "load_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "player_", "._", "message_", "(_", "str_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "subcommand_", "==_", "\"", "help", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "player_", "._", "message_", "(_", "\"&", "l", "Small", "Bro", "ther", "'", "s", " ", "command", "s", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "commands_", "=_", "{_", "\"", "toggle", "\"_", ":_", "{_", "\"", "text", "\"_", ":_", "\"", "Toggle", "s", " ", "break", "ing", " ", "or", " ", "pla", "cing", " ", "blocks", " ", "tha", "t", " ", "check", " ", "for", " ", "events", " ", "in", " ", "the", " ", "block", " ", "tha", "t", " ", "you", " ", "place", "d", " ", "or", " ", "bro", "ke", ".\"_", ",_", "\"", "args", "\"_", ":_", "\"\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "area", "\"_", ":_", "{_", "\"", "text", "\"_", ":_", "\"", "Sca", "n", " ", "the", " ", "square", " ", "radi", "us", " ", "aro", "und", " ", "the", " ", "player", " ", "for", " ", "events", ".\"_", ",_", "\"", "args", "\"_", ":_", "\"<", "square", "Rad", "ius", ">\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "block", "\"_", ":_", "{_", "\"", "text", "\"_", ":_", "\"", "Check", "s", " ", "tho", "se", " ", "specific", " ", "coordinate", "s", " ", "for", " ", "action", ".\"_", ",_", "\"", "args", "\"_", ":_", "\"<", "x", ">", " ", "<", "y", ">", " ", "<", "z", ">\"_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "commands_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "com_", "=_", "commands_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player_", "._", "message_", "(_", "\"&", "b", "&", "l", "/", "sb", " ", "%", "s", " ", "&", "r", "&", "c", "&", "o", "%", "s", ":", " ", "&", "r", "&", "a", "%", "s", "\"_", "%_", "(_", "i_", ",_", "com_", "[_", "\"", "args", "\"_", "]_", ",_", "com_", "[_", "\"", "text", "\"_", "]_", ")_", ")_", "\\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\t_", "player_", "._", "message_", "(_", "\"&", "c", "&", "l", "Small", "Bro", "ther", ":", " ", "&", "r", "&", "c", "Un", "know", "n", " ", "sub", "-", "command", " ", "'%", "s", "'.", " ", "Ple", "ase", " ", "see", " ", "/", "sb", " ", "help", " ", "for", " ", "a", " ", "list", " ", "of", " ", "sub", "-", "command", "s", ".\"_", "%_", "subcommand_", ")_", "\\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_", "player_", "._", "message_", "(_", "\"&", "a", "&", "l", "Small", "Bro", "ther", " ", "v1", ".0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player_", "._", "message_", "(_", "\"&", "a", "For", " ", "help", " ", "with", " ", "Small", "Bro", "ther", "'", "s", " ", "command", "s", ",", " ", "run", " ", "/", "sb", " ", "help", ".\"_", ")_", "\\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, 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,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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 ]
Unused local variable
yuce/pyswip/examples/father.py
[ { "content": "def main():\n p = Prolog()\n\n father = Functor(\"father\", 2)\n mother = Functor(\"mother\", 2)\n assertz = Functor(\"assertz\", 1)\n\n #call(assertz(father(\"john\", \"mich\")))\n #call(assertz(father(\"john\", \"gina\")))\n #call(assertz(father(\"hank\", \"cloe\")))\n #call(assertz(mother(\"jane\", \"mich\")))\n #call(assertz(mother(\"jane\", \"gina\")))\n\n p.assertz(\"father(john,mich)\")\n p.assertz(\"father(john,gina)\")\n p.assertz(\"mother(jane,mich)\")\n\n X = Variable(); Y = Variable(); Z = Variable()\n\n listing = Functor(\"listing\", 1)\n call(listing(father))\n\n #print list(p.query(\"listing(father))\"))\n\n q = Query(father(\"john\",Y), mother(Z,Y))\n while q.nextSolution():\n print Y.value, Z.value\n #print X.value, \"is the father of\", Y.value\n #print Z.value, \"is the mother of\", Y.value\n q.closeQuery() # Newer versions of SWI-Prolog do not allow nested queries\n\n print \"\\nQuery with strings\\n\"\n for s in p.query(\"father(john,Y),mother(Z,Y)\"):\n #print s[\"X\"], \"is the father of\", s[\"Y\"]\n #print s[\"Z\"], \"is the mother of\", s[\"Y\"] \n print s[\"Y\"], s[\"Z\"]\n\n #print \"running the query again\"\n #q = Query(father(X, Y))\n #while q.nextSolution():\n # print X.value, \"is the father of\", Y.value", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 28 } ]
[ { "span": "assertz ", "start_line": 33, "start_column": 4, "end_line": 33, "end_column": 11 }, { "span": "X ", "start_line": 45, "start_column": 4, "end_line": 45, "end_column": 5 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "Pro", "log_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "father_", "=_", "Func", "tor_", "(_", "\"", "fat", "her", "\"_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mother", "_", "=_", "Func", "tor_", "(_", "\"", "mother", "\"_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "z_", "=_", "Func", "tor_", "(_", "\"", "assert", "z", "\"_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "call", "(", "assert", "z", "(", "fat", "her", "(\"", "john", "\",", " ", "\"", "mich", "\"))", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "call", "(", "assert", "z", "(", "fat", "her", "(\"", "john", "\",", " ", "\"", "gin", "a", "\"))", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "call", "(", "assert", "z", "(", "fat", "her", "(\"", "han", "k", "\",", " ", "\"", "clo", "e", "\"))", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "call", "(", "assert", "z", "(", "mother", "(\"", "jane", "\",", " ", "\"", "mich", "\"))", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "call", "(", "assert", "z", "(", "mother", "(\"", "jane", "\",", " ", "\"", "gin", "a", "\"))", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "assert", "z_", "(_", "\"", "fat", "her", "(", "john", ",", "mich", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "assert", "z_", "(_", "\"", "fat", "her", "(", "john", ",", "gin", "a", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "assert", "z_", "(_", "\"", "mother", "(", "jane", ",", "mich", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "X_", "=_", "Variable_", "(_", ")_", ";_", "Y_", "=_", "Variable_", "(_", ")_", ";_", "Z_", "=_", "Variable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listing_", "=_", "Func", "tor_", "(_", "\"", "listi", "ng", "\"_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call_", "(_", "listing_", "(_", "father_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "list", "(", "p", ".", "query", "(\"", "listi", "ng", "(", "fat", "her", "))", "\"))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "q_", "=_", "Query_", "(_", "father_", "(_", "\"", "john", "\"_", ",_", "Y_", ")_", ",_", "mother", "_", "(_", "Z_", ",_", "Y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "q_", "._", "next", "Solution_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "Y_", "._", "value_", ",_", "Z_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "X", ".", "value", ",", " ", "\"", "is", " ", "the", " ", "fat", "her", " ", "of", "\",", " ", "Y", ".", "value_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "Z", ".", "value", ",", " ", "\"", "is", " ", "the", " ", "mother", " ", "of", "\",", " ", "Y", ".", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "q_", "._", "close", "Query_", "(_", ")_", "#", " ", "New", "er", " ", "version", "s", " ", "of", " ", "SWI", "-", "Pro", "log", " ", "do", " ", "not", " ", "allow", " ", "nest", "ed", " ", "queries_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"\\\\", "n", "Query", " ", "with", " ", "string", "s", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "p_", "._", "query_", "(_", "\"", "fat", "her", "(", "john", ",", "Y", "),", "mother", "(", "Z", ",", "Y", ")\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "s", "[\"", "X", "\"]", ",", " ", "\"", "is", " ", "the", " ", "fat", "her", " ", "of", "\",", " ", "s", "[\"", "Y", "\"]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "s", "[\"", "Z", "\"]", ",", " ", "\"", "is", " ", "the", " ", "mother", " ", "of", "\",", " ", "s", "[\"", "Y", "\"]", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "s_", "[_", "\"", "Y", "\"_", "]_", ",_", "s_", "[_", "\"", "Z", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "runn", "ing", " ", "the", " ", "query", " ", "again", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "q", " ", "=", " ", "Query", "(", "fat", "her", "(", "X", ",", " ", "Y", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "whi", "le", " ", "q", ".", "next", "Solut", "ion", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "X", ".", "value", ",", " ", "\"", "is", " ", "the", " ", "fat", "her", " ", "of", "\",", " ", "Y", ".", "value_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
azoft-dev-team/imagrium/env/Lib/test/test_scriptpackages.py
[ { "content": " def _test_scriptpackage(self, package, testobject=1):\n # Check that we can import the package\n mod = __import__(package)\n # Test that we can get the main event class\n klass = getattr(mod, package)\n # Test that we can instantiate that class\n talker = klass()\n if testobject:\n # Test that we can get an application object\n obj = mod.application(0)", "metadata": "root.TestScriptpackages._test_scriptpackage", "header": "['class', 'TestScriptpackages', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 10 } ]
[ { "span": "talker ", "start_line": 16, "start_column": 8, "end_line": 16, "end_column": 14 }, { "span": "obj ", "start_line": 19, "start_column": 12, "end_line": 19, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Script", "packages_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "test\\u", "script", "package_", "(_", "self_", ",_", "package_", ",_", "test", "object_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "tha", "t", " ", "we", " ", "can", " ", "import", " ", "the", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mod_", "=_", "\\u\\u", "import\\u\\u_", "(_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "tha", "t", " ", "we", " ", "can", " ", "get", " ", "the", " ", "main", " ", "event", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "klass_", "=_", "getattr_", "(_", "mod_", ",_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "tha", "t", " ", "we", " ", "can", " ", "instantiate", " ", "tha", "t", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "talk", "er_", "=_", "klass_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "test", "object_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "tha", "t", " ", "we", " ", "can", " ", "get", " ", "an", " ", "applica", "tion", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "mod_", "._", "application_", "(_", "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, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
amrdraz/kodr/app/brython/www/src/Lib/test/inspect_fodder.py
[ { "content": "def eggs(x, y):\n \"A docstring.\"\n global fr, st\n fr = inspect.currentframe()\n st = inspect.stack()\n p = x\n q = y / 0", "metadata": "root.eggs", "header": "['module', '___EOS___']", "index": 11 } ]
[ { "span": "p ", "start_line": 16, "start_column": 4, "end_line": 16, "end_column": 5 }, { "span": "q ", "start_line": 17, "start_column": 4, "end_line": 17, "end_column": 5 } ]
[]
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_", "egg", "s_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "A", " ", "docstr", "ing", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "fr_", ",_", "st_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fr_", "=_", "inspect_", "._", "currentframe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "st_", "=_", "inspect_", "._", "stack_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "q_", "=_", "y_", "/_", "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, 0, 2, 2, 2, 0, 2, 2, 2, 2, 2 ]
Unused import
ppwwyyxx/tensorpack/tensorpack/predict.py
[ { "content": "# -*- coding: UTF-8 -*-\n# File: predict.py\n# Author: Yuxin Wu <ppwwyyxx@gmail.com>\n\nimport tensorflow as tf\nimport numpy as np\nfrom collections import namedtuple\nfrom tqdm import tqdm\nfrom six.moves import zip, range\n\nimport multiprocessing\nfrom .utils.concurrency import ensure_proc_terminate, OrderedResultGatherProc, DIE\n\nfrom .tfutils import *\nfrom .utils import logger\nfrom .tfutils.modelutils import describe_model\nfrom .dataflow import DataFlow, BatchData\nfrom .dataflow.dftools import dataflow_to_process_queue\n\n__all__ = ['PredictConfig', 'DatasetPredictor', 'get_predict_func']\n\nPredictResult = namedtuple('PredictResult', ['input', 'output'])\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PredictConfig(object):", "metadata": "root.PredictConfig", "header": "['module', '___EOS___']", "index": 23 }, { "content": " def __init__(self, **kwargs):\n \"\"\"\n The config used by `get_predict_func`.\n\n :param session_config: a `tf.ConfigProto` instance to instantiate the session.\n :param session_init: a `utils.sessinit.SessionInit` instance to\n initialize variables of a session.\n :param input_data_mapping: Decide the mapping from each component in data\n to the input tensor, since you may not need all input variables\n of the Model to run the graph for prediction (for example\n the `label` input is not used if you only need probability distribution).\n\n It should be a list of int with length equal to `len(data_point)`,\n where each element in the list defines which input variables each\n component in the data point should be fed into.\n If not given, defaults to range(len(input_vars))\n\n For example, in image classification task, the testing\n dataset only provides datapoints of images (no labels). When\n the input variables of the model is: ::\n\n input_vars: [image_var, label_var]\n\n the mapping should then look like: ::\n\n input_data_mapping: [0] # the first component in a datapoint should map to `image_var`\n\n :param model: a `ModelDesc` instance\n :param output_var_names: a list of names of the output variables to predict, the\n variables can be any computable tensor in the graph.\n Predict specific output might not require all input variables.\n :param nr_gpu: default to 1. Use CUDA_VISIBLE_DEVICES to control which GPU to use sepcifically.\n \"\"\"\n def assert_type(v, tp):\n assert isinstance(v, tp), v.__class__\n self.session_config = kwargs.pop('session_config', get_default_sess_config())\n assert_type(self.session_config, tf.ConfigProto)\n self.session_init = kwargs.pop('session_init')\n self.model = kwargs.pop('model')\n self.input_data_mapping = kwargs.pop('input_data_mapping', None)\n self.output_var_names = kwargs.pop('output_var_names')\n self.nr_gpu = kwargs.pop('nr_gpu', 1)\n assert len(kwargs) == 0, 'Unknown arguments: {}'.format(str(kwargs.keys()))", "metadata": "root.PredictConfig.__init__", "header": "['class', 'PredictConfig', '(', 'object', ')', ':', '___EOS___']", "index": 24 }, { "content": "def get_predict_func(config):\n \"\"\"\n :param config: a `PredictConfig` instance.\n :returns: A prediction function that takes a list of input values, and return\n a list of output values defined in ``config.output_var_names``.\n \"\"\"\n output_var_names = config.output_var_names\n\n # input/output variables\n input_vars = config.model.get_input_vars()\n cost_var = config.model.get_cost(input_vars, is_training=False)\n if config.input_data_mapping is None:\n input_map = input_vars\n else:\n input_map = [input_vars[k] for k in config.input_data_mapping]\n\n # check output_var_names against output_vars\n output_vars = [tf.get_default_graph().get_tensor_by_name(get_op_var_name(n)[1])\n for n in output_var_names]\n\n sess = tf.Session(config=config.session_config)\n config.session_init.init(sess)\n\n def run_input(dp):\n assert len(input_map) == len(dp), \\\n \"Graph has {} inputs but dataset only gives {} components!\".format(\n len(input_map), len(dp))\n feed = dict(zip(input_map, dp))\n return sess.run(output_vars, feed_dict=feed)\n return run_input", "metadata": "root.get_predict_func", "header": "['module', '___EOS___']", "index": 68 }, { "content": "class PredictWorker(multiprocessing.Process):\n \"\"\" A worker process to run predictor on one GPU \"\"\"\n", "metadata": "root.PredictWorker", "header": "['module', '___EOS___']", "index": 99 }, { "content": " def __init__(self, idx, gpuid, inqueue, outqueue, config):\n \"\"\"\n :param idx: index of the worker. the 0th worker will print log.\n :param gpuid: id of the GPU to be used\n :param inqueue: input queue to get data point\n :param outqueue: output queue put result\n :param config: a `PredictConfig`\n \"\"\"\n super(PredictWorker, self).__init__()\n self.idx = idx\n self.gpuid = gpuid\n self.inqueue = inqueue\n self.outqueue = outqueue\n self.config = config", "metadata": "root.PredictWorker.__init__", "header": "['class', 'PredictWorker', '(', 'multiprocessing', '.', 'Process', ')', ':', '___EOS___']", "index": 101 }, { "content": " def run(self):\n os.environ['CUDA_VISIBLE_DEVICES'] = self.gpuid\n G = tf.Graph() # build a graph for each process, because they don't need to share anything\n with G.as_default(), tf.device('/gpu:0'):\n self.func = get_predict_func(self.config)\n if self.idx == 0:\n describe_model()\n while True:\n tid, dp = self.inqueue.get()\n if tid == DIE:\n self.outqueue.put((DIE, None))\n return\n else:\n res = PredictResult(dp, self.func(dp))\n self.outqueue.put((tid, res))", "metadata": "root.PredictWorker.run", "header": "['class', 'PredictWorker', '(', 'multiprocessing', '.', 'Process', ')', ':', '___EOS___']", "index": 116 }, { "content": "class DatasetPredictor(object):\n \"\"\"\n Run the predict_config on a given `DataFlow`.\n \"\"\"\n\n", "metadata": "root.DatasetPredictor", "header": "['module', '___EOS___']", "index": 132 }, { "content": " def __init__(self, config, dataset):\n \"\"\"\n :param config: a `PredictConfig` instance.\n :param dataset: a `DataFlow` instance.\n \"\"\"\n assert isinstance(dataset, DataFlow)\n self.ds = dataset\n self.nr_gpu = config.nr_gpu\n if self.nr_gpu > 1:\n self.inqueue, self.inqueue_proc = dataflow_to_process_queue(self.ds, 10, self.nr_gpu)\n self.outqueue = multiprocessing.Queue()\n try:\n gpus = os.environ['CUDA_VISIBLE_DEVICES'].split(',')\n except KeyError:\n gpus = list(range(self.nr_gpu))\n self.workers = [PredictWorker(i, gpus[i], self.inqueue, self.outqueue, config)\n for i in range(self.nr_gpu)]\n self.result_queue = OrderedResultGatherProc(self.outqueue)\n\n # setup all the procs\n self.inqueue_proc.start()\n for p in self.workers: p.start()\n self.result_queue.start()\n ensure_proc_terminate(self.workers)\n ensure_proc_terminate([self.result_queue, self.inqueue_proc])\n else:\n self.func = get_predict_func(config)", "metadata": "root.DatasetPredictor.__init__", "header": "['class', 'DatasetPredictor', '(', 'object', ')', ':', '___EOS___']", "index": 136 }, { "content": " def get_result(self):\n \"\"\" A generator to produce prediction for each data\"\"\"\n with tqdm(total=self.ds.size()) as pbar:\n if self.nr_gpu == 1:\n for dp in self.ds.get_data():\n yield PredictResult(dp, self.func(dp))\n pbar.update()\n else:\n die_cnt = 0\n while True:\n res = self.result_queue.get()\n if res[0] != DIE:\n yield res[1]\n else:\n die_cnt += 1\n if die_cnt == self.nr_gpu:\n break\n pbar.update()\n self.inqueue_proc.join()\n self.inqueue_proc.terminate()\n for p in self.workers:\n p.join(); p.terminate()", "metadata": "root.DatasetPredictor.get_result", "header": "['class', 'DatasetPredictor', '(', 'object', ')', ':', '___EOS___']", "index": 164 }, { "content": " def get_all_result(self):\n \"\"\"\n Run over the dataset and return a list of all predictions.\n \"\"\"\n return list(self.get_result())", "metadata": "root.DatasetPredictor.get_all_result", "header": "['class', 'DatasetPredictor', '(', 'object', ')', ':', '___EOS___']", "index": 187 } ]
[ { "span": "import numpy as np", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 18 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "UT", "F", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "File", ":", " ", "predi", "ct", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Yu", "xin", " ", "Wu", " ", "<", "pp", "ww", "yy", "xx", "@", "gma", "il", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "tensorflow_", "as_", "tf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "namedtuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tqdm_", "import_", "tqdm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "six_", "._", "moves_", "import_", "zip_", ",_", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "multiprocessing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "utils_", "._", "concurrency", "_", "import_", "ensure", "\\u", "proc", "\\u", "terminate_", ",_", "Order", "ed", "Result", "Gather", "Proc_", ",_", "DI", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "tf", "utils_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "utils_", "import_", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "tf", "utils_", "._", "model", "utils_", "import_", "descri", "be", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "dataflow", "_", "import_", "Data", "Flow_", ",_", "Bat", "ch", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "dataflow", "_", "._", "dft", "ools_", "import_", "dataflow", "\\u", "to", "\\u", "process", "\\u", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "Predic", "t", "Config", "'_", ",_", "'", "Datas", "et", "Predictor", "'_", ",_", "'", "get", "\\u", "predi", "ct", "\\u", "func", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Predic", "t", "Result_", "=_", "namedtuple_", "(_", "'", "Predic", "t", "Result", "'_", ",_", "[_", "'", "input", "'_", ",_", "'", "output", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Predic", "t", "Config_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Predic", "t", "Config_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "config", " ", "used", " ", "by", " ", "`", "get", "\\u", "predi", "ct", "\\u", "func", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "session", "\\u", "config", ":", " ", "a", " ", "`", "tf", ".", "Config", "Proto", "`", " ", "instance", " ", "to", " ", "instantiate", " ", "the", " ", "session", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "session", "\\u", "init", ":", " ", "a", " ", "`", "util", "s", ".", "sess", "init", ".", "Sess", "ion", "Ini", "t", "`", " ", "instance", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "initialize", " ", "variab", "les", " ", "of", " ", "a", " ", "session", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "input", "\\u", "data\\u", "mapping", ":", " ", "Deci", "de", " ", "the", " ", "mapping", " ", "from", " ", "each", " ", "component", " ", "in", " ", "data", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "input", " ", "tensor", ",", " ", "sinc", "e", " ", "you", " ", "may", " ", "not", " ", "need", " ", "all", " ", "input", " ", "variab", "les", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "Model", " ", "to", " ", "run", " ", "the", " ", "graph", " ", "for", " ", "predicti", "on", " ", "(", "for", " ", "example", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "`", "label", "`", " ", "input", " ", "is", " ", "not", " ", "used", " ", "if", " ", "you", " ", "only", " ", "need", " ", "probabilit", "y", " ", "distribu", "tion", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "shou", "ld", " ", "be", " ", "a", " ", "list", " ", "of", " ", "int", " ", "with", " ", "length", " ", "equal", " ", "to", " ", "`", "len", "(", "data\\u", "point", ")`", ",", "\\", "10", ";", " ", " ", " ", " ", "where", " ", "each", " ", "element", " ", "in", " ", "the", " ", "list", " ", "defin", "es", " ", "whi", "ch", " ", "input", " ", "variab", "les", " ", "each", "\\", "10", ";", " ", " ", " ", " ", "component", " ", "in", " ", "the", " ", "data", " ", "point", " ", "shou", "ld", " ", "be", " ", "fed", " ", "int", "o", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "not", " ", "give", "n", ",", " ", "default", "s", " ", "to", " ", "range", "(", "len", "(", "input", "\\u", "vars", "))\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "example", ",", " ", "in", " ", "image", " ", "classificati", "on", " ", "task", ",", " ", "the", " ", "testi", "ng", "\\", "10", ";", " ", " ", " ", " ", "dataset", " ", "only", " ", "provide", "s", " ", "datapoints", " ", "of", " ", "images", " ", "(", "no", " ", "labels", ").", " ", "Whe", "n", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "input", " ", "variab", "les", " ", "of", " ", "the", " ", "model", " ", "is", ":", " ", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "input", "\\u", "vars", ":", " ", "[", "image", "\\u", "var", ",", " ", "label", "\\u", "var", "]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "mapping", " ", "shou", "ld", " ", "then", " ", "look", " ", "like", ":", " ", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "input", "\\u", "data\\u", "mapping", ":", " ", "[", "0", "]", " ", "#", " ", "the", " ", "first", " ", "component", " ", "in", " ", "a", " ", "datapoint", " ", "shou", "ld", " ", "map", " ", "to", " ", "`", "image", "\\u", "var", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "model", ":", " ", "a", " ", "`", "Model", "Des", "c", "`", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "output", "\\u", "var", "\\u", "names", ":", " ", "a", " ", "list", " ", "of", " ", "names", " ", "of", " ", "the", " ", "output", " ", "variab", "les", " ", "to", " ", "predi", "ct", ",", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "variab", "les", " ", "can", " ", "be", " ", "any", " ", "compu", "table", " ", "tensor", " ", "in", " ", "the", " ", "graph", ".", "\\", "10", ";", " ", " ", " ", " ", "Predic", "t", " ", "specific", " ", "output", " ", "mig", "ht", " ", "not", " ", "require", " ", "all", " ", "input", " ", "variab", "les", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "nr", "\\u", "gpu", ":", " ", "default", " ", "to", " ", "1", ".", " ", "Us", "e", " ", "CU", "DA", "\\u", "VISI", "BL", "E", "\\u", "DEVICES", " ", "to", " ", "control", " ", "whi", "ch", " ", "GPU", " ", "to", " ", "use", " ", "sep", "cif", "ical", "ly", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "assert", "\\u", "type_", "(_", "v_", ",_", "tp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "isinstance_", "(_", "v_", ",_", "tp_", ")_", ",_", "v_", "._", "\\u\\u", "class\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "session", "\\u", "config_", "=_", "kwargs_", "._", "pop_", "(_", "'", "session", "\\u", "config", "'_", ",_", "get", "\\u", "default", "\\u", "sess", "\\u", "config_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "type_", "(_", "self_", "._", "session", "\\u", "config_", ",_", "tf_", "._", "Config", "Proto_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "session", "\\u", "init_", "=_", "kwargs_", "._", "pop_", "(_", "'", "session", "\\u", "init", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "=_", "kwargs_", "._", "pop_", "(_", "'", "model", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "\\u", "data\\u", "mapping_", "=_", "kwargs_", "._", "pop_", "(_", "'", "input", "\\u", "data\\u", "mapping", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "var", "\\u", "names_", "=_", "kwargs_", "._", "pop_", "(_", "'", "output", "\\u", "var", "\\u", "names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nr", "\\u", "gpu_", "=_", "kwargs_", "._", "pop_", "(_", "'", "nr", "\\u", "gpu", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "kwargs_", ")_", "==_", "0_", ",_", "'", "Un", "know", "n", " ", "argu", "ment", "s", ":", " ", "{}'_", "._", "format_", "(_", "str_", "(_", "kwargs_", "._", "keys_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "predi", "ct", "\\u", "func_", "(_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "config", ":", " ", "a", " ", "`", "Predic", "t", "Config", "`", " ", "instance", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "A", " ", "predicti", "on", " ", "function", " ", "tha", "t", " ", "take", "s", " ", "a", " ", "list", " ", "of", " ", "input", " ", "values", ",", " ", "and", " ", "return", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "list", " ", "of", " ", "output", " ", "values", " ", "defin", "ed", " ", "in", " ", "``", "config", ".", "output", "\\u", "var", "\\u", "names", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "var", "\\u", "names_", "=_", "config_", "._", "output", "\\u", "var", "\\u", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "input", "/", "output", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "vars_", "=_", "config_", "._", "model_", "._", "get", "\\u", "input", "\\u", "vars_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost", "\\u", "var_", "=_", "config_", "._", "model_", "._", "get", "\\u", "cost_", "(_", "input", "\\u", "vars_", ",_", "is", "\\u", "training_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "config_", "._", "input", "\\u", "data\\u", "mapping_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "\\u", "map_", "=_", "input", "\\u", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "\\u", "map_", "=_", "[_", "input", "\\u", "vars_", "[_", "k_", "]_", "for_", "k_", "in_", "config_", "._", "input", "\\u", "data\\u", "mapping_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "output", "\\u", "var", "\\u", "names", " ", "against", " ", "output", "\\u", "vars_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output", "\\u", "vars_", "=_", "[_", "tf_", "._", "get", "\\u", "default", "\\u", "graph_", "(_", ")_", "._", "get", "\\u", "tensor", "\\u", "by", "\\u", "name_", "(_", "get", "\\u", "op", "\\u", "var", "\\u", "name_", "(_", "n_", ")_", "[_", "1_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "n_", "in_", "output", "\\u", "var", "\\u", "names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sess_", "=_", "tf_", "._", "Session_", "(_", "config_", "=_", "config_", "._", "session", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "._", "session", "\\u", "init_", "._", "init_", "(_", "sess_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run", "\\u", "input_", "(_", "dp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "len_", "(_", "input", "\\u", "map_", ")_", "==_", "len_", "(_", "dp_", ")_", ",_", "\"", "Graph", " ", "has", " ", "{}", " ", "inputs", " ", "but", " ", "dataset", " ", "only", " ", "give", "s", " ", "{}", " ", "component", "s", "!\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "input", "\\u", "map_", ")_", ",_", "len_", "(_", "dp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feed_", "=_", "dict_", "(_", "zip_", "(_", "input", "\\u", "map_", ",_", "dp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sess_", "._", "run_", "(_", "output", "\\u", "vars_", ",_", "feed", "\\u", "dict_", "=_", "feed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "run", "\\u", "input_", "\\u\\u\\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_", "Predic", "t", "Worker_", "(_", "multiprocessing_", "._", "Process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "A", " ", "worker", " ", "process", " ", "to", " ", "run", " ", "predictor", " ", "on", " ", "one", " ", "GPU", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Predic", "t", "Worker_", "(_", "multiprocessing_", "._", "Process_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "idx_", ",_", "gpu", "id_", ",_", "inqu", "eu", "e_", ",_", "out", "queue_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "idx", ":", " ", "index", " ", "of", " ", "the", " ", "worker", ".", " ", "the", " ", "0", "th", " ", "worker", " ", "will", " ", "print", " ", "log", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "gpu", "id", ":", " ", "id", " ", "of", " ", "the", " ", "GPU", " ", "to", " ", "be", " ", "used", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "inqu", "eu", "e", ":", " ", "input", " ", "queue", " ", "to", " ", "get", " ", "data", " ", "point", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "out", "queue", ":", " ", "output", " ", "queue", " ", "put", " ", "result", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "config", ":", " ", "a", " ", "`", "Predic", "t", "Config", "`", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Predic", "t", "Worker_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gpu", "id_", "=_", "gpu", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "inqu", "eu", "e_", "=_", "inqu", "eu", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "out", "queue_", "=_", "out", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "=_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Predic", "t", "Worker_", "(_", "multiprocessing_", "._", "Process_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "environ_", "[_", "'", "CU", "DA", "\\u", "VISI", "BL", "E", "\\u", "DEVICES", "'_", "]_", "=_", "self_", "._", "gpu", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "=_", "tf_", "._", "Graph_", "(_", ")_", "#", " ", "build", " ", "a", " ", "graph", " ", "for", " ", "each", " ", "process", ",", " ", "bec", "aus", "e", " ", "the", "y", " ", "don", "'", "t", " ", "need", " ", "to", " ", "share", " ", "anyt", "hing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "G_", "._", "as", "\\u", "default_", "(_", ")_", ",_", "tf_", "._", "device_", "(_", "'/", "gpu", ":", "0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "func_", "=_", "get", "\\u", "predi", "ct", "\\u", "func_", "(_", "self_", "._", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "idx_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descri", "be", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tid_", ",_", "dp_", "=_", "self_", "._", "inqu", "eu", "e_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tid_", "==_", "DI", "E_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "out", "queue_", "._", "put_", "(_", "(_", "DI", "E_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "Predic", "t", "Result_", "(_", "dp_", ",_", "self_", "._", "func_", "(_", "dp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "out", "queue_", "._", "put_", "(_", "(_", "tid_", ",_", "res_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Datas", "et", "Predictor", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "the", " ", "predi", "ct", "\\u", "config", " ", "on", " ", "a", " ", "give", "n", " ", "`", "Data", "Flow", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Datas", "et", "Predictor", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "config_", ",_", "dataset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "config", ":", " ", "a", " ", "`", "Predic", "t", "Config", "`", " ", "instance", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "dataset", ":", " ", "a", " ", "`", "Data", "Flow", "`", " ", "instance", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "dataset_", ",_", "Data", "Flow_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ds_", "=_", "dataset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nr", "\\u", "gpu_", "=_", "config_", "._", "nr", "\\u", "gpu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "nr", "\\u", "gpu_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "inqu", "eu", "e_", ",_", "self_", "._", "inqu", "eu", "e\\u", "proc_", "=_", "dataflow", "\\u", "to", "\\u", "process", "\\u", "queue_", "(_", "self_", "._", "ds_", ",_", "10_", ",_", "self_", "._", "nr", "\\u", "gpu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "out", "queue_", "=_", "multiprocessing_", "._", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gpus_", "=_", "os_", "._", "environ_", "[_", "'", "CU", "DA", "\\u", "VISI", "BL", "E", "\\u", "DEVICES", "'_", "]_", "._", "split_", "(_", "','_", ")_", "\\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 ", " _", "gpus_", "=_", "list_", "(_", "range_", "(_", "self_", "._", "nr", "\\u", "gpu_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "workers_", "=_", "[_", "Predic", "t", "Worker_", "(_", "i_", ",_", "gpus_", "[_", "i_", "]_", ",_", "self_", "._", "inqu", "eu", "e_", ",_", "self_", "._", "out", "queue_", ",_", "config_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "nr", "\\u", "gpu_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "result", "\\u", "queue_", "=_", "Order", "ed", "Result", "Gather", "Proc_", "(_", "self_", "._", "out", "queue_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "setup", " ", "all", " ", "the", " ", "procs_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "inqu", "eu", "e\\u", "proc_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "self_", "._", "workers_", ":_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "result", "\\u", "queue_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensure", "\\u", "proc", "\\u", "terminate_", "(_", "self_", "._", "workers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensure", "\\u", "proc", "\\u", "terminate_", "(_", "[_", "self_", "._", "result", "\\u", "queue_", ",_", "self_", "._", "inqu", "eu", "e\\u", "proc_", "]_", ")_", "\\u\\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_", "._", "func_", "=_", "get", "\\u", "predi", "ct", "\\u", "func_", "(_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Datas", "et", "Predictor", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "A", " ", "generat", "or", " ", "to", " ", "produce", " ", "predicti", "on", " ", "for", " ", "each", " ", "data", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "tqdm_", "(_", "total_", "=_", "self_", "._", "ds_", "._", "size_", "(_", ")_", ")_", "as_", "pbar_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "nr", "\\u", "gpu_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "dp_", "in_", "self_", "._", "ds_", "._", "get", "\\u", "data_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "Predic", "t", "Result_", "(_", "dp_", ",_", "self_", "._", "func_", "(_", "dp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pbar_", "._", "update_", "(_", ")_", "\\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 ", " _", "die", "\\u", "cnt_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "res_", "=_", "self_", "._", "result", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "[_", "0_", "]_", "!=_", "DI", "E_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "yield_", "res_", "[_", "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 ", " ", " _", "die", "\\u", "cnt_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "die", "\\u", "cnt_", "==_", "self_", "._", "nr", "\\u", "gpu_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pbar_", "._", "update_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "inqu", "eu", "e\\u", "proc_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "inqu", "eu", "e\\u", "proc_", "._", "terminate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "self_", "._", "workers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "p_", "._", "join_", "(_", ")_", ";_", "p_", "._", "terminate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Datas", "et", "Predictor", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "all", "\\u", "result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "over", " ", "the", " ", "dataset", " ", "and", " ", "return", " ", "a", " ", "list", " ", "of", " ", "all", " ", "predicti", "ons", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "list_", "(_", "self_", "._", "get", "\\u", "result_", "(_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
Infinidat/gitpy/tests/test_branching.py
[ { "content": " def testBranching(self):\n branch_name = 'some_branch'\n branch = self.repo.createBranch(branch_name)\n self.assertTrue(branch in self.repo.getBranches())\n self.assertEquals(branch.name, branch_name)\n self.assertEquals(branch.getHead(), self.repo.getHead())\n return branch", "metadata": "root.TestBranching.testBranching", "header": "['class', 'TestBranching', '(', 'CommittedRepositoryTest', ')', ':', '___EOS___']", "index": 8 }, { "content": " def testMerging1(self):\n branch = self.testBranchingAndCommitting()\n prev_head = self.repo.getHead()\n self.repo.merge(branch)\n self.assertNotEquals(self.repo.getHead(), branch.getHead())\n self.assertTrue(branch.getHead() in self.repo.getHead().getParents())", "metadata": "root.TestBranching.testMerging1", "header": "['class', 'TestBranching', '(', 'CommittedRepositoryTest', ')', ':', '___EOS___']", "index": 29 }, { "content": " def testMerging2(self):\n branch = self.testBranching()\n self.repo.checkout(branch)\n self.commitSomeChange()\n master_branch = [b for b in self.repo.getBranches() if b.name == 'master'][0]\n self.assertNotEquals(branch.getHead(), master_branch.getHead())\n self.repo.checkout(master_branch)\n self.assertEquals(self.repo.getHead(), master_branch.getHead())\n self.assertNotEquals(self.repo.getHead(), branch.getHead())\n self.assertTrue(self.repo.getHead() in branch.getHead().getParents())\n self.repo.merge(branch)\n self.assertEquals(self.repo.getHead(), branch.getHead())", "metadata": "root.TestBranching.testMerging2", "header": "['class', 'TestBranching', '(', 'CommittedRepositoryTest', ')', ':', '___EOS___']", "index": 35 } ]
[ { "span": "self.assertTrue(branch in self.repo.getBranches())", "start_line": 11, "start_column": 8, "end_line": 11, "end_column": 58 }, { "span": "self.assertTrue(branch.getHead() in self.repo.getHead().getParents())", "start_line": 34, "start_column": 8, "end_line": 34, "end_column": 77 }, { "span": "self.assertTrue(self.repo.getHead() in branch.getHead().getParents())", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 77 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Branc", "hing_", "(_", "Committe", "d", "Repos", "itor", "y", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Branc", "hing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "branch", "\\u", "name_", "=_", "'", "some", "\\u", "branch", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "=_", "self_", "._", "repo_", "._", "create", "Branch_", "(_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "branch_", "in_", "self_", "._", "repo_", "._", "get", "Branc", "hes", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "branch_", "._", "name_", ",_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "branch_", "._", "get", "Head_", "(_", ")_", ",_", "self_", "._", "repo_", "._", "get", "Head_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "branch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Branc", "hing_", "(_", "Committe", "d", "Repos", "itor", "y", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Mer", "ging", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "branch_", "=_", "self_", "._", "test", "Branc", "hing", "And", "Commi", "tting", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "head_", "=_", "self_", "._", "repo_", "._", "get", "Head_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repo_", "._", "merge_", "(_", "branch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equals_", "(_", "self_", "._", "repo_", "._", "get", "Head_", "(_", ")_", ",_", "branch_", "._", "get", "Head_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "branch_", "._", "get", "Head_", "(_", ")_", "in_", "self_", "._", "repo_", "._", "get", "Head_", "(_", ")_", "._", "get", "Parent", "s_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Branc", "hing_", "(_", "Committe", "d", "Repos", "itor", "y", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Mer", "ging", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "branch_", "=_", "self_", "._", "test", "Branc", "hing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repo_", "._", "checkout_", "(_", "branch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "commit", "Some", "Change_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "master", "\\u", "branch_", "=_", "[_", "b_", "for_", "b_", "in_", "self_", "._", "repo_", "._", "get", "Branc", "hes", "_", "(_", ")_", "if_", "b_", "._", "name_", "==_", "'", "master", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equals_", "(_", "branch_", "._", "get", "Head_", "(_", ")_", ",_", "master", "\\u", "branch_", "._", "get", "Head_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repo_", "._", "checkout_", "(_", "master", "\\u", "branch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "repo_", "._", "get", "Head_", "(_", ")_", ",_", "master", "\\u", "branch_", "._", "get", "Head_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equals_", "(_", "self_", "._", "repo_", "._", "get", "Head_", "(_", ")_", ",_", "branch_", "._", "get", "Head_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "repo_", "._", "get", "Head_", "(_", ")_", "in_", "branch_", "._", "get", "Head_", "(_", ")_", "._", "get", "Parent", "s_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repo_", "._", "merge_", "(_", "branch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "repo_", "._", "get", "Head_", "(_", ")_", ",_", "branch_", "._", "get", "Head_", "(_", ")_", ")_", "\\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, 0, 1, 1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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Non-standard exception raised in special method
daler/metaseq/metaseq/filetype_adapters.py
[ { "content": " def __getitem__(self, key):\n raise ValueError('Subclasses must define __getitem__')", "metadata": "root.BaseAdapter.__getitem__", "header": "['class', 'BaseAdapter', '(', 'object', ')', ':', '___EOS___']", "index": 37 } ]
[ { "span": "def __getitem__(self, key):", "start_line": 37, "start_column": 4, "end_line": 37, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Non", "_", "-_", "standard_", "exception_", "raised_", "in_", "special_", "method_", "[SEP]_", "class_", "Base", "Adapter_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Subc", "lasse", "s", " ", "must", " ", "defin", "e", " ", "\\u\\u", "getitem", "\\u\\u'_", ")_", "\\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, 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 ]
Unnecessary pass
rizar/attention-lvcsr/libs/Theano/theano/sandbox/gpuarray/opt.py
[ { "content": " def apply(self, fgraph):\n for input in fgraph.inputs:\n if isinstance(input.type, GpuArrayType):\n continue\n\n # If all clients are outputs or transfers don't do anything.\n if (all(cl[0] == 'output' or isinstance(cl[0].op, GpuFromHost)\n for cl in input.clients)):\n continue\n\n target = getattr(input.tag, 'target', None)\n if target == 'cpu':\n continue\n\n try:\n new_input = host_from_gpu(GpuFromHost(target)(input))\n fgraph.replace_validate(input, new_input,\n \"InputToGpuOptimizer\")\n except TypeError:\n # This could fail if the inputs are not TensorTypes\n pass\n except ContextNotDefined:\n if hasattr(input.tag, 'target'):\n raise\n # If there is no context tag and no default context\n # then it stays on the CPU\n pass", "metadata": "root.InputToGpuOptimizer.apply", "header": "['class', 'InputToGpuOptimizer', '(', 'Optimizer', ')', ':', '___EOS___']", "index": 164 } ]
[ { "span": "pass", "start_line": 190, "start_column": 16, "end_line": 190, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Inp", "ut", "To", "Gp", "u", "Optimizer_", "(_", "Optimizer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "apply_", "(_", "self_", ",_", "fg", "raph_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "input_", "in_", "fg", "raph_", "._", "inputs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "input_", "._", "type_", ",_", "Gp", "u", "Array", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "all", " ", "clients", " ", "are", " ", "output", "s", " ", "or", " ", "transfers", " ", "don", "'", "t", " ", "do", " ", "anyt", "hing", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "all_", "(_", "cl_", "[_", "0_", "]_", "==_", "'", "output", "'_", "or_", "isinstance_", "(_", "cl_", "[_", "0_", "]_", "._", "op_", ",_", "Gp", "u", "Fro", "m", "Host_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "cl_", "in_", "input_", "._", "clients_", ")_", ")_", ":_", "\\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_", "target_", "=_", "getattr_", "(_", "input_", "._", "tag_", ",_", "'", "target", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "target_", "==_", "'", "cpu", "'_", ":_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "input_", "=_", "host", "\\u", "from", "\\u", "gpu_", "(_", "Gp", "u", "Fro", "m", "Host_", "(_", "target_", ")_", "(_", "input_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fg", "raph_", "._", "replace", "\\u", "validate_", "(_", "input_", ",_", "new", "\\u", "input_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Inp", "ut", "To", "Gp", "u", "Optimize", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "coul", "d", " ", "fail", " ", "if", " ", "the", " ", "inputs", " ", "are", " ", "not", " ", "Tensor", "Types_", "\\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_", "except_", "Context", "Not", "Define", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "input_", "._", "tag_", ",_", "'", "target", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "there", " ", "is", " ", "no", " ", "context", " ", "tag", " ", "and", " ", "no", " ", "default", " ", "context_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "it", " ", "stay", "s", " ", "on", " ", "the", " ", "CPU_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
benadida/helios-server/helios/models.py
[ { "content": "def unicode_csv_reader(unicode_csv_data, dialect=csv.excel, **kwargs):\n # csv.py doesn't do Unicode; encode temporarily as UTF-8:\n csv_reader = csv.reader(utf_8_encoder(unicode_csv_data),\n dialect=dialect, **kwargs)\n for row in csv_reader:\n # decode UTF-8 back to Unicode, cell by cell:\n try:\n yield [unicode(cell, 'utf-8') for cell in row]\n except:\n yield [unicode(cell, 'latin-1') for cell in row] ", "metadata": "root.unicode_csv_reader", "header": "['module', '___EOS___']", "index": 652 }, { "content": " @classmethod\n def get_by_election_and_uuid(cls, election, uuid):\n query = cls.objects.filter(election = election, uuid = uuid)\n\n try:\n return query[0]\n except:\n return None", "metadata": "root.Voter.get_by_election_and_uuid", "header": "['class', 'Voter', '(', 'HeliosModel', ')', ':', '___EOS___']", "index": 872 }, { "content": " @property\n def voter_id_hash(self):\n if self.voter_login_id:\n # for backwards compatibility with v3.0, and since it doesn't matter\n # too much if we hash the email or the unique login ID here.\n value_to_hash = self.voter_login_id\n else:\n value_to_hash = self.voter_id\n\n try:\n return utils.hash_b64(value_to_hash)\n except:\n try:\n return utils.hash_b64(value_to_hash.encode('latin-1'))\n except:\n return utils.hash_b64(value_to_hash.encode('utf-8')) ", "metadata": "root.Voter.voter_id_hash", "header": "['class', 'Voter', '(', 'HeliosModel', ')', ':', '___EOS___']", "index": 911 } ]
[ { "span": "except:", "start_line": 660, "start_column": 6, "end_line": 660, "end_column": 13 }, { "span": "except:", "start_line": 878, "start_column": 4, "end_line": 878, "end_column": 11 }, { "span": "except:", "start_line": 922, "start_column": 4, "end_line": 922, "end_column": 11 }, { "span": "except:", "start_line": 925, "start_column": 6, "end_line": 925, "end_column": 13 } ]
[]
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_", "unicode", "\\u", "csv", "\\u", "reader_", "(_", "unicode", "\\u", "csv", "\\u", "data_", ",_", "dialect_", "=_", "csv_", "._", "excel_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "csv", ".", "py", " ", "doe", "sn", "'", "t", " ", "do", " ", "Unic", "ode", ";", " ", "encode", " ", "temporar", "il", "y", " ", "as", " ", "UT", "F", "-", "8", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csv", "\\u", "reader_", "=_", "csv_", "._", "reader_", "(_", "utf", "\\u", "8", "\\u", "encoder_", "(_", "unicode", "\\u", "csv", "\\u", "data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dialect_", "=_", "dialect_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "csv", "\\u", "reader_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "decode", " ", "UT", "F", "-", "8", " ", "back", " ", "to", " ", "Unic", "ode", ",", " ", "cell", " ", "by", " ", "cell", ":_", "\\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 ", " _", "yield_", "[_", "unicode_", "(_", "cell_", ",_", "'", "utf", "-", "8", "'_", ")_", "for_", "cell_", "in_", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "[_", "unicode_", "(_", "cell_", ",_", "'", "latin", "-1", "'_", ")_", "for_", "cell_", "in_", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vote", "r_", "(_", "Heli", "os", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "by", "\\u", "election", "\\u", "and", "\\u", "uuid_", "(_", "cls_", ",_", "election_", ",_", "uuid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "cls_", "._", "objects_", "._", "filter_", "(_", "election_", "=_", "election_", ",_", "uuid_", "=_", "uuid_", ")_", "\\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 ", " _", "return_", "query_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vote", "r_", "(_", "Heli", "os", "Model_", ")_", ":_", "\\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_", "voter", "\\u", "id", "\\u", "hash_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "voter", "\\u", "login", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "back", "ward", "s", " ", "compatibility", " ", "with", " ", "v", "3.0", ",", " ", "and", " ", "sinc", "e", " ", "it", " ", "doe", "sn", "'", "t", " ", "matte", "r_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "too", " ", "muc", "h", " ", "if", " ", "we", " ", "hash", " ", "the", " ", "email", " ", "or", " ", "the", " ", "unique", " ", "login", " ", "ID", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value", "\\u", "to", "\\u", "hash_", "=_", "self_", "._", "voter", "\\u", "login", "\\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 ", " _", "value", "\\u", "to", "\\u", "hash_", "=_", "self_", "._", "voter", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "utils_", "._", "hash", "\\u", "b64", "_", "(_", "value", "\\u", "to", "\\u", "hash_", ")_", "\\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 ", " _", "return_", "utils_", "._", "hash", "\\u", "b64", "_", "(_", "value", "\\u", "to", "\\u", "hash_", "._", "encode_", "(_", "'", "latin", "-1", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "utils_", "._", "hash", "\\u", "b64", "_", "(_", "value", "\\u", "to", "\\u", "hash_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\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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/py-academicstoday/academicstoday_project/landpage/tests/test_google.py
[ { "content": "from django.core.urlresolvers import resolve\nfrom django.http import HttpRequest\nfrom django.http import QueryDict\nfrom django.test import TestCase\nfrom django.test import Client\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth import authenticate, login, logout\nfrom landpage.views import google\nimport json\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class GoogleVerifyTest(TestCase):\n \"\"\"\n python manage.py test landpage.tests.test_google\n \"\"\"\n \n \n", "metadata": "root.GoogleVerifyTest", "header": "['module', '___EOS___']", "index": 11 }, { "content": " def tearDown(self):\n pass", "metadata": "root.GoogleVerifyTest.tearDown", "header": "['class', 'GoogleVerifyTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 15 }, { "content": " def setUp(self):\n pass", "metadata": "root.GoogleVerifyTest.setUp", "header": "['class', 'GoogleVerifyTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 18 }, { "content": " def test_url_resolves_to_google_verify_page_view(self):\n found = resolve('/googlee81f1c16590924d1.html')\n self.assertEqual(found.func,google.google_verify_page)", "metadata": "root.GoogleVerifyTest.test_url_resolves_to_google_verify_page_view", "header": "['class', 'GoogleVerifyTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 21 }, { "content": " def test_google_verify_page_returns_correct_html(self):\n client = Client()\n response = client.post(\n '/googlee81f1c16590924d1.html',\n )\n self.assertEqual(response.status_code, 200)\n self.assertIn(b'googlee81f1c16590924d1.html',response.content)", "metadata": "root.GoogleVerifyTest.test_google_verify_page_returns_correct_html", "header": "['class', 'GoogleVerifyTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 25 } ]
[ { "span": "from django.http import HttpRequest", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 35 }, { "span": "from django.http import QueryDict", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 33 }, { "span": "from django.contrib.auth.models import User", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 43 }, { "span": "from django.contrib.auth import authenticate, login, logout", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 59 }, { "span": "import json", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "resolve_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Query", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "authenticate_", ",_", "login_", ",_", "logout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "land", "page_", "._", "views_", "import_", "google_", "\\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\\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_", "Goo", "gle", "Verify", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "python", " ", "manage", ".", "py", " ", "test", " ", "land", "page", ".", "tests", ".", "test\\u", "google", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Goo", "gle", "Verify", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Goo", "gle", "Verify", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Goo", "gle", "Verify", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "url", "\\u", "resolve", "s", "\\u", "to", "\\u", "google", "\\u", "verify", "\\u", "page", "\\u", "view_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "=_", "resolve_", "(_", "'/", "google", "e8", "1f", "1c", "165", "909", "24", "d1", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "found_", "._", "func_", ",_", "google_", "._", "google", "\\u", "verify", "\\u", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Goo", "gle", "Verify", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "google", "\\u", "verify", "\\u", "page", "\\u", "return", "s", "\\u", "correct", "\\u", "html_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "google", "e8", "1f", "1c", "165", "909", "24", "d1", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "b", "'", "google", "e8", "1f", "1c", "165", "909", "24", "d1", ".", "html", "'_", ",_", "response_", "._", "content_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
Impactstory/total-impact-core/test/unit_tests/providers/test_publons.py
[ { "content": "from test.unit_tests.providers import common\nfrom test.unit_tests.providers.common import ProviderTestCase\nfrom totalimpact.providers.provider import Provider, ProviderContentMalformedError\nfrom totalimpact.providers import provider\nfrom test.utils import http\n\nimport os\nimport collections\nfrom nose.tools import assert_equals, assert_items_equal, raises\n\ndatadir = os.path.join(os.path.split(__file__)[0], \"../../../extras/sample_provider_pages/publons\")\nSAMPLE_EXTRACT_METRICS_PAGE = os.path.join(datadir, \"metrics\")\nSAMPLE_EXTRACT_ALIASES_PAGE = os.path.join(datadir, \"aliases\")\nSAMPLE_EXTRACT_MEMBER_ITEMS_PAGE = os.path.join(datadir, \"members\")\nSAMPLE_EXTRACT_BIBLIO_PAGE = os.path.join(datadir, \"biblio\")\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestPublons(ProviderTestCase):\n\n provider_name = \"publons\"\n\n testitem_members = \"https://publons.com/author/13201/iain-hrynaszkiewicz\"\n testitem_metrics = (\"url\", \"https://publons.com/review/182/\")\n testitem_aliases = (\"url\", \"https://publons.com/review/182/\")\n testitem_biblio = (\"url\", \"https://publons.com/review/182/\")\n\n\n \n\n\n\n\n\n", "metadata": "root.TestPublons", "header": "['module', '___EOS___']", "index": 16 }, { "content": " def setUp(self):\n ProviderTestCase.setUp(self) ", "metadata": "root.TestPublons.setUp", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 25 }, { "content": " def test_is_relevant_alias(self):\n # ensure that it matches an appropriate ids\n assert_equals(self.provider.is_relevant_alias(self.testitem_aliases), True)\n\n assert_equals(self.provider.is_relevant_alias((\"doi\", \"NOT A PUBLONS ID\")), False)", "metadata": "root.TestPublons.test_is_relevant_alias", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 28 }, { "content": " def test_extract_metrics_success(self):\n f = open(SAMPLE_EXTRACT_METRICS_PAGE, \"r\")\n metrics_dict = self.provider._extract_metrics(f.read())\n print metrics_dict\n assert_equals(metrics_dict[\"publons:views\"], 13)", "metadata": "root.TestPublons.test_extract_metrics_success", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 34 }, { "content": " def test_extract_members_success(self): \n f = open(SAMPLE_EXTRACT_MEMBER_ITEMS_PAGE, \"r\")\n members = self.provider._extract_members(f.read(), self.testitem_members)\n expected = [('url', 'https://publons.com/r/182/')]\n assert_equals(expected, members)", "metadata": "root.TestPublons.test_extract_members_success", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 40 }, { "content": " def test_provenance_url(self):\n provenance_url = self.provider.provenance_url(\"publons:views\", [self.testitem_aliases])\n assert_equals(provenance_url, \"https://publons.com/review/182/\")", "metadata": "root.TestPublons.test_provenance_url", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 46 }, { "content": " @http\n def test_metrics(self):\n metrics_dict = self.provider.metrics([self.testitem_metrics])\n print metrics_dict\n expected = {'publons:views': (13, 'https://publons.com/review/182/')}\n for key in expected:\n assert metrics_dict[key][0] >= expected[key][0], [key, metrics_dict[key], expected[key]]\n assert metrics_dict[key][1] == expected[key][1], [key, metrics_dict[key], expected[key]]", "metadata": "root.TestPublons.test_metrics", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": " @http\n def test_aliases(self):\n aliases = self.provider.aliases([self.testitem_aliases])\n print aliases\n expected = [('doi', u'10.7287/peerj.175v0.1/reviews/2')]\n assert_equals(expected, aliases)", "metadata": "root.TestPublons.test_aliases", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 59 }, { "content": " @http\n def test_biblio(self):\n biblio_dict = self.provider.biblio([self.testitem_biblio])\n print biblio_dict\n expected = {'create_date': u'2013-04-28', 'authors': u'Hrynaszkiewicz', 'repository': 'Publons', 'title': u'Data reuse and the open data citation advantage', 'journal': u'PeerJ', 'genre': 'peer review', 'year': u'2013', 'review_type': u'Pre Publication', 'review_url': u'https://peerj.com/articles/175v0.1/reviews/2/'}\n assert_items_equal(biblio_dict.keys(), expected.keys())\n for key in [\"authors\", \"title\", \"create_date\", \"year\"]:\n assert_equals(biblio_dict[key], expected[key])", "metadata": "root.TestPublons.test_biblio", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 66 }, { "content": " @http\n def test_members(self):\n members = self.provider.member_items(self.testitem_members)\n print members\n expected = [('url', 'https://publons.com/r/182/')]\n for member in expected:\n assert(member in members)", "metadata": "root.TestPublons.test_members", "header": "['class', 'TestPublons', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 75 } ]
[ { "span": "from test.unit_tests.providers import common", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 44 }, { "span": "from totalimpact.providers.provider import Provider, ProviderContentMalformedError", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 82 }, { "span": "from totalimpact.providers import provider", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 42 }, { "span": "import collections", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 18 }, { "span": "from nose.tools import assert_equals, assert_items_equal, raises", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 64 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "test_", "._", "unit", "\\u", "tests_", "._", "providers_", "import_", "common_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "._", "unit", "\\u", "tests_", "._", "providers_", "._", "common_", "import_", "Provider", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "total", "impact", "_", "._", "providers_", "._", "provider_", "import_", "Provider_", ",_", "Provider", "Conten", "t", "Mal", "formed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "total", "impact", "_", "._", "providers_", "import_", "provider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "._", "utils_", "import_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "assert", "\\u", "equals_", ",_", "assert", "\\u", "items", "\\u", "equal_", ",_", "raises_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datadir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "split_", "(_", "\\u\\u", "file\\u\\u_", ")_", "[_", "0_", "]_", ",_", "\"../..", "/../", "extra", "s", "/", "sample", "\\u", "provide", "r", "\\u", "page", "s", "/", "pub", "lon", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "\\u", "EXTRACT", "\\u", "METRICS", "\\u", "PAGE_", "=_", "os_", "._", "path_", "._", "join_", "(_", "datadir_", ",_", "\"", "metric", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "\\u", "EXTRACT", "\\u", "ALIAS", "ES", "\\u", "PAGE_", "=_", "os_", "._", "path_", "._", "join_", "(_", "datadir_", ",_", "\"", "alias", "es", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "\\u", "EXTRACT", "\\u", "MEMBER", "\\u", "ITEM", "S", "\\u", "PAGE_", "=_", "os_", "._", "path_", "._", "join_", "(_", "datadir_", ",_", "\"", "member", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "\\u", "EXTRACT", "\\u", "BIB", "LI", "O", "\\u", "PAGE_", "=_", "os_", "._", "path_", "._", "join_", "(_", "datadir_", ",_", "\"", "biblio", "\"_", ")_", "\\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_", "Test", "Pub", "lons_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "provide", "r", "\\u", "name_", "=_", "\"", "pub", "lon", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "testi", "tem", "\\u", "members_", "=_", "\"", "https", "://", "pub", "lon", "s", ".", "com", "/", "author", "/", "132", "01", "/", "ia", "in", "-", "hr", "yna", "sz", "kie", "wic", "z", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testi", "tem", "\\u", "metrics_", "=_", "(_", "\"", "url", "\"_", ",_", "\"", "https", "://", "pub", "lon", "s", ".", "com", "/", "review", "/", "182", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testi", "tem", "\\u", "aliases_", "=_", "(_", "\"", "url", "\"_", ",_", "\"", "https", "://", "pub", "lon", "s", ".", "com", "/", "review", "/", "182", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testi", "tem", "\\u", "biblio", "_", "=_", "(_", "\"", "url", "\"_", ",_", "\"", "https", "://", "pub", "lon", "s", ".", "com", "/", "review", "/", "182", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Pub", "lons_", "(_", "Provider", "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 ", " _", "Provider", "Test", "Case_", "._", "set", "Up_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pub", "lons_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "is", "\\u", "rele", "van", "t", "\\u", "alias_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ensure", " ", "tha", "t", " ", "it", " ", "matche", "s", " ", "an", " ", "appropr", "iate", " ", "ids_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert", "\\u", "equals_", "(_", "self_", "._", "provider_", "._", "is", "\\u", "rele", "van", "t", "\\u", "alias_", "(_", "self_", "._", "testi", "tem", "\\u", "aliases_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "self_", "._", "provider_", "._", "is", "\\u", "rele", "van", "t", "\\u", "alias_", "(_", "(_", "\"", "doi", "\"_", ",_", "\"", "NOT", " ", "A", " ", "PUB", "LON", "S", " ", "ID", "\"_", ")_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pub", "lons_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "extract", "\\u", "metric", "s", "\\u", "success_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "SAMPLE", "\\u", "EXTRACT", "\\u", "METRICS", "\\u", "PAGE_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metric", "s", "\\u", "dict_", "=_", "self_", "._", "provider_", "._", "\\u", "extract", "\\u", "metrics_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "metric", "s", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "metric", "s", "\\u", "dict_", "[_", "\"", "pub", "lon", "s", ":", "views", "\"_", "]_", ",_", "13_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pub", "lons_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "extract", "\\u", "member", "s", "\\u", "success_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "SAMPLE", "\\u", "EXTRACT", "\\u", "MEMBER", "\\u", "ITEM", "S", "\\u", "PAGE_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "members_", "=_", "self_", "._", "provider_", "._", "\\u", "extract", "\\u", "members_", "(_", "f_", "._", "read_", "(_", ")_", ",_", "self_", "._", "testi", "tem", "\\u", "members_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "(_", "'", "url", "'_", ",_", "'", "https", "://", "pub", "lon", "s", ".", "com", "/", "r", "/", "182", "/'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "expected_", ",_", "members_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pub", "lons_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provenance", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "provenance", "\\u", "url_", "=_", "self_", "._", "provider_", "._", "provenance", "\\u", "url_", "(_", "\"", "pub", "lon", "s", ":", "views", "\"_", ",_", "[_", "self_", "._", "testi", "tem", "\\u", "aliases_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "provenance", "\\u", "url_", ",_", "\"", "https", "://", "pub", "lon", "s", ".", "com", "/", "review", "/", "182", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pub", "lons_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "metrics_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "metric", "s", "\\u", "dict_", "=_", "self_", "._", "provider_", "._", "metrics_", "(_", "[_", "self_", "._", "testi", "tem", "\\u", "metrics_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "metric", "s", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "'", "pub", "lon", "s", ":", "views", "'_", ":_", "(_", "13_", ",_", "'", "https", "://", "pub", "lon", "s", ".", "com", "/", "review", "/", "182", "/'_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "expected_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "metric", "s", "\\u", "dict_", "[_", "key_", "]_", "[_", "0_", "]_", ">=_", "expected_", "[_", "key_", "]_", "[_", "0_", "]_", ",_", "[_", "key_", ",_", "metric", "s", "\\u", "dict_", "[_", "key_", "]_", ",_", "expected_", "[_", "key_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "metric", "s", "\\u", "dict_", "[_", "key_", "]_", "[_", "1_", "]_", "==_", "expected_", "[_", "key_", "]_", "[_", "1_", "]_", ",_", "[_", "key_", ",_", "metric", "s", "\\u", "dict_", "[_", "key_", "]_", ",_", "expected_", "[_", "key_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pub", "lons_", "(_", "Provider", "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_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "aliases_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "aliases_", "=_", "self_", "._", "provider_", "._", "aliases_", "(_", "[_", "self_", "._", "testi", "tem", "\\u", "aliases_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "aliases_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "(_", "'", "doi", "'_", ",_", "u", "'", "10.", "728", "7", "/", "peer", "j", ".1", "7", "5", "v", "0.", "1", "/", "review", "s", "/", "2", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "expected_", ",_", "aliases_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pub", "lons_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "biblio", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "biblio", "\\u", "dict_", "=_", "self_", "._", "provider_", "._", "biblio", "_", "(_", "[_", "self_", "._", "testi", "tem", "\\u", "biblio", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "biblio", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "'", "create", "\\u", "date", "'_", ":_", "u", "'", "2013", "-0", "4", "-", "2", "8", "'_", ",_", "'", "author", "s", "'_", ":_", "u", "'", "Hr", "yna", "sz", "kie", "wic", "z", "'_", ",_", "'", "repos", "itor", "y", "'_", ":_", "'", "Pub", "lon", "s", "'_", ",_", "'", "title", "'_", ":_", "u", "'", "Data", " ", "reus", "e", " ", "and", " ", "the", " ", "open", " ", "data", " ", "cit", "ation", " ", "advantage", "'_", ",_", "'", "journal", "'_", ":_", "u", "'", "Peer", "J", "'_", ",_", "'", "genr", "e", "'_", ":_", "'", "peer", " ", "review", "'_", ",_", "'", "year", "'_", ":_", "u", "'", "2013", "'_", ",_", "'", "review", "\\u", "type", "'_", ":_", "u", "'", "Pre", " ", "Public", "ation", "'_", ",_", "'", "review", "\\u", "url", "'_", ":_", "u", "'", "https", "://", "peer", "j", ".", "com", "/", "article", "s", "/", "175", "v", "0.", "1", "/", "review", "s", "/", "2", "/'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "items", "\\u", "equal_", "(_", "biblio", "\\u", "dict_", "._", "keys_", "(_", ")_", ",_", "expected_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "[_", "\"", "author", "s", "\"_", ",_", "\"", "title", "\"_", ",_", "\"", "create", "\\u", "date", "\"_", ",_", "\"", "year", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert", "\\u", "equals_", "(_", "biblio", "\\u", "dict_", "[_", "key_", "]_", ",_", "expected_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pub", "lons_", "(_", "Provider", "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_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "members_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "members_", "=_", "self_", "._", "provider_", "._", "member", "\\u", "items_", "(_", "self_", "._", "testi", "tem", "\\u", "members_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "members_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "(_", "'", "url", "'_", ",_", "'", "https", "://", "pub", "lon", "s", ".", "com", "/", "r", "/", "182", "/'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "member_", "in_", "expected_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "member_", "in_", "members_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0,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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 ]
Unused import
rtucker-mozilla/mozilla_inventory/api_v3/system_api.py
[ { "content": "from tastypie import fields\nfrom tastypie.authorization import DjangoAuthorization\nfrom django.core.exceptions import ValidationError\nfrom tastypie.authentication import Authentication\n#from tastytools.resources import ModelResource\nfrom tastypie.resources import ModelResource\nfrom tastypie.resources import ALL, ALL_WITH_RELATIONS\nimport systems.models as system_model\nfrom django.conf.urls.defaults import url\nfrom tastypie.serializers import Serializer\nfrom django.core.serializers import json as djson\nfrom tastytools.test.resources import ResourceTestData\nfrom tastypie.authorization import Authorization\nfrom core.interface.static_intr.models import StaticInterface\nfrom core.interface.static_intr.models import StaticIntrKeyValue\nfrom core.range.models import Range\nfrom mozdns.view.models import View\nfrom mozdns.domain.models import Domain\nfrom core.lib.utils import create_ipv4_intr_from_domain\nimport json\nimport re\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PrettyJSONSerializer(Serializer):\n json_indent = 2\n", "metadata": "root.PrettyJSONSerializer", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def to_json(self, data, options=None):\n options = options or {}\n data = self.to_simple(data, options)\n return json.dumps(data, cls=djson.DjangoJSONEncoder,\n sort_keys=True, ensure_ascii=False, indent=self.json_indent)", "metadata": "root.PrettyJSONSerializer.to_json", "header": "['class', 'PrettyJSONSerializer', '(', 'Serializer', ')', ':', '___EOS___']", "index": 24 }, { "content": "class CustomAPIResource(ModelResource):\n\n\n class Meta:\n serializer = PrettyJSONSerializer()\n authorization= Authorization()\n authentication = Authentication()\n allowed_methods = ['get', 'post', 'put', 'delete', 'patch', 'PATCH']", "metadata": "root.CustomAPIResource", "header": "['module', '___EOS___']", "index": 30 }, { "content": " def __init__(self, *args, **kwargs):\n super(CustomAPIResource, self).__init__(*args, **kwargs)", "metadata": "root.CustomAPIResource.__init__", "header": "['class', 'CustomAPIResource', '(', 'ModelResource', ')', ':', '___EOS___']", "index": 31 }, { "content": " def determine_format(self, request):\n format = request.GET.get('format')\n if format:\n return super(CustomAPIResource, self).determine_format(request)\n else: \n return \"application/json\"", "metadata": "root.CustomAPIResource.determine_format", "header": "['class', 'CustomAPIResource', '(', 'ModelResource', ')', ':', '___EOS___']", "index": 34 }, { "content": "class SystemResource(CustomAPIResource):\n\n\n key_value = fields.ToManyField('api_v3.system_api.KeyValueResource', 'keyvalue_set', full=True, null=True)\n server_model = fields.ForeignKey('api_v3.system_api.ServerModelResource', 'server_model', null=True, full=True)\n system_status = fields.ForeignKey('api_v3.system_api.SystemStatusResource', 'system_status', null=True, full=True)\n operating_system = fields.ForeignKey('api_v3.system_api.OperatingSystemResource', 'operating_system', null=True, full=True)\n system_rack = fields.ForeignKey('api_v3.system_api.SystemRackResource', 'system_rack', null=True, full=True)\n allocation = fields.ForeignKey('api_v3.system_api.AllocationResource', 'allocation', null=True, full=True)\n \"\"\"\n Do not enable the following. It will fail due to the m2m validation routine written by uberj.\n Instead I'm overriding full_dehydrate to get the attributes that we want\n interface = fields.ToManyField('api_v3.system_api.StaticInterfaceResource', 'staticinterface_set', null=True, full=True)\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n class Meta(CustomAPIResource.Meta):\n filtering = {\n 'hostname': ALL_WITH_RELATIONS,\n 'system_rack': ALL_WITH_RELATIONS,\n 'system_status': ALL_WITH_RELATIONS,\n 'notes': ALL,\n 'asset_tag': ALL,\n 'key_value': ALL_WITH_RELATIONS,\n 'allocation': ALL_WITH_RELATIONS,\n 'key_value__key': ALL_WITH_RELATIONS,\n }\n fields = [\n \n ]\n exclude = [\n 'key_value__system',\n\n ]\n resource_name = 'system'\n queryset = system_model.System.objects.all()", "metadata": "root.SystemResource", "header": "['module', '___EOS___']", "index": 47 }, { "content": " def __init__(self, *args, **kwargs):\n super(SystemResource, self).__init__(*args, **kwargs)", "metadata": "root.SystemResource.__init__", "header": "['class', 'SystemResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 62 }, { "content": " def get_schema(self, request, **kwargs):\n ret = super(SystemResource, self).get_schema(request, **kwargs)\n retjson = json.loads(ret.content)\n retjson['fields']['auto_create_interface'] = {\n 'nullable': True,\n 'default': False,\n 'type': 'boolean',\n 'unique': False,\n 'help_text': 'auto_create_interface=\"True\"',\n 'example': 'auto_create_interface=\"True\"',\n }\n retjson['fields']['delete_interface'] = {\n 'nullable': True,\n 'default': False,\n 'type': 'boolean',\n 'unique': False,\n 'help_text': 'Set this to delete an interfacedelete_interface=\"True\"',\n 'example': 'delete_interface=\"True\"',\n }\n retjson['fields']['update_interface'] = {\n 'nullable': True,\n 'default': False,\n 'type': 'boolean',\n 'unique': False,\n 'help_text': 'Set this to update an interface update_interface=\"True\"',\n 'example': 'update_interface=\"True\"',\n }\n retjson['fields']['ip_address'] = {\n 'nullable': True,\n 'default': False,\n 'type': 'string',\n 'unique': False,\n 'help_text': 'ip_address=\"10.0.0.1\"',\n 'example': 'ip_address=\"10.0.0.1\"',\n }\n retjson['fields']['mac_address'] = {\n 'nullable': True,\n 'default': False,\n 'type': 'string',\n 'unique': False,\n 'help_text': 'mac_address=\"00:00:00:00:00:00\"',\n 'example': 'mac_address=\"00:00:00:00:00:00\"',\n }\n retjson['fields']['interface'] = {\n 'nullable': True,\n 'default': False,\n 'type': 'string',\n 'unique': False,\n 'help_text': 'interface=\"eth0.0\"',\n 'example': 'interface=\"eth0.0\"',\n }\n ret.content = json.dumps(retjson)\n return ret", "metadata": "root.SystemResource.get_schema", "header": "['class', 'SystemResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 66 }, { "content": " @staticmethod\n def extract_nic_attrs(nic_name):\n nic_type, primary, alias = \"eth\", 0, 0\n m = re.search(\"(eth|mgmt)(\\d+)\\.(\\d+)\", nic_name)\n if m:\n nic_type = m.group(1) if m.group(1) else \"eth\"\n primary = m.group(2) if m.group(2) else \"0\"\n nic_alias = m.group(3) if m.group(3) else \"0\"\n return nic_type, primary, nic_alias\n else:\n raise ValidationError(\"Invalid format for adapter name. ex: eth0.0\")", "metadata": "root.SystemResource.extract_nic_attrs", "header": "['class', 'SystemResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 121 }, { "content": " def process_extra(self, bundle, request, **kwargs):\n patch_dict = json.loads(request.POST.items()[0][0])\n\n if patch_dict.has_key('delete_interface') and patch_dict.has_key('interface'):\n patch_dict.pop('delete_interface')\n sys = bundle.obj\n interface = patch_dict.pop('interface', None)\n if sys and interface:\n sys.delete_adapter(interface)\n\n if patch_dict.has_key('update_interface') and patch_dict.has_key('interface'):\n patch_dict.pop('update_interface')\n sys = bundle.obj\n if 'interface' in patch_dict:\n sys.update_adapter(**patch_dict)\n\n ## Entry point for adding a new adapter by mac address via the rest API\n if patch_dict.has_key('mac'):\n\n enable_dns = True\n enable_private = True\n enable_public = False\n sys = bundle.obj\n range = patch_dict.pop('range', None)\n fqdn = patch_dict.pop('fqdn', None)\n ip_str = patch_dict.pop('ip_address', None)\n interface = patch_dict.pop('interface', None)\n domain = patch_dict.pop('domain', 'mozilla.com')\n from core.lib.utils import create_ipv4_intr_from_range\n mac = patch_dict['mac']\n if interface:\n interface_type, primary, alias = SystemResource.extract_nic_attrs(interface)\n else:\n interface_type, primary, alias = sys.get_next_adapter()\n\n if not fqdn:\n domain_parsed = \".\".join(sys.hostname.split('.')[1:]) + '.' + domain\n domain_name = domain_parsed.lower()\n label = sys.hostname.split('.')[0]\n else:\n domain_parsed = \".\".join(fqdn.split('.')[1:])\n domain_name = domain_parsed.lower()\n label = fqdn.split('.')[0]\n\n\n if range:\n range_start_str = range.split(',')[0]\n range_end_str = range.split(',')[1]\n s, errors = create_ipv4_intr_from_range(label, domain_name, sys, mac, range_start_str, range_end_str)\n if ip_str:\n domain = Domain.objects.filter(name=domain_parsed)[0]\n s = StaticInterface(label=label, mac=mac, domain=domain, ip_str=ip_str, ip_type='4', system=sys)\n try:\n if s:\n s.save()\n s.update_attrs()\n if enable_dns and enable_public:\n private = View.objects.get(name='private')\n s.views.add(private)\n s.save()\n\n elif enable_dns and enable_private and not enable_public:\n private = View.objects.get(name='private')\n s.views.add(private)\n s.save()\n\n if interface:\n interface_type, primary, alias = SystemResource.extract_nic_attrs(interface)\n else:\n interface_type, primary, alias = sys.get_next_adapter()\n\n s.attrs.primary = primary\n s.attrs.interface_type = interface_type\n s.attrs.alias = alias\n else:\n print 'We failed'\n bundle.errors['error_message'] = \"Unable to create adapter for unknown reason\"\n raise ValidationError(join(e.messages))\n except ValidationError, e:\n bundle.errors['error_message'] = \" \".join(e.messages)\n raise ValidationError(join(e.messages))\n except Exception, e:\n print e", "metadata": "root.SystemResource.process_extra", "header": "['class', 'SystemResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 133 }, { "content": " def obj_create(self, bundle, request, **kwargs):\n ret_bundle = super(SystemResource, self).obj_create(bundle, request, **kwargs)\n self.process_extra(ret_bundle, request, **kwargs)", "metadata": "root.SystemResource.obj_create", "header": "['class', 'SystemResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 218 }, { "content": " def obj_update(self, bundle, request, **kwargs):\n for intr in bundle.obj.staticinterface_set.all():\n intr.update_attrs()\n ret_bundle = super(SystemResource, self).obj_update(bundle, request, **kwargs)\n ret_bundle = self.process_extra(ret_bundle, request, **kwargs)\n return ret_bundle", "metadata": "root.SystemResource.obj_update", "header": "['class', 'SystemResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 222 }, { "content": " def full_dehydrate(self, bundle):\n \"\"\"\n Overrideing full dehydrate here. We want to display the iinterface\n attributes, but fails due to m2m validation.\n \"\"\"\n super(SystemResource, self).full_dehydrate(bundle)\n for intr in bundle.obj.staticinterface_set.all():\n intr.update_attrs()\n if hasattr(intr, 'attrs'):\n if hasattr(intr.attrs, 'primary'):\n bundle.data['interface:%s%s.%s:ip_address' % (intr.attrs.interface_type, intr.attrs.primary, intr.attrs.alias)] = intr.ip_str\n bundle.data['interface:%s%s.%s:fqdn' % (intr.attrs.interface_type, intr.attrs.primary, intr.attrs.alias)] = intr.fqdn\n bundle.data['interface:%s%s.%s:mac_address' % (intr.attrs.interface_type, intr.attrs.primary, intr.attrs.alias)] = intr.mac\n bundle.data['interface:%s%s.%s:dns_enabled' % (intr.attrs.interface_type, intr.attrs.primary, intr.attrs.alias)] = intr.dns_enabled\n bundle.data['interface:%s%s.%s:dhcp_enabled' % (intr.attrs.interface_type, intr.attrs.primary, intr.attrs.alias)] = intr.dhcp_enabled\n bundle.data['interface:%s%s.%s:label' % (intr.attrs.interface_type, intr.attrs.primary, intr.attrs.alias)] = intr.label\n #bundle.data['interface'] = \"%s%s.%s\" %\\\n #(bundle.obj.attrs.interface_type,\n # bundle.obj.attrs.primary, bundle.obj.attrs.alias)\n #del bundle.data['ip_lower']\n #del bundle.data['ip_upper']\n #del bundle.data['resource_uri']\n return bundle", "metadata": "root.SystemResource.full_dehydrate", "header": "['class', 'SystemResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 229 }, { "content": " def prepend_urls(self):\n return [\n url(r\"^(?P<resource_name>%s)/(?P<id>[\\d]+)/$\" % self._meta.resource_name, self.wrap_view('dispatch_detail'), name=\"api_system_dispatch_by_id_detail\"),\n url(r\"^(?P<resource_name>%s)/(?P<hostname>[^schema].*)/$\" % self._meta.resource_name, self.wrap_view('dispatch_detail'), name=\"api_system_dispatch_by_hostname_detail\"),\n ]", "metadata": "root.SystemResource.prepend_urls", "header": "['class', 'SystemResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 254 }, { "content": "class ServerModelResource(CustomAPIResource):\n class Meta(CustomAPIResource.Meta):\n filtering = {\n 'name': ALL,\n 'vendor': ALL,\n 'model': ALL\n }\n serializer = PrettyJSONSerializer()\n resource_name = 'server_model'\n queryset = system_model.ServerModel.objects.all()", "metadata": "root.ServerModelResource", "header": "['module', '___EOS___']", "index": 280 }, { "content": "class AllocationResource(CustomAPIResource):\n class Meta(CustomAPIResource.Meta):\n filtering = {\n 'name': ALL,\n }\n resource_name = 'allocation'\n queryset = system_model.Allocation.objects.all()", "metadata": "root.AllocationResource", "header": "['module', '___EOS___']", "index": 291 }, { "content": "class LocationResource(CustomAPIResource):\n class Meta(CustomAPIResource.Meta):\n resource_name = 'location'\n queryset = system_model.Location.objects.all()", "metadata": "root.LocationResource", "header": "['module', '___EOS___']", "index": 299 }, { "content": "class SystemRackResource(CustomAPIResource):\n class Meta(CustomAPIResource.Meta):\n resource_name = 'system_rack'\n queryset = system_model.SystemRack.objects.all()\n\n filtering = {\n 'name': ALL_WITH_RELATIONS,\n 'id': ALL_WITH_RELATIONS,\n }", "metadata": "root.SystemRackResource", "header": "['module', '___EOS___']", "index": 304 }, { "content": "class AdvisoryDataResource(CustomAPIResource):\n class Meta(CustomAPIResource.Meta):\n resource_name = 'advisory_data'\n queryset = system_model.AdvisoryData.objects.all()\n filtering = {\n 'ip_address': ALL_WITH_RELATIONS,\n 'title': ALL_WITH_RELATIONS,\n 'severity': ALL_WITH_RELATIONS,\n 'references': ALL_WITH_RELATIONS,\n 'advisory': ALL_WITH_RELATIONS,\n }", "metadata": "root.AdvisoryDataResource", "header": "['module', '___EOS___']", "index": 314 }, { "content": "class PortDataResource(CustomAPIResource):\n class Meta(CustomAPIResource.Meta):\n resource_name = 'port_data'\n queryset = system_model.PortData.objects.all()\n filtering = {\n 'ip_address': ALL_WITH_RELATIONS,\n 'state': ALL_WITH_RELATIONS,\n 'service': ALL_WITH_RELATIONS,\n 'port': ALL_WITH_RELATIONS,\n }", "metadata": "root.PortDataResource", "header": "['module', '___EOS___']", "index": 326 }, { "content": "class SystemStatusResource(CustomAPIResource):\n class Meta(CustomAPIResource.Meta):\n resource_name = 'system_status'\n queryset = system_model.SystemStatus.objects.all()\n filtering = {\n 'status': ALL_WITH_RELATIONS,\n }", "metadata": "root.SystemStatusResource", "header": "['module', '___EOS___']", "index": 337 }, { "content": "class StaticInterfaceResource(CustomAPIResource):\n \n system = fields.ToOneField(SystemResource, 'system', full=True)\n #system = fields.ForeignKey(SystemResource, 'system', full=True)\n\n\n class Meta(CustomAPIResource.Meta):\n resource_name = 'interface'\n queryset = StaticInterface.objects.select_related().all()", "metadata": "root.StaticInterfaceResource", "header": "['module', '___EOS___']", "index": 346 }, { "content": " def __init__(self, *args, **kwargs):\n super(StaticInterfaceResource, self).__init__(*args, **kwargs)", "metadata": "root.StaticInterfaceResource.__init__", "header": "['class', 'StaticInterfaceResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 350 }, { "content": " def full_dehydrate(self, bundle):\n super(StaticInterfaceResource, self).full_dehydrate(bundle)\n bundle.obj.update_attrs()\n bundle.data['interface'] = \"%s%s.%s\" %\\\n (bundle.obj.attrs.interface_type,\n bundle.obj.attrs.primary, bundle.obj.attrs.alias)\n del bundle.data['ip_lower']\n del bundle.data['ip_upper']\n del bundle.data['resource_uri']\n return bundle", "metadata": "root.StaticInterfaceResource.full_dehydrate", "header": "['class', 'StaticInterfaceResource', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 353 }, { "content": "class OperatingSystemResource(CustomAPIResource):\n \n class Meta(CustomAPIResource.Meta):\n resource_name = 'operating_system'\n queryset = system_model.OperatingSystem.objects.all()\n filtering = {\n 'version': ALL_WITH_RELATIONS,\n 'name': ALL_WITH_RELATIONS,\n }", "metadata": "root.OperatingSystemResource", "header": "['module', '___EOS___']", "index": 368 }, { "content": "class OperatingSystemData(CustomAPIResource):\n resource = \"operating_system\"\n", "metadata": "root.OperatingSystemData", "header": "['module', '___EOS___']", "index": 378 }, { "content": " def get_data(self, data):\n data.set('id', '8')\n data.set('name', 'RHEL')\n data.set('resource_uri', '/tasty/v3/operating_system/8/')\n data.set('version', '6.2')\n return data", "metadata": "root.OperatingSystemData.get_data", "header": "['class', 'OperatingSystemData', '(', 'CustomAPIResource', ')', ':', '___EOS___']", "index": 381 }, { "content": "class KeyValueResource(CustomAPIResource):\n system = fields.ToOneField('api_v3.system_api.SystemResource', 'system', full=False)\n\n class Meta(CustomAPIResource.Meta):\n filtering = {\n 'system': ALL_WITH_RELATIONS,\n 'key': ALL_WITH_RELATIONS,\n 'value': ALL_WITH_RELATIONS,\n }\n resource_name = 'key_value'\n queryset = system_model.KeyValue.objects.all()", "metadata": "root.KeyValueResource", "header": "['module', '___EOS___']", "index": 387 } ]
[ { "span": "from tastypie.authorization import DjangoAuthorization", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 54 }, { "span": "from tastytools.test.resources import ResourceTestData", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 54 }, { "span": "from core.interface.static_intr.models import StaticIntrKeyValue", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 64 }, { "span": "from core.range.models import Range", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 35 }, { "span": "from core.lib.utils import create_ipv4_intr_from_domain", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 55 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "tast", "ypi", "e_", "import_", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "ypi", "e_", "._", "authorization_", "import_", "Dj", "ang", "o", "Authorization_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "exceptions_", "import_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "ypi", "e_", "._", "authentication_", "import_", "Authentication_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "from", " ", "tast", "yto", "ols", ".", "resource", "s", " ", "import", " ", "Model", "Resource_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tast", "ypi", "e_", "._", "resources_", "import_", "Model", "Resource_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "ypi", "e_", "._", "resources_", "import_", "ALL_", ",_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "systems_", "._", "models_", "as_", "system", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "._", "urls_", "._", "defaults_", "import_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "ypi", "e_", "._", "serializers_", "import_", "Serializer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "serializers_", "import_", "json_", "as_", "dj", "son_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "yto", "ols_", "._", "test_", "._", "resources_", "import_", "Reso", "urc", "e", "Test", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "ypi", "e_", "._", "authorization_", "import_", "Authorization_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "interface_", "._", "static", "\\u", "intr", "_", "._", "models_", "import_", "Static", "Interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "interface_", "._", "static", "\\u", "intr", "_", "._", "models_", "import_", "Static", "Intr", "Key", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "range_", "._", "models_", "import_", "Range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "moz", "dns_", "._", "view_", "._", "models_", "import_", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "moz", "dns_", "._", "domain_", "._", "models_", "import_", "Domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "lib_", "._", "utils_", "import_", "create", "\\u", "ipv", "4", "\\u", "intr", "\\u", "from", "\\u", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Pret", "ty", "JSO", "NS", "eria", "lize", "r_", "(_", "Serializer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "indent_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Pret", "ty", "JSO", "NS", "eria", "lize", "r_", "(_", "Serializer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "to", "\\u", "json_", "(_", "self_", ",_", "data_", ",_", "options_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "=_", "options_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "self_", "._", "to", "\\u", "simple_", "(_", "data_", ",_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "json_", "._", "dumps_", "(_", "data_", ",_", "cls_", "=_", "dj", "son_", "._", "Dj", "ang", "o", "JSO", "NE", "ncode", "r_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "keys_", "=_", "True_", ",_", "ensure", "\\u", "ascii_", "=_", "False_", ",_", "indent_", "=_", "self_", "._", "json", "\\u", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Custom", "API", "Resource_", "(_", "Model", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "serializer_", "=_", "Pret", "ty", "JSO", "NS", "eria", "lize", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "authorization_", "=_", "Authorization_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "authentication_", "=_", "Authentication_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "allow", "ed", "\\u", "methods_", "=_", "[_", "'", "get", "'_", ",_", "'", "post", "'_", ",_", "'", "put", "'_", ",_", "'", "delete", "'_", ",_", "'", "patch", "'_", ",_", "'", "PATCH", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Custom", "API", "Resource_", "(_", "Model", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Custom", "API", "Resource_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Custom", "API", "Resource_", "(_", "Model", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dete", "rmin", "e\\u", "format_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "format_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "format", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Custom", "API", "Resource_", ",_", "self_", ")_", "._", "dete", "rmin", "e\\u", "format_", "(_", "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 ", " _", "return_", "\"", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "value_", "=_", "fields_", "._", "To", "Many", "Field_", "(_", "'", "api", "\\u", "v", "3", ".", "system", "\\u", "api", ".", "Key", "Value", "Reso", "urc", "e", "'_", ",_", "'", "keyval", "ue", "\\u", "set", "'_", ",_", "full_", "=_", "True_", ",_", "null_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server", "\\u", "model_", "=_", "fields_", "._", "Fore", "ign", "Key_", "(_", "'", "api", "\\u", "v", "3", ".", "system", "\\u", "api", ".", "Server", "Model", "Reso", "urc", "e", "'_", ",_", "'", "server", "\\u", "model", "'_", ",_", "null_", "=_", "True_", ",_", "full_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "status_", "=_", "fields_", "._", "Fore", "ign", "Key_", "(_", "'", "api", "\\u", "v", "3", ".", "system", "\\u", "api", ".", "System", "Status", "Reso", "urc", "e", "'_", ",_", "'", "system", "\\u", "status", "'_", ",_", "null_", "=_", "True_", ",_", "full_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "operati", "ng", "\\u", "system_", "=_", "fields_", "._", "Fore", "ign", "Key_", "(_", "'", "api", "\\u", "v", "3", ".", "system", "\\u", "api", ".", "Opera", "ting", "System", "Reso", "urc", "e", "'_", ",_", "'", "operati", "ng", "\\u", "system", "'_", ",_", "null_", "=_", "True_", ",_", "full_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "rack_", "=_", "fields_", "._", "Fore", "ign", "Key_", "(_", "'", "api", "\\u", "v", "3", ".", "system", "\\u", "api", ".", "System", "Rack", "Reso", "urc", "e", "'_", ",_", "'", "system", "\\u", "rack", "'_", ",_", "null_", "=_", "True_", ",_", "full_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "allocation_", "=_", "fields_", "._", "Fore", "ign", "Key_", "(_", "'", "api", "\\u", "v", "3", ".", "system", "\\u", "api", ".", "Allocati", "on", "Reso", "urc", "e", "'_", ",_", "'", "allocat", "ion", "'_", ",_", "null_", "=_", "True_", ",_", "full_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Do", " ", "not", " ", "enable", " ", "the", " ", "follow", "ing", ".", " ", "It", " ", "will", " ", "fail", " ", "due", " ", "to", " ", "the", " ", "m2", "m", " ", "validation", " ", "routin", "e", " ", "writt", "en", " ", "by", " ", "uber", "j", ".", "\\", "10", ";", " ", " ", " ", " ", "Ins", "tea", "d", " ", "I", "'", "m", " ", "overrid", "ing", " ", "full", "\\u", "de", "hydra", "te", " ", "to", " ", "get", " ", "the", " ", "attribute", "s", " ", "tha", "t", " ", "we", " ", "want", "\\", "10", ";", " ", " ", " ", " ", "interface", " ", "=", " ", "fields", ".", "To", "Many", "Field", "('", "api", "\\u", "v", "3", ".", "system", "\\u", "api", ".", "Static", "Interface", "Reso", "urc", "e", "',", " ", "'", "static", "interface", "\\u", "set", "',", " ", "null", "=", "Tru", "e", ",", " ", "full", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "host", "name", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "system", "\\u", "rack", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "system", "\\u", "status", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "s", "'_", ":_", "ALL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "asset", "\\u", "tag", "'_", ":_", "ALL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "key", "\\u", "value", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "allocat", "ion", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "key", "\\u", "value", "\\u\\u", "key", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclude_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "key", "\\u", "value", "\\u\\u", "system", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resource", "\\u", "name_", "=_", "'", "system", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "System_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\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_", "(_", "System", "Resource_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "schema_", "(_", "self_", ",_", "request_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "super_", "(_", "System", "Resource_", ",_", "self_", ")_", "._", "get", "\\u", "schema_", "(_", "request_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "json_", "=_", "json_", "._", "loads_", "(_", "ret_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "json_", "[_", "'", "fields", "'_", "]_", "[_", "'", "auto", "\\u", "create", "\\u", "interface", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "null", "able", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "boolean", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unique", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "'", "auto", "\\u", "create", "\\u", "interface", "=\"", "Tru", "e", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "example", "'_", ":_", "'", "auto", "\\u", "create", "\\u", "interface", "=\"", "Tru", "e", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "json_", "[_", "'", "fields", "'_", "]_", "[_", "'", "delete", "\\u", "interface", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "null", "able", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "boolean", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unique", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "'", "Set", " ", "this", " ", "to", " ", "delete", " ", "an", " ", "interface", "delete", "\\u", "interface", "=\"", "Tru", "e", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "example", "'_", ":_", "'", "delete", "\\u", "interface", "=\"", "Tru", "e", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "json_", "[_", "'", "fields", "'_", "]_", "[_", "'", "update", "\\u", "interface", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "null", "able", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "boolean", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unique", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "'", "Set", " ", "this", " ", "to", " ", "update", " ", "an", " ", "interface", " ", "update", "\\u", "interface", "=\"", "Tru", "e", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "example", "'_", ":_", "'", "update", "\\u", "interface", "=\"", "Tru", "e", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "json_", "[_", "'", "fields", "'_", "]_", "[_", "'", "ip", "\\u", "address", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "null", "able", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unique", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "'", "ip", "\\u", "address", "=\"", "10.", "0.", "0.", "1", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "example", "'_", ":_", "'", "ip", "\\u", "address", "=\"", "10.", "0.", "0.", "1", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "json_", "[_", "'", "fields", "'_", "]_", "[_", "'", "mac", "\\u", "address", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "null", "able", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unique", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "'", "mac", "\\u", "address", "=\"", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "example", "'_", ":_", "'", "mac", "\\u", "address", "=\"", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "json_", "[_", "'", "fields", "'_", "]_", "[_", "'", "interface", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "null", "able", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unique", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "'", "interface", "=\"", "eth", "0.", "0", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "example", "'_", ":_", "'", "interface", "=\"", "eth", "0.", "0", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "._", "content_", "=_", "json_", "._", "dumps_", "(_", "ret", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\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_", "extract", "\\u", "nic", "\\u", "attrs_", "(_", "nic", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nic", "\\u", "type_", ",_", "primary_", ",_", "alias_", "=_", "\"", "eth", "\"_", ",_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "re_", "._", "search_", "(_", "\"(", "eth", "|", "mg", "mt", ")(", "\\\\", "d", "+)\\\\", ".(", "\\\\", "d", "+)\"_", ",_", "nic", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nic", "\\u", "type_", "=_", "m_", "._", "group_", "(_", "1_", ")_", "if_", "m_", "._", "group_", "(_", "1_", ")_", "else_", "\"", "eth", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "primary_", "=_", "m_", "._", "group_", "(_", "2_", ")_", "if_", "m_", "._", "group_", "(_", "2_", ")_", "else_", "\"", "0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nic", "\\u", "alias_", "=_", "m_", "._", "group_", "(_", "3_", ")_", "if_", "m_", "._", "group_", "(_", "3_", ")_", "else_", "\"", "0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "nic", "\\u", "type_", ",_", "primary_", ",_", "nic", "\\u", "alias_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Validat", "ion", "Error_", "(_", "\"", "Inva", "lid", " ", "format", " ", "for", " ", "adapter", " ", "name", ".", " ", "ex", ":", " ", "eth", "0.", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "extra_", "(_", "self_", ",_", "bundle_", ",_", "request_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch", "\\u", "dict_", "=_", "json_", "._", "loads_", "(_", "request_", "._", "POST_", "._", "items_", "(_", ")_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "patch", "\\u", "dict_", "._", "has", "\\u", "key_", "(_", "'", "delete", "\\u", "interface", "'_", ")_", "and_", "patch", "\\u", "dict_", "._", "has", "\\u", "key_", "(_", "'", "interface", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch", "\\u", "dict_", "._", "pop_", "(_", "'", "delete", "\\u", "interface", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "=_", "bundle_", "._", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interface_", "=_", "patch", "\\u", "dict_", "._", "pop_", "(_", "'", "interface", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "and_", "interface_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "delete", "\\u", "adapter_", "(_", "interface_", ")_", "\\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_", "patch", "\\u", "dict_", "._", "has", "\\u", "key_", "(_", "'", "update", "\\u", "interface", "'_", ")_", "and_", "patch", "\\u", "dict_", "._", "has", "\\u", "key_", "(_", "'", "interface", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch", "\\u", "dict_", "._", "pop_", "(_", "'", "update", "\\u", "interface", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "=_", "bundle_", "._", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "interface", "'_", "in_", "patch", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "update", "\\u", "adapter_", "(_", "**_", "patch", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Entr", "y", " ", "point", " ", "for", " ", "addin", "g", " ", "a", " ", "new", " ", "adapter", " ", "by", " ", "mac", " ", "address", " ", "via", " ", "the", " ", "rest", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "patch", "\\u", "dict_", "._", "has", "\\u", "key_", "(_", "'", "mac", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enable", "\\u", "dns_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enable", "\\u", "private_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enable", "\\u", "public_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "=_", "bundle_", "._", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "range_", "=_", "patch", "\\u", "dict_", "._", "pop_", "(_", "'", "range", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fqdn_", "=_", "patch", "\\u", "dict_", "._", "pop_", "(_", "'", "fq", "dn", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "\\u", "str_", "=_", "patch", "\\u", "dict_", "._", "pop_", "(_", "'", "ip", "\\u", "address", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interface_", "=_", "patch", "\\u", "dict_", "._", "pop_", "(_", "'", "interface", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "domain_", "=_", "patch", "\\u", "dict_", "._", "pop_", "(_", "'", "domain", "'_", ",_", "'", "moz", "illa", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "lib_", "._", "utils_", "import_", "create", "\\u", "ipv", "4", "\\u", "intr", "\\u", "from", "\\u", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mac_", "=_", "patch", "\\u", "dict_", "[_", "'", "mac", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "interface_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "interface", "\\u", "type_", ",_", "primary_", ",_", "alias_", "=_", "System", "Resource_", "._", "extract", "\\u", "nic", "\\u", "attrs_", "(_", "interface_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "interface", "\\u", "type_", ",_", "primary_", ",_", "alias_", "=_", "sys_", "._", "get", "\\u", "next", "\\u", "adapter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "fqdn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "domain", "\\u", "parsed_", "=_", "\".\"_", "._", "join_", "(_", "sys_", "._", "hostname_", "._", "split_", "(_", "'.'_", ")_", "[_", "1_", ":_", "]_", ")_", "+_", "'.'_", "+_", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "domain", "\\u", "name_", "=_", "domain", "\\u", "parsed_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "sys_", "._", "hostname_", "._", "split_", "(_", "'.'_", ")_", "[_", "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 ", " _", "domain", "\\u", "parsed_", "=_", "\".\"_", "._", "join_", "(_", "fqdn_", "._", "split_", "(_", "'.'_", ")_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "domain", "\\u", "name_", "=_", "domain", "\\u", "parsed_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "fqdn_", "._", "split_", "(_", "'.'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "range", "\\u", "start", "\\u", "str_", "=_", "range_", "._", "split_", "(_", "','_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "range", "\\u", "end", "\\u", "str_", "=_", "range_", "._", "split_", "(_", "','_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", ",_", "errors_", "=_", "create", "\\u", "ipv", "4", "\\u", "intr", "\\u", "from", "\\u", "range_", "(_", "label_", ",_", "domain", "\\u", "name_", ",_", "sys_", ",_", "mac_", ",_", "range", "\\u", "start", "\\u", "str_", ",_", "range", "\\u", "end", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ip", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "domain_", "=_", "Domain_", "._", "objects_", "._", "filter_", "(_", "name_", "=_", "domain", "\\u", "parsed_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Static", "Interface_", "(_", "label_", "=_", "label_", ",_", "mac_", "=_", "mac_", ",_", "domain_", "=_", "domain_", ",_", "ip", "\\u", "str_", "=_", "ip", "\\u", "str_", ",_", "ip", "\\u", "type_", "=_", "'", "4", "'_", ",_", "system_", "=_", "sys_", ")_", "\\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 ", " _", "if_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "update", "\\u", "attrs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "enable", "\\u", "dns_", "and_", "enable", "\\u", "public_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "private_", "=_", "View_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "'", "private", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "views_", "._", "add_", "(_", "private_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "enable", "\\u", "dns_", "and_", "enable", "\\u", "private_", "and_", "not_", "enable", "\\u", "public_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "private_", "=_", "View_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "'", "private", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "views_", "._", "add_", "(_", "private_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "interface_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "interface", "\\u", "type_", ",_", "primary_", ",_", "alias_", "=_", "System", "Resource_", "._", "extract", "\\u", "nic", "\\u", "attrs_", "(_", "interface_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "interface", "\\u", "type_", ",_", "primary_", ",_", "alias_", "=_", "sys_", "._", "get", "\\u", "next", "\\u", "adapter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "._", "attrs_", "._", "primary_", "=_", "primary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "attrs_", "._", "interface", "\\u", "type_", "=_", "interface", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "attrs_", "._", "alias_", "=_", "alias_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "We", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bundle_", "._", "errors_", "[_", "'", "error", "\\u", "message", "'_", "]_", "=_", "\"", "Una", "ble", " ", "to", " ", "create", " ", "adapter", " ", "for", " ", "unknown", " ", "reason", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Validat", "ion", "Error_", "(_", "join_", "(_", "e_", "._", "messages_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Validat", "ion", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bundle_", "._", "errors_", "[_", "'", "error", "\\u", "message", "'_", "]_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "e_", "._", "messages_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Validat", "ion", "Error_", "(_", "join_", "(_", "e_", "._", "messages_", ")_", ")_", "\\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_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\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_", "obj", "\\u", "create_", "(_", "self_", ",_", "bundle_", ",_", "request_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret", "\\u", "bundle_", "=_", "super_", "(_", "System", "Resource_", ",_", "self_", ")_", "._", "obj", "\\u", "create_", "(_", "bundle_", ",_", "request_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "process", "\\u", "extra_", "(_", "ret", "\\u", "bundle_", ",_", "request_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "obj", "\\u", "update_", "(_", "self_", ",_", "bundle_", ",_", "request_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "intr", "_", "in_", "bundle_", "._", "obj_", "._", "static", "interface", "\\u", "set_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "intr", "_", "._", "update", "\\u", "attrs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ret", "\\u", "bundle_", "=_", "super_", "(_", "System", "Resource_", ",_", "self_", ")_", "._", "obj", "\\u", "update_", "(_", "bundle_", ",_", "request_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "\\u", "bundle_", "=_", "self_", "._", "process", "\\u", "extra_", "(_", "ret", "\\u", "bundle_", ",_", "request_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret", "\\u", "bundle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "full", "\\u", "de", "hydra", "te_", "(_", "self_", ",_", "bundle_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Override", "ing", " ", "full", " ", "de", "hydra", "te", " ", "here", ".", " ", "We", " ", "want", " ", "to", " ", "display", " ", "the", " ", "ii", "nter", "face", "\\", "10", ";", " ", " ", " ", " ", "attribute", "s", ",", " ", "but", " ", "fail", "s", " ", "due", " ", "to", " ", "m2", "m", " ", "validation", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "System", "Resource_", ",_", "self_", ")_", "._", "full", "\\u", "de", "hydra", "te_", "(_", "bundle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "intr", "_", "in_", "bundle_", "._", "obj_", "._", "static", "interface", "\\u", "set_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "intr", "_", "._", "update", "\\u", "attrs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "intr", "_", ",_", "'", "attr", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "intr", "_", "._", "attrs_", ",_", "'", "primary", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bundle_", "._", "data_", "[_", "'", "interface", ":", "%", "s", "%", "s", ".", "%", "s", ":", "ip", "\\u", "address", "'_", "%_", "(_", "intr", "_", "._", "attrs_", "._", "interface", "\\u", "type_", ",_", "intr", "_", "._", "attrs_", "._", "primary_", ",_", "intr", "_", "._", "attrs_", "._", "alias_", ")_", "]_", "=_", "intr", "_", "._", "ip", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bundle_", "._", "data_", "[_", "'", "interface", ":", "%", "s", "%", "s", ".", "%", "s", ":", "fq", "dn", "'_", "%_", "(_", "intr", "_", "._", "attrs_", "._", "interface", "\\u", "type_", ",_", "intr", "_", "._", "attrs_", "._", "primary_", ",_", "intr", "_", "._", "attrs_", "._", "alias_", ")_", "]_", "=_", "intr", "_", "._", "fqdn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bundle_", "._", "data_", "[_", "'", "interface", ":", "%", "s", "%", "s", ".", "%", "s", ":", "mac", "\\u", "address", "'_", "%_", "(_", "intr", "_", "._", "attrs_", "._", "interface", "\\u", "type_", ",_", "intr", "_", "._", "attrs_", "._", "primary_", ",_", "intr", "_", "._", "attrs_", "._", "alias_", ")_", "]_", "=_", "intr", "_", "._", "mac_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bundle_", "._", "data_", "[_", "'", "interface", ":", "%", "s", "%", "s", ".", "%", "s", ":", "dns", "\\u", "enable", "d", "'_", "%_", "(_", "intr", "_", "._", "attrs_", "._", "interface", "\\u", "type_", ",_", "intr", "_", "._", "attrs_", "._", "primary_", ",_", "intr", "_", "._", "attrs_", "._", "alias_", ")_", "]_", "=_", "intr", "_", "._", "dns", "\\u", "enabled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bundle_", "._", "data_", "[_", "'", "interface", ":", "%", "s", "%", "s", ".", "%", "s", ":", "dhcp", "\\u", "enable", "d", "'_", "%_", "(_", "intr", "_", "._", "attrs_", "._", "interface", "\\u", "type_", ",_", "intr", "_", "._", "attrs_", "._", "primary_", ",_", "intr", "_", "._", "attrs_", "._", "alias_", ")_", "]_", "=_", "intr", "_", "._", "dhcp", "\\u", "enabled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bundle_", "._", "data_", "[_", "'", "interface", ":", "%", "s", "%", "s", ".", "%", "s", ":", "label", "'_", "%_", "(_", "intr", "_", "._", "attrs_", "._", "interface", "\\u", "type_", ",_", "intr", "_", "._", "attrs_", "._", "primary_", ",_", "intr", "_", "._", "attrs_", "._", "alias_", ")_", "]_", "=_", "intr", "_", "._", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "bundle", ".", "data", "['", "interface", "']", " ", "=", " ", "\"%", "s", "%", "s", ".", "%", "s", "\"", " ", "%\\", "\\", "_", "\\u\\u\\uNL\\u\\u\\u_", "#(", "bundle", ".", "obj", ".", "attr", "s", ".", "interface", "\\u", "type", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "bundle", ".", "obj", ".", "attr", "s", ".", "primary", ",", " ", "bundle", ".", "obj", ".", "attr", "s", ".", "alias", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "del", " ", "bundle", ".", "data", "['", "ip", "\\u", "lower", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "del", " ", "bundle", ".", "data", "['", "ip", "\\u", "upper", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "del", " ", "bundle", ".", "data", "['", "resource", "\\u", "uri", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "bundle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prepend", "\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "\"", "^", "(?", "P", "<", "resource", "\\u", "name", ">", "%", "s", ")/(", "?", "P", "<", "id", ">[", "\\\\", "d", "]+)", "/$", "\"_", "%_", "self_", "._", "\\u", "meta_", "._", "resource", "\\u", "name_", ",_", "self_", "._", "wrap", "\\u", "view_", "(_", "'", "dispatch", "\\u", "deta", "il", "'_", ")_", ",_", "name_", "=_", "\"", "api", "\\u", "system", "\\u", "dispatch", "\\u", "by", "\\u", "id", "\\u", "deta", "il", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "\"", "^", "(?", "P", "<", "resource", "\\u", "name", ">", "%", "s", ")/(", "?", "P", "<", "host", "name", ">[", "^", "schema", "].", "*)", "/$", "\"_", "%_", "self_", "._", "\\u", "meta_", "._", "resource", "\\u", "name_", ",_", "self_", "._", "wrap", "\\u", "view_", "(_", "'", "dispatch", "\\u", "deta", "il", "'_", ")_", ",_", "name_", "=_", "\"", "api", "\\u", "system", "\\u", "dispatch", "\\u", "by", "\\u", "host", "name", "\\u", "deta", "il", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Server", "Model", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "ALL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vendor", "'_", ":_", "ALL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "ALL_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serializer_", "=_", "Pret", "ty", "JSO", "NS", "eria", "lize", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resource", "\\u", "name_", "=_", "'", "server", "\\u", "model", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "Server", "Model_", "._", "objects_", "._", "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_", "Allocati", "on", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "ALL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resource", "\\u", "name_", "=_", "'", "allocat", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "Allocati", "on_", "._", "objects_", "._", "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_", "Locat", "ion", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "name_", "=_", "'", "location", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "Location_", "._", "objects_", "._", "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_", "System", "Rack", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "name_", "=_", "'", "system", "\\u", "rack", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "System", "Rack", "_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Adv", "isor", "y", "Data", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "name_", "=_", "'", "advisor", "y", "\\u", "data", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "Adv", "isor", "y", "Data_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "\\u", "address", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sever", "it", "y", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reference", "s", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "advisor", "y", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Port", "Data", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "name_", "=_", "'", "port", "\\u", "data", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "Port", "Data_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "\\u", "address", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "System", "Status", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "name_", "=_", "'", "system", "\\u", "status", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "System", "Status_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Static", "Interface", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "system_", "=_", "fields_", "._", "To", "One", "Field_", "(_", "System", "Resource_", ",_", "'", "system", "'_", ",_", "full_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "system", " ", "=", " ", "fields", ".", "Fore", "ign", "Key", "(", "System", "Reso", "urc", "e", ",", " ", "'", "system", "',", " ", "full", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "name_", "=_", "'", "interface", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "Static", "Interface_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Static", "Interface", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\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_", "(_", "Static", "Interface", "Resource_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Static", "Interface", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "full", "\\u", "de", "hydra", "te_", "(_", "self_", ",_", "bundle_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Static", "Interface", "Resource_", ",_", "self_", ")_", "._", "full", "\\u", "de", "hydra", "te_", "(_", "bundle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bundle_", "._", "obj_", "._", "update", "\\u", "attrs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bundle_", "._", "data_", "[_", "'", "interface", "'_", "]_", "=_", "\"%", "s", "%", "s", ".", "%", "s", "\"_", "%_", "(_", "bundle_", "._", "obj_", "._", "attrs_", "._", "interface", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bundle_", "._", "obj_", "._", "attrs_", "._", "primary_", ",_", "bundle_", "._", "obj_", "._", "attrs_", "._", "alias_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "bundle_", "._", "data_", "[_", "'", "ip", "\\u", "lower", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "bundle_", "._", "data_", "[_", "'", "ip", "\\u", "upper", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "bundle_", "._", "data_", "[_", "'", "resource", "\\u", "uri", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "bundle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Opera", "ting", "System", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource", "\\u", "name_", "=_", "'", "operati", "ng", "\\u", "system", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "system", "\\u", "model_", "._", "Opera", "ting", "System_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Opera", "ting", "System", "Data_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource_", "=_", "\"", "operati", "ng", "\\u", "system", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Opera", "ting", "System", "Data_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "._", "set_", "(_", "'", "id", "'_", ",_", "'", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "set_", "(_", "'", "name", "'_", ",_", "'", "RHE", "L", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "set_", "(_", "'", "resource", "\\u", "uri", "'_", ",_", "'/", "tast", "y", "/", "v", "3", "/", "operati", "ng", "\\u", "system", "/", "8", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "set_", "(_", "'", "version", "'_", ",_", "'", "6.2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "\\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_", "class_", "Key", "Value", "Resource_", "(_", "Custom", "API", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "system_", "=_", "fields_", "._", "To", "One", "Field_", "(_", "'", "api", "\\u", "v", "3", ".", "system", "\\u", "api", ".", "System", "Reso", "urc", "e", "'_", ",_", "'", "system", "'_", ",_", "full_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", "(_", "Custom", "API", "Resource_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "system", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "key", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "'_", ":_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", ",_", "\\u\\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, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
JaimieMurdock/othello/othello/tournament/results.py
[ { "content": "import sys\nimport os\nimport time\n\n#sys.path.append('/u/epnichol/b351/othello/src/')\npath = '/Users/eric/workspace/othello/src/driver/results/'\nsys.path.append(path)\n\n\n# Load the list of all programs.\nfile = open(path + 'engines.txt', 'r')\n\nengines=[]\nfor engine in file.readlines():\n engines.append(engine.rstrip())\nfile.close()\n\n#print engines\n\n# Iterate over all engines and count up wins/draws.\nprint \"Engine\\t\\t\\tSCORE\\tWinWhite\\tWinBlack\\tDrawWhite\\tDrawBlack\\tLossWhite\\tLossBlack\"\nprint \"--------------------------------------------------------\"\nfor engine in engines:\n wins_white = 0\n wins_black = 0\n draws_white = 0\n draws_black = 0\n loss_white = 0\n loss_black = 0\n\n # Try all logs.\n for i in range(1,5):\n log_file = path + \"tournament.log.\" + str(i)\n log = open(log_file)\n for line in log.readlines():\n if line.find('white=' + engine + ',') != -1:\n if line.find('winner=' + engine + ',') != -1:\n wins_white += 1\n elif line.find('draw') != -1:\n draws_white += 1\n else:\n loss_white +=1\n elif line.find('black=' + engine + ',') != -1:\n if line.find('winner=' + engine + ',') != -1:\n wins_black += 1\n elif line.find('draw') != -1:\n draws_black += 1\n else:\n loss_black += 1\n log.close()\n\n score = wins_white + wins_black + (draws_white+draws_black)/2\n print (engine + '\\t\\t\\t' + str(score) + '\\t' + str(wins_white) + '\\t' + str(wins_black) + '\\t' + str(draws_white) + '\\t' + str(draws_black) + \\\n '\\t' + str(loss_white) + '\\t' + str(loss_black))\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import os", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 9 }, { "span": "import time", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "append", "('", "/", "u", "/", "epn", "ich", "ol", "/", "b3", "5", "1", "/", "othe", "llo", "/", "src", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "'/", "User", "s", "/", "eric", "/", "works", "pace", "/", "othe", "llo", "/", "src", "/", "driver", "/", "results", "/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "the", " ", "list", " ", "of", " ", "all", " ", "program", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "open_", "(_", "path_", "+_", "'", "engines", ".", "txt", "'_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "engines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "engine_", "in_", "file_", "._", "readlines_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "engines_", "._", "append_", "(_", "engine_", "._", "rstrip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "engines_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Iterat", "e", " ", "over", " ", "all", " ", "engines", " ", "and", " ", "count", " ", "up", " ", "wins", "/", "draws", "._", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Engine", "\\\\", "t", "\\\\", "t", "\\\\", "t", "SCORE", "\\\\", "t", "Win", "White", "\\\\", "t", "Win", "Black", "\\\\", "t", "Draw", "White", "\\\\", "t", "Draw", "Black", "\\\\", "t", "Lo", "ss", "White", "\\\\", "t", "Lo", "ss", "Black", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"-------", "--------------", "--------------", "--------------", "-------", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "engine_", "in_", "engines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wins", "\\u", "white_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wins", "\\u", "black_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "draws", "\\u", "white_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "draws", "\\u", "black_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loss", "\\u", "white_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loss", "\\u", "black_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "all", " ", "logs", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "file_", "=_", "path_", "+_", "\"", "tournament", ".", "log", ".\"_", "+_", "str_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "open_", "(_", "log", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "log_", "._", "readlines_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "._", "find_", "(_", "'", "white", "='_", "+_", "engine_", "+_", "','_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "._", "find_", "(_", "'", "winner", "='_", "+_", "engine_", "+_", "','_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wins", "\\u", "white_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "find_", "(_", "'", "draw", "'_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "draws", "\\u", "white_", "+=_", "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 ", " ", "_", "loss", "\\u", "white_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "find_", "(_", "'", "black", "='_", "+_", "engine_", "+_", "','_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "._", "find_", "(_", "'", "winner", "='_", "+_", "engine_", "+_", "','_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wins", "\\u", "black_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "find_", "(_", "'", "draw", "'_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "draws", "\\u", "black_", "+=_", "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 ", " ", "_", "loss", "\\u", "black_", "+=_", "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_", "log_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "score_", "=_", "wins", "\\u", "white_", "+_", "wins", "\\u", "black_", "+_", "(_", "draws", "\\u", "white_", "+_", "draws", "\\u", "black_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "engine_", "+_", "'\\\\", "t", "\\\\", "t", "\\\\", "t", "'_", "+_", "str_", "(_", "score_", ")_", "+_", "'\\\\", "t", "'_", "+_", "str_", "(_", "wins", "\\u", "white_", ")_", "+_", "'\\\\", "t", "'_", "+_", "str_", "(_", "wins", "\\u", "black_", ")_", "+_", "'\\\\", "t", "'_", "+_", "str_", "(_", "draws", "\\u", "white_", ")_", "+_", "'\\\\", "t", "'_", "+_", "str_", "(_", "draws", "\\u", "black_", ")_", "+_", "'\\\\", "t", "'_", "+_", "str_", "(_", "loss", "\\u", "white_", ")_", "+_", "'\\\\", "t", "'_", "+_", "str_", "(_", "loss", "\\u", "black_", ")_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
robotbill/VIctor/victor/app.py
[ { "content": "import collections\nimport pyglet\nimport pyglet.gl as gl\nimport pyglet.window.key as pkey\nimport re, sys, time\n\nfrom itertools import chain\n\nimport victor.mode as vmode\nfrom victor.command_area import CommandArea\nfrom victor.cursor import Cursor\nfrom victor.keystroke import Keystrokes\nfrom victor.movement_grid import MovementGrid;\n\nfrom victor.command import CommandException, register_ex_command, run_ex_command\n\nfrom victor.path_group import PathGroup;\nfrom victor.path import Path;\n\nimport victor.normal_dispatcher as vnd;\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class VIctorApp(pyglet.window.Window):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.VIctorApp", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def __init__(self, *args, **kwargs):\n super(VIctorApp, self).__init__(640, 400, caption=\"victor\")\n\n self.set_default_options()\n\n self.mode = vmode.NORMAL\n self.down_action = None\n self.text_event = None\n\n self.batch = pyglet.graphics.Batch()\n\n self.setup_cursor()\n\n self.marks = dict()\n\n self.command_area = CommandArea(0, 0, 550, self.batch)\n self.keystrokes = Keystrokes(550, 0, 70, self.batch)\n\n self.current_multiplier = None\n self.normal_dispatcher = vnd.construct_dispatcher(self);\n self.set_ex_commands()\n\n self.groups = self.current_group = PathGroup();\n self.current_path = None;\n\n self.time = time.time()\n pyglet.clock.schedule_interval(self.on_timer_fire, .05)\n\n gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA)\n gl.glEnable(gl.GL_BLEND)", "metadata": "root.VIctorApp.__init__", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 22 }, { "content": " def setup_cursor(self):\n self.cursor = Cursor(320, 200, self.batch)\n self.grid = MovementGrid(640, 400, self.options['gridcolor']);\n self.grid.reset_batch();", "metadata": "root.VIctorApp.setup_cursor", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 53 }, { "content": " def set_ex_commands(self):\n register_ex_command('line', self.draw_line)\n register_ex_command('marks', self.show_marks)\n register_ex_command('set', self.set_option)", "metadata": "root.VIctorApp.set_ex_commands", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 58 }, { "content": " def set_default_options(self):\n self.options = {}\n self.options[\"color\"] = (0, 0, 0, 255)\n self.options[\"gridcolor\"] = (0, 0, 255, 50)", "metadata": "root.VIctorApp.set_default_options", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 63 }, { "content": " def set_mode(self, mode):\n if self.is_ex_mode():\n self.command_area.unfocus()\n\n self.mode = mode\n\n if mode == vmode.EX:\n self.command_area.focus()", "metadata": "root.VIctorApp.set_mode", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 68 }, { "content": " def switch_to_ex_mode(self):\n self.set_mode(vmode.EX)", "metadata": "root.VIctorApp.switch_to_ex_mode", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 77 }, { "content": " def run_command(self):\n try: run_ex_command(self.command_area.text)\n except CommandException as e: sys.stderr.write('%s\\n' % str(e))\n self.set_mode(vmode.NORMAL)", "metadata": "root.VIctorApp.run_command", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 80 }, { "content": " def on_timer_fire(self, dt):\n self.time = time.time()\n self.normal_dispatcher.send(vnd.NormalEvent(vnd.TIMER_FIRE));", "metadata": "root.VIctorApp.on_timer_fire", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 85 }, { "content": " def dispatch_both(self):\n if self.down_action is None: return\n if self.text_event is None: return\n\n self.down_action()\n self.down_action = self.text_event = None", "metadata": "root.VIctorApp.dispatch_both", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 89 }, { "content": " def on_key_press(self, symbol, modifiers):\n is_mod_key = lambda key, mod: symbol == key and modifiers & mod\n\n if self.is_ex_mode() and symbol == pkey.ENTER:\n self.run_command()\n\n elif symbol == pkey.ESCAPE or is_mod_key(pkey.BRACKETLEFT, pkey.MOD_CTRL):\n if not self.is_normal_mode(): self.set_mode(vmode.NORMAL)\n self.keystrokes.push_text(\"^[\")\n self.normal_dispatcher.send(vnd.NormalEvent(vnd.ESCAPE))\n\n # don't close window\n return pyglet.event.EVENT_HANDLED\n\n elif self.is_normal_mode():\n self.normal_dispatcher.send(vnd.NormalEvent(vnd.ON_KEY_PRESS, symbol, modifiers));", "metadata": "root.VIctorApp.on_key_press", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 96 }, { "content": " def on_key_release(self, symbol, modifiers):\n if self.is_normal_mode():\n self.normal_dispatcher.send(vnd.NormalEvent(vnd.ON_KEY_RELEASE, symbol, modifiers));", "metadata": "root.VIctorApp.on_key_release", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 113 }, { "content": " def on_text(self, text):\n if self.is_ex_mode():\n self.command_area.on_text(text)\n if not self.command_area.text:\n self.set_mode(vmode.NORMAL)\n elif self.is_normal_mode():\n if text == ':':\n self.text_event = text\n self.dispatch_both()\n\n self.keystrokes.push_text(text)", "metadata": "root.VIctorApp.on_text", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 117 }, { "content": " def on_text_motion(self, motion):\n if self.is_ex_mode():\n self.command_area.on_text_motion(motion)\n\n if not self.command_area.has_focus:\n self.set_mode(vmode.NORMAL)", "metadata": "root.VIctorApp.on_text_motion", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 129 }, { "content": " def current_position(self):\n return (self.cursor.x, self.cursor.y)", "metadata": "root.VIctorApp.current_position", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 136 }, { "content": " def start_path(self):\n self.current_path = Path(self.cursor.position);\n self.paths.append(self.current_path);", "metadata": "root.VIctorApp.start_path", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 139 }, { "content": " def append_path(self):\n if self.current_path:\n self.current_path.append(self.cursor.position);", "metadata": "root.VIctorApp.append_path", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 143 }, { "content": " def draw_line(self, *args):\n if len(args) != 2:\n self.error(\"line requires two arguments\", args)\n else:\n start = self.marks[args[0]]\n end = self.marks[args[1]]\n\n self.batch.add(2, pyglet.gl.GL_LINES, None,\n ('v2i', (start[0], start[1], end[0], end[1])),\n ('c4B', tuple(chain(self.options[\"color\"], self.options[\"color\"]))))", "metadata": "root.VIctorApp.draw_line", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 147 }, { "content": " def show_marks(self, *args):\n for key, value in self.marks.iteritems():\n print key, value", "metadata": "root.VIctorApp.show_marks", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 158 }, { "content": " def set_option(self, *args):\n if len(args) < 2: raise CommandException(\"No option specified\")\n\n option = args[0]\n if option == \"color\":\n if len(args) != 5: raise CommandException(\"color must have 4 arguments\")\n self.options[\"color\"] = tuple(map(int, args[1:]))\n elif option == \"gridcolor\":\n pass", "metadata": "root.VIctorApp.set_option", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 162 }, { "content": " def error(self, *args):\n print args;", "metadata": "root.VIctorApp.error", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 172 }, { "content": " def on_draw(self):\n pyglet.gl.glClearColor(1, 1, 1, 1)\n self.clear()\n self.grid.draw();\n self.batch.draw()\n self.groups.draw();", "metadata": "root.VIctorApp.on_draw", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 175 }, { "content": " def is_normal_mode(self):\n return self.mode == vmode.NORMAL", "metadata": "root.VIctorApp.is_normal_mode", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 182 }, { "content": " def is_ex_mode(self):\n return self.mode == vmode.EX", "metadata": "root.VIctorApp.is_ex_mode", "header": "['class', 'VIctorApp', '(', 'pyglet', '.', 'window', '.', 'Window', ')', ':', '___EOS___']", "index": 185 } ]
[ { "span": "import collections", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 18 }, { "span": "import re, sys, time", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 20 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyglet_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyglet_", "._", "gl_", "as_", "gl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyglet_", "._", "window_", "._", "key_", "as_", "pkey_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", ",_", "sys_", ",_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "itertools_", "import_", "chain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "vict", "or_", "._", "mode_", "as_", "vmo", "de_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vict", "or_", "._", "command", "\\u", "area_", "import_", "Command", "Area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vict", "or_", "._", "cursor_", "import_", "Cursor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vict", "or_", "._", "keystr", "oke", "_", "import_", "Keys", "tro", "kes", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vict", "or_", "._", "movement", "\\u", "grid_", "import_", "Move", "ment", "Grid_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "vict", "or_", "._", "command_", "import_", "Command", "Exception_", ",_", "register", "\\u", "ex", "\\u", "command_", ",_", "run", "\\u", "ex", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "vict", "or_", "._", "path", "\\u", "group_", "import_", "Path", "Group_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vict", "or_", "._", "path_", "import_", "Path_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "vict", "or_", "._", "normal", "\\u", "dispatcher_", "as_", "vn", "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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\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_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "VI", "ctor", "App_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "640_", ",_", "400_", ",_", "caption_", "=_", "\"", "vict", "or", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "default", "\\u", "options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mode_", "=_", "vmo", "de_", "._", "NORMAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "down", "\\u", "action_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text", "\\u", "event_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "batch_", "=_", "pyglet_", "._", "graphics_", "._", "Batch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "setup", "\\u", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "marks_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "command", "\\u", "area_", "=_", "Command", "Area_", "(_", "0_", ",_", "0_", ",_", "550_", ",_", "self_", "._", "batch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keystr", "oke", "s_", "=_", "Keys", "tro", "kes", "_", "(_", "550_", ",_", "0_", ",_", "70_", ",_", "self_", "._", "batch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "current", "\\u", "multiplier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "normal", "\\u", "dispatcher_", "=_", "vn", "d_", "._", "construct", "\\u", "dispatcher_", "(_", "self_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "ex", "\\u", "commands_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "groups_", "=_", "self_", "._", "current", "\\u", "group_", "=_", "Path", "Group_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "current", "\\u", "path_", "=_", "None_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pyglet_", "._", "clock_", "._", "schedule", "\\u", "interval_", "(_", "self_", "._", "on", "\\u", "timer", "\\u", "fire_", ",_", ".05_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gl_", "._", "gl", "Ble", "nd", "Func_", "(_", "gl_", "._", "GL", "\\u", "SR", "C", "\\u", "ALPHA_", ",_", "gl_", "._", "GL", "\\u", "ONE", "\\u", "MINUS", "\\u", "SR", "C", "\\u", "ALPHA_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gl_", "._", "gl", "Enable_", "(_", "gl_", "._", "GL", "\\u", "BLEND", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setup", "\\u", "cursor_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cursor_", "=_", "Cursor_", "(_", "320_", ",_", "200_", ",_", "self_", "._", "batch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "grid_", "=_", "Move", "ment", "Grid_", "(_", "640_", ",_", "400_", ",_", "self_", "._", "options_", "[_", "'", "grid", "color", "'_", "]_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "grid_", "._", "reset", "\\u", "batch_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "ex", "\\u", "commands_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "register", "\\u", "ex", "\\u", "command_", "(_", "'", "line", "'_", ",_", "self_", "._", "draw", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "register", "\\u", "ex", "\\u", "command_", "(_", "'", "mark", "s", "'_", ",_", "self_", "._", "show", "\\u", "marks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "register", "\\u", "ex", "\\u", "command_", "(_", "'", "set", "'_", ",_", "self_", "._", "set\\u", "option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "default", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "options_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "options_", "[_", "\"", "color", "\"_", "]_", "=_", "(_", "0_", ",_", "0_", ",_", "0_", ",_", "255_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "options_", "[_", "\"", "grid", "color", "\"_", "]_", "=_", "(_", "0_", ",_", "0_", ",_", "255_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "mode_", "(_", "self_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "ex", "\\u", "mode_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "command", "\\u", "area_", "._", "unfo", "cus", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "mode_", "=_", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mode_", "==_", "vmo", "de_", "._", "EX_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "command", "\\u", "area_", "._", "focus_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "\\u", "to", "\\u", "ex", "\\u", "mode_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "mode_", "(_", "vmo", "de_", "._", "EX_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "command_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "run", "\\u", "ex", "\\u", "command_", "(_", "self_", "._", "command", "\\u", "area_", "._", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Command", "Exception_", "as_", "e_", ":_", "sys_", "._", "stderr_", "._", "write_", "(_", "'%", "s", "\\\\", "n", "'_", "%_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "mode_", "(_", "vmo", "de_", "._", "NORMAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "timer", "\\u", "fire_", "(_", "self_", ",_", "dt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "normal", "\\u", "dispatcher_", "._", "send_", "(_", "vn", "d_", "._", "Normal", "Event_", "(_", "vn", "d_", "._", "TIMER", "\\u", "FIRE", "_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dispatch", "\\u", "both_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "down", "\\u", "action_", "is_", "None_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "text", "\\u", "event_", "is_", "None_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "down", "\\u", "action_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "down", "\\u", "action_", "=_", "self_", "._", "text", "\\u", "event_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "key", "\\u", "press_", "(_", "self_", ",_", "symbol_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "mod", "\\u", "key_", "=_", "lambda_", "key_", ",_", "mod_", ":_", "symbol_", "==_", "key_", "and_", "modifiers_", "&_", "mod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "ex", "\\u", "mode_", "(_", ")_", "and_", "symbol_", "==_", "pkey_", "._", "ENTER_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run", "\\u", "command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "symbol_", "==_", "pkey_", "._", "ESCAPE", "_", "or_", "is", "\\u", "mod", "\\u", "key_", "(_", "pkey_", "._", "BRAC", "KET", "LEFT_", ",_", "pkey_", "._", "MOD", "\\u", "CTR", "L_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "is", "\\u", "normal", "\\u", "mode_", "(_", ")_", ":_", "self_", "._", "set\\u", "mode_", "(_", "vmo", "de_", "._", "NORMAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keystr", "oke", "s_", "._", "push", "\\u", "text_", "(_", "\"", "^", "[\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "normal", "\\u", "dispatcher_", "._", "send_", "(_", "vn", "d_", "._", "Normal", "Event_", "(_", "vn", "d_", "._", "ESCAPE", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "close", " ", "window_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "pyglet_", "._", "event_", "._", "EVENT", "\\u", "HANDLE", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "is", "\\u", "normal", "\\u", "mode_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "normal", "\\u", "dispatcher_", "._", "send_", "(_", "vn", "d_", "._", "Normal", "Event_", "(_", "vn", "d_", "._", "ON", "\\u", "KEY", "\\u", "PRESS", "_", ",_", "symbol_", ",_", "modifiers_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "key", "\\u", "release_", "(_", "self_", ",_", "symbol_", ",_", "modifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "normal", "\\u", "mode_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "normal", "\\u", "dispatcher_", "._", "send_", "(_", "vn", "d_", "._", "Normal", "Event_", "(_", "vn", "d_", "._", "ON", "\\u", "KEY", "\\u", "RELEASE", "_", ",_", "symbol_", ",_", "modifiers_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "text_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "ex", "\\u", "mode_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "command", "\\u", "area_", "._", "on", "\\u", "text_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "command", "\\u", "area_", "._", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "mode_", "(_", "vmo", "de_", "._", "NORMAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "is", "\\u", "normal", "\\u", "mode_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "text_", "==_", "':'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text", "\\u", "event_", "=_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dispatch", "\\u", "both_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "keystr", "oke", "s_", "._", "push", "\\u", "text_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "text", "\\u", "motion_", "(_", "self_", ",_", "motion_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "ex", "\\u", "mode_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "command", "\\u", "area_", "._", "on", "\\u", "text", "\\u", "motion_", "(_", "motion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "command", "\\u", "area_", "._", "has", "\\u", "focus_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "mode_", "(_", "vmo", "de_", "._", "NORMAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\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_", "current", "\\u", "position_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "cursor_", "._", "x_", ",_", "self_", "._", "cursor_", "._", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "\\u", "path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "current", "\\u", "path_", "=_", "Path_", "(_", "self_", "._", "cursor_", "._", "position_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "paths_", "._", "append_", "(_", "self_", "._", "current", "\\u", "path_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "append", "\\u", "path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "current", "\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "current", "\\u", "path_", "._", "append_", "(_", "self_", "._", "cursor_", "._", "position_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "draw", "\\u", "line_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "!=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", "\"", "line", " ", "require", "s", " ", "two", " ", "argu", "ment", "s", "\"_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "self_", "._", "marks_", "[_", "args_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "self_", "._", "marks_", "[_", "args_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "batch_", "._", "add_", "(_", "2_", ",_", "pyglet_", "._", "gl_", "._", "GL", "\\u", "LINES_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "v2", "i", "'_", ",_", "(_", "start_", "[_", "0_", "]_", ",_", "start_", "[_", "1_", "]_", ",_", "end_", "[_", "0_", "]_", ",_", "end_", "[_", "1_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "c4", "B", "'_", ",_", "tuple_", "(_", "chain_", "(_", "self_", "._", "options_", "[_", "\"", "color", "\"_", "]_", ",_", "self_", "._", "options_", "[_", "\"", "color", "\"_", "]_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "\\u", "marks_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "self_", "._", "marks_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "key_", ",_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\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", "option_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "<_", "2_", ":_", "raise_", "Command", "Exception_", "(_", "\"", "No", " ", "option", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "option_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "option_", "==_", "\"", "color", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "!=_", "5_", ":_", "raise_", "Command", "Exception_", "(_", "\"", "color", " ", "must", " ", "have", " ", "4", " ", "argu", "ment", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "options_", "[_", "\"", "color", "\"_", "]_", "=_", "tuple_", "(_", "map_", "(_", "int_", ",_", "args_", "[_", "1_", ":_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "option_", "==_", "\"", "grid", "color", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "error_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "args_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "draw_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyglet_", "._", "gl_", "._", "gl", "Clear", "Color_", "(_", "1_", ",_", "1_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "grid_", "._", "draw_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "batch_", "._", "draw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "groups_", "._", "draw_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "normal", "\\u", "mode_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "mode_", "==_", "vmo", "de_", "._", "NORMAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VI", "ctor", "App_", "(_", "pyglet_", "._", "window_", "._", "Window_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "ex", "\\u", "mode_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "mode_", "==_", "vmo", "de_", "._", "EX_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
apeeyush/MoodY-Trudes/inputvector.py
[ { "content": "import sys\nimport re\nimport os\nfrom os import listdir\nfrom os.path import isfile, join, isdir\nfrom stemming.porter2 import stem\nimport nltk\nfrom nltk.tag import pos_tag\n\nwordsd_final=[\"all\", \"keep\", \"celebr\", \"emili\", \"sleep\", \"asian\", \"go\", \"follow\", \"hate\", \"privat\", \"sorri\", \"young\", \"send\", \"smile\", \"song\", \"far\", \"ical\", \"worst\", \"fall\",\"veri\", \"appar\", \"exact\", \"cool\", \"tri\", \"magic\", \"die\", \"soooo\", \"quick\", \"enjoy\", \"work\", \"sigh\", \"direct\", \"past\", \"everytim\", \"second\", \"blue\", \"repli\", \"abl\", \"current\", \"new\", \"ever\", \"public\", \"full\", \"never\", \"french\", \"let\", \"trent_reznor\", \"miser\", \"wait\", \"great\", \"insan\", \"tire\", \"ahead\",\n\"anymor\", \"smoke\", \"pick\", \"healthi\", \"extrem\", \"weird\", \"guilti\", \"tweet\", \"love\", \"joshwhite78\", \"extra\", \"win\", \"emot\", \"put\", \"instal\", \"txt\", \"use\", \"doubl\", \"visit\", \"next\", \"few\", \"live\", \"call\", \"gorgeous\", \"angri\", \"tell\", \"more\", \"flat\", \"almost\", \"relax\", \"babi\", \"sore\", \"holi\", \"actual\", \"glad\", \"ride\", \"pretend\", \"fli\", \"wors\", \"obvious\",\"whatev\", \"learn\", \"meet\", \"aliv\", \"fabul\", \"give\", \"share\", \"high\", \"crazi\", \"want\", \"david\", \"everywher\", \"huge\", \"twitpic\",\n\"end\", \"quot\", \"rather\", \"write\",\"alway\", \"hot\", \"answer\", \"disappoint\", \"updat\", \"product\", \"watch\", \"earlier\", \"wrong\", \"mad\", \"beauti\", \"such\", \"welcom\", \"short\", \"favorit\", \"caus\", \"danni\", \"so\", \"talk\", \"cute\", \"help\", \"over\", \"sooo\", \"soon\", \"cold\", \"still\", \"perfect\", \"thank\", \"alli\", \"better\", \"lt\", \"therefor\", \"ly\", \"then\", \"good\", \"nation\", \"break\",\"tonit\", \"instead\", \"not\", \"now\", \"billi\", \"pregnant\", \"drop\", \"oliv\", \"mean\", \"hard\", \"yeah\", \"realli\", \"2day\",\n\"happen\", \"special\", \"god\", \"re\", \"nite\", \"drink\",\"free\", \"argh\", \"believ\", \"ask\", \"molli\", \"ate\", \"miss\", \"honest\", \"turn\", \"think\", \"first\", \"origin\", \"pleas\", \"major\", \"feel\", \"onc\", \"alreadi\", \"fast\", \"spanish\",\"horribl\", \"fantast\", \"differ\", \"top\", \"sometim\", \"least\", \"too\", \"white\", \"final\", \"listen\", \"especi\", \"juli\", \"haven\", \"jump\", \"kind\", \"silli\", \"mcfli\", \"terribl\", \"mind\", \"mine\", \"sad\", \"tonight\", \"say\", \"nick_cart\", \"have\", \"veryy\", \"breakfast\", \"sat\", \"also\", \"take\",\n\"green\", \"singl\", \"even\", \"begin\", \"sure\", \"normal\", \"most\", \"regular\", \"don\", \"later\", \"upset\", \"drive\", \"hospit\", \"inde\", \"clean\", \"usual\", \"wow\", \"awesom\", \"ridicul\", \"show\", \"tommcfli\", \"bring\", \"bright\", \"rough\", \"find\", \"absolut\", \"onli\", \"pretti\", \"nervous\", \"hope\", \"forev\", \"busi\", \"black\", \"local\", \"offici\", \"unhappi\", \"do\", \"get\", \"stop\", \"cannot\", \"sunni\", \"lucki\", \"truli\",\"anniversari\", \"bad\", \"stupid\", \"cri\", \"fair\", \"see\", \"asleep\", \"close\", \"best\",\n\"wonder\", \"away\", \"rlli\", \"figur\", \"awak\", \"import\", \"15th\", \"joy\", \"entir\", \"here\", \"key\", \"come\", \"last\", \"ill\", \"alon\", \"quiet\", \"ili\", \"mani\", \"whole\", \"wear\", \"sweet\", \"boat\", \"late\", \"due\", \"much\", \"damn\", \"interest\", \"basic\", \"alyssa_milano\", \"sooooo\", \"wake\", \"togeth\", \"chill\", \"play\", \"look\", \"will\", \"near\", \"fun\", \"howev\", \"earli\", \"ve\", \"readi\", \"dannymcfli\", \"worri\", \"ive\", \"cant\", \"sudden\", \"im\", \"rid\", \"sever\", \"belli\", \"open\", \"pay\", \"make\", \"same\", \"funni\",\n\"itali\", \"complet\", \"evry1\", \"finish\", \"http\", \"social\", \"hang\", \"jealous\", \"feelin\", \"recent\", \"overcast\", \"well\", \"tho\", \"english\", \"spend\", \"latest\", \"itouch\", \"just\", \"less\", \"laptop\", \"kill\", \"sleepi\", \"yet\", \"europ\", \"shaunjumpnow\", \"josh\", \"littl\", \"add\", \"soooooo\", \"els\", \"real\", \"sonic\", \"rememb\", \"mayb\", \"read\", \"big\", \"ladi\", \"gonna\", \"dark\", \"know\", \"amp\", \"like\", \"incred\", \"lose\", \"right\", \"old\", \"often\", \"twitter\", \"back\", \"b4\", \"home\", \"surpris\",\n\"total\", \"chocol\", \"definit\", \"leav\", \"be\", \"run\", \"quit\", \"super\", \"central\", \"oh\", \"unfortun\", \"plus\", \"own\", \"every1\", \"2nite\", \"elementari\", \"soo\", \"weather\", \"meeee\", \"there\", \"long\", \"happi\", \"start\", \"low\", \"forward\", \"music\", \"buy\", \"north\", \"enough\", \"hear\", \"true\", \"eat\", \"nanda_marinho\", \"possibl\", \"wish\", \"up\", \"ur\", \"certain\", \"pic\", \"doesn\", \"general\", \"as\", \"aw\", \"probabl\", \"again\", \"googl\", \"no\", \"other\", \"sick\", \"nice\", \"poor\", \"finali\", \"stay\", \"goin\",\n\"ago\",\"longer\", \"hungri\", \"serious\", \"bl3ss\", \"hello\"]\nf = open(\"update.txt\",\"rU\")\nwordsl=[]\nwordsd_temp={}\nfor line in f :\n start = line.find(\"u'message': u'\" )+ 14\n end = line.find(\"', u'actor_id':\")\n linei = line[start:end]\n wordsl=wordsl+[w for w in re.split('\\W',linei.lower()) if w]\nfor elements in wordsl:\n element=stem(elements)\n if element in wordsd_final:\n if element in wordsd_temp:\n wordsd_temp[element]+=1\n else:\n wordsd_temp[element]=1\nstring=\"\"\nstring+=\"1.0\"\nfor i in range(len(wordsd_final)) :\n if wordsd_final[i] in wordsd_temp:\n string+=\" \"\n string+=str(i+2)\n string+=\":\"\n string+=str(wordsd_temp[wordsd_final[i]])\n string+='.0'\nprint string\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sys", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 10 }, { "span": "import os", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 9 }, { "span": "from os import listdir", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 22 }, { "span": "from os.path import isfile, join, isdir", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 39 }, { "span": "import nltk", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 11 }, { "span": "from nltk.tag import pos_tag", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "import_", "listdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "._", "path_", "import_", "isfile_", ",_", "join_", ",_", "isdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stem", "ming", "_", "._", "porte", "r2_", "import_", "stem_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "nltk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nltk_", "._", "tag_", "import_", "pos", "\\u", "tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "words", "d\\u", "final_", "=_", "[_", "\"", "all", "\"_", ",_", "\"", "keep", "\"_", ",_", "\"", "cele", "br", "\"_", ",_", "\"", "emi", "li", "\"_", ",_", "\"", "sleep", "\"_", ",_", "\"", "asia", "n", "\"_", ",_", "\"", "go", "\"_", ",_", "\"", "follow", "\"_", ",_", "\"", "hat", "e", "\"_", ",_", "\"", "priv", "at", "\"_", ",_", "\"", "sorr", "i", "\"_", ",_", "\"", "young", "\"_", ",_", "\"", "send", "\"_", ",_", "\"", "smile", "\"_", ",_", "\"", "song", "\"_", ",_", "\"", "far", "\"_", ",_", "\"", "ical", "\"_", ",_", "\"", "worst", "\"_", ",_", "\"", "fall", "\"_", ",_", "\"", "veri", "\"_", ",_", "\"", "appa", "r", "\"_", ",_", "\"", "exact", "\"_", ",_", "\"", "cool", "\"_", ",_", "\"", "tri", "\"_", ",_", "\"", "magic", "\"_", ",_", "\"", "die", "\"_", ",_", "\"", "soo", "oo", "\"_", ",_", "\"", "quick", "\"_", ",_", "\"", "enj", "oy", "\"_", ",_", "\"", "work", "\"_", ",_", "\"", "sig", "h", "\"_", ",_", "\"", "direct", "\"_", ",_", "\"", "past", "\"_", ",_", "\"", "every", "tim", "\"_", ",_", "\"", "second", "\"_", ",_", "\"", "blue", "\"_", ",_", "\"", "repl", "i", "\"_", ",_", "\"", "abl", "\"_", ",_", "\"", "current", "\"_", ",_", "\"", "new", "\"_", ",_", "\"", "ever", "\"_", ",_", "\"", "public", "\"_", ",_", "\"", "full", "\"_", ",_", "\"", "neve", "r", "\"_", ",_", "\"", "french", "\"_", ",_", "\"", "let", "\"_", ",_", "\"", "tre", "nt", "\\u", "rez", "nor", "\"_", ",_", "\"", "mis", "er", "\"_", ",_", "\"", "wait", "\"_", ",_", "\"", "great", "\"_", ",_", "\"", "ins", "an", "\"_", ",_", "\"", "tir", "e", "\"_", ",_", "\"", "ahe", "ad", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "any", "mor", "\"_", ",_", "\"", "smoke", "\"_", ",_", "\"", "pick", "\"_", ",_", "\"", "health", "i", "\"_", ",_", "\"", "extre", "m", "\"_", ",_", "\"", "weird", "\"_", ",_", "\"", "guil", "ti", "\"_", ",_", "\"", "tweet", "\"_", ",_", "\"", "love", "\"_", ",_", "\"", "jos", "hw", "hit", "e7", "8", "\"_", ",_", "\"", "extra", "\"_", ",_", "\"", "win", "\"_", ",_", "\"", "emot", "\"_", ",_", "\"", "put", "\"_", ",_", "\"", "insta", "l", "\"_", ",_", "\"", "txt", "\"_", ",_", "\"", "use", "\"_", ",_", "\"", "dou", "bl", "\"_", ",_", "\"", "visit", "\"_", ",_", "\"", "next", "\"_", ",_", "\"", "few", "\"_", ",_", "\"", "live", "\"_", ",_", "\"", "call", "\"_", ",_", "\"", "gor", "geo", "us", "\"_", ",_", "\"", "angr", "i", "\"_", ",_", "\"", "tell", "\"_", ",_", "\"", "more", "\"_", ",_", "\"", "flat", "\"_", ",_", "\"", "alm", "ost", "\"_", ",_", "\"", "relax", "\"_", ",_", "\"", "bab", "i", "\"_", ",_", "\"", "sor", "e", "\"_", ",_", "\"", "hol", "i", "\"_", ",_", "\"", "actual", "\"_", ",_", "\"", "gla", "d", "\"_", ",_", "\"", "ride", "\"_", ",_", "\"", "prete", "nd", "\"_", ",_", "\"", "fli", "\"_", ",_", "\"", "wor", "s", "\"_", ",_", "\"", "ob", "vio", "us", "\"_", ",_", "\"", "what", "ev", "\"_", ",_", "\"", "learn", "\"_", ",_", "\"", "meet", "\"_", ",_", "\"", "ali", "v", "\"_", ",_", "\"", "fab", "ul", "\"_", ",_", "\"", "give", "\"_", ",_", "\"", "share", "\"_", ",_", "\"", "high", "\"_", ",_", "\"", "cra", "zi", "\"_", ",_", "\"", "want", "\"_", ",_", "\"", "davi", "d", "\"_", ",_", "\"", "every", "whe", "r", "\"_", ",_", "\"", "huge", "\"_", ",_", "\"", "twit", "pic", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "end", "\"_", ",_", "\"", "quot", "\"_", ",_", "\"", "rat", "her", "\"_", ",_", "\"", "write", "\"_", ",_", "\"", "alw", "ay", "\"_", ",_", "\"", "hot", "\"_", ",_", "\"", "answer", "\"_", ",_", "\"", "disapp", "oint", "\"_", ",_", "\"", "updat", "\"_", ",_", "\"", "product", "\"_", ",_", "\"", "watch", "\"_", ",_", "\"", "ear", "lie", "r", "\"_", ",_", "\"", "wrong", "\"_", ",_", "\"", "mad", "\"_", ",_", "\"", "beau", "ti", "\"_", ",_", "\"", "suc", "h", "\"_", ",_", "\"", "wel", "com", "\"_", ",_", "\"", "short", "\"_", ",_", "\"", "fav", "ori", "t", "\"_", ",_", "\"", "caus", "\"_", ",_", "\"", "dan", "ni", "\"_", ",_", "\"", "so", "\"_", ",_", "\"", "talk", "\"_", ",_", "\"", "cute", "\"_", ",_", "\"", "help", "\"_", ",_", "\"", "over", "\"_", ",_", "\"", "soo", "o", "\"_", ",_", "\"", "soo", "n", "\"_", ",_", "\"", "cold", "\"_", ",_", "\"", "still", "\"_", ",_", "\"", "perfect", "\"_", ",_", "\"", "than", "k", "\"_", ",_", "\"", "alli", "\"_", ",_", "\"", "bett", "er", "\"_", ",_", "\"", "lt", "\"_", ",_", "\"", "there", "for", "\"_", ",_", "\"", "ly", "\"_", ",_", "\"", "then", "\"_", ",_", "\"", "good", "\"_", ",_", "\"", "nati", "on", "\"_", ",_", "\"", "break", "\"_", ",_", "\"", "toni", "t", "\"_", ",_", "\"", "inst", "ead", "\"_", ",_", "\"", "not", "\"_", ",_", "\"", "now", "\"_", ",_", "\"", "bill", "i", "\"_", ",_", "\"", "preg", "nant", "\"_", ",_", "\"", "drop", "\"_", ",_", "\"", "oli", "v", "\"_", ",_", "\"", "mean", "\"_", ",_", "\"", "hard", "\"_", ",_", "\"", "ye", "ah", "\"_", ",_", "\"", "reall", "i", "\"_", ",_", "\"", "2d", "ay", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "happ", "en", "\"_", ",_", "\"", "special", "\"_", ",_", "\"", "god", "\"_", ",_", "\"", "re", "\"_", ",_", "\"", "nite", "\"_", ",_", "\"", "drink", "\"_", ",_", "\"", "free", "\"_", ",_", "\"", "arg", "h", "\"_", ",_", "\"", "beli", "ev", "\"_", ",_", "\"", "ask", "\"_", ",_", "\"", "mol", "li", "\"_", ",_", "\"", "ate", "\"_", ",_", "\"", "miss", "\"_", ",_", "\"", "hone", "st", "\"_", ",_", "\"", "turn", "\"_", ",_", "\"", "think", "\"_", ",_", "\"", "first", "\"_", ",_", "\"", "orig", "in", "\"_", ",_", "\"", "plea", "s", "\"_", ",_", "\"", "major", "\"_", ",_", "\"", "feel", "\"_", ",_", "\"", "onc", "\"_", ",_", "\"", "alr", "ead", "i", "\"_", ",_", "\"", "fast", "\"_", ",_", "\"", "span", "ish", "\"_", ",_", "\"", "hor", "rib", "l", "\"_", ",_", "\"", "fantas", "t", "\"_", ",_", "\"", "differ", "\"_", ",_", "\"", "top", "\"_", ",_", "\"", "somet", "im", "\"_", ",_", "\"", "leas", "t", "\"_", ",_", "\"", "too", "\"_", ",_", "\"", "white", "\"_", ",_", "\"", "final", "\"_", ",_", "\"", "listen", "\"_", ",_", "\"", "espec", "i", "\"_", ",_", "\"", "jul", "i", "\"_", ",_", "\"", "have", "n", "\"_", ",_", "\"", "jump", "\"_", ",_", "\"", "kind", "\"_", ",_", "\"", "sil", "li", "\"_", ",_", "\"", "mc", "fli", "\"_", ",_", "\"", "terr", "ibl", "\"_", ",_", "\"", "mind", "\"_", ",_", "\"", "mine", "\"_", ",_", "\"", "sad", "\"_", ",_", "\"", "toni", "ght", "\"_", ",_", "\"", "say", "\"_", ",_", "\"", "nick", "\\u", "cart", "\"_", ",_", "\"", "have", "\"_", ",_", "\"", "very", "y", "\"_", ",_", "\"", "break", "fast", "\"_", ",_", "\"", "sat", "\"_", ",_", "\"", "als", "o", "\"_", ",_", "\"", "take", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "green", "\"_", ",_", "\"", "sing", "l", "\"_", ",_", "\"", "even", "\"_", ",_", "\"", "begin", "\"_", ",_", "\"", "sure", "\"_", ",_", "\"", "normal", "\"_", ",_", "\"", "most", "\"_", ",_", "\"", "regular", "\"_", ",_", "\"", "don", "\"_", ",_", "\"", "late", "r", "\"_", ",_", "\"", "upse", "t", "\"_", ",_", "\"", "drive", "\"_", ",_", "\"", "hos", "pit", "\"_", ",_", "\"", "inde", "\"_", ",_", "\"", "clean", "\"_", ",_", "\"", "usual", "\"_", ",_", "\"", "wo", "w", "\"_", ",_", "\"", "aw", "eso", "m", "\"_", ",_", "\"", "rid", "icul", "\"_", ",_", "\"", "show", "\"_", ",_", "\"", "tom", "mc", "fli", "\"_", ",_", "\"", "bring", "\"_", ",_", "\"", "bright", "\"_", ",_", "\"", "rough", "\"_", ",_", "\"", "find", "\"_", ",_", "\"", "abs", "olu", "t", "\"_", ",_", "\"", "onli", "\"_", ",_", "\"", "pret", "ti", "\"_", ",_", "\"", "ner", "vous", "\"_", ",_", "\"", "hop", "e", "\"_", ",_", "\"", "fore", "v", "\"_", ",_", "\"", "bus", "i", "\"_", ",_", "\"", "black", "\"_", ",_", "\"", "local", "\"_", ",_", "\"", "off", "ici", "\"_", ",_", "\"", "unh", "app", "i", "\"_", ",_", "\"", "do", "\"_", ",_", "\"", "get", "\"_", ",_", "\"", "stop", "\"_", ",_", "\"", "cann", "ot", "\"_", ",_", "\"", "sun", "ni", "\"_", ",_", "\"", "luck", "i", "\"_", ",_", "\"", "tru", "li", "\"_", ",_", "\"", "ann", "iver", "sar", "i", "\"_", ",_", "\"", "bad", "\"_", ",_", "\"", "stu", "pid", "\"_", ",_", "\"", "cri", "\"_", ",_", "\"", "fair", "\"_", ",_", "\"", "see", "\"_", ",_", "\"", "asl", "eep", "\"_", ",_", "\"", "close", "\"_", ",_", "\"", "best", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "won", "der", "\"_", ",_", "\"", "awa", "y", "\"_", ",_", "\"", "rl", "li", "\"_", ",_", "\"", "fig", "ur", "\"_", ",_", "\"", "awa", "k", "\"_", ",_", "\"", "import", "\"_", ",_", "\"", "15", "th", "\"_", ",_", "\"", "joy", "\"_", ",_", "\"", "enti", "r", "\"_", ",_", "\"", "here", "\"_", ",_", "\"", "key", "\"_", ",_", "\"", "come", "\"_", ",_", "\"", "last", "\"_", ",_", "\"", "ill", "\"_", ",_", "\"", "alo", "n", "\"_", ",_", "\"", "quie", "t", "\"_", ",_", "\"", "ili", "\"_", ",_", "\"", "mani", "\"_", ",_", "\"", "whole", "\"_", ",_", "\"", "wea", "r", "\"_", ",_", "\"", "swe", "et", "\"_", ",_", "\"", "boat", "\"_", ",_", "\"", "late", "\"_", ",_", "\"", "due", "\"_", ",_", "\"", "muc", "h", "\"_", ",_", "\"", "dam", "n", "\"_", ",_", "\"", "interest", "\"_", ",_", "\"", "basic", "\"_", ",_", "\"", "aly", "ssa", "\\u", "mil", "ano", "\"_", ",_", "\"", "soo", "ooo", "\"_", ",_", "\"", "wake", "\"_", ",_", "\"", "tog", "eth", "\"_", ",_", "\"", "chill", "\"_", ",_", "\"", "play", "\"_", ",_", "\"", "look", "\"_", ",_", "\"", "will", "\"_", ",_", "\"", "near", "\"_", ",_", "\"", "fun", "\"_", ",_", "\"", "how", "ev", "\"_", ",_", "\"", "ear", "li", "\"_", ",_", "\"", "ve", "\"_", ",_", "\"", "readi", "\"_", ",_", "\"", "dan", "nym", "cf", "li", "\"_", ",_", "\"", "wor", "ri", "\"_", ",_", "\"", "ive", "\"_", ",_", "\"", "cant", "\"_", ",_", "\"", "sud", "den", "\"_", ",_", "\"", "im", "\"_", ",_", "\"", "rid", "\"_", ",_", "\"", "sever", "\"_", ",_", "\"", "bell", "i", "\"_", ",_", "\"", "open", "\"_", ",_", "\"", "pay", "\"_", ",_", "\"", "make", "\"_", ",_", "\"", "same", "\"_", ",_", "\"", "funn", "i", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ita", "li", "\"_", ",_", "\"", "complet", "\"_", ",_", "\"", "ev", "ry", "1", "\"_", ",_", "\"", "finish", "\"_", ",_", "\"", "http", "\"_", ",_", "\"", "social", "\"_", ",_", "\"", "hang", "\"_", ",_", "\"", "je", "alo", "us", "\"_", ",_", "\"", "feel", "in", "\"_", ",_", "\"", "recent", "\"_", ",_", "\"", "over", "cast", "\"_", ",_", "\"", "well", "\"_", ",_", "\"", "tho", "\"_", ",_", "\"", "english", "\"_", ",_", "\"", "spend", "\"_", ",_", "\"", "late", "st", "\"_", ",_", "\"", "ito", "uch", "\"_", ",_", "\"", "just", "\"_", ",_", "\"", "less", "\"_", ",_", "\"", "lap", "top", "\"_", ",_", "\"", "kill", "\"_", ",_", "\"", "sleep", "i", "\"_", ",_", "\"", "ye", "t", "\"_", ",_", "\"", "europ", "\"_", ",_", "\"", "sha", "un", "jump", "now", "\"_", ",_", "\"", "jos", "h", "\"_", ",_", "\"", "litt", "l", "\"_", ",_", "\"", "add", "\"_", ",_", "\"", "soo", "oooo", "\"_", ",_", "\"", "el", "s", "\"_", ",_", "\"", "real", "\"_", ",_", "\"", "son", "ic", "\"_", ",_", "\"", "reme", "mb", "\"_", ",_", "\"", "may", "b", "\"_", ",_", "\"", "read", "\"_", ",_", "\"", "big", "\"_", ",_", "\"", "lad", "i", "\"_", ",_", "\"", "gon", "na", "\"_", ",_", "\"", "dark", "\"_", ",_", "\"", "know", "\"_", ",_", "\"", "amp", "\"_", ",_", "\"", "like", "\"_", ",_", "\"", "incr", "ed", "\"_", ",_", "\"", "lose", "\"_", ",_", "\"", "right", "\"_", ",_", "\"", "old", "\"_", ",_", "\"", "oft", "en", "\"_", ",_", "\"", "twit", "ter", "\"_", ",_", "\"", "back", "\"_", ",_", "\"", "b4", "\"_", ",_", "\"", "home", "\"_", ",_", "\"", "sur", "pris", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "total", "\"_", ",_", "\"", "cho", "col", "\"_", ",_", "\"", "definit", "\"_", ",_", "\"", "lea", "v", "\"_", ",_", "\"", "be", "\"_", ",_", "\"", "run", "\"_", ",_", "\"", "quit", "\"_", ",_", "\"", "super", "\"_", ",_", "\"", "central", "\"_", ",_", "\"", "oh", "\"_", ",_", "\"", "unfo", "rtu", "n", "\"_", ",_", "\"", "plus", "\"_", ",_", "\"", "own", "\"_", ",_", "\"", "every", "1", "\"_", ",_", "\"", "2n", "ite", "\"_", ",_", "\"", "elementa", "ri", "\"_", ",_", "\"", "soo", "\"_", ",_", "\"", "wea", "ther", "\"_", ",_", "\"", "mee", "ee", "\"_", ",_", "\"", "there", "\"_", ",_", "\"", "long", "\"_", ",_", "\"", "happ", "i", "\"_", ",_", "\"", "start", "\"_", ",_", "\"", "low", "\"_", ",_", "\"", "forward", "\"_", ",_", "\"", "music", "\"_", ",_", "\"", "buy", "\"_", ",_", "\"", "north", "\"_", ",_", "\"", "eno", "ugh", "\"_", ",_", "\"", "hear", "\"_", ",_", "\"", "true", "\"_", ",_", "\"", "eat", "\"_", ",_", "\"", "nand", "a", "\\u", "mari", "nho", "\"_", ",_", "\"", "possib", "l", "\"_", ",_", "\"", "wish", "\"_", ",_", "\"", "up", "\"_", ",_", "\"", "ur", "\"_", ",_", "\"", "cert", "ain", "\"_", ",_", "\"", "pic", "\"_", ",_", "\"", "doe", "sn", "\"_", ",_", "\"", "genera", "l", "\"_", ",_", "\"", "as", "\"_", ",_", "\"", "aw", "\"_", ",_", "\"", "probab", "l", "\"_", ",_", "\"", "again", "\"_", ",_", "\"", "goog", "l", "\"_", ",_", "\"", "no", "\"_", ",_", "\"", "other", "\"_", ",_", "\"", "sick", "\"_", ",_", "\"", "nice", "\"_", ",_", "\"", "poo", "r", "\"_", ",_", "\"", "finali", "\"_", ",_", "\"", "stay", "\"_", ",_", "\"", "goi", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ago", "\"_", ",_", "\"", "long", "er", "\"_", ",_", "\"", "hun", "gri", "\"_", ",_", "\"", "seri", "ous", "\"_", ",_", "\"", "bl", "3", "ss", "\"_", ",_", "\"", "hell", "o", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "\"", "update", ".", "txt", "\"_", ",_", "\"", "r", "U", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words", "d\\u", "temp_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "line_", "._", "find_", "(_", "\"", "u", "'", "message", "':", " ", "u", "'\"_", ")_", "+_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "line_", "._", "find_", "(_", "\"',", " ", "u", "'", "actor", "\\u", "id", "':", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "i_", "=_", "line_", "[_", "start_", ":_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words", "l_", "=_", "words", "l_", "+_", "[_", "w_", "for_", "w_", "in_", "re_", "._", "split_", "(_", "'\\\\", "W", "'_", ",_", "line", "i_", "._", "lower_", "(_", ")_", ")_", "if_", "w_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "elements_", "in_", "words", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "element_", "=_", "stem_", "(_", "elements_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "element_", "in_", "words", "d\\u", "final_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "element_", "in_", "words", "d\\u", "temp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "words", "d\\u", "temp_", "[_", "element_", "]_", "+=_", "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 ", " _", "words", "d\\u", "temp_", "[_", "element_", "]_", "=_", "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_", "string_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "+=_", "\"", "1.0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "words", "d\\u", "final_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "words", "d\\u", "final_", "[_", "i_", "]_", "in_", "words", "d\\u", "temp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "string_", "+=_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "+=_", "str_", "(_", "i_", "+_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "+=_", "\":\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "+=_", "str_", "(_", "words", "d\\u", "temp_", "[_", "words", "d\\u", "final_", "[_", "i_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "+=_", "'.", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "string_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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aryage/firelogger.py/gprof2dot.py
[ { "content": " def format(self, val):\n \"\"\"Format an event value.\"\"\"\n assert val is not None\n return self._formatter(val)", "metadata": "root.Event.format", "header": "['class', 'Event', '(', 'object', ')', ':', '___EOS___']", "index": 111 }, { "content": " def __init__(self, id, name):\n Object.__init__(self)\n self.id = id\n self.name = name\n self.calls = {}\n self.cycle = None", "metadata": "root.Function.__init__", "header": "['class', 'Function', '(', 'Object', ')', ':', '___EOS___']", "index": 180 }, { "content": " def get_function_name(self, (filename, line, name)):\n module = os.path.splitext(filename)[0]\n module = os.path.basename(module)\n return \"%s:%d:%s\" % (module, line, name)", "metadata": "root.PstatsParser.get_function_name", "header": "['class', 'PstatsParser', ':', '___EOS___']", "index": 1464 }, { "content": " def get_function(self, key):\n try:\n id = self.function_ids[key]\n except KeyError:\n id = len(self.function_ids)\n name = self.get_function_name(key)\n function = Function(id, name)\n self.profile.functions[id] = function\n self.function_ids[key] = id\n else:\n function = self.profile.functions[id]\n return function", "metadata": "root.PstatsParser.get_function", "header": "['class', 'PstatsParser', ':', '___EOS___']", "index": 1469 }, { "content": " def graph(self, profile, theme):\n self.begin_graph()\n\n fontname = theme.graph_fontname()\n\n self.attr('graph', fontname=fontname, ranksep=0.25, nodesep=0.125)\n self.attr('node', fontname=fontname, shape=\"box\", style=\"filled,rounded\", fontcolor=\"white\", width=0, height=0)\n self.attr('edge', fontname=fontname)\n\n for function in profile.functions.itervalues():\n labels = []\n for event in PROCESS, MODULE:\n if event in function.events:\n label = event.format(function[event])\n labels.append(label)\n labels.append(function.name)\n for event in TOTAL_TIME_RATIO, TIME_RATIO, CALLS:\n if event in function.events:\n label = event.format(function[event])\n labels.append(label)\n\n try:\n weight = function[PRUNE_RATIO]\n except UndefinedEvent:\n weight = 0.0\n\n label = '\\n'.join(labels)\n self.node(function.id,\n label = label,\n color = self.color(theme.node_bgcolor(weight)),\n fontcolor = self.color(theme.node_fgcolor(weight)),\n fontsize = \"%.2f\" % theme.node_fontsize(weight),\n )\n\n for call in function.calls.itervalues():\n callee = profile.functions[call.callee_id]\n\n labels = []\n for event in TOTAL_TIME_RATIO, CALLS:\n if event in call.events:\n label = event.format(call[event])\n labels.append(label)\n\n try:\n weight = call[PRUNE_RATIO]\n except UndefinedEvent:\n try:\n weight = callee[PRUNE_RATIO]\n except UndefinedEvent:\n weight = 0.0\n\n label = '\\n'.join(labels)\n\n self.edge(function.id, call.callee_id,\n label = label,\n color = self.color(theme.edge_color(weight)),\n fontcolor = self.color(theme.edge_color(weight)),\n fontsize = \"%.2f\" % theme.edge_fontsize(weight),\n penwidth = \"%.2f\" % theme.edge_penwidth(weight),\n labeldistance = \"%.2f\" % theme.edge_penwidth(weight),\n arrowsize = \"%.2f\" % theme.edge_arrowsize(weight),\n )\n\n self.end_graph()", "metadata": "root.DotWriter.graph", "header": "['class', 'DotWriter', ':', '___EOS___']", "index": 1670 }, { "content": " def begin_graph(self):\n self.write('digraph {\\n')", "metadata": "root.DotWriter.begin_graph", "header": "['class', 'DotWriter', ':', '___EOS___']", "index": 1735 }, { "content": " def end_graph(self):\n self.write('}\\n')", "metadata": "root.DotWriter.end_graph", "header": "['class', 'DotWriter', ':', '___EOS___']", "index": 1738 }, { "content": " def attr(self, what, **attrs):\n self.write(\"\\t\")\n self.write(what)\n self.attr_list(attrs)\n self.write(\";\\n\")", "metadata": "root.DotWriter.attr", "header": "['class', 'DotWriter', ':', '___EOS___']", "index": 1741 }, { "content": " def node(self, node, **attrs):\n self.write(\"\\t\")\n self.id(node)\n self.attr_list(attrs)\n self.write(\";\\n\")", "metadata": "root.DotWriter.node", "header": "['class', 'DotWriter', ':', '___EOS___']", "index": 1747 }, { "content": " def edge(self, src, dst, **attrs):\n self.write(\"\\t\")\n self.id(src)\n self.write(\" -> \")\n self.id(dst)\n self.attr_list(attrs)\n self.write(\";\\n\")", "metadata": "root.DotWriter.edge", "header": "['class', 'DotWriter', ':', '___EOS___']", "index": 1753 }, { "content": " def color(self, (r, g, b)):\n\n def float2int(f):\n if f <= 0.0:\n return 0\n if f >= 1.0:\n return 255\n return int(255.0*f + 0.5)\n\n return \"#\" + \"\".join([\"%02x\" % float2int(c) for c in (r, g, b)])", "metadata": "root.DotWriter.color", "header": "['class', 'DotWriter', ':', '___EOS___']", "index": 1788 } ]
[ { "span": "self.get_function_name(key)", "start_line": 1474, "start_column": 19, "end_line": 1474, "end_column": 46 }, { "span": "self.color(theme.node_bgcolor(weight)),", "start_line": 1699, "start_column": 24, "end_line": 1699, "end_column": 62 }, { "span": "self.color(theme.node_fgcolor(weight)),", "start_line": 1700, "start_column": 28, "end_line": 1700, "end_column": 66 }, { "span": "self.color(theme.edge_color(weight)),", "start_line": 1725, "start_column": 28, "end_line": 1725, "end_column": 64 }, { "span": "self.color(theme.edge_color(weight)),", "start_line": 1726, "start_column": 32, "end_line": 1726, "end_column": 68 } ]
[ { "span": "def get_function_name(self, (filename, line, name)):", "start_line": 1464, "start_column": 4, "end_line": 1464, "end_column": 56 }, { "span": "def color(self, (r, g, b)):", "start_line": 1788, "start_column": 4, "end_line": 1788, "end_column": 31 } ]
1
false
[ "[CLS]_", "Wro", "ng_", "number_", "of_", "arguments_", "in_", "a_", "call_", "[SEP]_", "class_", "Event_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format_", "(_", "self_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Format", " ", "an", " ", "event", " ", "value", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "val_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "formatter_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Function_", "(_", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "id_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Object_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "=_", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "calls_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cycle_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ps", "tats", "Parser_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "function", "\\u", "name_", "(_", "self_", ",_", "(_", "filename_", ",_", "line_", ",_", "name_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "filename_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"%", "s", ":", "%", "d", ":", "%", "s", "\"_", "%_", "(_", "module_", ",_", "line_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ps", "tats", "Parser_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "function_", "(_", "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 ", " _", "id_", "=_", "self_", "._", "function", "\\u", "ids_", "[_", "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 ", " _", "id_", "=_", "len_", "(_", "self_", "._", "function", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "self_", "._", "get", "\\u", "function", "\\u", "name_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "function_", "=_", "Function_", "(_", "id_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "profile_", "._", "functions_", "[_", "id_", "]_", "=_", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "function", "\\u", "ids_", "[_", "key_", "]_", "=_", "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 ", " _", "function_", "=_", "self_", "._", "profile_", "._", "functions_", "[_", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dot", "Writer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "graph_", "(_", "self_", ",_", "profile_", ",_", "theme_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "begin", "\\u", "graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "font", "name_", "=_", "theme_", "._", "graph", "\\u", "font", "name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "attr_", "(_", "'", "graph", "'_", ",_", "font", "name_", "=_", "font", "name_", ",_", "ranks", "ep_", "=_", "0.25_", ",_", "nodes", "ep_", "=_", "0.125_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "attr_", "(_", "'", "node", "'_", ",_", "font", "name_", "=_", "font", "name_", ",_", "shape_", "=_", "\"", "box", "\"_", ",_", "style_", "=_", "\"", "filled", ",", "rounded", "\"_", ",_", "font", "color_", "=_", "\"", "white", "\"_", ",_", "width_", "=_", "0_", ",_", "height_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "attr_", "(_", "'", "edge", "'_", ",_", "font", "name_", "=_", "font", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "function_", "in_", "profile_", "._", "functions_", "._", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "labels_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "event_", "in_", "PROCESS", "_", ",_", "MODULE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event_", "in_", "function_", "._", "events_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "label_", "=_", "event_", "._", "format_", "(_", "function_", "[_", "event_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "._", "append_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "labels_", "._", "append_", "(_", "function_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "event_", "in_", "TOTAL", "\\u", "TIME", "\\u", "RATIO", "_", ",_", "TIME", "\\u", "RATIO", "_", ",_", "CALL", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event_", "in_", "function_", "._", "events_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "label_", "=_", "event_", "._", "format_", "(_", "function_", "[_", "event_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "._", "append_", "(_", "label_", ")_", "\\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 ", " _", "weight_", "=_", "function_", "[_", "PR", "UNE", "\\u", "RATIO", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Unde", "fined", "Event_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "weight_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "label_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "node_", "(_", "function_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "self_", "._", "color_", "(_", "theme_", "._", "node", "\\u", "bgcolor_", "(_", "weight_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "font", "color_", "=_", "self_", "._", "color_", "(_", "theme_", "._", "node", "\\u", "fg", "color_", "(_", "weight_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fontsize_", "=_", "\"%", ".2", "f", "\"_", "%_", "theme_", "._", "node", "\\u", "fontsize_", "(_", "weight_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "call_", "in_", "function_", "._", "calls_", "._", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "callee", "_", "=_", "profile_", "._", "functions_", "[_", "call_", "._", "callee", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "labels_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "event_", "in_", "TOTAL", "\\u", "TIME", "\\u", "RATIO", "_", ",_", "CALL", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "event_", "in_", "call_", "._", "events_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "label_", "=_", "event_", "._", "format_", "(_", "call_", "[_", "event_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "._", "append_", "(_", "label_", ")_", "\\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 ", " ", "_", "weight_", "=_", "call_", "[_", "PR", "UNE", "\\u", "RATIO", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Unde", "fined", "Event_", ":_", "\\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 ", " ", " _", "weight_", "=_", "callee", "_", "[_", "PR", "UNE", "\\u", "RATIO", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Unde", "fined", "Event_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "weight_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "label_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "edge_", "(_", "function_", "._", "id_", ",_", "call_", "._", "callee", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "self_", "._", "color_", "(_", "theme_", "._", "edge", "\\u", "color_", "(_", "weight_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "font", "color_", "=_", "self_", "._", "color_", "(_", "theme_", "._", "edge", "\\u", "color_", "(_", "weight_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fontsize_", "=_", "\"%", ".2", "f", "\"_", "%_", "theme_", "._", "edge", "\\u", "fontsize_", "(_", "weight_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pen", "width_", "=_", "\"%", ".2", "f", "\"_", "%_", "theme_", "._", "edge", "\\u", "pen", "width_", "(_", "weight_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label", "distance_", "=_", "\"%", ".2", "f", "\"_", "%_", "theme_", "._", "edge", "\\u", "pen", "width_", "(_", "weight_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arrows", "ize_", "=_", "\"%", ".2", "f", "\"_", "%_", "theme_", "._", "edge", "\\u", "arrows", "ize_", "(_", "weight_", ")_", ",_", "\\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_", "self_", "._", "end", "\\u", "graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dot", "Writer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "begin", "\\u", "graph_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "'", "digraph", " ", "{\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dot", "Writer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "end", "\\u", "graph_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "'}", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dot", "Writer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "attr_", "(_", "self_", ",_", "what_", ",_", "**_", "attrs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "\"\\\\", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "what_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "attr", "\\u", "list_", "(_", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\";", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dot", "Writer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "node_", "(_", "self_", ",_", "node_", ",_", "**_", "attrs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "\"\\\\", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "attr", "\\u", "list_", "(_", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\";", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dot", "Writer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "edge_", "(_", "self_", ",_", "src_", ",_", "dst_", ",_", "**_", "attrs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "\"\\\\", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "(_", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\"", " ", "->", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "(_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "attr", "\\u", "list_", "(_", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\";", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dot", "Writer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "color_", "(_", "self_", ",_", "(_", "r_", ",_", "g_", ",_", "b_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "float", "2in", "t_", "(_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "f_", "<=_", "0.0_", ":_", "\\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_", "if_", "f_", ">=_", "1.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "255_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "int_", "(_", "255.0_", "*_", "f_", "+_", "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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 ]
Variable defined multiple times
daler/metaseq/metaseq/results_table.py
[ { "content": " def scatter(self, x, y, xfunc=None, yfunc=None, xscale=None, yscale=None,\n xlab=None, ylab=None, genes_to_highlight=None,\n label_genes=False, marginal_histograms=False,\n general_kwargs=dict(color=\"k\", alpha=0.2, picker=True),\n general_hist_kwargs=None, offset_kwargs={}, label_kwargs=None,\n ax=None, one_to_one=None, callback=None, xlab_prefix=None,\n ylab_prefix=None, sizefunc=None, hist_size=0.3, hist_pad=0.0,\n nan_offset=0.015, pos_offset=0.99, linelength=0.01,\n neg_offset=0.005, figure_kwargs=None):\n \"\"\"\n Do-it-all method for making annotated scatterplots.\n\n Parameters\n ----------\n\n x, y : array-like\n Variables to plot. Must be names in self.data's DataFrame. For\n example, \"baseMeanA\" and \"baseMeanB\"\n\n xfunc, yfunc : callable\n Functions to apply to `xvar` and `yvar` respectively. Default is\n log2; set to None to have no transformation.\n\n xlab, ylab : string\n Labels for x and y axes; default is to use function names for\n `xfunc` and `yfunc` and variable names `xvar` and `yvar`, e.g.,\n \"log2(baseMeanA)\"\n\n ax : None or Axes object\n If `ax=None`, then makes a new fig and returns the Axes object,\n otherwise, plots onto `ax`\n\n general_kwargs : dict\n Kwargs for matplotlib.scatter; specifies how all points look\n\n genes_to_highlight : list of (index, dict) tuples\n Provides lots of control to colors. It is a list of (`ind`,\n `kwargs`) tuples, where each `ind` specifies genes to plot with\n `kwargs`. Each dictionary updates a copy of `general_kwargs`. If\n `genes_to_highlight` has a \"name\" kwarg, this must be a list that't\n the same length as `ind`. It will be used to label the genes in\n `ind` using `label_kwargs`.\n\n callback : callable\n Function to call upon clicking a point. Must accept a single\n argument which is the gene ID. Default is to print the gene name,\n but an example of another useful callback would be a mini-browser\n connected to a genomic_signal object from which the expression data\n were calculated.\n\n one_to_one : None or dict\n If not None, a dictionary of matplotlib.plot kwargs that will be\n used to plot a 1:1 line.\n\n label_kwargs : dict\n Kwargs for labeled genes (e.g., dict=(style='italic')). Will only\n be used if an entry in `genes_to_highlight` has a `name` key.\n\n offset_kwargs : dict\n Kwargs to be passed to matplotlib.transforms.offset_copy, used for\n adjusting the positioning of gene labels in relation to the actual\n point.\n\n xlab_prefix, ylab_prefix : str\n Optional label prefix that will be added to the beginning of `xlab`\n and/or `ylab`.\n\n hist_size : float\n Size of marginal histograms\n\n hist_pad : float\n Spacing between marginal histograms\n\n nan_offset, pos_offset, neg_offset : float\n Offset, in units of \"fraction of axes\" for the NaN, +inf, and -inf\n \"rug plots\"\n\n linelength : float\n Line length for the rug plots\n\n \"\"\"\n _x = self.data[x]\n _y = self.data[y]\n\n # Construct defaults---------------------------------------------------\n def identity(x):\n return x.copy()\n\n # Axis label setup\n if xlab_prefix is None:\n xlab_prefix = \"\"\n\n if ylab_prefix is None:\n ylab_prefix = \"\"\n\n if xlab is None:\n xlab = x\n\n if xfunc is not None:\n xlab = xlab_prefix + \"%s(%s)\" % (xfunc.__name__, str(x))\n else:\n xlab = xlab_prefix + \"%s\" % (str(x))\n\n if ylab is None:\n ylab = y\n if yfunc is not None:\n ylab = ylab_prefix + \"%s(%s)\" % (yfunc.__name__, str(y))\n else:\n ylab = ylab_prefix + \"%s\" % (str(y))\n\n if xfunc is None:\n xfunc = identity\n\n if yfunc is None:\n yfunc = identity\n\n if general_kwargs is None:\n general_kwargs = {}\n\n if general_hist_kwargs is None:\n general_hist_kwargs = {}\n\n if genes_to_highlight is None:\n genes_to_highlight = []\n\n if ax is None:\n if figure_kwargs is None:\n figure_kwargs = {}\n fig = plt.figure(**figure_kwargs)\n ax = fig.add_subplot(111)\n\n if label_kwargs is None:\n label_kwargs = dict(\n horizontalalignment='right',\n verticalalignment='center',\n style='italic',\n bbox=dict(facecolor='w', edgecolor='None', alpha=0.5)\n )\n\n # Clean data ---------------------------------------------------------\n xi = xfunc(_x)\n yi = yfunc(_y)\n\n # handle inf, -inf, and NaN\n x_is_pos_inf = np.isinf(xi) & (xi > 0)\n x_is_neg_inf = np.isinf(xi) & (xi < 0)\n x_is_nan = np.isnan(xi)\n y_is_pos_inf = np.isinf(yi) & (yi > 0)\n y_is_neg_inf = np.isinf(yi) & (yi < 0)\n y_is_nan = np.isnan(yi)\n\n # Indexes for valid values\n x_valid = ~(x_is_pos_inf | x_is_neg_inf | x_is_nan)\n y_valid = ~(y_is_pos_inf | y_is_neg_inf | y_is_nan)\n\n # global min/max\n gmin = max(xi[x_valid].min(), yi[y_valid].min())\n gmax = min(xi[x_valid].max(), yi[y_valid].max())\n\n # Convert any integer indexes into boolean, and create a new list of\n # genes to highlight. This handles optional hist kwargs.\n\n # We'll compile a new list of genes to highlight.\n _genes_to_highlight = []\n\n for block in genes_to_highlight:\n ind = block[0]\n\n # Convert to boolean\n if ind.dtype != 'bool':\n new_ind = (np.zeros_like(xi) == 0)\n new_ind[ind] = True\n _genes_to_highlight.append(\n tuple([new_ind] + list(block[1:]))\n )\n\n # If it's a DataFrame, we only want the boolean values;\n else:\n if hasattr(ind, 'values'):\n ind = ind.values\n _genes_to_highlight.append(\n tuple([ind] + list(block[1:]))\n )\n\n # Now we remove any genes from in allind (which will be plotted using\n # `general_kwargs`) that will be plotted by genes_to_highlight. This\n # avoids double-plotting.\n allind = np.zeros_like(xi) == 0\n for block in _genes_to_highlight:\n ind = block[0]\n allind[ind] = False\n\n # Copy over the color and alpha if they're not specified\n general_hist_kwargs = plotutils._updatecopy(\n orig=general_hist_kwargs, update_with=general_kwargs,\n keys=['color', 'alpha'])\n\n # Put the non-highlighted genes at the beginning of _genes_to_highlight\n # list so we can just iterate over one list\n _genes_to_highlight.insert(\n 0,\n (allind, general_kwargs, general_hist_kwargs)\n )\n\n # Set up the object that will handle the marginal histograms\n self.marginal = plotutils.MarginalHistScatter(\n ax, hist_size=hist_size, pad=hist_pad)\n\n # Set up kwargs for x and y rug plots\n rug_x_kwargs = dict(\n linelength=linelength,\n transform=blended_transform_factory(ax.transData, ax.transAxes),\n )\n rug_y_kwargs = dict(\n linelength=linelength,\n transform=blended_transform_factory(ax.transAxes, ax.transData),\n orientation='vertical',\n )\n\n # EventCollection objects need a color as a 3-tuple, so set up\n # a converter here.\n color_converter = matplotlib.colors.ColorConverter().to_rgb\n\n # Plot the one-to-one line, if kwargs were specified\n if one_to_one:\n ax.plot([gmin, gmax],\n [gmin, gmax],\n **one_to_one)\n\n # Plot 'em all, and label if specified\n\n # In order to avoid calling the callback function multiple times when\n # we have overlapping genes to highlight (e.g., a gene that is both\n # upregulated AND has a peak), keep track of everything that's been\n # added so far.\n self._seen = np.ones_like(xi) == 0\n for block in _genes_to_highlight:\n ind = block[0]\n kwargs = block[1]\n\n if len(block) == 3:\n hist_kwargs = block[2]\n else:\n hist_kwargs = {}\n\n names = kwargs.pop('names', None)\n _marginal_histograms = (\n kwargs.pop('marginal_histograms', False) or\n marginal_histograms)\n\n updated_kwargs = plotutils._updatecopy(\n orig=kwargs, update_with=general_kwargs)\n\n updated_hist_kwargs = plotutils._updatecopy(\n orig=hist_kwargs, update_with=general_hist_kwargs)\n updated_hist_kwargs = plotutils._updatecopy(\n orig=updated_hist_kwargs, update_with=kwargs,\n keys=['color', 'alpha'], override=True)\n\n xhist_kwargs = updated_kwargs.pop('xhist_kwargs', None)\n yhist_kwargs = updated_kwargs.pop('yhist_kwargs', None)\n\n self.marginal.append(\n xi[ind & x_valid & y_valid],\n yi[ind & x_valid & y_valid],\n scatter_kwargs=dict(**updated_kwargs),\n hist_kwargs=updated_hist_kwargs,\n xhist_kwargs=xhist_kwargs,\n yhist_kwargs=yhist_kwargs,\n marginal_histograms=_marginal_histograms,\n )\n\n # This is important for callbacks: here we grab the last-created\n # collection,\n coll = self.marginal.scatter_ax.collections[-1]\n coll.df = self.data\n coll.ind = ind & x_valid & y_valid\n\n color = color_converter(updated_kwargs['color'])\n rug_x_kwargs['color'] = color\n rug_y_kwargs['color'] = color\n\n # Note: if both x and y are not valid, then they will not be on the\n # plot.\n items = [\n # top rug, y is +inf and x is valid\n (xi, ind & x_valid & y_is_pos_inf, pos_offset, rug_x_kwargs),\n\n # one of the bottom rugs, where y is NaN\n (xi, ind & x_valid & y_is_nan, nan_offset, rug_x_kwargs),\n\n # bottom rug, y is -inf\n (xi, ind & x_valid & y_is_neg_inf, neg_offset, rug_x_kwargs),\n\n # right rug, x is +inf\n (yi, ind & y_valid & x_is_pos_inf, pos_offset, rug_y_kwargs),\n\n # one of the left rugs; x is NaN\n (yi, ind & y_valid & x_is_nan, nan_offset, rug_y_kwargs),\n\n # left rug, x is -inf\n (yi, ind & y_valid & x_is_neg_inf, neg_offset, rug_y_kwargs),\n ]\n for values, index, offset, kwargs in items:\n coll = EventCollection(\n values[index], lineoffset=offset, **kwargs)\n coll.df = self.data\n coll.ind = index\n ax.add_collection(coll)\n\n if names:\n transOffset = matplotlib.transforms.offset_copy(\n ax.transData, fig=ax.figure, **offset_kwargs)\n\n for xii, yii, name in zip(xi[ind], yi[ind], names):\n ax.text(xii,\n yii,\n name,\n transform=transOffset,\n **label_kwargs)\n\n # register callback\n if callback is None:\n callback = self._default_callback\n\n def wrapped_callback(event):\n for _id in self._id_callback(event):\n callback(_id)\n\n ax.figure.canvas.mpl_connect('pick_event', wrapped_callback)\n\n ax.set_xlabel(xlab)\n ax.set_ylabel(ylab)\n ax.axis('tight')\n\n return ax", "metadata": "root.ResultsTable.scatter", "header": "['class', 'ResultsTable', '(', 'object', ')', ':', '___EOS___']", "index": 205 } ]
[ { "span": "xlab ", "start_line": 301, "start_column": 12, "end_line": 301, "end_column": 16 }, { "span": "ylab ", "start_line": 309, "start_column": 12, "end_line": 309, "end_column": 16 } ]
[ { "span": "xlab ", "start_line": 304, "start_column": 16, "end_line": 304, "end_column": 20 }, { "span": "xlab ", "start_line": 306, "start_column": 16, "end_line": 306, "end_column": 20 }, { "span": "ylab ", "start_line": 311, "start_column": 16, "end_line": 311, "end_column": 20 }, { "span": "ylab ", "start_line": 313, "start_column": 16, "end_line": 313, "end_column": 20 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Result", "s", "Table_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scatter_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "xf", "unc_", "=_", "None_", ",_", "yf", "unc_", "=_", "None_", ",_", "xscale_", "=_", "None_", ",_", "yscale_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xla", "b_", "=_", "None_", ",_", "yla", "b_", "=_", "None_", ",_", "gene", "s", "\\u", "to", "\\u", "highlight_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "genes_", "=_", "False_", ",_", "marginal", "\\u", "histograms", "_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "genera", "l\\u", "kwargs_", "=_", "dict_", "(_", "color_", "=_", "\"", "k", "\"_", ",_", "alpha_", "=_", "0.2_", ",_", "picker_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "genera", "l\\u", "hist", "\\u", "kwargs_", "=_", "None_", ",_", "offset", "\\u", "kwargs_", "=_", "{_", "}_", ",_", "label", "\\u", "kwargs_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ax_", "=_", "None_", ",_", "one", "\\u", "to", "\\u", "one_", "=_", "None_", ",_", "callback_", "=_", "None_", ",_", "xla", "b", "\\u", "prefix_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "yla", "b", "\\u", "prefix_", "=_", "None_", ",_", "size", "func_", "=_", "None_", ",_", "hist", "\\u", "size_", "=_", "0.3_", ",_", "hist", "\\u", "pad_", "=_", "0.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nan", "\\u", "offset_", "=_", "0.015", "_", ",_", "pos", "\\u", "offset_", "=_", "0.99_", ",_", "line", "length_", "=_", "0.01_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "neg", "\\u", "offset_", "=_", "0.005_", ",_", "figure", "\\u", "kwargs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Do", "-", "it", "-", "all", " ", "method", " ", "for", " ", "mak", "ing", " ", "annotated", " ", "scatter", "plots", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "x", ",", " ", "y", " ", ":", " ", "array", "-", "like", "\\", "10", ";", " ", " ", " ", " ", "Varia", "bles", " ", "to", " ", "plot", ".", " ", " ", "Mus", "t", " ", "be", " ", "names", " ", "in", " ", "self", ".", "data", "'", "s", " ", "Data", "Frame", ".", " ", " ", "For", "\\", "10", ";", " ", " ", " ", " ", "example", ",", " ", "\"", "base", "Mea", "n", "A", "\"", " ", "and", " ", "\"", "base", "Mea", "n", "B", "\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "xf", "unc", ",", " ", "yf", "unc", " ", ":", " ", "calla", "ble", "\\", "10", ";", " ", " ", " ", " ", "Function", "s", " ", "to", " ", "appl", "y", " ", "to", " ", "`", "xv", "ar", "`", " ", "and", " ", "`", "yv", "ar", "`", " ", "respec", "tiv", "el", "y", ".", " ", "Default", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "log", "2", ";", " ", "set", " ", "to", " ", "Non", "e", " ", "to", " ", "have", " ", "no", " ", "transformation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "xla", "b", ",", " ", "yla", "b", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Label", "s", " ", "for", " ", "x", " ", "and", " ", "y", " ", "axes", ";", " ", "default", " ", "is", " ", "to", " ", "use", " ", "function", " ", "names", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "`", "xf", "unc", "`", " ", "and", " ", "`", "yf", "unc", "`", " ", "and", " ", "variab", "le", " ", "names", " ", "`", "xv", "ar", "`", " ", "and", " ", "`", "yv", "ar", "`", ",", " ", "e", ".", "g", ".,", "\\", "10", ";", " ", " ", " ", " ", "\"", "log", "2", "(", "base", "Mea", "n", "A", ")\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "ax", " ", ":", " ", "Non", "e", " ", "or", " ", "Axe", "s", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "`", "ax", "=", "Non", "e", "`", ",", " ", "then", " ", "make", "s", " ", "a", " ", "new", " ", "fig", " ", "and", " ", "return", "s", " ", "the", " ", "Axe", "s", " ", "object", ",", "\\", "10", ";", " ", " ", " ", " ", "other", "wis", "e", ",", " ", "plots", " ", "onto", " ", "`", "ax", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "genera", "l\\u", "kwarg", "s", " ", ":", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "Kwargs", " ", "for", " ", "mat", "plotlib", ".", "scatter", ";", " ", "speci", "fie", "s", " ", "how", " ", "all", " ", "points", " ", "look", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "gene", "s", "\\u", "to", "\\u", "highlight", " ", ":", " ", "list", " ", "of", " ", "(", "index", ",", " ", "dict", ")", " ", "tuple", "s", "\\", "10", ";", " ", " ", " ", " ", "Prov", "ides", " ", "lots", " ", "of", " ", "control", " ", "to", " ", "colors", ".", " ", " ", "It", " ", "is", " ", "a", " ", "list", " ", "of", " ", "(", "`", "ind", "`", ",", "\\", "10", ";", " ", " ", " ", " ", "`", "kwarg", "s", "`)", " ", "tuple", "s", ",", " ", "where", " ", "each", " ", "`", "ind", "`", " ", "speci", "fie", "s", " ", "gene", "s", " ", "to", " ", "plot", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "`", "kwarg", "s", "`.", " ", " ", "Ea", "ch", " ", "dictionar", "y", " ", "update", "s", " ", "a", " ", "copy", " ", "of", " ", "`", "genera", "l\\u", "kwarg", "s", "`.", " ", "If", "\\", "10", ";", " ", " ", " ", " ", "`", "gene", "s", "\\u", "to", "\\u", "highlight", "`", " ", "has", " ", "a", " ", "\"", "name", "\"", " ", "kwarg", ",", " ", "this", " ", "must", " ", "be", " ", "a", " ", "list", " ", "tha", "t", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "same", " ", "length", " ", "as", " ", "`", "ind", "`.", " ", " ", "It", " ", "will", " ", "be", " ", "used", " ", "to", " ", "label", " ", "the", " ", "gene", "s", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "`", "ind", "`", " ", "usi", "ng", " ", "`", "label", "\\u", "kwarg", "s", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "callback", " ", ":", " ", "calla", "ble", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "to", " ", "call", " ", "upo", "n", " ", "click", "ing", " ", "a", " ", "point", ".", " ", "Mus", "t", " ", "accept", " ", "a", " ", "single", "\\", "10", ";", " ", " ", " ", " ", "argu", "ment", " ", "whi", "ch", " ", "is", " ", "the", " ", "gene", " ", "ID", ".", " ", "Default", " ", "is", " ", "to", " ", "print", " ", "the", " ", "gene", " ", "name", ",", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "an", " ", "example", " ", "of", " ", "anot", "her", " ", "usef", "ul", " ", "callback", " ", "wou", "ld", " ", "be", " ", "a", " ", "mini", "-", "browse", "r", "\\", "10", ";", " ", " ", " ", " ", "connect", "ed", " ", "to", " ", "a", " ", "genomic", "\\u", "signal", " ", "object", " ", "from", " ", "whi", "ch", " ", "the", " ", "express", "ion", " ", "data", "\\", "10", ";", " ", " ", " ", " ", "wer", "e", " ", "calculated", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "one", "\\u", "to", "\\u", "one", " ", ":", " ", "Non", "e", " ", "or", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "not", " ", "Non", "e", ",", " ", "a", " ", "dictionar", "y", " ", "of", " ", "mat", "plotlib", ".", "plot", " ", "kwarg", "s", " ", "tha", "t", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "used", " ", "to", " ", "plot", " ", "a", " ", "1", ":", "1", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "label", "\\u", "kwarg", "s", " ", ":", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "Kwargs", " ", "for", " ", "label", "ed", " ", "gene", "s", " ", "(", "e", ".", "g", ".,", " ", "dict", "=(", "style", "='", "italic", "'))", ".", " ", " ", "Wil", "l", " ", "only", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "used", " ", "if", " ", "an", " ", "entry", " ", "in", " ", "`", "gene", "s", "\\u", "to", "\\u", "highlight", "`", " ", "has", " ", "a", " ", "`", "name", "`", " ", "key", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "offset", "\\u", "kwarg", "s", " ", ":", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "Kwargs", " ", "to", " ", "be", " ", "pass", "ed", " ", "to", " ", "mat", "plotlib", ".", "transform", "s", ".", "offset", "\\u", "copy", ",", " ", "used", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "adjust", "ing", " ", "the", " ", "position", "ing", " ", "of", " ", "gene", " ", "labels", " ", "in", " ", "relation", " ", "to", " ", "the", " ", "actual", "\\", "10", ";", " ", " ", " ", " ", "point", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "xla", "b", "\\u", "prefix", ",", " ", "yla", "b", "\\u", "prefix", " ", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "Optio", "nal", " ", "label", " ", "prefix", " ", "tha", "t", " ", "will", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "beginn", "ing", " ", "of", " ", "`", "xla", "b", "`", "\\", "10", ";", " ", " ", " ", " ", "and", "/", "or", " ", "`", "yla", "b", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "hist", "\\u", "size", " ", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "Size", " ", "of", " ", "marginal", " ", "histograms", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "hist", "\\u", "pad", " ", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "Spac", "ing", " ", "bet", "ween", " ", "marginal", " ", "histograms", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "nan", "\\u", "offset", ",", " ", "pos", "\\u", "offset", ",", " ", "neg", "\\u", "offset", " ", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "Off", "set", ",", " ", "in", " ", "unit", "s", " ", "of", " ", "\"", "fract", "ion", " ", "of", " ", "axes", "\"", " ", "for", " ", "the", " ", "Na", "N", ",", " ", "+", "inf", ",", " ", "and", " ", "-", "inf", "\\", "10", ";", " ", " ", " ", " ", "\"", "ru", "g", " ", "plots", "\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "line", "length", " ", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "Line", " ", "length", " ", "for", " ", "the", " ", "ru", "g", " ", "plots", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "x_", "=_", "self_", "._", "data_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "y_", "=_", "self_", "._", "data_", "[_", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Construct", " ", "default", "s", "--------------", "--------------", "--------------", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "identity_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Axi", "s", " ", "label", " ", "setup_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "xla", "b", "\\u", "prefix_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xla", "b", "\\u", "prefix_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "yla", "b", "\\u", "prefix_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yla", "b", "\\u", "prefix_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "xla", "b_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xla", "b_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "xf", "unc_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xla", "b_", "=_", "xla", "b", "\\u", "prefix_", "+_", "\"%", "s", "(%", "s", ")\"_", "%_", "(_", "xf", "unc_", "._", "\\u\\u", "name\\u\\u_", ",_", "str_", "(_", "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 ", " _", "xla", "b_", "=_", "xla", "b", "\\u", "prefix_", "+_", "\"%", "s", "\"_", "%_", "(_", "str_", "(_", "x_", ")_", ")_", "\\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_", "yla", "b_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yla", "b_", "=_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "yf", "unc_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yla", "b_", "=_", "yla", "b", "\\u", "prefix_", "+_", "\"%", "s", "(%", "s", ")\"_", "%_", "(_", "yf", "unc_", "._", "\\u\\u", "name\\u\\u_", ",_", "str_", "(_", "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 ", " _", "yla", "b_", "=_", "yla", "b", "\\u", "prefix_", "+_", "\"%", "s", "\"_", "%_", "(_", "str_", "(_", "y_", ")_", ")_", "\\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_", "xf", "unc_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xf", "unc_", "=_", "identity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "yf", "unc_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yf", "unc_", "=_", "identity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "genera", "l\\u", "kwargs_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "genera", "l\\u", "kwargs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "genera", "l\\u", "hist", "\\u", "kwargs_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "genera", "l\\u", "hist", "\\u", "kwargs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "gene", "s", "\\u", "to", "\\u", "highlight_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gene", "s", "\\u", "to", "\\u", "highlight_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ax_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "figure", "\\u", "kwargs_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "figure", "\\u", "kwargs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fig_", "=_", "plt_", "._", "figure_", "(_", "**_", "figure", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "=_", "fig_", "._", "add", "\\u", "subplot_", "(_", "111_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "label", "\\u", "kwargs_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "\\u", "kwargs_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "horizon", "tal", "alignment_", "=_", "'", "right", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vertical", "alignment_", "=_", "'", "center", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "style_", "=_", "'", "italic", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bbox_", "=_", "dict_", "(_", "facecolor_", "=_", "'", "w", "'_", ",_", "edgecolor_", "=_", "'", "Non", "e", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Clean", " ", "data", " ", "--------------", "--------------", "--------------", "--------------", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xi_", "=_", "xf", "unc_", "(_", "\\u", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yi_", "=_", "yf", "unc_", "(_", "\\u", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "handle", " ", "inf", ",", " ", "-", "inf", ",", " ", "and", " ", "Na", "N_", "\\u\\u\\uNL\\u\\u\\u_", "x", "\\u", "is", "\\u", "pos", "\\u", "inf_", "=_", "np_", "._", "isinf", "_", "(_", "xi_", ")_", "&_", "(_", "xi_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "is", "\\u", "neg", "\\u", "inf_", "=_", "np_", "._", "isinf", "_", "(_", "xi_", ")_", "&_", "(_", "xi_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "is", "\\u", "nan_", "=_", "np_", "._", "isnan_", "(_", "xi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "is", "\\u", "pos", "\\u", "inf_", "=_", "np_", "._", "isinf", "_", "(_", "yi_", ")_", "&_", "(_", "yi_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "is", "\\u", "neg", "\\u", "inf_", "=_", "np_", "._", "isinf", "_", "(_", "yi_", ")_", "&_", "(_", "yi_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "is", "\\u", "nan_", "=_", "np_", "._", "isnan_", "(_", "yi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Indexe", "s", " ", "for", " ", "valid", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "x", "\\u", "valid_", "=_", "~_", "(_", "x", "\\u", "is", "\\u", "pos", "\\u", "inf_", "|_", "x", "\\u", "is", "\\u", "neg", "\\u", "inf_", "|_", "x", "\\u", "is", "\\u", "nan_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "valid_", "=_", "~_", "(_", "y", "\\u", "is", "\\u", "pos", "\\u", "inf_", "|_", "y", "\\u", "is", "\\u", "neg", "\\u", "inf_", "|_", "y", "\\u", "is", "\\u", "nan_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "global", " ", "min", "/", "max_", "\\u\\u\\uNL\\u\\u\\u_", "gm", "in_", "=_", "max_", "(_", "xi_", "[_", "x", "\\u", "valid_", "]_", "._", "min_", "(_", ")_", ",_", "yi_", "[_", "y", "\\u", "valid_", "]_", "._", "min_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gma", "x_", "=_", "min_", "(_", "xi_", "[_", "x", "\\u", "valid_", "]_", "._", "max_", "(_", ")_", ",_", "yi_", "[_", "y", "\\u", "valid_", "]_", "._", "max_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "any", " ", "integ", "er", " ", "indexe", "s", " ", "int", "o", " ", "boolean", ",", " ", "and", " ", "create", " ", "a", " ", "new", " ", "list", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gene", "s", " ", "to", " ", "highlight", ".", " ", " ", "Thi", "s", " ", "handle", "s", " ", "option", "al", " ", "hist", " ", "kwarg", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "ll", " ", "compile", " ", "a", " ", "new", " ", "list", " ", "of", " ", "gene", "s", " ", "to", " ", "highlight", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gene", "s", "\\u", "to", "\\u", "highlight_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "block_", "in_", "gene", "s", "\\u", "to", "\\u", "highlight_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ind_", "=_", "block_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "to", " ", "boolean_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ind_", "._", "dtype_", "!=_", "'", "bool", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "ind_", "=_", "(_", "np_", "._", "zero", "s", "\\u", "like_", "(_", "xi_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "ind_", "[_", "ind_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "gene", "s", "\\u", "to", "\\u", "highlight_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tuple_", "(_", "[_", "new", "\\u", "ind_", "]_", "+_", "list_", "(_", "block_", "[_", "1_", ":_", "]_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "it", "'", "s", " ", "a", " ", "Data", "Frame", ",", " ", "we", " ", "only", " ", "want", " ", "the", " ", "boolean", " ", "values", ";_", "\\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 ", " _", "if_", "hasattr_", "(_", "ind_", ",_", "'", "values", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ind_", "=_", "ind_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "gene", "s", "\\u", "to", "\\u", "highlight_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tuple_", "(_", "[_", "ind_", "]_", "+_", "list_", "(_", "block_", "[_", "1_", ":_", "]_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "we", " ", "remove", " ", "any", " ", "gene", "s", " ", "from", " ", "in", " ", "alli", "nd", " ", "(", "whi", "ch", " ", "will", " ", "be", " ", "plott", "ed", " ", "using_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "`", "genera", "l\\u", "kwarg", "s", "`)", " ", "tha", "t", " ", "will", " ", "be", " ", "plott", "ed", " ", "by", " ", "gene", "s", "\\u", "to", "\\u", "highlight", ".", " ", " ", "Thi", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "avoid", "s", " ", "double", "-", "plott", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "alli", "nd_", "=_", "np_", "._", "zero", "s", "\\u", "like_", "(_", "xi_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "block_", "in_", "\\u", "gene", "s", "\\u", "to", "\\u", "highlight_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ind_", "=_", "block_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alli", "nd_", "[_", "ind_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "over", " ", "the", " ", "color", " ", "and", " ", "alpha", " ", "if", " ", "the", "y", "'", "re", " ", "not", " ", "specified", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "genera", "l\\u", "hist", "\\u", "kwargs_", "=_", "plot", "utils_", "._", "\\u", "update", "copy_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "orig_", "=_", "genera", "l\\u", "hist", "\\u", "kwargs_", ",_", "update", "\\u", "with_", "=_", "genera", "l\\u", "kwargs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keys_", "=_", "[_", "'", "color", "'_", ",_", "'", "alpha", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Put", " ", "the", " ", "non", "-", "highlighted", " ", "gene", "s", " ", "at", " ", "the", " ", "beginn", "ing", " ", "of", " ", "\\u", "gene", "s", "\\u", "to", "\\u", "highlight_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "list", " ", "so", " ", "we", " ", "can", " ", "just", " ", "iterate", " ", "over", " ", "one", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gene", "s", "\\u", "to", "\\u", "highlight_", "._", "insert_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "alli", "nd_", ",_", "genera", "l\\u", "kwargs_", ",_", "genera", "l\\u", "hist", "\\u", "kwargs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "the", " ", "object", " ", "tha", "t", " ", "will", " ", "handle", " ", "the", " ", "marginal", " ", "histograms", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "marginal", "_", "=_", "plot", "utils_", "._", "Marg", "inal", "Hist", "Scatter", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ax_", ",_", "hist", "\\u", "size_", "=_", "hist", "\\u", "size_", ",_", "pad_", "=_", "hist", "\\u", "pad_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "kwarg", "s", " ", "for", " ", "x", " ", "and", " ", "y", " ", "ru", "g", " ", "plots_", "\\u\\u\\uNL\\u\\u\\u_", "ru", "g", "\\u", "x", "\\u", "kwargs_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "line", "length_", "=_", "line", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transform_", "=_", "blend", "ed", "\\u", "transform", "\\u", "factory_", "(_", "ax_", "._", "trans", "Data_", ",_", "ax_", "._", "trans", "Axes_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ru", "g", "\\u", "y", "\\u", "kwargs_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "line", "length_", "=_", "line", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transform_", "=_", "blend", "ed", "\\u", "transform", "\\u", "factory_", "(_", "ax_", "._", "trans", "Axes_", ",_", "ax_", "._", "trans", "Data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "orientation_", "=_", "'", "vertical", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Event", "Collecti", "on", " ", "object", "s", " ", "need", " ", "a", " ", "color", " ", "as", " ", "a", " ", "3", "-", "tuple", ",", " ", "so", " ", "set", " ", "up_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "converter", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "color", "\\u", "converter_", "=_", "matplotlib_", "._", "colors_", "._", "Color", "Converter_", "(_", ")_", "._", "to", "\\u", "rgb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "the", " ", "one", "-", "to", "-", "one", " ", "line", ",", " ", "if", " ", "kwarg", "s", " ", "wer", "e", " ", "specified", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "one", "\\u", "to", "\\u", "one_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "._", "plot_", "(_", "[_", "gm", "in_", ",_", "gma", "x_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "gm", "in_", ",_", "gma", "x_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "one", "\\u", "to", "\\u", "one_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "'", "em", " ", "all", ",", " ", "and", " ", "label", " ", "if", " ", "specified", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "order", " ", "to", " ", "avoid", " ", "calling", " ", "the", " ", "callback", " ", "function", " ", "multiple", " ", "times", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "have", " ", "overlapping", " ", "gene", "s", " ", "to", " ", "highlight", " ", "(", "e", ".", "g", ".,", " ", "a", " ", "gene", " ", "tha", "t", " ", "is", " ", "both_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "upr", "eg", "ulate", "d", " ", "AND", " ", "has", " ", "a", " ", "peak", "),", " ", "keep", " ", "track", " ", "of", " ", "every", "thing", " ", "tha", "t", "'", "s", " ", "bee", "n_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "adde", "d", " ", "so", " ", "far", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "seen_", "=_", "np_", "._", "ones", "\\u", "like_", "(_", "xi_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "block_", "in_", "\\u", "gene", "s", "\\u", "to", "\\u", "highlight_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ind_", "=_", "block_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "=_", "block_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "block_", ")_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hist", "\\u", "kwargs_", "=_", "block_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hist", "\\u", "kwargs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "names_", "=_", "kwargs_", "._", "pop_", "(_", "'", "names", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "marginal", "\\u", "histograms", "_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "._", "pop_", "(_", "'", "marginal", "\\u", "histograms", "'_", ",_", "False_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "marginal", "\\u", "histograms", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "update", "d\\u", "kwargs_", "=_", "plot", "utils_", "._", "\\u", "update", "copy_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "orig_", "=_", "kwargs_", ",_", "update", "\\u", "with_", "=_", "genera", "l\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "update", "d\\u", "hist", "\\u", "kwargs_", "=_", "plot", "utils_", "._", "\\u", "update", "copy_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "orig_", "=_", "hist", "\\u", "kwargs_", ",_", "update", "\\u", "with_", "=_", "genera", "l\\u", "hist", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "d\\u", "hist", "\\u", "kwargs_", "=_", "plot", "utils_", "._", "\\u", "update", "copy_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "orig_", "=_", "update", "d\\u", "hist", "\\u", "kwargs_", ",_", "update", "\\u", "with_", "=_", "kwargs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keys_", "=_", "[_", "'", "color", "'_", ",_", "'", "alpha", "'_", "]_", ",_", "override_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xh", "ist", "\\u", "kwargs_", "=_", "update", "d\\u", "kwargs_", "._", "pop_", "(_", "'", "xh", "ist", "\\u", "kwarg", "s", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yh", "ist", "\\u", "kwargs_", "=_", "update", "d\\u", "kwargs_", "._", "pop_", "(_", "'", "yh", "ist", "\\u", "kwarg", "s", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "marginal", "_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "xi_", "[_", "ind_", "&_", "x", "\\u", "valid_", "&_", "y", "\\u", "valid_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "yi_", "[_", "ind_", "&_", "x", "\\u", "valid_", "&_", "y", "\\u", "valid_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scatter", "\\u", "kwargs_", "=_", "dict_", "(_", "**_", "update", "d\\u", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hist", "\\u", "kwargs_", "=_", "update", "d\\u", "hist", "\\u", "kwargs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xh", "ist", "\\u", "kwargs_", "=_", "xh", "ist", "\\u", "kwargs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "yh", "ist", "\\u", "kwargs_", "=_", "yh", "ist", "\\u", "kwargs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marginal", "\\u", "histograms", "_", "=_", "\\u", "marginal", "\\u", "histograms", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "importa", "nt", " ", "for", " ", "callback", "s", ":", " ", "here", " ", "we", " ", "gra", "b", " ", "the", " ", "last", "-", "created_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "collection", ",_", "\\u\\u\\uNL\\u\\u\\u_", "coll_", "=_", "self_", "._", "marginal", "_", "._", "scatter", "\\u", "ax_", "._", "collections_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coll_", "._", "df_", "=_", "self_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coll_", "._", "ind_", "=_", "ind_", "&_", "x", "\\u", "valid_", "&_", "y", "\\u", "valid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "color", "\\u", "converter_", "(_", "update", "d\\u", "kwargs_", "[_", "'", "color", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ru", "g", "\\u", "x", "\\u", "kwargs_", "[_", "'", "color", "'_", "]_", "=_", "color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ru", "g", "\\u", "y", "\\u", "kwargs_", "[_", "'", "color", "'_", "]_", "=_", "color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "if", " ", "bot", "h", " ", "x", " ", "and", " ", "y", " ", "are", " ", "not", " ", "valid", ",", " ", "then", " ", "the", "y", " ", "will", " ", "not", " ", "be", " ", "on", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plot", "._", "\\u\\u\\uNL\\u\\u\\u_", "items_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", " ", "ru", "g", ",", " ", "y", " ", "is", " ", "+", "inf", " ", "and", " ", "x", " ", "is", " ", "valid_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "xi_", ",_", "ind_", "&_", "x", "\\u", "valid_", "&_", "y", "\\u", "is", "\\u", "pos", "\\u", "inf_", ",_", "pos", "\\u", "offset_", ",_", "ru", "g", "\\u", "x", "\\u", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "one", " ", "of", " ", "the", " ", "bottom", " ", "ru", "gs", ",", " ", "where", " ", "y", " ", "is", " ", "Na", "N_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "xi_", ",_", "ind_", "&_", "x", "\\u", "valid_", "&_", "y", "\\u", "is", "\\u", "nan_", ",_", "nan", "\\u", "offset_", ",_", "ru", "g", "\\u", "x", "\\u", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bottom", " ", "ru", "g", ",", " ", "y", " ", "is", " ", "-", "inf_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "xi_", ",_", "ind_", "&_", "x", "\\u", "valid_", "&_", "y", "\\u", "is", "\\u", "neg", "\\u", "inf_", ",_", "neg", "\\u", "offset_", ",_", "ru", "g", "\\u", "x", "\\u", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "right", " ", "ru", "g", ",", " ", "x", " ", "is", " ", "+", "inf_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "yi_", ",_", "ind_", "&_", "y", "\\u", "valid_", "&_", "x", "\\u", "is", "\\u", "pos", "\\u", "inf_", ",_", "pos", "\\u", "offset_", ",_", "ru", "g", "\\u", "y", "\\u", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "one", " ", "of", " ", "the", " ", "left", " ", "ru", "gs", ";", " ", "x", " ", "is", " ", "Na", "N_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "yi_", ",_", "ind_", "&_", "y", "\\u", "valid_", "&_", "x", "\\u", "is", "\\u", "nan_", ",_", "nan", "\\u", "offset_", ",_", "ru", "g", "\\u", "y", "\\u", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "left", " ", "ru", "g", ",", " ", "x", " ", "is", " ", "-", "inf_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "yi_", ",_", "ind_", "&_", "y", "\\u", "valid_", "&_", "x", "\\u", "is", "\\u", "neg", "\\u", "inf_", ",_", "neg", "\\u", "offset_", ",_", "ru", "g", "\\u", "y", "\\u", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "values_", ",_", "index_", ",_", "offset_", ",_", "kwargs_", "in_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coll_", "=_", "Event", "Collection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "values_", "[_", "index_", "]_", ",_", "line", "offset_", "=_", "offset_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coll_", "._", "df_", "=_", "self_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coll_", "._", "ind_", "=_", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "add", "\\u", "collection_", "(_", "coll_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trans", "Offset_", "=_", "matplotlib_", "._", "transforms_", "._", "offset", "\\u", "copy_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ax_", "._", "trans", "Data_", ",_", "fig_", "=_", "ax_", "._", "figure_", ",_", "**_", "offset", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "xi", "i_", ",_", "yi", "i_", ",_", "name_", "in_", "zip_", "(_", "xi_", "[_", "ind_", "]_", ",_", "yi_", "[_", "ind_", "]_", ",_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ax_", "._", "text_", "(_", "xi", "i_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "yi", "i_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transform_", "=_", "trans", "Offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "label", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "register", " ", "callback_", "\\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_", "callback_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "callback_", "=_", "self_", "._", "\\u", "default", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrapp", "ed", "\\u", "callback_", "(_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "\\u", "id_", "in_", "self_", "._", "\\u", "id", "\\u", "callback_", "(_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "callback_", "(_", "\\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_", "ax_", "._", "figure_", "._", "canvas_", "._", "mpl", "\\u", "connect_", "(_", "'", "pick", "\\u", "event", "'_", ",_", "wrapp", "ed", "\\u", "callback_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ax_", "._", "set\\u", "xlabel_", "(_", "xla", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "ylabel_", "(_", "yla", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "axis_", "(_", "'", "tig", "ht", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
AppScale/appscale/AppServer/lib/google-api-python-client/apiclient/http.py
[ { "content": " def __init__(self, http, postproc, uri,\n method='GET',\n body=None,\n headers=None,\n methodId=None,\n resumable=None):\n \"\"\"Constructor for an HttpRequest.\n\n Args:\n http: httplib2.Http, the transport object to use to make a request\n postproc: callable, called on the HTTP response and content to transform\n it into a data object before returning, or raising an exception\n on an error.\n uri: string, the absolute URI to send the request to\n method: string, the HTTP method to use\n body: string, the request body of the HTTP request,\n headers: dict, the HTTP request headers\n methodId: string, a unique identifier for the API method being called.\n resumable: MediaUpload, None if this is not a resumbale request.\n \"\"\"\n self.uri = uri\n self.method = method\n self.body = body\n self.headers = headers or {}\n self.methodId = methodId\n self.http = http\n self.postproc = postproc\n self.resumable = resumable\n\n # Pull the multipart boundary out of the content-type header.\n major, minor, params = mimeparse.parse_mime_type(\n headers.get('content-type', 'application/json'))\n\n # The size of the non-media part of the request.\n self.body_size = len(self.body or '')\n\n # The resumable URI to send chunks to.\n self.resumable_uri = None\n\n # The bytes that have been uploaded.\n self.resumable_progress = 0", "metadata": "root.HttpRequest.__init__", "header": "['class', 'HttpRequest', '(', 'object', ')', ':', '___EOS___']", "index": 221 } ]
[ { "span": "major,", "start_line": 251, "start_column": 4, "end_line": 251, "end_column": 9 }, { "span": "minor,", "start_line": 251, "start_column": 11, "end_line": 251, "end_column": 16 }, { "span": "params ", "start_line": 251, "start_column": 18, "end_line": 251, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Http", "Request_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "http_", ",_", "postp", "roc_", ",_", "uri_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "'", "GET", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "body_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method", "Id_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resum", "able_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Constructor", " ", "for", " ", "an", " ", "Http", "Request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "http", ":", " ", "http", "lib", "2", ".", "Http", ",", " ", "the", " ", "transport", " ", "object", " ", "to", " ", "use", " ", "to", " ", "make", " ", "a", " ", "request", "\\", "10", ";", " ", " ", "postp", "roc", ":", " ", "calla", "ble", ",", " ", "call", "ed", " ", "on", " ", "the", " ", "HTTP", " ", "response", " ", "and", " ", "content", " ", "to", " ", "transform", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "int", "o", " ", "a", " ", "data", " ", "object", " ", "bef", "ore", " ", "return", "ing", ",", " ", "or", " ", "rais", "ing", " ", "an", " ", "exception", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "an", " ", "error", ".", "\\", "10", ";", " ", " ", "uri", ":", " ", "string", ",", " ", "the", " ", "abs", "olute", " ", "URI", " ", "to", " ", "send", " ", "the", " ", "request", " ", "to", "\\", "10", ";", " ", " ", "method", ":", " ", "string", ",", " ", "the", " ", "HTTP", " ", "method", " ", "to", " ", "use", "\\", "10", ";", " ", " ", "body", ":", " ", "string", ",", " ", "the", " ", "request", " ", "body", " ", "of", " ", "the", " ", "HTTP", " ", "request", ",", "\\", "10", ";", " ", " ", "header", "s", ":", " ", "dict", ",", " ", "the", " ", "HTTP", " ", "request", " ", "header", "s", "\\", "10", ";", " ", " ", "method", "Id", ":", " ", "string", ",", " ", "a", " ", "unique", " ", "identifi", "er", " ", "for", " ", "the", " ", "API", " ", "method", " ", "bei", "ng", " ", "call", "ed", ".", "\\", "10", ";", " ", " ", "resum", "able", ":", " ", "Media", "Upload", ",", " ", "Non", "e", " ", "if", " ", "this", " ", "is", " ", "not", " ", "a", " ", "resum", "bal", "e", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "uri_", "=_", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "method_", "=_", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "body_", "=_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "headers_", "=_", "headers_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "method", "Id_", "=_", "method", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "http_", "=_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "postp", "roc_", "=_", "postp", "roc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resum", "able_", "=_", "resum", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pul", "l", " ", "the", " ", "multip", "art", " ", "bound", "ary", " ", "out", " ", "of", " ", "the", " ", "content", "-", "type", " ", "header", "._", "\\u\\u\\uNL\\u\\u\\u_", "major_", ",_", "minor_", ",_", "params_", "=_", "mime", "parse_", "._", "parse", "\\u", "mime", "\\u", "type_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "._", "get_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "applica", "tion", "/", "json", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "size", " ", "of", " ", "the", " ", "non", "-", "media", " ", "part", " ", "of", " ", "the", " ", "request", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "body", "\\u", "size_", "=_", "len_", "(_", "self_", "._", "body_", "or_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "resum", "able", " ", "URI", " ", "to", " ", "send", " ", "chunks", " ", "to", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "resum", "able", "\\u", "uri_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "bytes", " ", "tha", "t", " ", "have", " ", "bee", "n", " ", "uploade", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "resum", "able", "\\u", "progress_", "=_", "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, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
djangome/djangome/djangome/views.py
[ { "content": "import redis\nimport itertools\nimport operator\nimport urlparse\nfrom django import forms\nfrom django import http\nfrom django.conf import settings\nfrom django.shortcuts import render\nfrom django.shortcuts import redirect\nfrom django.views.decorators.csrf import csrf_exempt\nfrom django.contrib.admin.views.decorators import staff_member_required\n\nr = redis.StrictRedis.from_url(settings.REDIS_URL)\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class RedirectForm(forms.Form):\n _domain = 'docs.djangoproject.com'\n\n url = forms.URLField(label='URL', initial='http://%s/' % _domain)\n title = forms.CharField(label='Title', required=False)\n", "metadata": "root.RedirectForm", "header": "['module', '___EOS___']", "index": 14 }, { "content": " def clean_url(self):\n url = urlparse.urlparse(self.cleaned_data['url'])\n if url.netloc != self._domain:\n raise forms.ValidationError('Please enter a valid URL starting with http://%s/' % self._domain)\n return self.cleaned_data['url']", "metadata": "root.RedirectForm.clean_url", "header": "['class', 'RedirectForm', '(', 'forms', '.', 'Form', ')', ':', '___EOS___']", "index": 20 }, { "content": "def redirect_to_term(request, version, term):\n # Check for an admin oneoff first.\n oneoff_redirect = find_oneoff_redirect(version, term)\n if oneoff_redirect:\n return oneoff_redirect\n\n form = RedirectForm(request.GET or None)\n\n # If we're explicitly choosing a new URL for this term, just go ahead and\n # do that. This could also insert new URLs, so do a brief sanity check to\n # make sure this service can't be used for spam.\n if 'url' in request.GET:\n if form.is_valid():\n # Make sure the new URL is in the set of URLs and increment its score.\n url = form.cleaned_data['url']\n r.sadd('redirects:v2:%s:%s' % (version, term), url)\n r.incr('redirects:v2:%s:%s:%s' % (version, term, url))\n return redirect(request.GET.get('return_to', url))\n\n urls = get_urls(version, term)\n if urls:\n scoregroups = group_urls(urls)\n\n # The first group is the URLs with the highest score.\n score, winners = scoregroups.next()\n\n # If there's only a single winning URL, we're done. Count the redirect and\n # then issue it.\n if len(winners) == 1:\n url = winners[0]\n r.incr('redirects:v2:%s:%s:%s' % (version, term, url))\n return redirect(url)\n\n # Otherwise we need to display a list of all choices. We'll present this into\n # two buckets: the tied URLs with the high score (which is the list of winners\n # we've already gotten) and the tied URLs with a lower score. This second\n # bucket might be empty.\n losers = [losing_group for score, losing_group in scoregroups]\n\n else:\n winners = losers = None\n\n return render(request, 'choices.html', {\n 'term': term,\n 'winners': winners,\n 'losers': losers,\n 'form': form,\n 'version': version,\n })", "metadata": "root.redirect_to_term", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def show_term(request, version, term):\n user_is_staff = request.user.is_staff\n return render(request, 'show.html', {\n 'term': term,\n 'version': version,\n 'urls': get_urls(version, term),\n 'can_edit': user_is_staff,\n })", "metadata": "root.show_term", "header": "['module', '___EOS___']", "index": 76 }, { "content": "@csrf_exempt\n@staff_member_required\ndef manage_oneoffs(request):\n \"\"\"\n Manage the hard-coded one-offs. Admins only.\n \"\"\"\n\n if request.method == 'POST':\n if 'action' in request.POST:\n try:\n action, version, term, target = (request.POST['action'],\n request.POST['version'],\n request.POST['term'],\n request.POST['target'])\n except KeyError:\n return redirect(manage_oneoffs)\n if action == 'add':\n add_oneoff(version, term, target)\n elif action == 'kill':\n kill_oneoff(version, term)\n return redirect(manage_oneoffs)\n\n keys = r.keys('redirects:v2:oneoffs:*')\n targets = r.mget(keys) if keys else []\n\n oneoffs = []\n for (k, target) in zip(keys, targets):\n k = k.replace('redirects:v2:oneoffs:', '')\n if ':' in k:\n version, term = k.split(':')\n else:\n version, term = None, k\n oneoffs.append((version, term, target))\n\n return render(request, 'oneoffs.html', {\n 'oneoffs': oneoffs,\n })", "metadata": "root.manage_oneoffs", "header": "['module', '___EOS___']", "index": 85 }, { "content": "def find_oneoff_redirect(version, term):\n \"\"\"\n Find a one-off redirect for the given version/term.\n\n Returns an HttpResponseRedirect if the redirect was found, None otherwise.\n\n Increments a count of the found term if successful.\n \"\"\"\n oneoff_keys = ['redirects:v2:oneoffs:%s' % term,\n 'redirects:v2:oneoffs:%s:%s' % (version, term)]\n oneoff_redirects = r.mget(oneoff_keys)\n for k, target in zip(oneoff_keys, oneoff_redirects):\n if target:\n r.incr('redirects:v2:%s:%s:%s' % (version, term, target))\n return redirect(target)\n return None", "metadata": "root.find_oneoff_redirect", "header": "['module', '___EOS___']", "index": 123 }, { "content": "def add_oneoff(version, term, target):\n if version:\n k = 'redirects:v2:oneoffs:%s:%s' % (version, term)\n else:\n k = 'redirects:v2:oneoffs:%s' % term\n r.set(k, target)", "metadata": "root.add_oneoff", "header": "['module', '___EOS___']", "index": 140 }, { "content": "def kill_oneoff(version, term):\n if version:\n k = 'redirects:v2:oneoffs:%s:%s' % (version, term)\n else:\n k = 'redirects:v2:oneoffs:%s' % term\n print \"kill\", k\n r.delete(k)", "metadata": "root.kill_oneoff", "header": "['module', '___EOS___']", "index": 147 }, { "content": "def get_urls(version, term):\n \"\"\"\n Gets the set of URLs for <term> in <version>.\n\n Returns a list of (score, url) tuples, sorted by score descending.\n \"\"\"\n # Sort the set of URLs in redirects:v1:term by the scores (clicks) in\n # redirects:v1:term:url, then get each score along with each URL.\n # This returns a list [score, url, score, url, ...]\n urls = r.sort('redirects:v2:%s:%s' % (version, term),\n by = 'redirects:v2:%s:%s:*' % (version, term),\n get = ('redirects:v2:%s:%s:*' % (version, term), '#'),\n desc = True)\n\n # Convert that to a list of tuples [(score, url), (score, url), ...]\n return zip(urls[::2], urls[1::2])", "metadata": "root.get_urls", "header": "['module', '___EOS___']", "index": 155 }, { "content": "def group_urls(urls):\n \"\"\"\n Given a list of (score, url) tuples, group them into buckets by score.\n\n Returns a list of (score, list_of_urls) tuples.\n \"\"\"\n for (score, group) in itertools.groupby(urls, operator.itemgetter(0)):\n yield (score, [url for score, url in group])", "metadata": "root.group_urls", "header": "['module', '___EOS___']", "index": 172 }, { "content": "def firstof(list):\n for i in list:\n if i:\n return i", "metadata": "root.firstof", "header": "['module', '___EOS___']", "index": 181 } ]
[ { "span": "from django import http", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 23 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "redis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "itertools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "import_", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "import_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "decorators_", "._", "csrf_", "import_", "csr", "f", "\\u", "exempt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "admin_", "._", "views_", "._", "decorators_", "import_", "sta", "ff", "\\u", "member", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "redis_", "._", "Stri", "ct", "Redis_", "._", "from", "\\u", "url_", "(_", "settings_", "._", "REDIS", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Redirect", "Form_", "(_", "forms_", "._", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "domain_", "=_", "'", "docs", ".", "django", "project", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "forms_", "._", "URL", "Field_", "(_", "label_", "=_", "'", "URL", "'_", ",_", "initial_", "=_", "'", "http", "://", "%", "s", "/'_", "%_", "\\u", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "forms_", "._", "Char", "Field_", "(_", "label_", "=_", "'", "Tit", "le", "'_", ",_", "required_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "Form_", "(_", "forms_", "._", "Form_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "clean", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "urlparse_", "._", "urlparse_", "(_", "self_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "url", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "url_", "._", "netloc_", "!=_", "self_", "._", "\\u", "domain_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "forms_", "._", "Validat", "ion", "Error_", "(_", "'", "Ple", "ase", " ", "enter", " ", "a", " ", "valid", " ", "URL", " ", "startin", "g", " ", "with", " ", "http", "://", "%", "s", "/'_", "%_", "self_", "._", "\\u", "domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "url", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "redirec", "t", "\\u", "to", "\\u", "term_", "(_", "request_", ",_", "version_", ",_", "term_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "an", " ", "admin", " ", "oneof", "f", " ", "first", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oneof", "f", "\\u", "redirect_", "=_", "find", "\\u", "oneof", "f", "\\u", "redirect_", "(_", "version_", ",_", "term_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "oneof", "f", "\\u", "redirect_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "oneof", "f", "\\u", "redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "Redirect", "Form_", "(_", "request_", "._", "GET_", "or_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", "'", "re", " ", "explicit", "ly", " ", "choo", "sing", " ", "a", " ", "new", " ", "URL", " ", "for", " ", "this", " ", "term", ",", " ", "just", " ", "go", " ", "ahe", "ad", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "do", " ", "tha", "t", ".", " ", "Thi", "s", " ", "coul", "d", " ", "als", "o", " ", "insert", " ", "new", " ", "URL", "s", ",", " ", "so", " ", "do", " ", "a", " ", "brief", " ", "sanity", " ", "check", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "this", " ", "service", " ", "can", "'", "t", " ", "be", " ", "used", " ", "for", " ", "spam", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "url", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "new", " ", "URL", " ", "is", " ", "in", " ", "the", " ", "set", " ", "of", " ", "URL", "s", " ", "and", " ", "increment", " ", "its", " ", "score", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "url", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "._", "sadd", "_", "(_", "'", "redirec", "ts", ":", "v2", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "version_", ",_", "term_", ")_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "._", "incr_", "(_", "'", "redirec", "ts", ":", "v2", ":", "%", "s", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "version_", ",_", "term_", ",_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "request_", "._", "GET_", "._", "get_", "(_", "'", "return", "\\u", "to", "'_", ",_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "urls_", "=_", "get", "\\u", "urls_", "(_", "version_", ",_", "term_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "urls_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score", "groups_", "=_", "group", "\\u", "urls_", "(_", "urls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "first", " ", "group", " ", "is", " ", "the", " ", "URL", "s", " ", "with", " ", "the", " ", "high", "est", " ", "score", "._", "\\u\\u\\uNL\\u\\u\\u_", "score_", ",_", "winner", "s_", "=_", "score", "groups_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "there", "'", "s", " ", "only", " ", "a", " ", "single", " ", "winning", " ", "URL", ",", " ", "we", "'", "re", " ", "don", "e", ".", " ", "Count", " ", "the", " ", "redirec", "t", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "issue", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "winner", "s_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "winner", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "._", "incr_", "(_", "'", "redirec", "ts", ":", "v2", ":", "%", "s", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "version_", ",_", "term_", ",_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ot", "her", "wis", "e", " ", "we", " ", "need", " ", "to", " ", "display", " ", "a", " ", "list", " ", "of", " ", "all", " ", "choice", "s", ".", " ", "We", "'", "ll", " ", "presen", "t", " ", "this", " ", "into_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "two", " ", "bucket", "s", ":", " ", "the", " ", "tied", " ", "URL", "s", " ", "with", " ", "the", " ", "high", " ", "score", " ", "(", "whi", "ch", " ", "is", " ", "the", " ", "list", " ", "of", " ", "winner", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", "'", "ve", " ", "alr", "ead", "y", " ", "got", "ten", ")", " ", "and", " ", "the", " ", "tied", " ", "URL", "s", " ", "with", " ", "a", " ", "lower", " ", "score", ".", " ", "Thi", "s", " ", "second_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bucket", " ", "mig", "ht", " ", "be", " ", "empty", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lose", "rs_", "=_", "[_", "los", "ing", "\\u", "group_", "for_", "score_", ",_", "los", "ing", "\\u", "group_", "in_", "score", "groups_", "]_", "\\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 ", " _", "winner", "s_", "=_", "lose", "rs_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "choice", "s", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "term", "'_", ":_", "term_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "winner", "s", "'_", ":_", "winner", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lose", "rs", "'_", ":_", "lose", "rs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "'_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "version_", ",_", "\\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_", "show", "\\u", "term_", "(_", "request_", ",_", "version_", ",_", "term_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "is", "\\u", "staff_", "=_", "request_", "._", "user_", "._", "is", "\\u", "staff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "show", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "term", "'_", ":_", "term_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "urls", "'_", ":_", "get", "\\u", "urls_", "(_", "version_", ",_", "term_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "can", "\\u", "edit", "'_", ":_", "user", "\\u", "is", "\\u", "staff_", ",_", "\\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_", "@_", "csr", "f", "\\u", "exempt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "sta", "ff", "\\u", "member", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "manage", "\\u", "oneof", "fs_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Manage", " ", "the", " ", "hard", "-", "code", "d", " ", "one", "-", "offs", ".", " ", "Admi", "ns", " ", "only", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "action", "'_", "in_", "request_", "._", "POST_", ":_", "\\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 ", " _", "action_", ",_", "version_", ",_", "term_", ",_", "target_", "=_", "(_", "request_", "._", "POST_", "[_", "'", "action", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "POST_", "[_", "'", "version", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "POST_", "[_", "'", "term", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "POST_", "[_", "'", "target", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "redirect_", "(_", "manage", "\\u", "oneof", "fs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "action_", "==_", "'", "add", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "oneof", "f_", "(_", "version_", ",_", "term_", ",_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "kill", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kill", "\\u", "oneof", "f_", "(_", "version_", ",_", "term_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "redirect_", "(_", "manage", "\\u", "oneof", "fs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keys_", "=_", "r_", "._", "keys_", "(_", "'", "redirec", "ts", ":", "v2", ":", "oneof", "fs", ":*", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "targets_", "=_", "r_", "._", "mg", "et_", "(_", "keys_", ")_", "if_", "keys_", "else_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "oneof", "fs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "k_", ",_", "target_", ")_", "in_", "zip_", "(_", "keys_", ",_", "targets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "k_", "._", "replace_", "(_", "'", "redirec", "ts", ":", "v2", ":", "oneof", "fs", ":'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "':'_", "in_", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", ",_", "term_", "=_", "k_", "._", "split_", "(_", "':'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", ",_", "term_", "=_", "None_", ",_", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oneof", "fs_", "._", "append_", "(_", "(_", "version_", ",_", "term_", ",_", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render_", "(_", "request_", ",_", "'", "oneof", "fs", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oneof", "fs", "'_", ":_", "oneof", "fs_", ",_", "\\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_", "find", "\\u", "oneof", "f", "\\u", "redirect_", "(_", "version_", ",_", "term_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fin", "d", " ", "a", " ", "one", "-", "off", " ", "redirec", "t", " ", "for", " ", "the", " ", "give", "n", " ", "version", "/", "term", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "an", " ", "Http", "Respons", "e", "Redirect", " ", "if", " ", "the", " ", "redirec", "t", " ", "was", " ", "found", ",", " ", "Non", "e", " ", "other", "wis", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Increment", "s", " ", "a", " ", "count", " ", "of", " ", "the", " ", "found", " ", "term", " ", "if", " ", "success", "ful", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oneof", "f", "\\u", "keys_", "=_", "[_", "'", "redirec", "ts", ":", "v2", ":", "oneof", "fs", ":", "%", "s", "'_", "%_", "term_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "redirec", "ts", ":", "v2", ":", "oneof", "fs", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "version_", ",_", "term_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oneof", "f", "\\u", "redirects_", "=_", "r_", "._", "mg", "et_", "(_", "oneof", "f", "\\u", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "target_", "in_", "zip_", "(_", "oneof", "f", "\\u", "keys_", ",_", "oneof", "f", "\\u", "redirects_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "target_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "._", "incr_", "(_", "'", "redirec", "ts", ":", "v2", ":", "%", "s", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "version_", ",_", "term_", ",_", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "oneof", "f_", "(_", "version_", ",_", "term_", ",_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "'", "redirec", "ts", ":", "v2", ":", "oneof", "fs", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "version_", ",_", "term_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "'", "redirec", "ts", ":", "v2", ":", "oneof", "fs", ":", "%", "s", "'_", "%_", "term_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "._", "set_", "(_", "k_", ",_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "kill", "\\u", "oneof", "f_", "(_", "version_", ",_", "term_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "'", "redirec", "ts", ":", "v2", ":", "oneof", "fs", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "version_", ",_", "term_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "'", "redirec", "ts", ":", "v2", ":", "oneof", "fs", ":", "%", "s", "'_", "%_", "term_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "kill", "\"_", ",_", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "._", "delete_", "(_", "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_", "def_", "get", "\\u", "urls_", "(_", "version_", ",_", "term_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", "s", " ", "the", " ", "set", " ", "of", " ", "URL", "s", " ", "for", " ", "<", "term", ">", " ", "in", " ", "<", "version", ">.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "(", "score", ",", " ", "url", ")", " ", "tuple", "s", ",", " ", "sorte", "d", " ", "by", " ", "score", " ", "descend", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sort", " ", "the", " ", "set", " ", "of", " ", "URL", "s", " ", "in", " ", "redirec", "ts", ":", "v1", ":", "term", " ", "by", " ", "the", " ", "score", "s", " ", "(", "clicks", ")", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "redirec", "ts", ":", "v1", ":", "term", ":", "url", ",", " ", "then", " ", "get", " ", "each", " ", "score", " ", "along", " ", "with", " ", "each", " ", "URL", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "return", "s", " ", "a", " ", "list", " ", "[", "score", ",", " ", "url", ",", " ", "score", ",", " ", "url", ",", " ", "...]", "_", "\\u\\u\\uNL\\u\\u\\u_", "urls_", "=_", "r_", "._", "sort_", "(_", "'", "redirec", "ts", ":", "v2", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "version_", ",_", "term_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "by_", "=_", "'", "redirec", "ts", ":", "v2", ":", "%", "s", ":", "%", "s", ":*", "'_", "%_", "(_", "version_", ",_", "term_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get_", "=_", "(_", "'", "redirec", "ts", ":", "v2", ":", "%", "s", ":", "%", "s", ":*", "'_", "%_", "(_", "version_", ",_", "term_", ")_", ",_", "'#'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "desc_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "tha", "t", " ", "to", " ", "a", " ", "list", " ", "of", " ", "tuple", "s", " ", "[(", "score", ",", " ", "url", "),", " ", "(", "score", ",", " ", "url", "),", " ", "...]", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "zip_", "(_", "urls_", "[_", ":_", ":_", "2_", "]_", ",_", "urls_", "[_", "1_", ":_", ":_", "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_", "group", "\\u", "urls_", "(_", "urls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "a", " ", "list", " ", "of", " ", "(", "score", ",", " ", "url", ")", " ", "tuple", "s", ",", " ", "group", " ", "them", " ", "int", "o", " ", "bucket", "s", " ", "by", " ", "score", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "(", "score", ",", " ", "list", "\\u", "of", "\\u", "urls", ")", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "score_", ",_", "group_", ")_", "in_", "itertools_", "._", "groupby_", "(_", "urls_", ",_", "operator_", "._", "itemgetter_", "(_", "0_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "score_", ",_", "[_", "url_", "for_", "score_", ",_", "url_", "in_", "group_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "first", "of_", "(_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "i_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Redundant comparison
google/capirca/tools/ldpush/pexpect_connection.py
[ { "content": " def _MaybeFindPrompt(self):\n \"\"\"Perform real login and then enable if we have an enable password.\"\"\"\n # We always run this for HP, no matter the state of self._find_prompt.\n self._prompt = r'(?:^|\\n|\\r)([A-Za-z0-9\\._-]+)(?:>|#) '\n # Shake out the prompt. We may be facing a Password prompt or\n # a 'Press any key to continue' prompt.\n self.child.send('\\r')\n\n # Only send the password once.\n password_sent = False\n try:\n # Login.\n while True:\n logging.vlog(3, 'Expecting prompt %r', self._prompt)\n compiled_regexes = self.child.compile_pattern_list(\n [self._prompt, r'Press any key to continue',\n 'Password:', 'Invalid password',\n 'Unable to verify password'])\n i = self.child.expect(compiled_regexes, timeout=10)\n if i == 0:\n re_str = (re.escape(self.child.match.group(1)) +\n r'(?:>|#) ')\n logging.vlog(3, 'Prompt set to %r', re_str)\n self.re_prompt = re.compile(re_str)\n break\n elif i == 1:\n logging.vlog(3, 'Pressing any key (space)')\n self.child.send(' ')\n elif i == 2 and not password_sent:\n # Send the password only once.\n try:\n self.child.sendline(self._password)\n logging.vlog(3, 'Sent user password (again) to %r', self._host)\n password_sent = True\n except (pexpect.TIMEOUT, pexpect.EOF) as e:\n self._ssh_client = None\n raise ConnectionError(str(e))\n elif i <= 3 and i < 5:\n logging.error('CONNECT_ERROR Incorrect user password on %r',\n self._host)\n\n # Sleep momentarily before expecting again to break buffer swap races.\n time.sleep(0.05)\n\n # Enable.\n password_sent = False\n logging.vlog(3, 'Enabling for HP on %r', self._host)\n self.child.sendline('enable')\n while True:\n i = self.child.expect([self._prompt, 'Password:',\n 'Invalid password',\n 'Unable to verify password'], timeout=10)\n if i == 0:\n # Found the prompt, we're enabled.\n break\n elif i == 1 and not password_sent:\n if self._enable_password is not None:\n self.child.sendline(self._enable_password)\n logging.vlog(3, 'Sent enable password to %r', self._host)\n else:\n self.child.sendline(self._password)\n logging.vlog(3, 'Sent user password to %r', self._host)\n password_sent = True\n elif i <= 3 and i < 5:\n logging.error('CONNECT_ERROR Incorrect user password on %r',\n self._host)\n # Sleep momentarily before expecting again to break buffer swap races.\n time.sleep(0.05)\n except (pexpect.TIMEOUT, pexpect.EOF) as e:\n self._ssh_client = None\n raise ConnectionError(str(e))", "metadata": "root.HpSshFilterConnection._MaybeFindPrompt", "header": "['class', 'HpSshFilterConnection', '(', 'ParamikoSshConnection', ')', ':', '___EOS___']", "index": 506 } ]
[ { "span": "i < 5:", "start_line": 543, "start_column": 24, "end_line": 543, "end_column": 29 }, { "span": "i < 5:", "start_line": 569, "start_column": 24, "end_line": 569, "end_column": 29 } ]
[ { "span": "i <= 3 ", "start_line": 543, "start_column": 13, "end_line": 543, "end_column": 19 }, { "span": "i <= 3 ", "start_line": 569, "start_column": 13, "end_line": 569, "end_column": 19 } ]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "comparison_", "[SEP]_", "class_", "Hp", "Ss", "h", "Filter", "Connection_", "(_", "Param", "iko", "Ss", "h", "Connection_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Ma", "yb", "e", "Fin", "d", "Prompt_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Perform", " ", "real", " ", "login", " ", "and", " ", "then", " ", "enable", " ", "if", " ", "we", " ", "have", " ", "an", " ", "enable", " ", "password", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "alw", "ay", "s", " ", "run", " ", "this", " ", "for", " ", "HP", ",", " ", "no", " ", "matte", "r", " ", "the", " ", "state", " ", "of", " ", "self", ".\\u", "find", "\\u", "prompt", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "prompt_", "=_", "r", "'(?:", "^", "|\\\\", "n", "|\\\\", "r", ")(", "[", "A", "-", "Za", "-", "z", "0", "-", "9", "\\\\.", "\\u-]", "+)(", "?:", ">", "|", "#)", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sha", "ke", " ", "out", " ", "the", " ", "prompt", ".", " ", " ", "We", " ", "may", " ", "be", " ", "facing", " ", "a", " ", "Passw", "ord", " ", "prompt", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "'", "Press", " ", "any", " ", "key", " ", "to", " ", "continue", "'", " ", "prompt", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "child_", "._", "send_", "(_", "'\\\\", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "send", " ", "the", " ", "password", " ", "onc", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "password", "\\u", "sent_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Logi", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "vlo", "g_", "(_", "3_", ",_", "'", "Expecti", "ng", " ", "prompt", " ", "%", "r", "'_", ",_", "self_", "._", "\\u", "prompt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compile", "d\\u", "regexes_", "=_", "self_", "._", "child_", "._", "compile", "\\u", "pattern", "\\u", "list_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "self_", "._", "\\u", "prompt_", ",_", "r", "'", "Press", " ", "any", " ", "key", " ", "to", " ", "continue", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Passw", "ord", ":'_", ",_", "'", "Inva", "lid", " ", "password", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Una", "ble", " ", "to", " ", "verify", " ", "password", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "self_", "._", "child_", "._", "expect_", "(_", "compile", "d\\u", "regexes_", ",_", "timeout_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "re", "\\u", "str_", "=_", "(_", "re_", "._", "escape_", "(_", "self_", "._", "child_", "._", "match_", "._", "group_", "(_", "1_", ")_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(?:", ">", "|", "#)", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "vlo", "g_", "(_", "3_", ",_", "'", "Prom", "pt", " ", "set", " ", "to", " ", "%", "r", "'_", ",_", "re", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "re", "\\u", "prompt_", "=_", "re_", "._", "compile_", "(_", "re", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "vlo", "g_", "(_", "3_", ",_", "'", "Press", "ing", " ", "any", " ", "key", " ", "(", "space", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "child_", "._", "send_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "==_", "2_", "and_", "not_", "password", "\\u", "sent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sen", "d", " ", "the", " ", "password", " ", "only", " ", "onc", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "child_", "._", "sendline_", "(_", "self_", "._", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "vlo", "g_", "(_", "3_", ",_", "'", "Sent", " ", "user", " ", "password", " ", "(", "again", ")", " ", "to", " ", "%", "r", "'_", ",_", "self_", "._", "\\u", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password", "\\u", "sent_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "pexpect_", "._", "TIMEOUT_", ",_", "pexpect_", "._", "EOF_", ")_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "ssh", "\\u", "client_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Connect", "ion", "Error_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "<=_", "3_", "and_", "i_", "<_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "error_", "(_", "'", "CONNECT", "\\u", "ERROR", " ", "Inco", "rrect", " ", "user", " ", "password", " ", "on", " ", "%", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sleep", " ", "moment", "ari", "ly", " ", "bef", "ore", " ", "expect", "ing", " ", "again", " ", "to", " ", "break", " ", "buffer", " ", "swap", " ", "race", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.05_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Enable", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "password", "\\u", "sent_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "vlo", "g_", "(_", "3_", ",_", "'", "En", "abl", "ing", " ", "for", " ", "HP", " ", "on", " ", "%", "r", "'_", ",_", "self_", "._", "\\u", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "child_", "._", "sendline_", "(_", "'", "enable", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "self_", "._", "child_", "._", "expect_", "(_", "[_", "self_", "._", "\\u", "prompt_", ",_", "'", "Passw", "ord", ":'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Inva", "lid", " ", "password", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Una", "ble", " ", "to", " ", "verify", " ", "password", "'_", "]_", ",_", "timeout_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Foun", "d", " ", "the", " ", "prompt", ",", " ", "we", "'", "re", " ", "enable", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "==_", "1_", "and_", "not_", "password", "\\u", "sent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "enable", "\\u", "password_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "child_", "._", "sendline_", "(_", "self_", "._", "\\u", "enable", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "vlo", "g_", "(_", "3_", ",_", "'", "Sent", " ", "enable", " ", "password", " ", "to", " ", "%", "r", "'_", ",_", "self_", "._", "\\u", "host_", ")_", "\\u\\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_", "._", "child_", "._", "sendline_", "(_", "self_", "._", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "vlo", "g_", "(_", "3_", ",_", "'", "Sent", " ", "user", " ", "password", " ", "to", " ", "%", "r", "'_", ",_", "self_", "._", "\\u", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "password", "\\u", "sent_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "<=_", "3_", "and_", "i_", "<_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "error_", "(_", "'", "CONNECT", "\\u", "ERROR", " ", "Inco", "rrect", " ", "user", " ", "password", " ", "on", " ", "%", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sleep", " ", "moment", "ari", "ly", " ", "bef", "ore", " ", "expect", "ing", " ", "again", " ", "to", " ", "break", " ", "buffer", " ", "swap", " ", "race", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.05_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "pexpect_", "._", "TIMEOUT_", ",_", "pexpect_", "._", "EOF_", ")_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "ssh", "\\u", "client_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Connect", "ion", "Error_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 3, 1, 1, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
enthought/mayavi/tvtk/pipeline/browser.py
[ { "content": " def _on_dclick(self, obj):\n \"\"\"Callback that is called when nodes are double-clicked.\"\"\"\n if hasattr(obj, 'object') and hasattr(obj.object, 'edit_traits'):\n object = obj.object\n view = object.trait_view()\n view.handler = UICloseHandler(browser=self)\n object.on_trait_change(self.render)\n ui = object.edit_traits(view=view)", "metadata": "root.PipelineBrowser._on_dclick", "header": "['class', 'PipelineBrowser', '(', 'HasTraits', ')', ':', '___NEWLINE___', '# The tree generator to use.', '___NL___', '___EOS___']", "index": 764 } ]
[ { "span": "ui ", "start_line": 771, "start_column": 12, "end_line": 771, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Pipe", "line", "Browser_", "(_", "Has", "Trait", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "tree", " ", "generat", "or", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "on", "\\u", "dcl", "ick", "_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", "back", " ", "tha", "t", " ", "is", " ", "call", "ed", " ", "whe", "n", " ", "nodes", " ", "are", " ", "double", "-", "click", "ed", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "obj_", ",_", "'", "object", "'_", ")_", "and_", "hasattr_", "(_", "obj_", "._", "object_", ",_", "'", "edit", "\\u", "traits", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "object_", "=_", "obj_", "._", "object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "=_", "object_", "._", "tra", "it", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "handler_", "=_", "UI", "Clos", "e", "Handler_", "(_", "browser_", "=_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "object_", "._", "on", "\\u", "tra", "it", "\\u", "change_", "(_", "self_", "._", "render_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui_", "=_", "object_", "._", "edit", "\\u", "traits_", "(_", "view_", "=_", "view_", ")_", "\\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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
newsapps/django-boundaryservice/boundaryservice/resources.py
[ { "content": "import re\n\nfrom django.conf import settings\nfrom django.contrib.gis.measure import D\nfrom tastypie import fields\nfrom tastypie.serializers import Serializer\nfrom tastypie.constants import ALL, ALL_WITH_RELATIONS\nfrom django.contrib.gis.geos import Polygon\n\nfrom boundaryservice.authentication import NoOpApiKeyAuthentication\nfrom boundaryservice.models import BoundarySet, Boundary\nfrom boundaryservice.tastyhacks import SluggedResource\nfrom boundaryservice.throttle import AnonymousThrottle\n\nif getattr(settings, 'BOUNDARY_SERVICE_THROTTLE', False):\n throttle_cls = AnonymousThrottle(**settings.BOUNDARY_SERVICE_THROTTLE)\nelse:\n throttle_cls = False\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BoundarySetResource(SluggedResource):\n boundaries = fields.ToManyField(\n 'boundaryservice.resources.BoundaryResource', 'boundaries')\n\n class Meta:\n queryset = BoundarySet.objects.all()\n serializer = Serializer(\n formats=['json', 'jsonp'],\n content_types={\n 'json': 'application/json',\n 'jsonp': 'text/javascript'})\n resource_name = 'boundary-set'\n excludes = ['id', 'singular', 'kind_first']\n allowed_methods = ['get']\n authentication = NoOpApiKeyAuthentication()\n throttle = throttle_cls", "metadata": "root.BoundarySetResource", "header": "['module', '___EOS___']", "index": 20 }, { "content": "class BoundaryResource(SluggedResource):\n set = fields.ForeignKey(BoundarySetResource, 'set')\n\n class Meta:\n queryset = Boundary.objects.all()\n serializer = Serializer(\n formats=['json', 'jsonp'],\n content_types={\n 'json': 'application/json',\n 'jsonp': 'text/javascript'})\n resource_name = 'boundary'\n excludes = ['id', 'display_name']\n allowed_methods = ['get']\n authentication = NoOpApiKeyAuthentication()\n throttle = throttle_cls\n filtering = {\n \"slug\": ALL\n }\n\n\n", "metadata": "root.BoundaryResource", "header": "['module', '___EOS___']", "index": 38 }, { "content": " def alter_list_data_to_serialize(self, request, data):\n \"\"\"\n Allow the selection of simple, full or no shapes\n using a query parameter.\n \"\"\"\n shape_type = request.GET.get('shape_type', 'simple')\n\n for obj in data['objects']:\n if shape_type != 'simple':\n del obj.data['simple_shape']\n\n if shape_type != 'full':\n del obj.data['shape']\n\n return data", "metadata": "root.BoundaryResource.alter_list_data_to_serialize", "header": "['class', 'BoundaryResource', '(', 'SluggedResource', ')', ':', '___EOS___']", "index": 57 }, { "content": " def alter_detail_data_to_serialize(self, request, bundle):\n \"\"\"\n Allow the selection of simple, full or no shapes\n using a query parameter.\n \"\"\"\n shape_type = request.GET.get('shape_type', 'simple')\n\n if shape_type != 'simple':\n del bundle.data['simple_shape']\n\n if shape_type != 'full':\n del bundle.data['shape']\n\n return bundle", "metadata": "root.BoundaryResource.alter_detail_data_to_serialize", "header": "['class', 'BoundaryResource', '(', 'SluggedResource', ')', ':', '___EOS___']", "index": 73 }, { "content": " def build_filters(self, filters=None):\n \"\"\"\n Override build_filters to support geoqueries.\n \"\"\"\n if filters is None:\n filters = {}\n\n orm_filters = super(BoundaryResource, self).build_filters(filters)\n\n if 'sets' in filters:\n sets = filters['sets'].split(',')\n\n orm_filters.update({'set__slug__in': sets})\n\n if 'contains' in filters:\n lat, lon = filters['contains'].split(',')\n wkt_pt = 'POINT(%s %s)' % (lon, lat)\n\n orm_filters.update({'shape__contains': wkt_pt})\n\n if 'near' in filters:\n lat, lon, range = filters['near'].split(',')\n wkt_pt = 'POINT(%s %s)' % (lon, lat)\n numeral = re.match('([0-9]+)', range).group(1)\n unit = range[len(numeral):]\n numeral = int(numeral)\n kwargs = {unit: numeral}\n\n orm_filters.update({'shape__distance_lte': (wkt_pt, D(**kwargs))})\n\n if 'intersects' in filters:\n slug = filters['intersects']\n bounds = Boundary.objects.get(slug=slug)\n\n orm_filters.update({'shape__intersects': bounds.shape})\n\n if 'bbox' in filters:\n xmin, ymin, xmax, ymax = filters['bbox'].split(\",\")\n bbox = (xmin, ymin, xmax, ymax)\n bbox = Polygon.from_bbox(bbox)\n\n orm_filters.update({'shape__intersects': bbox})\n\n return orm_filters", "metadata": "root.BoundaryResource.build_filters", "header": "['class', 'BoundaryResource', '(', 'SluggedResource', ')', ':', '___EOS___']", "index": 88 } ]
[ { "span": "from tastypie.constants import ALL, ALL_WITH_RELATIONS", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 54 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "gis_", "._", "measure_", "import_", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "ypi", "e_", "import_", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "ypi", "e_", "._", "serializers_", "import_", "Serializer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tast", "ypi", "e_", "._", "constants_", "import_", "ALL_", ",_", "ALL", "\\u", "WITH", "\\u", "RELATION", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "gis_", "._", "geos", "_", "import_", "Polygon_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bound", "ary", "service_", "._", "authentication_", "import_", "No", "Op", "Ap", "i", "Key", "Authentication_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bound", "ary", "service_", "._", "models_", "import_", "Boundar", "y", "Set_", ",_", "Boundar", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bound", "ary", "service_", "._", "tast", "yh", "ack", "s_", "import_", "Sl", "ugg", "ed", "Resource_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bound", "ary", "service_", "._", "throttle_", "import_", "Ano", "nym", "ous", "Throttle", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "getattr_", "(_", "settings_", ",_", "'", "BOUND", "ARY", "\\u", "SERV", "ICE", "\\u", "THRO", "TTL", "E", "'_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "throttle", "\\u", "cls_", "=_", "Ano", "nym", "ous", "Throttle", "_", "(_", "**_", "settings_", "._", "BOUND", "ARY", "\\u", "SERV", "ICE", "\\u", "THRO", "TTL", "E_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "throttle", "\\u", "cls_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Boundar", "y", "Set", "Resource_", "(_", "Sl", "ugg", "ed", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "boundaries_", "=_", "fields_", "._", "To", "Many", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bound", "ary", "service", ".", "resource", "s", ".", "Boundar", "y", "Reso", "urc", "e", "'_", ",_", "'", "bound", "aries", "'_", ")_", "\\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 ", " _", "queryset_", "=_", "Boundar", "y", "Set_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serializer_", "=_", "Serializer_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "formats_", "=_", "[_", "'", "json", "'_", ",_", "'", "jsonp", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "types_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "json", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "jsonp", "'_", ":_", "'", "text", "/", "javascript", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resource", "\\u", "name_", "=_", "'", "bound", "ary", "-", "set", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "excludes_", "=_", "[_", "'", "id", "'_", ",_", "'", "singular", "'_", ",_", "'", "kind", "\\u", "first", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "allow", "ed", "\\u", "methods_", "=_", "[_", "'", "get", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "authentication_", "=_", "No", "Op", "Ap", "i", "Key", "Authentication_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "throttle_", "=_", "throttle", "\\u", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Boundar", "y", "Resource_", "(_", "Sl", "ugg", "ed", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "set_", "=_", "fields_", "._", "Fore", "ign", "Key_", "(_", "Boundar", "y", "Set", "Resource_", ",_", "'", "set", "'_", ")_", "\\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 ", " _", "queryset_", "=_", "Boundar", "y_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serializer_", "=_", "Serializer_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "formats_", "=_", "[_", "'", "json", "'_", ",_", "'", "jsonp", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "types_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "json", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "jsonp", "'_", ":_", "'", "text", "/", "javascript", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resource", "\\u", "name_", "=_", "'", "bound", "ary", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "excludes_", "=_", "[_", "'", "id", "'_", ",_", "'", "display", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "allow", "ed", "\\u", "methods_", "=_", "[_", "'", "get", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "authentication_", "=_", "No", "Op", "Ap", "i", "Key", "Authentication_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "throttle_", "=_", "throttle", "\\u", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filtering", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "slug", "\"_", ":_", "ALL_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Boundar", "y", "Resource_", "(_", "Sl", "ugg", "ed", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "alter", "\\u", "list", "\\u", "data\\u", "to", "\\u", "serialize_", "(_", "self_", ",_", "request_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "All", "ow", " ", "the", " ", "selection", " ", "of", " ", "simple", ",", " ", "full", " ", "or", " ", "no", " ", "shape", "s", "\\", "10", ";", " ", " ", " ", " ", "usi", "ng", " ", "a", " ", "query", " ", "parameter", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shape", "\\u", "type_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "shape", "\\u", "type", "'_", ",_", "'", "simple", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "obj_", "in_", "data_", "[_", "'", "object", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "shape", "\\u", "type_", "!=_", "'", "simple", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "obj_", "._", "data_", "[_", "'", "simple", "\\u", "shape", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "shape", "\\u", "type_", "!=_", "'", "full", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "obj_", "._", "data_", "[_", "'", "shape", "'_", "]_", "\\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_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boundar", "y", "Resource_", "(_", "Sl", "ugg", "ed", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "alter", "\\u", "deta", "il", "\\u", "data\\u", "to", "\\u", "serialize_", "(_", "self_", ",_", "request_", ",_", "bundle_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "All", "ow", " ", "the", " ", "selection", " ", "of", " ", "simple", ",", " ", "full", " ", "or", " ", "no", " ", "shape", "s", "\\", "10", ";", " ", " ", " ", " ", "usi", "ng", " ", "a", " ", "query", " ", "parameter", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shape", "\\u", "type_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "shape", "\\u", "type", "'_", ",_", "'", "simple", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "shape", "\\u", "type_", "!=_", "'", "simple", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "bundle_", "._", "data_", "[_", "'", "simple", "\\u", "shape", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "shape", "\\u", "type_", "!=_", "'", "full", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "bundle_", "._", "data_", "[_", "'", "shape", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "bundle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boundar", "y", "Resource_", "(_", "Sl", "ugg", "ed", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "filters_", "(_", "self_", ",_", "filters_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Override", " ", "build", "\\u", "filter", "s", " ", "to", " ", "support", " ", "geo", "querie", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filters_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "orm", "\\u", "filters_", "=_", "super_", "(_", "Boundar", "y", "Resource_", ",_", "self_", ")_", "._", "build", "\\u", "filters_", "(_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "sets", "'_", "in_", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sets_", "=_", "filters_", "[_", "'", "sets", "'_", "]_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "orm", "\\u", "filters_", "._", "update_", "(_", "{_", "'", "set\\u", "\\u", "slug", "\\u\\u", "in", "'_", ":_", "sets_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "contain", "s", "'_", "in_", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lat_", ",_", "lon_", "=_", "filters_", "[_", "'", "contain", "s", "'_", "]_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wk", "t", "\\u", "pt_", "=_", "'", "POINT", "(%", "s", " ", "%", "s", ")'_", "%_", "(_", "lon_", ",_", "lat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "orm", "\\u", "filters_", "._", "update_", "(_", "{_", "'", "shape", "\\u\\u", "contain", "s", "'_", ":_", "wk", "t", "\\u", "pt_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "near", "'_", "in_", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lat_", ",_", "lon_", ",_", "range_", "=_", "filters_", "[_", "'", "near", "'_", "]_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wk", "t", "\\u", "pt_", "=_", "'", "POINT", "(%", "s", " ", "%", "s", ")'_", "%_", "(_", "lon_", ",_", "lat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numeral", "_", "=_", "re_", "._", "match_", "(_", "'(", "[", "0", "-", "9", "]+)'_", ",_", "range_", ")_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unit_", "=_", "range_", "[_", "len_", "(_", "numeral", "_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numeral", "_", "=_", "int_", "(_", "numeral", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "=_", "{_", "unit_", ":_", "numeral", "_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "orm", "\\u", "filters_", "._", "update_", "(_", "{_", "'", "shape", "\\u\\u", "distance", "\\u", "lte", "'_", ":_", "(_", "wk", "t", "\\u", "pt_", ",_", "D_", "(_", "**_", "kwargs_", ")_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "intersect", "s", "'_", "in_", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slug_", "=_", "filters_", "[_", "'", "intersect", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bounds_", "=_", "Boundar", "y_", "._", "objects_", "._", "get_", "(_", "slug_", "=_", "slug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "orm", "\\u", "filters_", "._", "update_", "(_", "{_", "'", "shape", "\\u\\u", "intersect", "s", "'_", ":_", "bounds_", "._", "shape_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "bbox", "'_", "in_", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xmin_", ",_", "ymin_", ",_", "xmax_", ",_", "ymax_", "=_", "filters_", "[_", "'", "bbox", "'_", "]_", "._", "split_", "(_", "\",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bbox_", "=_", "(_", "xmin_", ",_", "ymin_", ",_", "xmax_", ",_", "ymax_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bbox_", "=_", "Polygon_", "._", "from", "\\u", "bbox_", "(_", "bbox_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "orm", "\\u", "filters_", "._", "update_", "(_", "{_", "'", "shape", "\\u\\u", "intersect", "s", "'_", ":_", "bbox_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "orm", "\\u", "filters_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
arachnys/cabot/cabot/cabotapp/alert.py
[ { "content": "from os import environ as env\n\nfrom django.conf import settings\nfrom django.core.mail import send_mail\nfrom django.core.urlresolvers import reverse\nfrom django.template import Context, Template\nfrom django.db import models\nfrom django.db.models import get_models\n\nfrom twilio.rest import TwilioRestClient\nfrom twilio import twiml\n\nimport requests\nimport logging\nimport re\n\nfrom polymorphic import PolymorphicModel\n\nlogger = logging.getLogger(__name__)\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class AlertPlugin(PolymorphicModel):\n title = models.CharField(max_length=30, unique=True, editable=False)\n enabled = models.BooleanField(default=True)\n\n author = None\n\n", "metadata": "root.AlertPlugin", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def __unicode__(self):\n return u'%s' % (self.title)", "metadata": "root.AlertPlugin.__unicode__", "header": "['class', 'AlertPlugin', '(', 'PolymorphicModel', ')', ':', '___EOS___']", "index": 26 }, { "content": " def send_alert(self, service, users, duty_officers):\n \"\"\"\n Implement a send_alert function here that shall be called.\n \"\"\"\n return True", "metadata": "root.AlertPlugin.send_alert", "header": "['class', 'AlertPlugin', '(', 'PolymorphicModel', ')', ':', '___EOS___']", "index": 29 }, { "content": "class AlertPluginUserData(PolymorphicModel):\n title = models.CharField(max_length=30, editable=False)\n user = models.ForeignKey('UserProfile', editable=False)\n\n class Meta:\n unique_together = ('title', 'user',)\n", "metadata": "root.AlertPluginUserData", "header": "['module', '___EOS___']", "index": 35 }, { "content": " def __unicode__(self):\n return u'%s' % (self.title)", "metadata": "root.AlertPluginUserData.__unicode__", "header": "['class', 'AlertPluginUserData', '(', 'PolymorphicModel', ')', ':', '___EOS___']", "index": 42 }, { "content": "def send_alert(service, duty_officers=None):\n users = service.users_to_notify.filter(is_active=True)\n for alert in service.alerts.all():\n try:\n alert.send_alert(service, users, duty_officers)\n except Exception as e:\n logging.exception('Could not send %s alert: %s' % (alert.name, e))", "metadata": "root.send_alert", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def send_alert_update(service, duty_officers=None):\n users = service.users_to_notify.filter(is_active=True)\n for alert in service.alerts.all():\n if hasattr(alert, 'send_alert_update'):\n try:\n alert.send_alert_update(service, users, duty_officers)\n except Exception as e:\n logger.exception('Could not send %s alert update: %s' % (alert.name, e))\n else:\n logger.warning('No send_alert_update method present for %s' % alert.name)", "metadata": "root.send_alert_update", "header": "['module', '___EOS___']", "index": 53 }, { "content": "def update_alert_plugins():\n for plugin_subclass in AlertPlugin.__subclasses__():\n plugin = plugin_subclass.objects.get_or_create(title=plugin_subclass.name)\n return AlertPlugin.objects.all()", "metadata": "root.update_alert_plugins", "header": "['module', '___EOS___']", "index": 65 } ]
[ { "span": "from django.conf import settings", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 32 }, { "span": "from django.core.mail import send_mail", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 38 }, { "span": "from django.core.urlresolvers import reverse", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 44 }, { "span": "from django.template import Context, Template", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 45 }, { "span": "from django.db.models import get_models", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 39 }, { "span": "from twilio.rest import TwilioRestClient", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 40 }, { "span": "from twilio import twiml", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 24 }, { "span": "import requests", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 15 }, { "span": "import re", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "os_", "import_", "environ_", "as_", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "mail_", "import_", "send", "\\u", "mail_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Context_", ",_", "Template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "get", "\\u", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "twilio", "_", "._", "rest_", "import_", "Twi", "lio", "Rest", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twilio", "_", "import_", "twi", "ml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "polymorphic", "_", "import_", "Poly", "morphi", "c", "Model_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Alert", "Plugin_", "(_", "Poly", "morphi", "c", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "30_", ",_", "unique_", "=_", "True_", ",_", "editable_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enabled_", "=_", "models_", "._", "Boo", "lean", "Field_", "(_", "default_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "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_", "Alert", "Plugin_", "(_", "Poly", "morphi", "c", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "'%", "s", "'_", "%_", "(_", "self_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Alert", "Plugin_", "(_", "Poly", "morphi", "c", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "alert_", "(_", "self_", ",_", "service_", ",_", "users_", ",_", "duty", "\\u", "office", "rs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Impl", "ement", " ", "a", " ", "send", "\\u", "alert", " ", "function", " ", "here", " ", "tha", "t", " ", "sha", "ll", " ", "be", " ", "call", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Alert", "Plug", "in", "User", "Data_", "(_", "Poly", "morphi", "c", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "30_", ",_", "editable_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "'", "User", "Profil", "e", "'_", ",_", "editable_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unique", "\\u", "together_", "=_", "(_", "'", "title", "'_", ",_", "'", "user", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Alert", "Plug", "in", "User", "Data_", "(_", "Poly", "morphi", "c", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "'%", "s", "'_", "%_", "(_", "self_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "alert_", "(_", "service_", ",_", "duty", "\\u", "office", "rs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "users_", "=_", "service_", "._", "users", "\\u", "to", "\\u", "notify_", "._", "filter_", "(_", "is", "\\u", "active_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "alert_", "in_", "service_", "._", "alerts_", "._", "all_", "(_", ")_", ":_", "\\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 ", " _", "alert_", "._", "send", "\\u", "alert_", "(_", "service_", ",_", "users_", ",_", "duty", "\\u", "office", "rs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "exception_", "(_", "'", "Cou", "ld", " ", "not", " ", "send", " ", "%", "s", " ", "alert", ":", " ", "%", "s", "'_", "%_", "(_", "alert_", "._", "name_", ",_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "alert", "\\u", "update_", "(_", "service_", ",_", "duty", "\\u", "office", "rs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "users_", "=_", "service_", "._", "users", "\\u", "to", "\\u", "notify_", "._", "filter_", "(_", "is", "\\u", "active_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "alert_", "in_", "service_", "._", "alerts_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "alert_", ",_", "'", "send", "\\u", "alert", "\\u", "update", "'_", ")_", ":_", "\\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 ", " _", "alert_", "._", "send", "\\u", "alert", "\\u", "update_", "(_", "service_", ",_", "users_", ",_", "duty", "\\u", "office", "rs_", ")_", "\\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 ", " _", "logger_", "._", "exception_", "(_", "'", "Cou", "ld", " ", "not", " ", "send", " ", "%", "s", " ", "alert", " ", "update", ":", " ", "%", "s", "'_", "%_", "(_", "alert_", "._", "name_", ",_", "e_", ")_", ")_", "\\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 ", " _", "logger_", "._", "warning_", "(_", "'", "No", " ", "send", "\\u", "alert", "\\u", "update", " ", "method", " ", "presen", "t", " ", "for", " ", "%", "s", "'_", "%_", "alert_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "alert", "\\u", "plugins_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "plugin", "\\u", "subclass_", "in_", "Alert", "Plugin_", "._", "\\u\\u", "subclasses", "\\u\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plugin_", "=_", "plugin", "\\u", "subclass_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "title_", "=_", "plugin", "\\u", "subclass_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Alert", "Plugin_", "._", "objects_", "._", "all_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
redhat-cip/software-factory/tests/functional/test_userdata.py
[ { "content": " def test_hook_user_login(self):\n \"\"\" Functional test when trying to login with service user\n \"\"\"\n self.logout()\n response = self.login(config.HOOK_USER,\n config.HOOK_USER_PASSWORD,\n '/')\n self.assertTrue(response.status_code < 400)", "metadata": "root.TestUserdata.test_hook_user_login", "header": "['class', 'TestUserdata', '(', 'Base', ')', ':', '___EOS___']", "index": 117 }, { "content": " @skipIfIssueTrackerMissing()\n def test_nonmember_backlog_permissions(self):\n \"\"\"Make sure project non members can see the backlog and add\n stories\"\"\"\n # default value, skip gracefully if it cannot be found\n try:\n non_member_role = self.rm.get_role(1)\n assert non_member_role.name == 'Non member'\n except:\n self.skipTest(\"Could not fetch non-member permissions\")\n self.assertTrue('view_master_backlog' in non_member_role.permissions)\n self.assertTrue('create_stories' in non_member_role.permissions)", "metadata": "root.TestUserdata.test_nonmember_backlog_permissions", "header": "['class', 'TestUserdata', '(', 'Base', ')', ':', '___EOS___']", "index": 139 }, { "content": " def test_delete_in_backend_and_recreate(self):\n \"\"\"Make sure we can recreate a user but as a different one\"\"\"\n # first, create a user and register it with services\n try:\n self.msu.create_user('freddie', 'mercury', 'mrbadguy@queen.com')\n except NotImplementedError:\n skip(\"user management not supported in this version of managesf\")\n self.logout()\n self.login('freddie', 'mercury', config.GATEWAY_URL)\n gerrit_id = self.gu.get_account('freddie').get('_account_id')\n if has_issue_tracker():\n tracker_id = self.rm.get_user_id_by_username('freddie')\n del_url = config.GATEWAY_URL +\\\n 'manage/services_users/?email=mrbadguy@queen.com'\n auth_cookie = config.USERS[config.ADMIN_USER]['auth_cookie']\n d = requests.delete(del_url,\n cookies={'auth_pubtkt': auth_cookie})\n self.assertTrue(int(d.status_code) < 400, d.status_code)\n self.assertEqual(False,\n self.gu.get_account('freddie'))\n if has_issue_tracker():\n users = self.rm.active_users()\n self.assertEqual(0,\n len([u for u in users\n if u[0] == 'freddie']))\n # recreate the user in the backends\n time.sleep(5)\n self.logout()\n self.login('freddie', 'mercury', config.GATEWAY_URL)\n new_gerrit_id = self.gu.get_account('freddie').get('_account_id')\n self.assertTrue(gerrit_id != new_gerrit_id)\n if has_issue_tracker():\n new_tracker_id = self.rm.get_user_id_by_username('freddie')\n self.assertTrue(tracker_id != new_tracker_id)", "metadata": "root.TestUserdata.test_delete_in_backend_and_recreate", "header": "['class', 'TestUserdata', '(', 'Base', ')', ':', '___EOS___']", "index": 230 } ]
[ { "span": "self.assertTrue(response.status_code < 400)", "start_line": 124, "start_column": 8, "end_line": 124, "end_column": 51 }, { "span": "self.assertTrue('view_master_backlog' in non_member_role.permissions)", "start_line": 149, "start_column": 8, "end_line": 149, "end_column": 77 }, { "span": "self.assertTrue('create_stories' in non_member_role.permissions)", "start_line": 150, "start_column": 8, "end_line": 150, "end_column": 72 }, { "span": "self.assertTrue(gerrit_id != new_gerrit_id)", "start_line": 260, "start_column": 8, "end_line": 260, "end_column": 51 }, { "span": "self.assertTrue(tracker_id != new_tracker_id)", "start_line": 263, "start_column": 12, "end_line": 263, "end_column": 57 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "User", "data_", "(_", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hook", "\\u", "user", "\\u", "login_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Function", "al", " ", "test", " ", "whe", "n", " ", "try", "ing", " ", "to", " ", "login", " ", "with", " ", "service", " ", "user", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "login_", "(_", "config_", "._", "HOOK", "\\u", "USER_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "._", "HOOK", "\\u", "USER", "\\u", "PASSWORD_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "status", "\\u", "code_", "<_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "User", "data_", "(_", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "skip", "If", "Issue", "Track", "er", "Missing", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "non", "member", "\\u", "backlog", "\\u", "permissions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Make", " ", "sure", " ", "project", " ", "non", " ", "member", "s", " ", "can", " ", "see", " ", "the", " ", "backlog", " ", "and", " ", "add", "\\", "10", ";", " ", " ", " ", " ", "stories", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "default", " ", "value", ",", " ", "skip", " ", "graceful", "ly", " ", "if", " ", "it", " ", "cann", "ot", " ", "be", " ", "found_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "non", "\\u", "member", "\\u", "role_", "=_", "self_", "._", "rm_", "._", "get", "\\u", "role_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "non", "\\u", "member", "\\u", "role_", "._", "name_", "==_", "'", "Non", " ", "member", "'_", "\\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_", "._", "skip", "Test_", "(_", "\"", "Cou", "ld", " ", "not", " ", "fetch", " ", "non", "-", "member", " ", "permissi", "ons", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "view", "\\u", "master", "\\u", "backlog", "'_", "in_", "non", "\\u", "member", "\\u", "role_", "._", "permissions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "create", "\\u", "stories", "'_", "in_", "non", "\\u", "member", "\\u", "role_", "._", "permissions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "User", "data_", "(_", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "in", "\\u", "back", "end", "\\u", "and", "\\u", "recreate", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Make", " ", "sure", " ", "we", " ", "can", " ", "recreate", " ", "a", " ", "user", " ", "but", " ", "as", " ", "a", " ", "different", " ", "one", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "first", ",", " ", "create", " ", "a", " ", "user", " ", "and", " ", "register", " ", "it", " ", "with", " ", "services_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ms", "u_", "._", "create", "\\u", "user_", "(_", "'", "fre", "ddi", "e", "'_", ",_", "'", "mercur", "y", "'_", ",_", "'", "mr", "bad", "guy", "@", "queen", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Not", "Impl", "ement", "ed", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "skip_", "(_", "\"", "user", " ", "manage", "ment", " ", "not", " ", "support", "ed", " ", "in", " ", "this", " ", "version", " ", "of", " ", "manage", "sf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "logout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "login_", "(_", "'", "fre", "ddi", "e", "'_", ",_", "'", "mercur", "y", "'_", ",_", "config_", "._", "GATEWAY", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gerrit", "\\u", "id_", "=_", "self_", "._", "gu", "_", "._", "get", "\\u", "account_", "(_", "'", "fre", "ddi", "e", "'_", ")_", "._", "get_", "(_", "'\\u", "account", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "has", "\\u", "issue", "\\u", "tracker_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "track", "er", "\\u", "id_", "=_", "self_", "._", "rm_", "._", "get", "\\u", "user", "\\u", "id", "\\u", "by", "\\u", "username_", "(_", "'", "fre", "ddi", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del", "\\u", "url_", "=_", "config_", "._", "GATEWAY", "\\u", "URL_", "+_", "'", "manage", "/", "service", "s", "\\u", "users", "/?", "email", "=", "mr", "bad", "guy", "@", "queen", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "cookie_", "=_", "config_", "._", "USERS", "_", "[_", "config_", "._", "ADM", "IN", "\\u", "USER_", "]_", "[_", "'", "auth", "\\u", "cookie", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "requests_", "._", "delete_", "(_", "del", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cookies_", "=_", "{_", "'", "auth", "\\u", "pub", "tk", "t", "'_", ":_", "auth", "\\u", "cookie_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "int_", "(_", "d_", "._", "status", "\\u", "code_", ")_", "<_", "400_", ",_", "d_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gu", "_", "._", "get", "\\u", "account_", "(_", "'", "fre", "ddi", "e", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "has", "\\u", "issue", "\\u", "tracker_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "users_", "=_", "self_", "._", "rm_", "._", "active", "\\u", "users_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "[_", "u_", "for_", "u_", "in_", "users_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "u_", "[_", "0_", "]_", "==_", "'", "fre", "ddi", "e", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "recreate", " ", "the", " ", "user", " ", "in", " ", "the", " ", "backends_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "login_", "(_", "'", "fre", "ddi", "e", "'_", ",_", "'", "mercur", "y", "'_", ",_", "config_", "._", "GATEWAY", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "gerrit", "\\u", "id_", "=_", "self_", "._", "gu", "_", "._", "get", "\\u", "account_", "(_", "'", "fre", "ddi", "e", "'_", ")_", "._", "get_", "(_", "'\\u", "account", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "gerrit", "\\u", "id_", "!=_", "new", "\\u", "gerrit", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "has", "\\u", "issue", "\\u", "tracker_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "track", "er", "\\u", "id_", "=_", "self_", "._", "rm_", "._", "get", "\\u", "user", "\\u", "id", "\\u", "by", "\\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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
`__iter__` method returns a non-iterator
emansim/text2image/coco/homogeneous-data.py
[ { "content": "class HomogeneousData():\n # prepare -> reset -> next\n\n\n\n", "metadata": "root.HomogeneousData", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def __iter__(self):\n return self", "metadata": "root.HomogeneousData.__iter__", "header": "['class', 'HomogeneousData', '(', ')', ':', '___NEWLINE___', '# prepare -> reset -> next', '___NL___', '___EOS___']", "index": 56 } ]
[ { "span": "class HomogeneousData():", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 24 } ]
[ { "span": "def __iter__(self):", "start_line": 56, "start_column": 4, "end_line": 56, "end_column": 23 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "iter\\u\\u_", "`_", "method_", "returns_", "a_", "non", "_", "-_", "iterator_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Homo", "gene", "ous", "Data_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "prepar", "e", " ", "->", " ", "reset", " ", "->", " ", "next_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Homo", "gene", "ous", "Data_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "prepar", "e", " ", "->", " ", "reset", " ", "->", " ", "next_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2 ]
Unused import
enthought/mayavi/mayavi/core/common.py
[ { "content": "\"\"\"Common utility functions and classes. This includes error/warning\nmessages etc.\n\n\"\"\"\n# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>\n# Copyright (c) 2005-2008, Enthought, Inc.\n# License: BSD Style.\n\n# Standard library imports.\nimport sys\nimport traceback\nimport logging\nimport vtk\n\n# Enthought library imports.\nfrom apptools.persistence.state_pickler import create_instance\nfrom traits.etsconfig.api import ETSConfig\nif ETSConfig.toolkit in ('null', ''):\n pyface = None\nelse:\n from pyface import api as pyface\n\n# Setup a logger for this module.\nlogger = logging.getLogger(__name__)\n\n######################################################################\n# Utility functions.\n######################################################################\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def debug(msg):\n \"\"\"Handle a debug message.\n \"\"\"\n logger.debug(msg)", "metadata": "root.debug", "header": "['module', '___EOS___']", "index": 30 }, { "content": "def warning(msg, parent=None):\n \"\"\"Handle a warning message.\n \"\"\"\n logger.warn(msg)\n if pyface is not None:\n pyface.warning(parent, msg)", "metadata": "root.warning", "header": "['module', '___EOS___']", "index": 36 }, { "content": "def error(msg, parent=None):\n \"\"\"Handle an error message.\n \"\"\"\n logger.error(msg)\n if pyface is not None:\n pyface.error(parent, msg)", "metadata": "root.error", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def exception(msg='Exception', parent=None):\n \"\"\"This function handles any exception derived from Exception and\n prints out an error. The optional `parent` argument is passed\n along to the dialog box. The optional `msg` is printed and sent\n to the logger. So you could send extra information here.\n \"\"\"\n try:\n type, value, tb = sys.exc_info()\n info = traceback.extract_tb(tb)\n filename, lineno, function, text = info[-1] # last line only\n exc_msg = \"%s\\nIn %s:%d\\n%s: %s (in %s)\" %\\\n (msg, filename, lineno, type.__name__, str(value),\n function)\n # Log and display the message.\n logger.exception(msg)\n if pyface is not None:\n pyface.error(parent, exc_msg, title='Exception')\n finally:\n type = value = tb = None # clean up", "metadata": "root.exception", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def process_ui_events():\n \"\"\"Process GUI events.\n\n This function merely abstracts the function so nothing is done when\n no UI is running.\n \"\"\"\n if pyface is not None:\n pyface.GUI.process_events()", "metadata": "root.process_ui_events", "header": "['module', '___EOS___']", "index": 73 }, { "content": "def get_engine(obj):\n \"\"\"Try and return the engine given an object in the mayavi\n pipeline. This basically walks up the parent's of the object till\n the engine is found.\n \"\"\"\n from mayavi.core.engine import Engine\n while obj is not None:\n if isinstance(obj, Engine):\n return obj\n else:\n obj = obj.parent\n return None", "metadata": "root.get_engine", "header": "['module', '___EOS___']", "index": 83 }, { "content": "def get_output(obj):\n \"\"\"Given an object, extracts the output object, hiding differences\n between old and new pipeline.\"\"\"\n if obj.is_a('vtkDataSet'):\n return obj\n else:\n return obj.output", "metadata": "root.get_output", "header": "['module', '___EOS___']", "index": 97 }, { "content": "def get_object_path(object, parent, path='engine'):\n \"\"\"Given a mayavi object on the tree view, this should find its\n \"path\" with respect to the parent object that contains it.\n \"\"\"\n def _get_child_trait(obj):\n if hasattr(obj, 'scenes'):\n return 'scenes'\n elif hasattr(obj, 'children'):\n return 'children'\n return ''\n\n def _finder(obj, to_find, path):\n if obj is to_find:\n return path\n else:\n child_t = _get_child_trait(obj)\n if child_t == '':\n return ''\n for i, o in enumerate(getattr(obj, child_t)):\n pth = _finder(o, to_find, '%s.%s[%d]'%(path, child_t, i))\n if len(pth) > 0:\n return pth\n return ''\n\n return _finder(parent, object, path)", "metadata": "root.get_object_path", "header": "['module', '___EOS___']", "index": 106 }, { "content": "def handle_children_state(children, kids):\n \"\"\"Given a list of children (as `children`) of a particular object\n and their states in the `kids` argument, this function sets up the\n children by removing unnecessary ones, fixing existing ones and\n adding new children if necessary (depending on the state).\n \"\"\"\n # Make a copy of the list so adding/removing does not trigger events\n # each time.\n m_children = list(children)\n\n n_child, n_kid = len(m_children), len(kids)\n # Remove extra children we have.\n for i in range(n_child - n_kid):\n m_children.pop()\n # Now check existing children deleting existing ones and\n # creating new ones if needed.\n for i in range(n_child):\n child, kid = m_children[i], kids[i]\n md = kid.__metadata__\n if (child.__module__ != md['module']) \\\n or (child.__class__.__name__ != md['class_name']):\n m_children[i] = create_instance(kid)\n # Add any extra kids.\n for i in range(n_kid - n_child):\n child = create_instance(kids[n_child + i])\n m_children.append(child)\n\n # Now set the children in one shot.\n children[:] = m_children", "metadata": "root.handle_children_state", "header": "['module', '___EOS___']", "index": 133 } ]
[ { "span": "import vtk", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Common", " ", "utility", " ", "function", "s", " ", "and", " ", "classe", "s", ".", " ", " ", "Thi", "s", " ", "include", "s", " ", "error", "/", "warn", "ing", "\\", "10", ";", "message", "s", " ", "etc", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Author", ":", " ", "Pra", "bh", "u", " ", "Ram", "ach", "andra", "n", " ", "<", "pra", "bh", "u\\u", "r", "@", "users", ".", "sf", ".", "net", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2005", "-", "2008", ",", " ", "Ent", "hou", "ght", ",", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", "BS", "D", " ", "Style", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Standard", " ", "librar", "y", " ", "import", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "vtk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ent", "hou", "ght", " ", "librar", "y", " ", "import", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "app", "tools_", "._", "persistence_", "._", "state", "\\u", "pickle", "r_", "import_", "create", "\\u", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "traits_", "._", "ets", "config_", "._", "api_", "import_", "ET", "SC", "onfig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ET", "SC", "onfig_", "._", "toolkit_", "in_", "(_", "'", "null", "'_", ",_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyf", "ace_", "=_", "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 ", " _", "from_", "pyf", "ace_", "import_", "api_", "as_", "pyf", "ace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", "up", " ", "a", " ", "logg", "er", " ", "for", " ", "this", " ", "module", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Utili", "ty", " ", "function", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "debug_", "(_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Handle", " ", "a", " ", "debug", " ", "message", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "debug_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "warning_", "(_", "msg_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Handle", " ", "a", " ", "warn", "ing", " ", "message", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "warn_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pyf", "ace_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyf", "ace_", "._", "warning_", "(_", "parent_", ",_", "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_", "def_", "error_", "(_", "msg_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Handle", " ", "an", " ", "error", " ", "message", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pyf", "ace_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyf", "ace_", "._", "error_", "(_", "parent_", ",_", "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_", "def_", "exception_", "(_", "msg_", "=_", "'", "Except", "ion", "'_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "function", " ", "handle", "s", " ", "any", " ", "exception", " ", "derive", "d", " ", "from", " ", "Except", "ion", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "print", "s", " ", "out", " ", "an", " ", "error", ".", " ", " ", "The", " ", "option", "al", " ", "`", "parent", "`", " ", "argu", "ment", " ", "is", " ", "pass", "ed", "\\", "10", ";", " ", " ", " ", " ", "along", " ", "to", " ", "the", " ", "dialog", " ", "box", ".", " ", " ", "The", " ", "option", "al", " ", "`", "msg", "`", " ", "is", " ", "printed", " ", "and", " ", "sent", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "logg", "er", ".", " ", " ", "So", " ", "you", " ", "coul", "d", " ", "send", " ", "extra", " ", "informati", "on", " ", "here", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type_", ",_", "value_", ",_", "tb_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "traceback_", "._", "extract", "\\u", "tb_", "(_", "tb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", ",_", "lineno_", ",_", "function_", ",_", "text_", "=_", "info_", "[_", "-_", "1_", "]_", "#", " ", "last", " ", "line", " ", "only_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc", "\\u", "msg_", "=_", "\"%", "s", "\\\\", "n", "In", " ", "%", "s", ":", "%", "d", "\\\\", "n", "%", "s", ":", " ", "%", "s", " ", "(", "in", " ", "%", "s", ")\"_", "%_", "(_", "msg_", ",_", "filename_", ",_", "lineno_", ",_", "type_", "._", "\\u\\u", "name\\u\\u_", ",_", "str_", "(_", "value_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "function_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Log", " ", "and", " ", "display", " ", "the", " ", "message", "._", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "._", "exception_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pyf", "ace_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyf", "ace_", "._", "error_", "(_", "parent_", ",_", "exc", "\\u", "msg_", ",_", "title_", "=_", "'", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type_", "=_", "value_", "=_", "tb_", "=_", "None_", "#", " ", "clean", " ", "up_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "ui", "\\u", "events_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Process", " ", "GU", "I", " ", "events", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "mer", "el", "y", " ", "abstract", "s", " ", "the", " ", "function", " ", "so", " ", "not", "hing", " ", "is", " ", "don", "e", " ", "whe", "n", "\\", "10", ";", " ", " ", " ", " ", "no", " ", "UI", " ", "is", " ", "runn", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pyf", "ace_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyf", "ace_", "._", "GUI_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "engine_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tr", "y", " ", "and", " ", "return", " ", "the", " ", "eng", "ine", " ", "give", "n", " ", "an", " ", "object", " ", "in", " ", "the", " ", "maya", "vi", "\\", "10", ";", " ", " ", " ", " ", "pipeline", ".", " ", " ", "Thi", "s", " ", "basic", "ally", " ", "walk", "s", " ", "up", " ", "the", " ", "parent", "'", "s", " ", "of", " ", "the", " ", "object", " ", "till", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "eng", "ine", " ", "is", " ", "found", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "maya", "vi_", "._", "core_", "._", "engine_", "import_", "Engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "obj_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "obj_", ",_", "Engine_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "obj_", "._", "parent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "output_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "an", " ", "object", ",", " ", "extracts", " ", "the", " ", "output", " ", "object", ",", " ", "hid", "ing", " ", "difference", "s", "\\", "10", ";", " ", " ", " ", " ", "bet", "ween", " ", "old", " ", "and", " ", "new", " ", "pipeline", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "obj_", "._", "is", "\\u", "a_", "(_", "'", "vtk", "Data", "Set", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "obj_", "\\u\\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_", "obj_", "._", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "object\\u", "path_", "(_", "object_", ",_", "parent_", ",_", "path_", "=_", "'", "eng", "ine", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "a", " ", "maya", "vi", " ", "object", " ", "on", " ", "the", " ", "tree", " ", "view", ",", " ", "this", " ", "shou", "ld", " ", "find", " ", "its", "\\", "10", ";", " ", " ", " ", " ", "\"", "path", "\"", " ", "with", " ", "respec", "t", " ", "to", " ", "the", " ", "parent", " ", "object", " ", "tha", "t", " ", "contain", "s", " ", "it", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "get", "\\u", "child", "\\u", "trait_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "obj_", ",_", "'", "scenes", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "scenes", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "obj_", ",_", "'", "child", "ren", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "child", "ren", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "finder_", "(_", "obj_", ",_", "to", "\\u", "find_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "obj_", "is_", "to", "\\u", "find_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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 ", " _", "child", "\\u", "t_", "=_", "\\u", "get", "\\u", "child", "\\u", "trait_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "child", "\\u", "t_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", ",_", "o_", "in_", "enumerate_", "(_", "getattr_", "(_", "obj_", ",_", "child", "\\u", "t_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pth_", "=_", "\\u", "finder_", "(_", "o_", ",_", "to", "\\u", "find_", ",_", "'%", "s", ".", "%", "s", "[", "%", "d", "]'_", "%_", "(_", "path_", ",_", "child", "\\u", "t_", ",_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "pth_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "pth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u", "finder_", "(_", "parent_", ",_", "object_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "child", "ren", "\\u", "state_", "(_", "children_", ",_", "kids", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "a", " ", "list", " ", "of", " ", "child", "ren", " ", "(", "as", " ", "`", "child", "ren", "`)", " ", "of", " ", "a", " ", "partic", "ular", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "thei", "r", " ", "state", "s", " ", "in", " ", "the", " ", "`", "kids", "`", " ", "argu", "ment", ",", " ", "this", " ", "function", " ", "sets", " ", "up", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "child", "ren", " ", "by", " ", "remo", "ving", " ", "unne", "cess", "ary", " ", "ones", ",", " ", "fix", "ing", " ", "exist", "ing", " ", "ones", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "addin", "g", " ", "new", " ", "child", "ren", " ", "if", " ", "necessar", "y", " ", "(", "depend", "ing", " ", "on", " ", "the", " ", "state", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "list", " ", "so", " ", "addin", "g", "/", "remo", "ving", " ", "doe", "s", " ", "not", " ", "trigger", " ", "events_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "each", " ", "time", "._", "\\u\\u\\uNL\\u\\u\\u_", "m", "\\u", "children_", "=_", "list_", "(_", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "child_", ",_", "n", "\\u", "kid", "_", "=_", "len_", "(_", "m", "\\u", "children_", ")_", ",_", "len_", "(_", "kids", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "extra", " ", "child", "ren", " ", "we", " ", "have", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "n", "\\u", "child_", "-_", "n", "\\u", "kid", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m", "\\u", "children_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "check", " ", "exist", "ing", " ", "child", "ren", " ", "delet", "ing", " ", "exist", "ing", " ", "ones", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "creati", "ng", " ", "new", " ", "ones", " ", "if", " ", "need", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "n", "\\u", "child_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "child_", ",_", "kid", "_", "=_", "m", "\\u", "children_", "[_", "i_", "]_", ",_", "kids", "_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "md_", "=_", "kid", "_", "._", "\\u\\u", "metadata", "\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "child_", "._", "\\u\\u", "module\\u\\u_", "!=_", "md_", "[_", "'", "module", "'_", "]_", ")_", "or_", "(_", "child_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "!=_", "md_", "[_", "'", "class", "\\u", "name", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m", "\\u", "children_", "[_", "i_", "]_", "=_", "create", "\\u", "instance_", "(_", "kid", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "extra", " ", "kids", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "n", "\\u", "kid", "_", "-_", "n", "\\u", "child_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "child_", "=_", "create", "\\u", "instance_", "(_", "kids", "_", "[_", "n", "\\u", "child_", "+_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "\\u", "children_", "._", "append_", "(_", "child_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "set", " ", "the", " ", "child", "ren", " ", "in", " ", "one", " ", "sho", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "children_", "[_", ":_", "]_", "=_", "m", "\\u", "children_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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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 ]
Imprecise assert
HubSpot/sanetime/sanetime/test/test_tztime.py
[ { "content": " def test_equality(self):\n t1 = tztime(JAN_MICROS, tz='UTC')\n t2 = tztime(JAN_MICROS, tz='America/New_York')\n t3 = tztime(JAN_MICROS+1)\n self.assertTrue(t1==t1)\n self.assertTrue(t2==t2)\n self.assertTrue(t3==t3)\n self.assertFalse(t1!=t1)\n self.assertFalse(t2!=t2)\n self.assertFalse(t3!=t3)\n\n self.assertTrue(t1!=t2)\n self.assertTrue(t2!=t1)\n self.assertTrue(t1!=t3)\n self.assertTrue(t3!=t1)\n self.assertTrue(t2!=t3)\n self.assertTrue(t3!=t2)\n\n self.assertFalse(t1==t2)\n self.assertFalse(t2==t1)\n self.assertFalse(t1==t3)\n self.assertFalse(t3==t1)\n self.assertFalse(t2==t3)\n self.assertFalse(t3==t2)\n\n self.assertTrue(t1!=None)\n self.assertFalse(t1==None)\n self.assertTrue(None!=t1)\n self.assertFalse(None==t1)\n\n self.assertTrue(t1==t1.us)", "metadata": "root.SaneTzTimeTest.test_equality", "header": "['class', 'SaneTzTimeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 24 }, { "content": " def test_comparisons(self):\n t1 = tztime(JAN_MICROS,'UTC')\n t2 = tztime(JAN_MICROS,'America/New_York')\n t3 = tztime(JAN_MICROS+1,'UTC')\n\n self.assertFalse(t1 > t1)\n self.assertFalse(t2 > t2)\n self.assertFalse(t3 > t3)\n self.assertTrue(t1 > t2)\n self.assertFalse(t2 > t1)\n self.assertFalse(t1 > t3)\n self.assertTrue(t3 > t1)\n self.assertFalse(t2 > t3)\n self.assertTrue(t3 > t2)\n\n self.assertTrue(t1 >= t1)\n self.assertTrue(t2 >= t2)\n self.assertTrue(t3 >= t3)\n self.assertTrue(t1 >= t2)\n self.assertFalse(t2 >= t1)\n self.assertFalse(t1 >= t3)\n self.assertTrue(t3 >= t1)\n self.assertFalse(t2 >= t3)\n self.assertTrue(t3 >= t2)\n\n self.assertTrue(t1 <= t1)\n self.assertTrue(t2 <= t2)\n self.assertTrue(t3 <= t3)\n self.assertFalse(t1 <= t2)\n self.assertTrue(t2 <= t1)\n self.assertTrue(t1 <= t3)\n self.assertFalse(t3 <= t1)\n self.assertTrue(t2 <= t3)\n self.assertFalse(t3 <= t2)\n\n self.assertFalse(t1 < t1)\n self.assertFalse(t2 < t2)\n self.assertFalse(t3 < t3)\n self.assertFalse(t1 < t2)\n self.assertTrue(t2 < t1)\n self.assertTrue(t1 < t3)\n self.assertFalse(t3 < t1)\n self.assertTrue(t2 < t3)\n self.assertFalse(t3 < t2)", "metadata": "root.SaneTzTimeTest.test_comparisons", "header": "['class', 'SaneTzTimeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 } ]
[ { "span": "self.assertTrue(t1==t1)", "start_line": 28, "start_column": 8, "end_line": 28, "end_column": 31 }, { "span": "self.assertTrue(t2==t2)", "start_line": 29, "start_column": 8, "end_line": 29, "end_column": 31 }, { "span": "self.assertTrue(t3==t3)", "start_line": 30, "start_column": 8, "end_line": 30, "end_column": 31 }, { "span": "self.assertFalse(t1!=t1)", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 32 }, { "span": "self.assertFalse(t2!=t2)", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 32 }, { "span": "self.assertFalse(t3!=t3)", "start_line": 33, "start_column": 8, "end_line": 33, "end_column": 32 }, { "span": "self.assertTrue(t1!=t2)", "start_line": 35, "start_column": 8, "end_line": 35, "end_column": 31 }, { "span": "self.assertTrue(t2!=t1)", "start_line": 36, "start_column": 8, "end_line": 36, "end_column": 31 }, { "span": "self.assertTrue(t1!=t3)", "start_line": 37, "start_column": 8, "end_line": 37, "end_column": 31 }, { "span": "self.assertTrue(t3!=t1)", "start_line": 38, "start_column": 8, "end_line": 38, "end_column": 31 }, { "span": "self.assertTrue(t2!=t3)", "start_line": 39, "start_column": 8, "end_line": 39, "end_column": 31 }, { "span": "self.assertTrue(t3!=t2)", "start_line": 40, "start_column": 8, "end_line": 40, "end_column": 31 }, { "span": "self.assertFalse(t1==t2)", "start_line": 42, "start_column": 8, "end_line": 42, "end_column": 32 }, { "span": "self.assertFalse(t2==t1)", "start_line": 43, "start_column": 8, "end_line": 43, "end_column": 32 }, { "span": "self.assertFalse(t1==t3)", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 32 }, { "span": "self.assertFalse(t3==t1)", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 32 }, { "span": "self.assertFalse(t2==t3)", "start_line": 46, "start_column": 8, "end_line": 46, "end_column": 32 }, { "span": "self.assertFalse(t3==t2)", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 32 }, { "span": "self.assertTrue(t1!=None)", "start_line": 49, "start_column": 8, "end_line": 49, "end_column": 33 }, { "span": "self.assertFalse(t1==None)", "start_line": 50, "start_column": 8, "end_line": 50, "end_column": 34 }, { "span": "self.assertTrue(None!=t1)", "start_line": 51, "start_column": 8, "end_line": 51, "end_column": 33 }, { "span": "self.assertFalse(None==t1)", "start_line": 52, "start_column": 8, "end_line": 52, "end_column": 34 }, { "span": "self.assertTrue(t1==t1.us)", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 34 }, { "span": "self.assertFalse(t1 > t1)", "start_line": 61, "start_column": 8, "end_line": 61, "end_column": 33 }, { "span": "self.assertFalse(t2 > t2)", "start_line": 62, "start_column": 8, "end_line": 62, "end_column": 33 }, { "span": "self.assertFalse(t3 > t3)", "start_line": 63, "start_column": 8, "end_line": 63, "end_column": 33 }, { "span": "self.assertTrue(t1 > t2)", "start_line": 64, "start_column": 8, "end_line": 64, "end_column": 32 }, { "span": "self.assertFalse(t2 > t1)", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 33 }, { "span": "self.assertFalse(t1 > t3)", "start_line": 66, "start_column": 8, "end_line": 66, "end_column": 33 }, { "span": "self.assertTrue(t3 > t1)", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 32 }, { "span": "self.assertFalse(t2 > t3)", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 33 }, { "span": "self.assertTrue(t3 > t2)", "start_line": 69, "start_column": 8, "end_line": 69, "end_column": 32 }, { "span": "self.assertTrue(t1 >= t1)", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 33 }, { "span": "self.assertTrue(t2 >= t2)", "start_line": 72, "start_column": 8, "end_line": 72, "end_column": 33 }, { "span": "self.assertTrue(t3 >= t3)", "start_line": 73, "start_column": 8, "end_line": 73, "end_column": 33 }, { "span": "self.assertTrue(t1 >= t2)", "start_line": 74, "start_column": 8, "end_line": 74, "end_column": 33 }, { "span": "self.assertFalse(t2 >= t1)", "start_line": 75, "start_column": 8, "end_line": 75, "end_column": 34 }, { "span": "self.assertFalse(t1 >= t3)", "start_line": 76, "start_column": 8, "end_line": 76, "end_column": 34 }, { "span": "self.assertTrue(t3 >= t1)", "start_line": 77, "start_column": 8, "end_line": 77, "end_column": 33 }, { "span": "self.assertFalse(t2 >= t3)", "start_line": 78, "start_column": 8, "end_line": 78, "end_column": 34 }, { "span": "self.assertTrue(t3 >= t2)", "start_line": 79, "start_column": 8, "end_line": 79, "end_column": 33 }, { "span": "self.assertTrue(t1 <= t1)", "start_line": 81, "start_column": 8, "end_line": 81, "end_column": 33 }, { "span": "self.assertTrue(t2 <= t2)", "start_line": 82, "start_column": 8, "end_line": 82, "end_column": 33 }, { "span": "self.assertTrue(t3 <= t3)", "start_line": 83, "start_column": 8, "end_line": 83, "end_column": 33 }, { "span": "self.assertFalse(t1 <= t2)", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 34 }, { "span": "self.assertTrue(t2 <= t1)", "start_line": 85, "start_column": 8, "end_line": 85, "end_column": 33 }, { "span": "self.assertTrue(t1 <= t3)", "start_line": 86, "start_column": 8, "end_line": 86, "end_column": 33 }, { "span": "self.assertFalse(t3 <= t1)", "start_line": 87, "start_column": 8, "end_line": 87, "end_column": 34 }, { "span": "self.assertTrue(t2 <= t3)", "start_line": 88, "start_column": 8, "end_line": 88, "end_column": 33 }, { "span": "self.assertFalse(t3 <= t2)", "start_line": 89, "start_column": 8, "end_line": 89, "end_column": 34 }, { "span": "self.assertFalse(t1 < t1)", "start_line": 91, "start_column": 8, "end_line": 91, "end_column": 33 }, { "span": "self.assertFalse(t2 < t2)", "start_line": 92, "start_column": 8, "end_line": 92, "end_column": 33 }, { "span": "self.assertFalse(t3 < t3)", "start_line": 93, "start_column": 8, "end_line": 93, "end_column": 33 }, { "span": "self.assertFalse(t1 < t2)", "start_line": 94, "start_column": 8, "end_line": 94, "end_column": 33 }, { "span": "self.assertTrue(t2 < t1)", "start_line": 95, "start_column": 8, "end_line": 95, "end_column": 32 }, { "span": "self.assertTrue(t1 < t3)", "start_line": 96, "start_column": 8, "end_line": 96, "end_column": 32 }, { "span": "self.assertFalse(t3 < t1)", "start_line": 97, "start_column": 8, "end_line": 97, "end_column": 33 }, { "span": "self.assertTrue(t2 < t3)", "start_line": 98, "start_column": 8, "end_line": 98, "end_column": 32 }, { "span": "self.assertFalse(t3 < t2)", "start_line": 99, "start_column": 8, "end_line": 99, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "San", "e", "T", "z", "Time", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "equality", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", ",_", "tz_", "=_", "'", "UT", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", ",_", "tz_", "=_", "'", "Ame", "rica", "/", "New", "\\u", "Yo", "rk", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "==_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "==_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", "==_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "!=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", "!=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "!=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "!=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "!=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "!=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", "!=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "!=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", "!=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "==_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", "==_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "==_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "==_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", "==_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "==_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "!=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "None_", "!=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "None_", "==_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "==_", "t1_", "._", "us_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "San", "e", "T", "z", "Time", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "comparisons", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", ",_", "'", "UT", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", ",_", "'", "Ame", "rica", "/", "New", "\\u", "Yo", "rk", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", "+_", "1_", ",_", "'", "UT", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", ">_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", ">_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", ">_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", ">_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", ">=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", ">=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", ">=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", ">=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "<=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", "<=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "<=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "<=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "<_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", "<_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "<_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "<_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<_", "t2_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 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2012 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom raven.transport.base import AsyncTransport\nfrom raven.transport.http import HTTPTransport\n\ntry:\n import gevent\n # gevent 1.0bN renamed coros to lock\n try:\n from gevent.lock import Semaphore\n except ImportError:\n from gevent.coros import Semaphore # NOQA\n has_gevent = True\nexcept:\n has_gevent = None\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "rave", "n", ".", "transport", ".", "gev", "ent", "\\", "10", ";", "~~~~~~~~~~~", "~~~~~~~~~~~", "\\", "10", ";", "\\", "10", ";", ":", "copyr", "ight", ":", " ", "(", "c", ")", " ", "2010", "-", "2012", " ", "by", " ", "the", " ", "Sent", "ry", " ", "Tea", "m", ",", " ", "see", " ", "AUTHOR", "S", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";", ":", "license", ":", " ", "BS", "D", ",", " ", "see", " ", "LICENSE", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "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_", "from_", "rave", "n_", "._", "transport_", "._", "base_", "import_", "Async", "Transport_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rave", "n_", "._", "transport_", "._", "http_", "import_", "HTTP", "Transport_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "gevent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "gev", "ent", " ", "1.0", "b", "N", " ", "renamed", " ", "coros", " ", "to", " ", "lock_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "gevent_", "._", "lock_", "import_", "Semaphore", "_", "\\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_", "gevent_", "._", "coros", "_", "import_", "Semaphore", "_", "#", " ", "NO", "QA", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "has", "\\u", "gevent_", "=_", "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 ", " _", "has", "\\u", "gevent_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
scieloorg/scielo-manager/scielomanager/health/checks.py
[ { "content": "# coding: utf-8\nimport logging\nimport uuid\n\nimport psycopg2\nfrom django.db import connections, DatabaseError\nfrom celery import current_app\nfrom kombu import Connection\n\nfrom . import CheckItem\n\n\nlogger = logging.getLogger(__name__)\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PGConnection(CheckItem):\n \"\"\"\n Connection with the data backend\n \"\"\"\n working_status = (\n psycopg2.extensions.STATUS_READY,\n psycopg2.extensions.STATUS_BEGIN,\n psycopg2.extensions.STATUS_IN_TRANSACTION,\n psycopg2.extensions.STATUS_PREPARED,\n )\n\n", "metadata": "root.PGConnection", "header": "['module', '___EOS___']", "index": 15 }, { "content": " def __init__(self):\n self.must_fail = False\n\n for conn in connections.all():\n try:\n # Executa uma query, mesmo que inválida, apenas para\n # forçar a comunicação com o backend\n conn.cursor().execute('SELECT')\n except DatabaseError:\n # Erro esperado por conta da query inválida\n pass\n except psycopg2.OperationalError as e:\n self.must_fail = True", "metadata": "root.PGConnection.__init__", "header": "['class', 'PGConnection', '(', 'CheckItem', ')', ':', '___EOS___']", "index": 26 }, { "content": " def __call__(self):\n \"\"\"\n Try to list table names just to reach the db.\n \"\"\"\n if self.must_fail:\n return False\n\n for conn in connections.all():\n try:\n if conn.connection.status not in self.working_status:\n return False\n except AttributeError as e:\n return None\n else:\n return True", "metadata": "root.PGConnection.__call__", "header": "['class', 'PGConnection', '(', 'CheckItem', ')', ':', '___EOS___']", "index": 40 }, { "content": "class CeleryConnection(CheckItem):\n \"\"\"\n Connection with celery backend.\n \"\"\"\n", "metadata": "root.CeleryConnection", "header": "['module', '___EOS___']", "index": 57 }, { "content": " def __init__(self):\n self.broker_url = current_app.conf.BROKER_URL", "metadata": "root.CeleryConnection.__init__", "header": "['class', 'CeleryConnection', '(', 'CheckItem', ')', ':', '___EOS___']", "index": 61 }, { "content": " def __call__(self):\n \"\"\"\n If backend is \"django://\" will return None\n Else: return if is connected or not\n \"\"\"\n if self.broker_url == 'django://':\n return None\n else:\n try:\n ping_response = current_app.control.ping(timeout=1)[0]\n ping_key = ping_response.keys()[0]\n status = ping_response[ping_key]['ok'] == u'pong'\n except Exception as exc:\n logger.exception(exc)\n status = False\n return status", "metadata": "root.CeleryConnection.__call__", "header": "['class', 'CeleryConnection', '(', 'CheckItem', ')', ':', '___EOS___']", "index": 64 }, { "content": "class RabbitConnection(CheckItem):\n \"\"\"\n Connection with RabbitMQ server.\n \"\"\"\n", "metadata": "root.RabbitConnection", "header": "['module', '___EOS___']", "index": 82 }, { "content": " def __init__(self):\n self.broker_url = current_app.conf.BROKER_URL", "metadata": "root.RabbitConnection.__init__", "header": "['class', 'RabbitConnection', '(', 'CheckItem', ')', ':', '___EOS___']", "index": 86 }, { "content": " def __call__(self):\n \"\"\"\n Broker URL must start with \"amqp://\" else return None\n Return True if can establish connection or not.\n \"\"\"\n if self.broker_url.startswith(\"amqp://\"):\n try:\n connection = Connection(self.broker_url, connection_timeout=1)\n try:\n connection.connect()\n status = connection.connected\n finally:\n connection.release()\n except Exception as exc:\n logger.exception(exc)\n status = False\n return status\n else:\n return None", "metadata": "root.RabbitConnection.__call__", "header": "['class', 'RabbitConnection', '(', 'CheckItem', ')', ':', '___EOS___']", "index": 89 } ]
[ { "span": "import uuid", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "codi", "ng", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "psycopg2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "connections_", ",_", "Databa", "se", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "celery_", "import_", "current", "\\u", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kom", "bu", "_", "import_", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "import_", "Check", "Item_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "PG", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Connect", "ion", " ", "with", " ", "the", " ", "data", " ", "back", "end", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "working", "\\u", "status_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "psycopg2_", "._", "extensions_", "._", "STATUS", "\\u", "READY", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "psycopg2_", "._", "extensions_", "._", "STATUS", "\\u", "BEGIN", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "psycopg2_", "._", "extensions_", "._", "STATUS", "\\u", "IN", "\\u", "TRANSACTION", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "psycopg2_", "._", "extensions_", "._", "STATUS", "\\u", "PREP", "ARE", "D_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "PG", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\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_", "._", "must", "\\u", "fail_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "conn_", "in_", "connections_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Execut", "a", " ", "uma", " ", "query", ",", " ", "mes", "mo", " ", "que", " ", "inv", "\\", "225", ";", "lida", ",", " ", "ape", "nas", " ", "para_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", "\\", "231", ";", "ar", " ", "a", " ", "comun", "ica", "\\", "231", ";", "\\", "227", ";", "o", " ", "com", " ", "o", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "cursor_", "(_", ")_", "._", "execute_", "(_", "'", "SELECT", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Databa", "se", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Err", "o", " ", "espe", "rado", " ", "por", " ", "conta", " ", "da", " ", "query", " ", "inv", "\\", "225", ";", "lida", "_", "\\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_", "except_", "psycopg2_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "must", "\\u", "fail_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PG", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Tr", "y", " ", "to", " ", "list", " ", "table", " ", "names", " ", "just", " ", "to", " ", "reach", " ", "the", " ", "db", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "must", "\\u", "fail_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "conn_", "in_", "connections_", "._", "all_", "(_", ")_", ":_", "\\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_", "conn_", "._", "connection_", "._", "status_", "not_", "in_", "self_", "._", "working", "\\u", "status_", ":_", "\\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_", "except_", "Attribute", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Celery", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Connect", "ion", " ", "with", " ", "celery", " ", "back", "end", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Celery", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "broker", "\\u", "url_", "=_", "current", "\\u", "app_", "._", "conf_", "._", "BROKER", "\\u", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Celery", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "back", "end", " ", "is", " ", "\"", "django", "://", "\"", " ", "will", " ", "return", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Else", ":", " ", "return", " ", "if", " ", "is", " ", "connect", "ed", " ", "or", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "broker", "\\u", "url_", "==_", "'", "django", "://'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ping", "\\u", "response_", "=_", "current", "\\u", "app_", "._", "control_", "._", "ping_", "(_", "timeout_", "=_", "1_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ping", "\\u", "key_", "=_", "ping", "\\u", "response_", "._", "keys_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "ping", "\\u", "response_", "[_", "ping", "\\u", "key_", "]_", "[_", "'", "ok", "'_", "]_", "==_", "u", "'", "pong", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "exception_", "(_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ra", "bbi", "t", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Connect", "ion", " ", "with", " ", "Ra", "bbi", "t", "MQ", " ", "server", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ra", "bbi", "t", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "broker", "\\u", "url_", "=_", "current", "\\u", "app_", "._", "conf_", "._", "BROKER", "\\u", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ra", "bbi", "t", "Connection_", "(_", "Check", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Broker", " ", "URL", " ", "must", " ", "start", " ", "with", " ", "\"", "amqp", "://", "\"", " ", "else", " ", "return", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "Tru", "e", " ", "if", " ", "can", " ", "establish", " ", "connecti", "on", " ", "or", " ", "not", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "broker", "\\u", "url_", "._", "startswith_", "(_", "\"", "amqp", "://\"_", ")_", ":_", "\\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 ", " _", "connection_", "=_", "Connection_", "(_", "self_", "._", "broker", "\\u", "url_", ",_", "connecti", "on", "\\u", "timeout_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "connection_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "connection_", "._", "connected_", "\\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 ", " ", "_", "connection_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "exception_", "(_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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 ", " _", "return_", "None_" ]
[ 4, 4, 4, 4, 4, 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, 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.handler import BaseHandler, rc\nfrom systems.models import System, SystemRack,SystemStatus,NetworkAdapter,KeyValue,ScheduledTask\nfrom truth.models import Truth, KeyValue as TruthKeyValue\nfrom MacroExpansion import MacroExpansion\nfrom KeyValueTree import KeyValueTree\nimport re\ntry:\n import json\nexcept:\n from django.utils import simplejson as json\nfrom django.test.client import Client\nfrom settings import API_ACCESS\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def read(self, request, reverse_dns_zone=None, reverse_dns_action=None):\n if reverse_dns_zone and reverse_dns_action == 'get_reverse_dns_zones':\n tasks = []\n for task in ScheduledTask.objects.get_all_reverse_dns():\n tasks.append(task.task)\n #ScheduledTask.objects.delete_all_reverse_dns()\n return tasks\n elif reverse_dns_zone and reverse_dns_action == 'get_reverse_dns_zones_with_names':\n truths = Truth.objects.select_related().filter(keyvalue__key='is_reverse_dns_zone',keyvalue__value='True')\n truth_list = []\n for t in truths:\n truth_list.append({'name':t.name.strip(),'description':t.description.strip()})\n return truth_list\n elif reverse_dns_zone and reverse_dns_action == 'view_hosts':\n scope_options = []\n client = Client()\n hosts = json.loads(client.get('/api/keyvalue/?key_type=system_by_zone&zone=%s' % reverse_dns_zone, follow=True).content)\n #print hosts\n adapter_list = []\n for host in hosts:\n if 'hostname' in host:\n the_url = '/api/keyvalue/?key_type=adapters_by_system_and_zone&reverse_dns_zone=%s&system=%s' % (reverse_dns_zone, host['hostname'])\n try:\n adapter_list.append(json.loads(client.get(the_url, follow=True).content))\n except:\n pass\n #d = DHCPInterface(scope_options, adapter_list)\n #return d.get_hosts()\n return None\n else:\n resp = rc.NOT_FOUND\n resp.write(\"I'm sorry but I don't understand your request\")", "metadata": "root.ReverseDNSHandler.read", "header": "['class', 'ReverseDNSHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "except:", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 7 }, { "span": "except:", "start_line": 41, "start_column": 20, "end_line": 41, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "pis", "ton_", "._", "handler_", "import_", "Base", "Handler_", ",_", "rc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "systems_", "._", "models_", "import_", "System_", ",_", "System", "Rack", "_", ",_", "System", "Status_", ",_", "Network", "Adapter_", ",_", "Key", "Value_", ",_", "Schedule", "d", "Task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "truth_", "._", "models_", "import_", "Tru", "th_", ",_", "Key", "Value_", "as_", "Tru", "th", "Key", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Macro", "Expa", "nsion", "_", "import_", "Macro", "Expa", "nsion", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Key", "Value", "Tree_", "import_", "Key", "Value", "Tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "utils_", "import_", "simplejson_", "as_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "django_", "._", "test_", "._", "client_", "import_", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "settings_", "import_", "API", "\\u", "ACCESS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "class_", "Revers", "e", "DNS", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "request_", ",_", "reverse", "\\u", "dns", "\\u", "zone_", "=_", "None_", ",_", "reverse", "\\u", "dns", "\\u", "action_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "reverse", "\\u", "dns", "\\u", "zone_", "and_", "reverse", "\\u", "dns", "\\u", "action_", "==_", "'", "get", "\\u", "reverse", "\\u", "dns", "\\u", "zone", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tasks_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "task_", "in_", "Schedule", "d", "Task_", "._", "objects_", "._", "get", "\\u", "all", "\\u", "reverse", "\\u", "dns_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tasks_", "._", "append_", "(_", "task_", "._", "task_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Schedule", "d", "Task", ".", "object", "s", ".", "delete", "\\u", "all", "\\u", "reverse", "\\u", "dns", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tasks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "reverse", "\\u", "dns", "\\u", "zone_", "and_", "reverse", "\\u", "dns", "\\u", "action_", "==_", "'", "get", "\\u", "reverse", "\\u", "dns", "\\u", "zone", "s", "\\u", "with", "\\u", "names", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "truth", "s_", "=_", "Tru", "th_", "._", "objects_", "._", "select", "\\u", "related_", "(_", ")_", "._", "filter_", "(_", "keyval", "ue", "\\u\\u", "key_", "=_", "'", "is", "\\u", "reverse", "\\u", "dns", "\\u", "zone", "'_", ",_", "keyval", "ue", "\\u\\u", "value_", "=_", "'", "Tru", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "truth", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "truth", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "truth", "\\u", "list_", "._", "append_", "(_", "{_", "'", "name", "'_", ":_", "t_", "._", "name_", "._", "strip_", "(_", ")_", ",_", "'", "description", "'_", ":_", "t_", "._", "description_", "._", "strip_", "(_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "truth", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "reverse", "\\u", "dns", "\\u", "zone_", "and_", "reverse", "\\u", "dns", "\\u", "action_", "==_", "'", "view", "\\u", "host", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scope", "\\u", "options_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "json_", "._", "loads_", "(_", "client_", "._", "get_", "(_", "'/", "api", "/", "keyval", "ue", "/?", "key", "\\u", "type", "=", "system", "\\u", "by", "\\u", "zone", "&", "zone", "=", "%", "s", "'_", "%_", "reverse", "\\u", "dns", "\\u", "zone_", ",_", "follow_", "=_", "True_", ")_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "hosts_", "\\u\\u\\uNL\\u\\u\\u_", "adapter", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "host_", "in_", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "host", "name", "'_", "in_", "host_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "the", "\\u", "url_", "=_", "'/", "api", "/", "keyval", "ue", "/?", "key", "\\u", "type", "=", "adapter", "s", "\\u", "by", "\\u", "system", "\\u", "and", "\\u", "zone", "&", "reverse", "\\u", "dns", "\\u", "zone", "=", "%", "s", "&", "system", "=", "%", "s", "'_", "%_", "(_", "reverse", "\\u", "dns", "\\u", "zone_", ",_", "host_", "[_", "'", "host", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "list_", "._", "append_", "(_", "json_", "._", "loads_", "(_", "client_", "._", "get_", "(_", "the", "\\u", "url_", ",_", "follow_", "=_", "True_", ")_", "._", "content_", ")_", ")_", "\\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_", "#", "d", " ", "=", " ", "DHC", "PI", "nter", "face", "(", "scope", "\\u", "options", ",", " ", "adapter", "\\u", "list", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "d", ".", "get", "\\u", "host", "s", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "\"", "I", "'", "m", " ", "sorr", "y", " ", "but", " ", "I", " ", "don", "'", "t", " ", "underst", "and", " ", "your", " ", "request", "\"_", ")_" ]
[ 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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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 ]
Unused import
catap/namebench/tools/add_linkcount_and_version_to_csv.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\"\"\"Add link count and version to csv\"\"\"\n\n__author__ = 'tstromberg@google.com (Thomas Stromberg)'\n\nimport csv\nimport check_nameserver_popularity\nimport sys\nreader = csv.reader(open(sys.argv[1]))\nwriter = csv.writer(open('output.csv', 'w'))\n\nsys.path.append('..')\n#sys.path.append('/Users/tstromberg/namebench')\nimport third_party\nfrom libnamebench import addr_util\nfrom libnamebench import nameserver\n\nfor row in reader:\n ip = row[0]\n ns = nameserver.NameServer(ip)\n ns.timeout = 0.5\n ns.health_timeout = 0.5\n try:\n link_count = len(check_nameserver_popularity.GetUrls(ip))\n except:\n link_count = ''\n row.insert(-1, link_count)\n row.append(ns.version or '')\n print \"%s: %s\" % (ip, ns.version)\n writer.writerow(row)\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import third_party", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 18 }, { "span": "from libnamebench import addr_util", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 34 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[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_", "\"\"\"", "Add", " ", "link", " ", "count", " ", "and", " ", "version", " ", "to", " ", "csv", "\"\"\"_", "\\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_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "check", "\\u", "nameserv", "er", "\\u", "popular", "ity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reader_", "=_", "csv_", "._", "reader_", "(_", "open_", "(_", "sys_", "._", "argv_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "writer_", "=_", "csv_", "._", "writer_", "(_", "open_", "(_", "'", "output", ".", "csv", "'_", ",_", "'", "w", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "'..'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "sys", ".", "path", ".", "append", "('", "/", "User", "s", "/", "tstr", "omb", "erg", "/", "name", "bench", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "third", "\\u", "party_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "libname", "bench_", "import_", "addr", "\\u", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "libname", "bench_", "import_", "nameserv", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "reader_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip_", "=_", "row_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "=_", "nameserv", "er_", "._", "Name", "Server_", "(_", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "._", "timeout_", "=_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "._", "health", "\\u", "timeout_", "=_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link", "\\u", "count_", "=_", "len_", "(_", "check", "\\u", "nameserv", "er", "\\u", "popular", "ity_", "._", "Get", "Urls", "_", "(_", "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 ", " _", "link", "\\u", "count_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "row_", "._", "insert_", "(_", "-_", "1_", ",_", "link", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "append_", "(_", "ns_", "._", "version_", "or_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "ip_", ",_", "ns_", "._", "version_", ")_", "\\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, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
kastnerkyle/ift6266h15/load_data.py
[ { "content": "def load_color(random_seed=123522):\n # Check if dataset is in the data directory.\n data_path = os.path.join(os.path.split(__file__)[0], \"data\")\n if not os.path.exists(data_path):\n os.makedirs(data_path)\n\n dataset = 'train.zip'\n data_file = os.path.join(data_path, dataset)\n if os.path.isfile(data_file):\n dataset = data_file\n\n if (not os.path.isfile(data_file)):\n try:\n import urllib\n urllib.urlretrieve('http://google.com')\n except AttributeError:\n import urllib.request as urllib\n url = 'https://dl.dropboxusercontent.com/u/15378192/train.zip'\n print('Downloading data from %s' % url)\n urllib.urlretrieve(url, data_file)\n\n data_dir = os.path.join(data_path, 'cvd')\n if not os.path.exists(data_dir):\n os.makedirs(data_dir)\n zf = zipfile.ZipFile(data_file)\n zf.extractall(data_dir)\n\n data_file = os.path.join(data_path, 'cvd_color.hdf5')\n label_file = os.path.join(data_path, 'cvd_color_labels.npy')\n if not os.path.exists(data_file):\n print('... loading data')\n cat_matches = []\n dog_matches = []\n for root, dirname, filenames in os.walk(data_dir):\n for filename in fnmatch.filter(filenames, 'cat*'):\n cat_matches.append(os.path.join(root, filename))\n for filename in fnmatch.filter(filenames, 'dog*'):\n dog_matches.append(os.path.join(root, filename))\n\n sort_key = lambda x: int(x.split('.')[-2])\n cat_matches = sorted(cat_matches, key=sort_key)\n dog_matches = sorted(dog_matches, key=sort_key)\n\n def square(X):\n resize_shape = (64, 64)\n slice_size = (48, 48)\n slice_left = (resize_shape[0] - slice_size[0]) / 2\n slice_upper = (resize_shape[1] - slice_size[1]) / 2\n return imresize(X, resize_shape, interp='nearest')[\n slice_left:slice_left + slice_size[0],\n slice_upper:slice_upper + slice_size[1]].transpose(\n 2, 0, 1).astype('float32')\n\n matches = cat_matches + dog_matches\n matches = np.array(matches)\n random_state = np.random.RandomState(random_seed)\n idx = random_state.permutation(len(matches))\n c = [0] * len(cat_matches)\n d = [1] * len(dog_matches)\n y = np.array(c + d).astype('int32')\n matches = matches[idx]\n y = y[idx]\n\n compression_filter = tables.Filters(complevel=5, complib='blosc')\n h5_file = tables.openFile(data_file, mode='w')\n example = square(mpimg.imread(matches[0]))\n image_storage = h5_file.createEArray(h5_file.root, 'images',\n tables.Float32Atom(),\n shape=(0,) + example.shape,\n filters=compression_filter)\n for n, f in enumerate(matches):\n print(\"Processing image %i of %i\" % (n, len(matches)))\n X = square(mpimg.imread(f)).astype('float32')\n image_storage.append(X[None])\n h5_file.close()\n np.save(label_file, y)\n h5_file = tables.openFile(data_file, mode='r')\n X_s = h5_file.root.images\n y_s = np.load(label_file)\n return (X_s, y_s)", "metadata": "root.load_color", "header": "['module', '___EOS___']", "index": 10 }, { "content": "def load_gray(random_seed=123522):\n # Check if dataset is in the data directory.\n data_path = os.path.join(os.path.split(__file__)[0], \"data\")\n if not os.path.exists(data_path):\n os.makedirs(data_path)\n\n dataset = 'train.zip'\n data_file = os.path.join(data_path, dataset)\n if os.path.isfile(data_file):\n dataset = data_file\n\n if (not os.path.isfile(data_file)):\n try:\n import urllib\n urllib.urlretrieve('http://google.com')\n except AttributeError:\n import urllib.request as urllib\n url = 'https://dl.dropboxusercontent.com/u/15378192/train.zip'\n print('Downloading data from %s' % url)\n urllib.urlretrieve(url, data_file)\n\n data_dir = os.path.join(data_path, 'cvd')\n if not os.path.exists(data_dir):\n os.makedirs(data_dir)\n zf = zipfile.ZipFile(data_file)\n zf.extractall(data_dir)\n\n data_file = os.path.join(data_path, 'cvd_gray.npy')\n label_file = os.path.join(data_path, 'cvd_gray_labels.npy')\n if not os.path.exists(data_file):\n print('... loading data')\n cat_matches = []\n dog_matches = []\n for root, dirname, filenames in os.walk(data_dir):\n for filename in fnmatch.filter(filenames, 'cat*'):\n cat_matches.append(os.path.join(root, filename))\n for filename in fnmatch.filter(filenames, 'dog*'):\n dog_matches.append(os.path.join(root, filename))\n\n sort_key = lambda x: int(x.split('.')[-2])\n cat_matches = sorted(cat_matches, key=sort_key)\n dog_matches = sorted(dog_matches, key=sort_key)\n\n def square_and_gray(X):\n # From Roland\n gray_consts = np.array([[0.299], [0.587], [0.144]])\n return imresize(X, (48, 48)).dot(gray_consts).squeeze()\n\n X_cat = np.asarray([square_and_gray(mpimg.imread(f))\n for f in cat_matches])\n y_cat = np.zeros((len(X_cat),))\n X_dog = np.asarray([square_and_gray(mpimg.imread(f))\n for f in dog_matches])\n y_dog = np.ones((len(X_dog),))\n X = np.concatenate((X_cat, X_dog), axis=0).astype('float32')\n y = np.concatenate((y_cat, y_dog), axis=0).astype('int32')\n np.save(data_file, X)\n np.save(label_file, y)\n else:\n X = np.load(data_file)\n y = np.load(label_file)\n\n random_state = np.random.RandomState(random_seed)\n idx = random_state.permutation(len(X))\n X_s = X[idx].reshape(len(X), -1)\n y_s = y[idx]\n\n train_x = X_s[:20000]\n valid_x = X_s[20000:22500]\n test_x = X_s[22500:]\n train_y = y_s[:20000]\n valid_y = y_s[20000:22500]\n test_y = y_s[22500:]\n test_x = test_x.astype('float32')\n test_y = test_y.astype('int32')\n valid_x = valid_x.astype('float32')\n valid_y = valid_y.astype('int32')\n train_x = train_x.astype('float32')\n train_y = train_y.astype('int32')\n\n rval = [(train_x, train_y), (valid_x, valid_y), (test_x, test_y)]\n return rval", "metadata": "root.load_gray", "header": "['module', '___EOS___']", "index": 92 } ]
[ { "span": "dataset ", "start_line": 19, "start_column": 8, "end_line": 19, "end_column": 15 }, { "span": "dataset ", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "load", "\\u", "color_", "(_", "random", "\\u", "seed_", "=_", "123", "522", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "dataset", " ", "is", " ", "in", " ", "the", " ", "data", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "split_", "(_", "\\u\\u", "file\\u\\u_", ")_", "[_", "0_", "]_", ",_", "\"", "data", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "data\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "data\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dataset_", "=_", "'", "train", ".", "zip", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "path_", ",_", "dataset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "data\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "data\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "data\\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 ", " _", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urllib_", "._", "urlretrieve_", "(_", "'", "http", "://", "google", ".", "com", "'_", ")_", "\\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 ", " _", "import_", "urllib_", "._", "request_", "as_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "'", "https", "://", "dl", ".", "dropb", "ox", "userco", "ntent", ".", "com", "/", "u", "/", "153", "781", "9", "2", "/", "train", ".", "zip", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Down", "load", "ing", " ", "data", " ", "from", " ", "%", "s", "'_", "%_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urllib_", "._", "urlretrieve_", "(_", "url_", ",_", "data\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "path_", ",_", "'", "cv", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "data\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "data\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zf_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "data\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zf_", "._", "extracta", "ll_", "(_", "data\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "path_", ",_", "'", "cv", "d\\u", "color", ".", "hdf5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "path_", ",_", "'", "cv", "d\\u", "color", "\\u", "labels", ".", "npy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "data\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'...", " ", "load", "ing", " ", "data", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cat", "\\u", "matches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dog", "\\u", "matches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "root_", ",_", "dirname_", ",_", "filenames_", "in_", "os_", "._", "walk_", "(_", "data\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "filename_", "in_", "fnmatch_", "._", "filter_", "(_", "filenames_", ",_", "'", "cat", "*'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cat", "\\u", "matches_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "filename_", "in_", "fnmatch_", "._", "filter_", "(_", "filenames_", ",_", "'", "dog", "*'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dog", "\\u", "matches_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sort", "\\u", "key_", "=_", "lambda_", "x_", ":_", "int_", "(_", "x_", "._", "split_", "(_", "'.'_", ")_", "[_", "-_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cat", "\\u", "matches_", "=_", "sorted_", "(_", "cat", "\\u", "matches_", ",_", "key_", "=_", "sort", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dog", "\\u", "matches_", "=_", "sorted_", "(_", "dog", "\\u", "matches_", ",_", "key_", "=_", "sort", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "square_", "(_", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resiz", "e\\u", "shape_", "=_", "(_", "64_", ",_", "64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slice", "\\u", "size_", "=_", "(_", "48_", ",_", "48_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slice", "\\u", "left_", "=_", "(_", "resiz", "e\\u", "shape_", "[_", "0_", "]_", "-_", "slice", "\\u", "size_", "[_", "0_", "]_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slice", "\\u", "upper_", "=_", "(_", "resiz", "e\\u", "shape_", "[_", "1_", "]_", "-_", "slice", "\\u", "size_", "[_", "1_", "]_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "im", "resize_", "(_", "X_", ",_", "resiz", "e\\u", "shape_", ",_", "interp_", "=_", "'", "near", "est", "'_", ")_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "left_", ":_", "slice", "\\u", "left_", "+_", "slice", "\\u", "size_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "upper_", ":_", "slice", "\\u", "upper_", "+_", "slice", "\\u", "size_", "[_", "1_", "]_", "]_", "._", "transpose_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ",_", "0_", ",_", "1_", ")_", "._", "astype_", "(_", "'", "float", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "matches_", "=_", "cat", "\\u", "matches_", "+_", "dog", "\\u", "matches_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matches_", "=_", "np_", "._", "array_", "(_", "matches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "random", "\\u", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "random", "\\u", "state_", "._", "permutation_", "(_", "len_", "(_", "matches_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "[_", "0_", "]_", "*_", "len_", "(_", "cat", "\\u", "matches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "[_", "1_", "]_", "*_", "len_", "(_", "dog", "\\u", "matches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "np_", "._", "array_", "(_", "c_", "+_", "d_", ")_", "._", "astype_", "(_", "'", "int", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matches_", "=_", "matches_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "y_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compress", "ion", "\\u", "filter_", "=_", "tables_", "._", "Filters_", "(_", "compl", "evel_", "=_", "5_", ",_", "compli", "b_", "=_", "'", "blo", "sc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h5", "\\u", "file_", "=_", "tables_", "._", "open", "File_", "(_", "data\\u", "file_", ",_", "mode_", "=_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "example_", "=_", "square_", "(_", "mpi", "mg_", "._", "imread_", "(_", "matches_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "storage_", "=_", "h5", "\\u", "file_", "._", "create", "EA", "rray_", "(_", "h5", "\\u", "file_", "._", "root_", ",_", "'", "images", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tables_", "._", "Float", "32", "Atom_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape_", "=_", "(_", "0_", ",_", ")_", "+_", "example_", "._", "shape_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "compress", "ion", "\\u", "filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", ",_", "f_", "in_", "enumerate_", "(_", "matches_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Process", "ing", " ", "image", " ", "%", "i", " ", "of", " ", "%", "i", "\"_", "%_", "(_", "n_", ",_", "len_", "(_", "matches_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "square_", "(_", "mpi", "mg_", "._", "imread_", "(_", "f_", ")_", ")_", "._", "astype_", "(_", "'", "float", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "storage_", "._", "append_", "(_", "X_", "[_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h5", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "save_", "(_", "label", "\\u", "file_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h5", "\\u", "file_", "=_", "tables_", "._", "open", "File_", "(_", "data\\u", "file_", ",_", "mode_", "=_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "s_", "=_", "h5", "\\u", "file_", "._", "root_", "._", "images_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "s_", "=_", "np_", "._", "load_", "(_", "label", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "X", "\\u", "s_", ",_", "y", "\\u", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "gray_", "(_", "random", "\\u", "seed_", "=_", "123", "522", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "dataset", " ", "is", " ", "in", " ", "the", " ", "data", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "split_", "(_", "\\u\\u", "file\\u\\u_", ")_", "[_", "0_", "]_", ",_", "\"", "data", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "data\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "data\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dataset_", "=_", "'", "train", ".", "zip", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "path_", ",_", "dataset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "data\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "data\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "data\\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 ", " _", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urllib_", "._", "urlretrieve_", "(_", "'", "http", "://", "google", ".", "com", "'_", ")_", "\\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 ", " _", "import_", "urllib_", "._", "request_", "as_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "'", "https", "://", "dl", ".", "dropb", "ox", "userco", "ntent", ".", "com", "/", "u", "/", "153", "781", "9", "2", "/", "train", ".", "zip", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Down", "load", "ing", " ", "data", " ", "from", " ", "%", "s", "'_", "%_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urllib_", "._", "urlretrieve_", "(_", "url_", ",_", "data\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "path_", ",_", "'", "cv", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "data\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "data\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zf_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "data\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zf_", "._", "extracta", "ll_", "(_", "data\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "path_", ",_", "'", "cv", "d\\u", "gray", ".", "npy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "path_", ",_", "'", "cv", "d\\u", "gray", "\\u", "labels", ".", "npy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "data\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'...", " ", "load", "ing", " ", "data", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cat", "\\u", "matches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dog", "\\u", "matches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "root_", ",_", "dirname_", ",_", "filenames_", "in_", "os_", "._", "walk_", "(_", "data\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "filename_", "in_", "fnmatch_", "._", "filter_", "(_", "filenames_", ",_", "'", "cat", "*'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cat", "\\u", "matches_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "filename_", "in_", "fnmatch_", "._", "filter_", "(_", "filenames_", ",_", "'", "dog", "*'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dog", "\\u", "matches_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sort", "\\u", "key_", "=_", "lambda_", "x_", ":_", "int_", "(_", "x_", "._", "split_", "(_", "'.'_", ")_", "[_", "-_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cat", "\\u", "matches_", "=_", "sorted_", "(_", "cat", "\\u", "matches_", ",_", "key_", "=_", "sort", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dog", "\\u", "matches_", "=_", "sorted_", "(_", "dog", "\\u", "matches_", ",_", "key_", "=_", "sort", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "square", "\\u", "and", "\\u", "gray_", "(_", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fro", "m", " ", "Ro", "land", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gray", "\\u", "consts_", "=_", "np_", "._", "array_", "(_", "[_", "[_", "0.29", "9_", "]_", ",_", "[_", "0.58", "7_", "]_", ",_", "[_", "0.14", "4_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "im", "resize_", "(_", "X_", ",_", "(_", "48_", ",_", "48_", ")_", ")_", "._", "dot_", "(_", "gray", "\\u", "consts_", ")_", "._", "squeeze_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "X", "\\u", "cat_", "=_", "np_", "._", "asarray_", "(_", "[_", "square", "\\u", "and", "\\u", "gray_", "(_", "mpi", "mg_", "._", "imread_", "(_", "f_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "f_", "in_", "cat", "\\u", "matches_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "cat_", "=_", "np_", "._", "zeros_", "(_", "(_", "len_", "(_", "X", "\\u", "cat_", ")_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "dog", "_", "=_", "np_", "._", "asarray_", "(_", "[_", "square", "\\u", "and", "\\u", "gray_", "(_", "mpi", "mg_", "._", "imread_", "(_", "f_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "f_", "in_", "dog", "\\u", "matches_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "dog", "_", "=_", "np_", "._", "ones_", "(_", "(_", "len_", "(_", "X", "\\u", "dog", "_", ")_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "np_", "._", "concatenate_", "(_", "(_", "X", "\\u", "cat_", ",_", "X", "\\u", "dog", "_", ")_", ",_", "axis_", "=_", "0_", ")_", "._", "astype_", "(_", "'", "float", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "np_", "._", "concatenate_", "(_", "(_", "y", "\\u", "cat_", ",_", "y", "\\u", "dog", "_", ")_", ",_", "axis_", "=_", "0_", ")_", "._", "astype_", "(_", "'", "int", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "save_", "(_", "data\\u", "file_", ",_", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "save_", "(_", "label", "\\u", "file_", ",_", "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 ", " _", "X_", "=_", "np_", "._", "load_", "(_", "data\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "np_", "._", "load_", "(_", "label", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "random", "\\u", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "random", "\\u", "state_", "._", "permutation_", "(_", "len_", "(_", "X_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "s_", "=_", "X_", "[_", "idx_", "]_", "._", "reshape_", "(_", "len_", "(_", "X_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "s_", "=_", "y_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "x_", "=_", "X", "\\u", "s_", "[_", ":_", "20000_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid", "\\u", "x_", "=_", "X", "\\u", "s_", "[_", "20000_", ":_", "225", "00_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "x_", "=_", "X", "\\u", "s_", "[_", "225", "00_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "y_", "=_", "y", "\\u", "s_", "[_", ":_", "20000_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid", "\\u", "y_", "=_", "y", "\\u", "s_", "[_", "20000_", ":_", "225", "00_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "y_", "=_", "y", "\\u", "s_", "[_", "225", "00_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "x_", "=_", "test\\u", "x_", "._", "astype_", "(_", "'", "float", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "y_", "=_", "test\\u", "y_", "._", "astype_", "(_", "'", "int", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid", "\\u", "x_", "=_", "valid", "\\u", "x_", "._", "astype_", "(_", "'", "float", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid", "\\u", "y_", "=_", "valid", "\\u", "y_", "._", "astype_", "(_", "'", "int", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "x_", "=_", "train", "\\u", "x_", "._", "astype_", "(_", "'", "float", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "y_", "=_", "train", "\\u", "y_", "._", "astype_", "(_", "'", "int", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rval_", "=_", "[_", "(_", "train", "\\u", "x_", ",_", "train", "\\u", "y_", ")_", ",_", "(_", "valid", "\\u", "x_", ",_", "valid", "\\u", "y_", ")_", ",_", "(_", "test\\u", "x_", ",_", "test\\u", "y_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "rval_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
benadida/helios-server/helios/views.py
[ { "content": "@election_view()\ndef one_election_view(request, election):\n user = get_user(request)\n admin_p = security.user_can_admin_election(user, election)\n can_feature_p = security.user_can_feature_election(user, election)\n \n notregistered = False\n eligible_p = True\n \n election_url = get_election_url(election)\n election_badge_url = get_election_badge_url(election)\n status_update_message = None\n\n vote_url = \"%s/booth/vote.html?%s\" % (settings.SECURE_URL_HOST, urllib.urlencode({'election_url' : reverse(one_election, args=[election.uuid])}))\n\n test_cookie_url = \"%s?%s\" % (reverse(test_cookie), urllib.urlencode({'continue_url' : vote_url}))\n \n if user:\n voter = Voter.get_by_election_and_user(election, user)\n \n if not voter:\n try:\n eligible_p = _check_eligibility(election, user)\n except AuthenticationExpired:\n return user_reauth(request, user)\n notregistered = True\n else:\n voter = get_voter(request, user, election)\n\n if voter:\n # cast any votes?\n votes = CastVote.get_by_voter(voter)\n else:\n votes = None\n\n # status update message?\n if election.openreg:\n if election.voting_has_started:\n status_update_message = u\"Vote in %s\" % election.name\n else:\n status_update_message = u\"Register to vote in %s\" % election.name\n\n # result!\n if election.result:\n status_update_message = u\"Results are in for %s\" % election.name\n \n trustees = Trustee.get_by_election(election)\n\n # should we show the result?\n show_result = election.result_released_at or (election.result and admin_p)\n\n return render_template(request, 'election_view',\n {'election' : election, 'trustees': trustees, 'admin_p': admin_p, 'user': user,\n 'voter': voter, 'votes': votes, 'notregistered': notregistered, 'eligible_p': eligible_p,\n 'can_feature_p': can_feature_p, 'election_url' : election_url, \n 'vote_url': vote_url, 'election_badge_url' : election_badge_url,\n 'show_result': show_result,\n 'test_cookie_url': test_cookie_url})", "metadata": "root.one_election_view", "header": "['module', '___EOS___']", "index": 278 }, { "content": "@election_view()\ndef one_election_cast(request, election):\n \"\"\"\n on a GET, this is a cancellation, on a POST it's a cast\n \"\"\"\n if request.method == \"GET\":\n return HttpResponseRedirect(\"%s%s\" % (settings.SECURE_URL_HOST, reverse(one_election_view, args = [election.uuid])))\n \n user = get_user(request) \n encrypted_vote = request.POST['encrypted_vote']\n\n save_in_session_across_logouts(request, 'encrypted_vote', encrypted_vote)\n\n return HttpResponseRedirect(\"%s%s\" % (settings.SECURE_URL_HOST, reverse(one_election_cast_confirm, args=[election.uuid])))", "metadata": "root.one_election_cast", "header": "['module', '___EOS___']", "index": 518 }, { "content": "@election_view()\ndef one_election_cast_done(request, election):\n \"\"\"\n This view needs to be loaded because of the IFRAME, but then this causes \n problems if someone clicks \"reload\". So we need a strategy.\n We store the ballot hash in the session\n \"\"\"\n user = get_user(request)\n voter = get_voter(request, user, election)\n\n if voter:\n votes = CastVote.get_by_voter(voter)\n vote_hash = votes[0].vote_hash\n cv_url = get_castvote_url(votes[0])\n\n # only log out if the setting says so *and* we're dealing\n # with a site-wide voter. Definitely remove current_voter\n if voter.user == user:\n logout = settings.LOGOUT_ON_CONFIRMATION\n else:\n logout = False\n del request.session['CURRENT_VOTER_ID']\n\n save_in_session_across_logouts(request, 'last_vote_hash', vote_hash)\n save_in_session_across_logouts(request, 'last_vote_cv_url', cv_url)\n else:\n vote_hash = request.session['last_vote_hash']\n cv_url = request.session['last_vote_cv_url']\n logout = False\n \n # local logout ensures that there's no more\n # user locally\n # WHY DO WE COMMENT THIS OUT? because we want to force a full logout via the iframe, including\n # from remote systems, just in case, i.e. CAS\n # if logout:\n # auth_views.do_local_logout(request)\n \n # remote logout is happening asynchronously in an iframe to be modular given the logout mechanism\n # include_user is set to False if logout is happening\n return render_template(request, 'cast_done', {'election': election,\n 'vote_hash': vote_hash, 'logout': logout},\n include_user=(not logout))", "metadata": "root.one_election_cast_done", "header": "['module', '___EOS___']", "index": 714 }, { "content": "@election_view()\ndef one_election_register(request, election):\n if not election.openreg:\n return HttpResponseForbidden('registration is closed for this election')\n \n check_csrf(request)\n \n user = get_user(request)\n voter = Voter.get_by_election_and_user(election, user)\n \n if not voter:\n voter = _register_voter(election, user)\n \n return HttpResponseRedirect(settings.SECURE_URL_HOST + reverse(one_election_view, args=[election.uuid]))", "metadata": "root.one_election_register", "header": "['module', '___EOS___']", "index": 923 }, { "content": "@election_admin(frozen=True)\ndef release_result(request, election):\n \"\"\"\n result is computed and now it's time to release the result\n \"\"\"\n election_url = get_election_url(election)\n\n if request.method == \"POST\":\n check_csrf(request)\n\n election.release_result()\n election.save()\n\n return HttpResponseRedirect(\"%s\" % (settings.SECURE_URL_HOST + reverse(one_election_view, args=[election.uuid])))\n\n # if just viewing the form or the form is not valid\n return render_template(request, 'release_result', {'election': election})", "metadata": "root.release_result", "header": "['module', '___EOS___']", "index": 1031 }, { "content": "@election_admin(frozen=True)\ndef combine_decryptions(request, election):\n \"\"\"\n combine trustee decryptions\n \"\"\"\n\n election_url = get_election_url(election)\n\n if request.method == \"POST\":\n check_csrf(request)\n\n election.combine_decryptions()\n election.save()\n\n return HttpResponseRedirect(\"%s\" % (settings.SECURE_URL_HOST + reverse(one_election_view, args=[election.uuid])))\n\n # if just viewing the form or the form is not valid\n return render_template(request, 'combine_decryptions', {'election': election})", "metadata": "root.combine_decryptions", "header": "['module', '___EOS___']", "index": 1049 } ]
[ { "span": "status_update_message ", "start_line": 322, "start_column": 4, "end_line": 322, "end_column": 25 }, { "span": "user ", "start_line": 526, "start_column": 2, "end_line": 526, "end_column": 6 }, { "span": "cv_url ", "start_line": 741, "start_column": 4, "end_line": 741, "end_column": 10 }, { "span": "voter ", "start_line": 934, "start_column": 4, "end_line": 934, "end_column": 9 }, { "span": "election_url ", "start_line": 1036, "start_column": 2, "end_line": 1036, "end_column": 14 }, { "span": "election_url ", "start_line": 1055, "start_column": 2, "end_line": 1055, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "election", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "one", "\\u", "election", "\\u", "view_", "(_", "request_", ",_", "election_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "get", "\\u", "user_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin", "\\u", "p_", "=_", "security_", "._", "user", "\\u", "can", "\\u", "admin", "\\u", "election_", "(_", "user_", ",_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "can", "\\u", "feature", "\\u", "p_", "=_", "security_", "._", "user", "\\u", "can", "\\u", "feature", "\\u", "election_", "(_", "user_", ",_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "not", "registered_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "\\u", "p_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "election", "\\u", "url_", "=_", "get", "\\u", "election", "\\u", "url_", "(_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "election", "\\u", "badge", "\\u", "url_", "=_", "get", "\\u", "election", "\\u", "badge", "\\u", "url_", "(_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status", "\\u", "update", "\\u", "message_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vote", "\\u", "url_", "=_", "\"%", "s", "/", "boot", "h", "/", "vote", ".", "html", "?", "%", "s", "\"_", "%_", "(_", "settings_", "._", "SECU", "RE", "\\u", "URL", "\\u", "HOST_", ",_", "urllib_", "._", "urlencode_", "(_", "{_", "'", "election", "\\u", "url", "'_", ":_", "reverse_", "(_", "one", "\\u", "election_", ",_", "args_", "=_", "[_", "election_", "._", "uuid_", "]_", ")_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "cookie", "\\u", "url_", "=_", "\"%", "s", "?", "%", "s", "\"_", "%_", "(_", "reverse_", "(_", "test\\u", "cookie_", ")_", ",_", "urllib_", "._", "urlencode_", "(_", "{_", "'", "continue", "\\u", "url", "'_", ":_", "vote", "\\u", "url_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "voter", "_", "=_", "Vote", "r_", "._", "get", "\\u", "by", "\\u", "election", "\\u", "and", "\\u", "user_", "(_", "election_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "voter", "_", ":_", "\\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 ", " _", "eligible", "\\u", "p_", "=_", "\\u", "check", "\\u", "eli", "gib", "ility_", "(_", "election_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Auth", "entica", "tion", "Expire", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "user", "\\u", "rea", "uth_", "(_", "request_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "not", "registered_", "=_", "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 ", " _", "voter", "_", "=_", "get", "\\u", "voter", "_", "(_", "request_", ",_", "user_", ",_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "voter", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "cast", " ", "any", " ", "vote", "s", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "votes_", "=_", "Cast", "Vote", "_", "._", "get", "\\u", "by", "\\u", "voter", "_", "(_", "voter", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "votes_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "status", " ", "update", " ", "message", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "election_", "._", "open", "reg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "election_", "._", "voting", "\\u", "has", "\\u", "started_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status", "\\u", "update", "\\u", "message_", "=_", "u", "\"", "Vote", " ", "in", " ", "%", "s", "\"_", "%_", "election_", "._", "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 ", " _", "status", "\\u", "update", "\\u", "message_", "=_", "u", "\"", "Register", " ", "to", " ", "vote", " ", "in", " ", "%", "s", "\"_", "%_", "election_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "election_", "._", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status", "\\u", "update", "\\u", "message_", "=_", "u", "\"", "Result", "s", " ", "are", " ", "in", " ", "for", " ", "%", "s", "\"_", "%_", "election_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "trust", "ees", "_", "=_", "Trust", "ee_", "._", "get", "\\u", "by", "\\u", "election_", "(_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "we", " ", "show", " ", "the", " ", "result", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "show", "\\u", "result_", "=_", "election_", "._", "result", "\\u", "released", "\\u", "at_", "or_", "(_", "election_", "._", "result_", "and_", "admin", "\\u", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "render", "\\u", "template_", "(_", "request_", ",_", "'", "election", "\\u", "view", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "election", "'_", ":_", "election_", ",_", "'", "trust", "ees", "'_", ":_", "trust", "ees", "_", ",_", "'", "admin", "\\u", "p", "'_", ":_", "admin", "\\u", "p_", ",_", "'", "user", "'_", ":_", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "voter", "'_", ":_", "voter", "_", ",_", "'", "vote", "s", "'_", ":_", "votes_", ",_", "'", "not", "register", "ed", "'_", ":_", "not", "registered_", ",_", "'", "eligible", "\\u", "p", "'_", ":_", "eligible", "\\u", "p_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "can", "\\u", "feature", "\\u", "p", "'_", ":_", "can", "\\u", "feature", "\\u", "p_", ",_", "'", "election", "\\u", "url", "'_", ":_", "election", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "\\u", "url", "'_", ":_", "vote", "\\u", "url_", ",_", "'", "election", "\\u", "badge", "\\u", "url", "'_", ":_", "election", "\\u", "badge", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "show", "\\u", "result", "'_", ":_", "show", "\\u", "result_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "test\\u", "cookie", "\\u", "url", "'_", ":_", "test\\u", "cookie", "\\u", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "election", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "one", "\\u", "election", "\\u", "cast_", "(_", "request_", ",_", "election_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "on", " ", "a", " ", "GET", ",", " ", "this", " ", "is", " ", "a", " ", "cancellat", "ion", ",", " ", "on", " ", "a", " ", "POST", " ", "it", "'", "s", " ", "a", " ", "cast", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "\"", "GET", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"%", "s", "%", "s", "\"_", "%_", "(_", "settings_", "._", "SECU", "RE", "\\u", "URL", "\\u", "HOST_", ",_", "reverse_", "(_", "one", "\\u", "election", "\\u", "view_", ",_", "args_", "=_", "[_", "election_", "._", "uuid_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user_", "=_", "get", "\\u", "user_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encrypt", "ed", "\\u", "vote_", "=_", "request_", "._", "POST_", "[_", "'", "encrypt", "ed", "\\u", "vote", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "in", "\\u", "session", "\\u", "acro", "ss", "\\u", "logo", "uts", "_", "(_", "request_", ",_", "'", "encrypt", "ed", "\\u", "vote", "'_", ",_", "encrypt", "ed", "\\u", "vote_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"%", "s", "%", "s", "\"_", "%_", "(_", "settings_", "._", "SECU", "RE", "\\u", "URL", "\\u", "HOST_", ",_", "reverse_", "(_", "one", "\\u", "election", "\\u", "cast", "\\u", "confirm_", ",_", "args_", "=_", "[_", "election_", "._", "uuid_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "election", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "one", "\\u", "election", "\\u", "cast", "\\u", "done_", "(_", "request_", ",_", "election_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Thi", "s", " ", "view", " ", "need", "s", " ", "to", " ", "be", " ", "load", "ed", " ", "bec", "aus", "e", " ", "of", " ", "the", " ", "IF", "RAM", "E", ",", " ", "but", " ", "then", " ", "this", " ", "caus", "es", " ", "\\", "10", ";", " ", " ", "problem", "s", " ", "if", " ", "some", "one", " ", "clicks", " ", "\"", "relo", "ad", "\".", " ", "So", " ", "we", " ", "need", " ", "a", " ", "strat", "eg", "y", ".", "\\", "10", ";", " ", " ", "We", " ", "store", " ", "the", " ", "ballot", " ", "hash", " ", "in", " ", "the", " ", "session", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "get", "\\u", "user_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "voter", "_", "=_", "get", "\\u", "voter", "_", "(_", "request_", ",_", "user_", ",_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "voter", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "votes_", "=_", "Cast", "Vote", "_", "._", "get", "\\u", "by", "\\u", "voter", "_", "(_", "voter", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vote", "\\u", "hash_", "=_", "votes_", "[_", "0_", "]_", "._", "vote", "\\u", "hash_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cv", "\\u", "url_", "=_", "get", "\\u", "cast", "vote", "\\u", "url_", "(_", "votes_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "only", " ", "log", " ", "out", " ", "if", " ", "the", " ", "setti", "ng", " ", "say", "s", " ", "so", " ", "*", "and", "*", " ", "we", "'", "re", " ", "deal", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "a", " ", "site", "-", "wide", " ", "voter", ".", " ", "Definit", "el", "y", " ", "remove", " ", "current", "\\u", "voter", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "voter", "_", "._", "user_", "==_", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logout_", "=_", "settings_", "._", "LOGO", "UT\\u", "ON", "\\u", "CONFIRM", "ATION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logout_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "request_", "._", "session_", "[_", "'", "CURREN", "T", "\\u", "VO", "TER", "\\u", "ID", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "save", "\\u", "in", "\\u", "session", "\\u", "acro", "ss", "\\u", "logo", "uts", "_", "(_", "request_", ",_", "'", "last", "\\u", "vote", "\\u", "hash", "'_", ",_", "vote", "\\u", "hash_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "\\u", "in", "\\u", "session", "\\u", "acro", "ss", "\\u", "logo", "uts", "_", "(_", "request_", ",_", "'", "last", "\\u", "vote", "\\u", "cv", "\\u", "url", "'_", ",_", "cv", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vote", "\\u", "hash_", "=_", "request_", "._", "session_", "[_", "'", "last", "\\u", "vote", "\\u", "hash", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cv", "\\u", "url_", "=_", "request_", "._", "session_", "[_", "'", "last", "\\u", "vote", "\\u", "cv", "\\u", "url", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logout_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "local", " ", "logo", "ut", " ", "ensure", "s", " ", "tha", "t", " ", "there", "'", "s", " ", "no", " ", "more_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "user", " ", "local", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WH", "Y", " ", "DO", " ", "WE", " ", "COMMENT", " ", "THIS", " ", "OUT", "?", " ", "bec", "aus", "e", " ", "we", " ", "want", " ", "to", " ", "force", " ", "a", " ", "full", " ", "logo", "ut", " ", "via", " ", "the", " ", "iframe", ",", " ", "inclu", "ding_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "remote", " ", "system", "s", ",", " ", "just", " ", "in", " ", "case", ",", " ", "i", ".", "e", ".", " ", "CAS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "logo", "ut", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "auth", "\\u", "views", ".", "do", "\\u", "local", "\\u", "logo", "ut", "(", "request", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remote", " ", "logo", "ut", " ", "is", " ", "happ", "eni", "ng", " ", "async", "hronous", "ly", " ", "in", " ", "an", " ", "iframe", " ", "to", " ", "be", " ", "modula", "r", " ", "give", "n", " ", "the", " ", "logo", "ut", " ", "mechanism", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "include", "\\u", "user", " ", "is", " ", "set", " ", "to", " ", "Fal", "se", " ", "if", " ", "logo", "ut", " ", "is", " ", "happ", "eni", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render", "\\u", "template_", "(_", "request_", ",_", "'", "cast", "\\u", "don", "e", "'_", ",_", "{_", "'", "election", "'_", ":_", "election_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "\\u", "hash", "'_", ":_", "vote", "\\u", "hash_", ",_", "'", "logo", "ut", "'_", ":_", "logout_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "user_", "=_", "(_", "not_", "logout_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "election", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "one", "\\u", "election", "\\u", "register_", "(_", "request_", ",_", "election_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "election_", "._", "open", "reg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", "'", "registration", " ", "is", " ", "close", "d", " ", "for", " ", "this", " ", "election", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "check", "\\u", "csrf_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "get", "\\u", "user_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "voter", "_", "=_", "Vote", "r_", "._", "get", "\\u", "by", "\\u", "election", "\\u", "and", "\\u", "user_", "(_", "election_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "voter", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "voter", "_", "=_", "\\u", "register", "\\u", "voter", "_", "(_", "election_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "settings_", "._", "SECU", "RE", "\\u", "URL", "\\u", "HOST_", "+_", "reverse_", "(_", "one", "\\u", "election", "\\u", "view_", ",_", "args_", "=_", "[_", "election_", "._", "uuid_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "election", "\\u", "admin_", "(_", "frozen_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "release", "\\u", "result_", "(_", "request_", ",_", "election_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "result", " ", "is", " ", "compute", "d", " ", "and", " ", "now", " ", "it", "'", "s", " ", "time", " ", "to", " ", "release", " ", "the", " ", "result", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "election", "\\u", "url_", "=_", "get", "\\u", "election", "\\u", "url_", "(_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "\"", "POST", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "csrf_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "election_", "._", "release", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "election_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"%", "s", "\"_", "%_", "(_", "settings_", "._", "SECU", "RE", "\\u", "URL", "\\u", "HOST_", "+_", "reverse_", "(_", "one", "\\u", "election", "\\u", "view_", ",_", "args_", "=_", "[_", "election_", "._", "uuid_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "just", " ", "viewin", "g", " ", "the", " ", "form", " ", "or", " ", "the", " ", "form", " ", "is", " ", "not", " ", "valid_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render", "\\u", "template_", "(_", "request_", ",_", "'", "release", "\\u", "result", "'_", ",_", "{_", "'", "election", "'_", ":_", "election_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "election", "\\u", "admin_", "(_", "frozen_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "combin", "e\\u", "decrypt", "ions_", "(_", "request_", ",_", "election_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "combin", "e", " ", "trust", "ee", " ", "decrypt", "ion", "s", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "election", "\\u", "url_", "=_", "get", "\\u", "election", "\\u", "url_", "(_", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "\"", "POST", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "csrf_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "election_", "._", "combin", "e\\u", "decrypt", "ions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "election_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"%", "s", "\"_", "%_", "(_", "settings_", "._", "SECU", "RE", "\\u", "URL", "\\u", "HOST_", "+_", "reverse_", "(_", "one", "\\u", "election", "\\u", "view_", ",_", "args_", "=_", "[_", "election_", "._", "uuid_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "just", " ", "viewin", "g", " ", "the", " ", "form", " ", "or", " ", "the", " ", "form", " ", "is", " ", "not", " ", "valid_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render", "\\u", "template_", "(_", "request_", ",_", "'", "combin", "e\\u", "decrypt", "ion", "s", "'_", ",_", "{_", "'", "election", "'_", ":_", "election_", "}_", ")_", "\\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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.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\nimport os\nimport sys\nimport random\nimport argparse\nimport numpy as np\nimport tempfile\nimport h5py\nimport urllib2\nimport zlib\nimport cStringIO\nimport blosc\nimport time\nimport json\nfrom operator import add, sub, mul\nfrom functools import reduce\n\nsys.path += [os.path.abspath('../django/')]\nimport OCP.settings\nos.environ['DJANGO_SETTINGS_MODULE'] = 'ocpblaze.settings'\n\nfrom ocplib import MortonXYZ\n\n\n\n\n\nif __name__ == '__main__':\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def getURL(url):\n \"\"\"Get data\"\"\"\n\n try:\n # Build a post request\n req = urllib2.Request(url)\n start = time.time() \n response = urllib2.urlopen(req)\n print time.time()-start\n return response\n except urllib2.HTTPError,e:\n print \"Error\"\n return e", "metadata": "root.getURL", "header": "['module', '___EOS___']", "index": 36 }, { "content": "class BenchmarkTest:\n\n\n\n", "metadata": "root.BenchmarkTest", "header": "['module', '___EOS___']", "index": 50 }, { "content": " def __init__(self, host, token, channel, resolution):\n \"\"\"Init\"\"\"\n\n self.host = host\n self.token = token\n self.channels = [channel]\n self.resolution = resolution\n self.getProjInfo()", "metadata": "root.BenchmarkTest.__init__", "header": "['class', 'BenchmarkTest', ':', '___EOS___']", "index": 52 }, { "content": " def readTest(self, start_value=[0,0,0], number_iteration=13):\n \"\"\"Run the Benchmark.\"\"\"\n\n min_values = [xmin,ymin,zmin] = map(add, self.offset, start_value)\n max_values = map(add, min_values, self.dim)\n range_args = [None]*(len(min_values)+len(max_values))\n \n for i in range(0, number_iteration, 1):\n range_args[::2] = min_values\n range_args[1::2] = max_values\n # print \"Size\", reduce(mul, map(sub, max_values, min_values), 1)*2.0/(1024*1024)\n self.getBlosc(range_args)\n # min_values = max_values\n # max_values = map(add, map(sub, min_values, temp_values), min_values)\n min_values[2] = max_values[2]\n max_values[2] = min_values[2] + self.dim[2] \n max_values[(i+1)%2] = start_value[(i+1)%2] + (max_values[(i+1)%2]-min_values[(i+1)%2])*2", "metadata": "root.BenchmarkTest.readTest", "header": "['class', 'BenchmarkTest', ':', '___EOS___']", "index": 61 }, { "content": " def getProjInfo(self):\n \"\"\"Get the project info\"\"\"\n\n # Build the url\n url = 'http://{}/ca/{}/info/'.format(self.host, self.token)\n f = getURL(url)\n info = json.loads(f.read())\n self.dim = info['dataset']['cube_dimension'][self.resolution]\n self.imagesize = info['dataset']['imagesize'][self.resolution]\n self.offset = info['dataset']['offset'][self.resolution]", "metadata": "root.BenchmarkTest.getProjInfo", "header": "['class', 'BenchmarkTest', ':', '___EOS___']", "index": 79 }, { "content": " def getBlosc(self, range_args):\n \"\"\"Post data using the blosc interface\"\"\"\n\n # Build the url\n url = 'http://{}/ca/{}/{}/blosc/{}/{},{}/{},{}/{},{}/'.format(self.host, self.token, ','.join(self.channels), self.resolution, *range_args)\n # print url\n getURL(url)", "metadata": "root.BenchmarkTest.getBlosc", "header": "['class', 'BenchmarkTest', ':', '___EOS___']", "index": 90 }, { "content": "def main():\n \"\"\"Take in the arguments\"\"\"\n\n parser = argparse.ArgumentParser(description='Run the Benchmark script')\n parser.add_argument('host', action=\"store\", help='HostName')\n parser.add_argument('token', action=\"store\", help='Token')\n parser.add_argument('channel', action=\"store\", help='Channel')\n parser.add_argument('resolution', action=\"store\", help='Resolution')\n parser.add_argument('--offset', nargs=3, type=int, metavar=('x','y','z'), default=[0,0,0], help='Start Offset')\n result = parser.parse_args()\n \n bt = BenchmarkTest(result.host, result.token, result.channel, result.resolution)\n bt.readTest(start_value=result.offset)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 99 } ]
[ { "span": "import random", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 13 }, { "span": "import numpy as np", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 18 }, { "span": "import tempfile", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 15 }, { "span": "import h5py", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 11 }, { "span": "import zlib", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 11 }, { "span": "import cStringIO", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 16 }, { "span": "import blosc", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 12 }, { "span": "from operator import add, sub, mul", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 34 }, { "span": "from functools import reduce", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 28 }, { "span": "import OCP.settings", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 19 }, { "span": "from ocplib import MortonXYZ", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 28 } ]
[]
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_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "h5py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "blo", "sc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "operator_", "import_", "add_", ",_", "sub_", ",_", "mul_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "functools_", "import_", "reduce_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "+=_", "[_", "os_", "._", "path_", "._", "abspath_", "(_", "'../", "django", "/'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "OC", "P_", "._", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "environ_", "[_", "'", "DJANGO", "\\u", "SETTING", "S", "\\u", "MODUL", "E", "'_", "]_", "=_", "'", "oc", "pb", "laz", "e", ".", "settings", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "oc", "pli", "b_", "import_", "Mor", "ton", "XYZ_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "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_", "get", "URL_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "data", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Build", " ", "a", " ", "post", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "=_", "urllib2_", "._", "Request_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "time_", "._", "time_", "(_", ")_", "-_", "start_", "\\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 ", " _", "print_", "\"", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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_", "Benchmark", "Test_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Benchmark", "Test_", ":_", "\\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_", ",_", "host_", ",_", "token_", ",_", "channel_", ",_", "resolution_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ini", "t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "host_", "=_", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "token_", "=_", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "channels_", "=_", "[_", "channel_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resolution_", "=_", "resolution_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "get", "Proj", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Benchmark", "Test_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read", "Test_", "(_", "self_", ",_", "start", "\\u", "value_", "=_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "number", "\\u", "iteration_", "=_", "13_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Run", " ", "the", " ", "Benchmark", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "values_", "=_", "[_", "xmin_", ",_", "ymin_", ",_", "zmin", "_", "]_", "=_", "map_", "(_", "add_", ",_", "self_", "._", "offset_", ",_", "start", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "values_", "=_", "map_", "(_", "add_", ",_", "min", "\\u", "values_", ",_", "self_", "._", "dim_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "range", "\\u", "args_", "=_", "[_", "None_", "]_", "*_", "(_", "len_", "(_", "min", "\\u", "values_", ")_", "+_", "len_", "(_", "max", "\\u", "values_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "number", "\\u", "iteration_", ",_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "range", "\\u", "args_", "[_", ":_", ":_", "2_", "]_", "=_", "min", "\\u", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "range", "\\u", "args_", "[_", "1_", ":_", ":_", "2_", "]_", "=_", "max", "\\u", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "Size", "\",", " ", "reduce", "(", "mul", ",", " ", "map", "(", "sub", ",", " ", "max", "\\u", "values", ",", " ", "min", "\\u", "values", "),", " ", "1", ")*", "2.0", "/(", "1024", "*", "1024", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "get", "Blo", "sc_", "(_", "range", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "min", "\\u", "values", " ", "=", " ", "max", "\\u", "values_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "max", "\\u", "values", " ", "=", " ", "map", "(", "add", ",", " ", "map", "(", "sub", ",", " ", "min", "\\u", "values", ",", " ", "temp", "\\u", "values", "),", " ", "min", "\\u", "values", ")_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "values_", "[_", "2_", "]_", "=_", "max", "\\u", "values_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "values_", "[_", "2_", "]_", "=_", "min", "\\u", "values_", "[_", "2_", "]_", "+_", "self_", "._", "dim_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "values_", "[_", "(_", "i_", "+_", "1_", ")_", "%_", "2_", "]_", "=_", "start", "\\u", "value_", "[_", "(_", "i_", "+_", "1_", ")_", "%_", "2_", "]_", "+_", "(_", "max", "\\u", "values_", "[_", "(_", "i_", "+_", "1_", ")_", "%_", "2_", "]_", "-_", "min", "\\u", "values_", "[_", "(_", "i_", "+_", "1_", ")_", "%_", "2_", "]_", ")_", "*_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Benchmark", "Test_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Proj", "Info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "project", " ", "info", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "the", " ", "url_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://{}", "/", "ca", "/{}/", "info", "/'_", "._", "format_", "(_", "self_", "._", "host_", ",_", "self_", "._", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "get", "URL_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "json_", "._", "loads_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dim_", "=_", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "cube", "\\u", "dimension", "'_", "]_", "[_", "self_", "._", "resolution_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "images", "ize_", "=_", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "images", "ize", "'_", "]_", "[_", "self_", "._", "resolution_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "offset_", "=_", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "offset", "'_", "]_", "[_", "self_", "._", "resolution_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Benchmark", "Test_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Blo", "sc_", "(_", "self_", ",_", "range", "\\u", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Post", " ", "data", " ", "usi", "ng", " ", "the", " ", "blo", "sc", " ", "interface", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "the", " ", "url_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://{}", "/", "ca", "/{}/", "{}/", "blo", "sc", "/{}/", "{}", ",{}", "/{}", ",{}", "/{}", ",{}", "/'_", "._", "format_", "(_", "self_", "._", "host_", ",_", "self_", "._", "token_", ",_", "','_", "._", "join_", "(_", "self_", "._", "channels_", ")_", ",_", "self_", "._", "resolution_", ",_", "*_", "range", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "url_", "\\u\\u\\uNL\\u\\u\\u_", "get", "URL_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tak", "e", " ", "in", " ", "the", " ", "argu", "ment", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "description_", "=_", "'", "Run", " ", "the", " ", "Benchmark", " ", "script", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "host", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "help_", "=_", "'", "Host", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "token", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "help_", "=_", "'", "Token", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "channel", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "help_", "=_", "'", "Chan", "nel", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "resolu", "tion", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "help_", "=_", "'", "Reso", "luti", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "offset", "'_", ",_", "nargs_", "=_", "3_", ",_", "type_", "=_", "int_", ",_", "metavar_", "=_", "(_", "'", "x", "'_", ",_", "'", "y", "'_", ",_", "'", "z", "'_", ")_", ",_", "default_", "=_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "help_", "=_", "'", "Start", " ", "Off", "set", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bt_", "=_", "Benchmark", "Test_", "(_", "result_", "._", "host_", ",_", "result_", "._", "token_", ",_", "result_", "._", "channel_", ",_", "result_", "._", "resolution_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bt_", "._", "read", "Test_", "(_", "start", "\\u", "value_", "=_", "result_", "._", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Module is imported with 'import' and 'import from'
sdispater/orator/orator/utils/__init__.py
[ { "content": "# -*- coding: utf-8 -*-\n\nimport sys\nimport os\nimport errno\nimport warnings\nimport functools\n\nPY2 = sys.version_info[0] == 2\nPY3K = sys.version_info[0] >= 3\nPY33 = sys.version_info >= (3, 3)\n\nif PY2:\n import imp\n\n long = long\n unicode = unicode\n basestring = basestring\n\n reduce = reduce\n\n from urllib import quote_plus, unquote_plus, quote, unquote\n from urlparse import parse_qsl\n\nelse:\n long = int\n unicode = str\n basestring = str\n\n from functools import reduce\n\n from urllib.parse import (quote_plus, unquote_plus,\n parse_qsl, quote, unquote)\n\n if PY33:\n from importlib import machinery\n\n else:\n import imp\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import functools", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "functools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PY", "2_", "=_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", "]_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PY", "3", "K_", "=_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", "]_", ">=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PY", "33_", "=_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "3_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "PY", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "imp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "long_", "=_", "long_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unicode_", "=_", "unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basestring_", "=_", "basestring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reduce_", "=_", "reduce_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "urllib_", "import_", "quote", "\\u", "plus_", ",_", "unqu", "ote", "\\u", "plus_", ",_", "quote_", ",_", "unquote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urlparse_", "import_", "parse", "\\u", "qs", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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 ", " _", "long_", "=_", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unicode_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basestring_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "functools_", "import_", "reduce_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "urllib_", "._", "parse_", "import_", "(_", "quote", "\\u", "plus_", ",_", "unqu", "ote", "\\u", "plus_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "qs", "l_", ",_", "quote_", ",_", "unquote_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "PY", "33_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "importlib_", "import_", "machine", "ry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "imp_", "\\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 ]
Imprecise assert
dcramer/sentry-old/tests/test_events.py
[ { "content": " def test_tags(self):\n event_id = capture('Message', message='foo', tags=[('level', 'info')])\n\n event = Event.objects.get(event_id)\n\n self.assertEquals(len(event.tags), 2, event.tags)\n\n tags = dict(event.tags)\n\n self.assertTrue('level' in tags)\n self.assertEquals(tags['level'], 'info')\n \n self.assertTrue('server' in tags)\n self.assertEquals(tags['server'], app.config['NAME'])", "metadata": "root.SentryTest.test_tags", "header": "['class', 'SentryTest', '(', 'BaseTest', ')', ':', '___NEWLINE___', '# Some quick ugly high level tests to get shit working fast', '___NL___', '___EOS___']", "index": 184 }, { "content": " def test_message_event(self):\n event_id = capture('Message', message='foo')\n\n event = Event.objects.get(event_id)\n\n self.assertEquals(event.type, 'sentry.events.Message')\n self.assertEquals(event.time_spent, 0)\n self.assertTrue('sentry.interfaces.Message' in event.data)\n event_data = event.data['sentry.interfaces.Message']\n self.assertTrue('message' in event_data)\n self.assertEquals(event_data['message'], 'foo')\n self.assertTrue('params' in event_data)\n self.assertEquals(event_data['params'], [])", "metadata": "root.SentryTest.test_message_event", "header": "['class', 'SentryTest', '(', 'BaseTest', ')', ':', '___NEWLINE___', '# Some quick ugly high level tests to get shit working fast', '___NL___', '___EOS___']", "index": 199 }, { "content": " def test_exception_event_without_exc_info(self):\n try:\n raise ValueError('foo bar')\n except:\n pass\n\n # Exception pulls in sys.exc_info()\n # by default\n event_id = capture('Exception')\n\n event = Event.objects.get(event_id)\n\n self.assertEquals(event.type, 'sentry.events.Exception')\n self.assertEquals(event.time_spent, 0)\n\n data = event.data\n\n self.assertTrue('sentry.interfaces.Exception' in data)\n event_data = data['sentry.interfaces.Exception']\n self.assertTrue('value' in event_data)\n self.assertEquals(event_data['value'], 'foo bar')\n self.assertTrue('type' in event_data)\n self.assertEquals(event_data['type'], 'ValueError')\n \n self.assertTrue('sentry.interfaces.Stacktrace' in data)\n event_data = data['sentry.interfaces.Stacktrace']\n self.assertTrue('frames' in event_data)\n self.assertEquals(len(event_data['frames']), 1)\n frame = event_data['frames'][0]\n self.assertTrue('function' in frame)\n self.assertEquals(frame['function'], 'test_exception_event_without_exc_info')\n self.assertTrue('lineno' in frame)\n self.assertTrue(frame['lineno'] > 0)\n self.assertTrue('module' in frame)\n self.assertEquals(frame['module'], 'tests.test_events')\n self.assertTrue('id' in frame)\n self.assertTrue('filename' in frame)", "metadata": "root.SentryTest.test_exception_event_without_exc_info", "header": "['class', 'SentryTest', '(', 'BaseTest', ')', ':', '___NEWLINE___', '# Some quick ugly high level tests to get shit working fast', '___NL___', '___EOS___']", "index": 221 }, { "content": " def test_exception_event_with_exc_info(self):\n try:\n raise ValueError('foo bar')\n except:\n exc_info = sys.exc_info()\n\n # We raise a second event to ensure we actually reference\n # the first event\n try:\n raise SyntaxError('baz')\n except:\n pass\n\n # Exception pulls in sys.exc_info()\n # by default\n event_id = capture('Exception', exc_info=exc_info)\n\n event = Event.objects.get(event_id)\n\n self.assertEquals(event.type, 'sentry.events.Exception')\n self.assertEquals(event.time_spent, 0)\n\n data = event.data\n\n self.assertTrue('sentry.interfaces.Exception' in data)\n event_data = data['sentry.interfaces.Exception']\n self.assertTrue('value' in event_data)\n self.assertEquals(event_data['value'], 'foo bar')\n self.assertTrue('type' in event_data)\n self.assertEquals(event_data['type'], 'ValueError')\n\n self.assertTrue('sentry.interfaces.Stacktrace' in data)\n event_data = data['sentry.interfaces.Stacktrace']\n self.assertTrue('frames' in event_data)\n self.assertEquals(len(event_data['frames']), 1)\n frame = event_data['frames'][0]\n self.assertTrue('function' in frame)\n self.assertEquals(frame['function'], 'test_exception_event_with_exc_info')\n self.assertTrue('lineno' in frame)\n self.assertTrue(frame['lineno'] > 0)\n self.assertTrue('module' in frame)\n self.assertEquals(frame['module'], 'tests.test_events')\n self.assertTrue('id' in frame)\n self.assertTrue('filename' in frame)", "metadata": "root.SentryTest.test_exception_event_with_exc_info", "header": "['class', 'SentryTest', '(', 'BaseTest', ')', ':', '___NEWLINE___', '# Some quick ugly high level tests to get shit working fast', '___NL___', '___EOS___']", "index": 259 }, { "content": " def test_context_processors(self):\n try:\n username = 'random_user'\n password = 'secret42'\n raise ValueError('foo bar')\n except:\n exc_info = sys.exc_info()\n\n # We raise a second event to ensure we actually reference\n # the first event\n try:\n raise SyntaxError('baz')\n except:\n pass\n\n # Exception pulls in sys.exc_info()\n # by default\n event_id = capture('Exception')\n\n event = Event.objects.get(event_id)\n self.assertTrue('sentry.interfaces.Stacktrace' in event.data)\n event_data = event.data['sentry.interfaces.Stacktrace']\n frame = event_data['frames'][0]\n self.assertEquals(frame['vars']['password'], '****************')", "metadata": "root.SentryTest.test_context_processors", "header": "['class', 'SentryTest', '(', 'BaseTest', ')', ':', '___NEWLINE___', '# Some quick ugly high level tests to get shit working fast', '___NL___', '___EOS___']", "index": 304 } ]
[ { "span": "self.assertTrue('level' in tags)", "start_line": 193, "start_column": 8, "end_line": 193, "end_column": 40 }, { "span": "self.assertTrue('server' in tags)", "start_line": 196, "start_column": 8, "end_line": 196, "end_column": 41 }, { "span": "self.assertTrue('sentry.interfaces.Message' in event.data)", "start_line": 206, "start_column": 8, "end_line": 206, "end_column": 66 }, { "span": "self.assertTrue('message' in event_data)", "start_line": 208, "start_column": 8, "end_line": 208, "end_column": 48 }, { "span": "self.assertTrue('params' in event_data)", "start_line": 210, "start_column": 8, "end_line": 210, "end_column": 47 }, { "span": "self.assertTrue('sentry.interfaces.Exception' in data)", "start_line": 238, "start_column": 8, "end_line": 238, "end_column": 62 }, { "span": "self.assertTrue('value' in event_data)", "start_line": 240, "start_column": 8, "end_line": 240, "end_column": 46 }, { "span": "self.assertTrue('type' in event_data)", "start_line": 242, "start_column": 8, "end_line": 242, "end_column": 45 }, { "span": "self.assertTrue('sentry.interfaces.Stacktrace' in data)", "start_line": 245, "start_column": 8, "end_line": 245, "end_column": 63 }, { "span": "self.assertTrue('frames' in event_data)", "start_line": 247, "start_column": 8, "end_line": 247, "end_column": 47 }, { "span": "self.assertTrue('function' in frame)", "start_line": 250, "start_column": 8, "end_line": 250, "end_column": 44 }, { "span": "self.assertTrue('lineno' in frame)", "start_line": 252, "start_column": 8, "end_line": 252, "end_column": 42 }, { "span": "self.assertTrue(frame['lineno'] > 0)", "start_line": 253, "start_column": 8, "end_line": 253, "end_column": 44 }, { "span": "self.assertTrue('module' in frame)", "start_line": 254, "start_column": 8, "end_line": 254, "end_column": 42 }, { "span": "self.assertTrue('id' in frame)", "start_line": 256, "start_column": 8, "end_line": 256, "end_column": 38 }, { "span": "self.assertTrue('filename' in frame)", "start_line": 257, "start_column": 8, "end_line": 257, "end_column": 44 }, { "span": "self.assertTrue('sentry.interfaces.Exception' in data)", "start_line": 283, "start_column": 8, "end_line": 283, "end_column": 62 }, { "span": "self.assertTrue('value' in event_data)", "start_line": 285, "start_column": 8, "end_line": 285, "end_column": 46 }, { "span": "self.assertTrue('type' in event_data)", "start_line": 287, "start_column": 8, "end_line": 287, "end_column": 45 }, { "span": "self.assertTrue('sentry.interfaces.Stacktrace' in data)", "start_line": 290, "start_column": 8, "end_line": 290, "end_column": 63 }, { "span": "self.assertTrue('frames' in event_data)", "start_line": 292, "start_column": 8, "end_line": 292, "end_column": 47 }, { "span": "self.assertTrue('function' in frame)", "start_line": 295, "start_column": 8, "end_line": 295, "end_column": 44 }, { "span": "self.assertTrue('lineno' in frame)", "start_line": 297, "start_column": 8, "end_line": 297, "end_column": 42 }, { "span": "self.assertTrue(frame['lineno'] > 0)", "start_line": 298, "start_column": 8, "end_line": 298, "end_column": 44 }, { "span": "self.assertTrue('module' in frame)", "start_line": 299, "start_column": 8, "end_line": 299, "end_column": 42 }, { "span": "self.assertTrue('id' in frame)", "start_line": 301, "start_column": 8, "end_line": 301, "end_column": 38 }, { "span": "self.assertTrue('filename' in frame)", "start_line": 302, "start_column": 8, "end_line": 302, "end_column": 44 }, { "span": "self.assertTrue('sentry.interfaces.Stacktrace' in event.data)", "start_line": 324, "start_column": 8, "end_line": 324, "end_column": 69 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Sent", "ry", "Test_", "(_", "Base", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Some", " ", "quick", " ", "ug", "ly", " ", "high", " ", "level", " ", "tests", " ", "to", " ", "get", " ", "shi", "t", " ", "working", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tags_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event", "\\u", "id_", "=_", "capture_", "(_", "'", "Messag", "e", "'_", ",_", "message_", "=_", "'", "foo", "'_", ",_", "tags_", "=_", "[_", "(_", "'", "level", "'_", ",_", "'", "info", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event_", "=_", "Event_", "._", "objects_", "._", "get_", "(_", "event", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "event_", "._", "tags_", ")_", ",_", "2_", ",_", "event_", "._", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tags_", "=_", "dict_", "(_", "event_", "._", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "level", "'_", "in_", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "tags_", "[_", "'", "level", "'_", "]_", ",_", "'", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "server", "'_", "in_", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "tags_", "[_", "'", "server", "'_", "]_", ",_", "app_", "._", "config_", "[_", "'", "NAME", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sent", "ry", "Test_", "(_", "Base", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Some", " ", "quick", " ", "ug", "ly", " ", "high", " ", "level", " ", "tests", " ", "to", " ", "get", " ", "shi", "t", " ", "working", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "message", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event", "\\u", "id_", "=_", "capture_", "(_", "'", "Messag", "e", "'_", ",_", "message_", "=_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event_", "=_", "Event_", "._", "objects_", "._", "get_", "(_", "event", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event_", "._", "type_", ",_", "'", "sentry", ".", "events", ".", "Messag", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event_", "._", "time", "\\u", "spe", "nt_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "sentry", ".", "interface", "s", ".", "Messag", "e", "'_", "in_", "event_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "data_", "=_", "event_", "._", "data_", "[_", "'", "sentry", ".", "interface", "s", ".", "Messag", "e", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "message", "'_", "in_", "event", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event", "\\u", "data_", "[_", "'", "message", "'_", "]_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "params", "'_", "in_", "event", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event", "\\u", "data_", "[_", "'", "params", "'_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sent", "ry", "Test_", "(_", "Base", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Some", " ", "quick", " ", "ug", "ly", " ", "high", " ", "level", " ", "tests", " ", "to", " ", "get", " ", "shi", "t", " ", "working", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exception", "\\u", "event", "\\u", "with", "out", "\\u", "exc", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "foo", " ", "bar", "'_", ")_", "\\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_", "#", " ", "Except", "ion", " ", "pull", "s", " ", "in", " ", "sys", ".", "exc", "\\u", "info", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "event", "\\u", "id_", "=_", "capture_", "(_", "'", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event_", "=_", "Event_", "._", "objects_", "._", "get_", "(_", "event", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event_", "._", "type_", ",_", "'", "sentry", ".", "events", ".", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event_", "._", "time", "\\u", "spe", "nt_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "event_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "sentry", ".", "interface", "s", ".", "Except", "ion", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "data_", "=_", "data_", "[_", "'", "sentry", ".", "interface", "s", ".", "Except", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "value", "'_", "in_", "event", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event", "\\u", "data_", "[_", "'", "value", "'_", "]_", ",_", "'", "foo", " ", "bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "type", "'_", "in_", "event", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event", "\\u", "data_", "[_", "'", "type", "'_", "]_", ",_", "'", "Value", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "sentry", ".", "interface", "s", ".", "Stack", "trace", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "data_", "=_", "data_", "[_", "'", "sentry", ".", "interface", "s", ".", "Stack", "trace", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "frames", "'_", "in_", "event", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "event", "\\u", "data_", "[_", "'", "frames", "'_", "]_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "=_", "event", "\\u", "data_", "[_", "'", "frames", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "function", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "frame_", "[_", "'", "function", "'_", "]_", ",_", "'", "test\\u", "exception", "\\u", "event", "\\u", "with", "out", "\\u", "exc", "\\u", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "linen", "o", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "frame_", "[_", "'", "linen", "o", "'_", "]_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "module", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "frame_", "[_", "'", "module", "'_", "]_", ",_", "'", "tests", ".", "test\\u", "events", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "id", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "filename", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sent", "ry", "Test_", "(_", "Base", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Some", " ", "quick", " ", "ug", "ly", " ", "high", " ", "level", " ", "tests", " ", "to", " ", "get", " ", "shi", "t", " ", "working", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exception", "\\u", "event", "\\u", "with", "\\u", "exc", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "foo", " ", "bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "info_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "raise", " ", "a", " ", "second", " ", "event", " ", "to", " ", "ensure", " ", "we", " ", "actual", "ly", " ", "reference_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "event_", "\\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 ", " _", "raise_", "Syntax", "Error_", "(_", "'", "ba", "z", "'_", ")_", "\\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_", "#", " ", "Except", "ion", " ", "pull", "s", " ", "in", " ", "sys", ".", "exc", "\\u", "info", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "event", "\\u", "id_", "=_", "capture_", "(_", "'", "Except", "ion", "'_", ",_", "exc", "\\u", "info_", "=_", "exc", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event_", "=_", "Event_", "._", "objects_", "._", "get_", "(_", "event", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event_", "._", "type_", ",_", "'", "sentry", ".", "events", ".", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event_", "._", "time", "\\u", "spe", "nt_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "event_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "sentry", ".", "interface", "s", ".", "Except", "ion", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "data_", "=_", "data_", "[_", "'", "sentry", ".", "interface", "s", ".", "Except", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "value", "'_", "in_", "event", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event", "\\u", "data_", "[_", "'", "value", "'_", "]_", ",_", "'", "foo", " ", "bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "type", "'_", "in_", "event", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "event", "\\u", "data_", "[_", "'", "type", "'_", "]_", ",_", "'", "Value", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "sentry", ".", "interface", "s", ".", "Stack", "trace", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "data_", "=_", "data_", "[_", "'", "sentry", ".", "interface", "s", ".", "Stack", "trace", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "frames", "'_", "in_", "event", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "event", "\\u", "data_", "[_", "'", "frames", "'_", "]_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "=_", "event", "\\u", "data_", "[_", "'", "frames", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "function", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "frame_", "[_", "'", "function", "'_", "]_", ",_", "'", "test\\u", "exception", "\\u", "event", "\\u", "with", "\\u", "exc", "\\u", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "linen", "o", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "frame_", "[_", "'", "linen", "o", "'_", "]_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "module", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "frame_", "[_", "'", "module", "'_", "]_", ",_", "'", "tests", ".", "test\\u", "events", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "id", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "filename", "'_", "in_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sent", "ry", "Test_", "(_", "Base", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Some", " ", "quick", " ", "ug", "ly", " ", "high", " ", "level", " ", "tests", " ", "to", " ", "get", " ", "shi", "t", " ", "working", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "context", "\\u", "processors_", "(_", "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 ", " _", "username_", "=_", "'", "random", "\\u", "user", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "'", "secret", "4", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "'", "foo", " ", "bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "info_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "raise", " ", "a", " ", "second", " ", "event", " ", "to", " ", "ensure", " ", "we", " ", "actual", "ly", " ", "reference_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "event_", "\\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 ", " _", "raise_", "Syntax", "Error_", "(_", "'", "ba", "z", "'_", ")_", "\\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_", "#", " ", "Except", "ion", " ", "pull", "s", " ", "in", " ", "sys", ".", "exc", "\\u", "info", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "event", "\\u", "id_", "=_", "capture_", "(_", "'", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event_", "=_", "Event_", "._", "objects_", "._", "get_", "(_", "event", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "sentry", ".", "interface", "s", ".", "Stack", "trace", "'_", "in_", "event_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "data_", "=_", "event_", "._", "data_", "[_", "'", "sentry", ".", "interface", "s", ".", "Stack", "trace", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "=_", "event", "\\u", "data_", "[_", "'", "frames", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "frame_", "[_", "'", "vars", "'_", "]_", "[_", "'", "password", "'_", "]_", ",_", "'*******", "********", "*'_", ")_" ]
[ 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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, path_template, verbose, qc):\n\n # Initialization\n self.fname_src = fname_src\n self.fname_transfo = fname_transfo\n self.warp_atlas = warp_atlas\n self.warp_spinal_levels = warp_spinal_levels\n self.folder_out = folder_out\n self.path_template = path_template\n self.folder_template = param.folder_template\n self.folder_atlas = param.folder_atlas\n self.folder_spinal_levels = param.folder_spinal_levels\n self.verbose = verbose\n self.qc = qc\n start_time = time.time()\n\n # Check file existence\n sct.printv('\\nCheck file existence...', self.verbose)\n sct.check_file_exist(self.fname_src)\n sct.check_file_exist(self.fname_transfo)\n\n # add slash at the end of folder name (in case there is no slash)\n self.path_template = sct.slash_at_the_end(self.path_template, 1)\n self.folder_out = sct.slash_at_the_end(self.folder_out, 1)\n self.folder_template = sct.slash_at_the_end(self.folder_template, 1)\n self.folder_atlas = sct.slash_at_the_end(self.folder_atlas, 1)\n self.folder_spinal_levels = sct.slash_at_the_end(self.folder_spinal_levels, 1)\n\n # print arguments\n print '\\nCheck parameters:'\n print ' Destination image ........ '+self.fname_src\n print ' Warping field ............ '+self.fname_transfo\n print ' Path template ............ '+self.path_template\n print ' Output folder ............ '+self.folder_out+'\\n'\n\n # Extract path, file and extension\n path_src, file_src, ext_src = sct.extract_fname(self.fname_src)\n\n # create output folder\n if os.path.exists(self.folder_out):\n sct.printv('WARNING: Output folder already exists. Deleting it...', self.verbose, 'warning')\n sct.run('rm -rf '+self.folder_out)\n sct.run('mkdir '+self.folder_out)\n\n # Warp template objects\n sct.printv('\\nWarp template objects...', self.verbose)\n warp_label(self.path_template, self.folder_template, param.file_info_label, self.fname_src, self.fname_transfo, self.folder_out)\n\n # Warp atlas\n if self.warp_atlas == 1:\n sct.printv('\\nWarp atlas of white matter tracts...', self.verbose)\n warp_label(self.path_template, self.folder_atlas, param.file_info_label, self.fname_src, self.fname_transfo, self.folder_out)\n\n # Warp spinal levels\n if self.warp_spinal_levels == 1:\n sct.printv('\\nWarp spinal levels...', self.verbose)\n warp_label(self.path_template, self.folder_spinal_levels, param.file_info_label, self.fname_src, self.fname_transfo, self.folder_out)\n\n # to view results\n sct.printv('\\nDone! To view results, type:', self.verbose)\n sct.printv('fslview '+self.fname_src+' '+self.folder_out+self.folder_template+'MNI-Poly-AMU_T2.nii.gz -b 0,4000 '+self.folder_out+self.folder_template+'MNI-Poly-AMU_level.nii.gz -l MGH-Cortical -t 0.5 '+self.folder_out+self.folder_template+'MNI-Poly-AMU_GM.nii.gz -l Red-Yellow -b 0.5,1 '+self.folder_out+self.folder_template+'MNI-Poly-AMU_WM.nii.gz -l Blue-Lightblue -b 0.5,1 &\\n', self.verbose, 'info')\n\n if self.qc:\n from msct_image import Image\n # output QC image\n im = Image(self.fname_src)\n im_wm = Image(self.folder_out+self.folder_template+'MNI-Poly-AMU_WM.nii.gz')\n im.save_quality_control(plane='axial', n_slices=4, seg=im_wm, thr=0.5, cmap_col='blue-cyan', path_output=self.folder_out)", "metadata": "root.WarpTemplate.__init__", "header": "['class', 'WarpTemplate', ':', '___EOS___']", "index": 54 } ]
[ { "span": "start_time ", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 18 }, { "span": "path_src,", "start_line": 90, "start_column": 8, "end_line": 90, "end_column": 16 }, { "span": "file_src,", "start_line": 90, "start_column": 18, "end_line": 90, "end_column": 26 }, { "span": "ext_src ", "start_line": 90, "start_column": 28, "end_line": 90, "end_column": 35 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "War", "p", "Template_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "fname", "\\u", "src_", ",_", "fname", "\\u", "transf", "o_", ",_", "warp", "\\u", "atlas", "_", ",_", "warp", "\\u", "spin", "al", "\\u", "levels_", ",_", "folder", "\\u", "out_", ",_", "path", "\\u", "template_", ",_", "verbose_", ",_", "qc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "ation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fname", "\\u", "src_", "=_", "fname", "\\u", "src_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fname", "\\u", "transf", "o_", "=_", "fname", "\\u", "transf", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "warp", "\\u", "atlas", "_", "=_", "warp", "\\u", "atlas", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "warp", "\\u", "spin", "al", "\\u", "levels_", "=_", "warp", "\\u", "spin", "al", "\\u", "levels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "out_", "=_", "folder", "\\u", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "path", "\\u", "template_", "=_", "path", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "template_", "=_", "param_", "._", "folder", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "atlas", "_", "=_", "param_", "._", "folder", "\\u", "atlas", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "spin", "al", "\\u", "levels_", "=_", "param_", "._", "folder", "\\u", "spin", "al", "\\u", "levels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "verbose_", "=_", "verbose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "qc_", "=_", "qc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "file", " ", "existence", "_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Check", " ", "file", " ", "existence", "...'_", ",_", "self_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "check", "\\u", "file", "\\u", "exist_", "(_", "self_", "._", "fname", "\\u", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "check", "\\u", "file", "\\u", "exist_", "(_", "self_", "._", "fname", "\\u", "transf", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "slash", " ", "at", " ", "the", " ", "end", " ", "of", " ", "folder", " ", "name", " ", "(", "in", " ", "case", " ", "there", " ", "is", " ", "no", " ", "slash", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "path", "\\u", "template_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "self_", "._", "path", "\\u", "template_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "out_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "self_", "._", "folder", "\\u", "out_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "template_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "self_", "._", "folder", "\\u", "template_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "atlas", "_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "self_", "._", "folder", "\\u", "atlas", "_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "spin", "al", "\\u", "levels_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "self_", "._", "folder", "\\u", "spin", "al", "\\u", "levels_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", "Check", " ", "parameter", "s", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", " ", " ", "Dest", "ination", " ", "image", " ", "........", " ", "'_", "+_", "self_", "._", "fname", "\\u", "src_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", " ", " ", "War", "ping", " ", "field", " ", "...........", ".", " ", "'_", "+_", "self_", "._", "fname", "\\u", "transf", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", " ", " ", "Path", " ", "template", " ", "...........", ".", " ", "'_", "+_", "self_", "._", "path", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", " ", " ", "Output", " ", "folder", " ", "...........", ".", " ", "'_", "+_", "self_", "._", "folder", "\\u", "out_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "path", ",", " ", "file", " ", "and", " ", "extension_", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "src_", ",_", "file", "\\u", "src_", ",_", "ext", "\\u", "src_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "self_", "._", "fname", "\\u", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "output", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "folder", "\\u", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "WARN", "ING", ":", " ", "Output", " ", "folder", " ", "alr", "ead", "y", " ", "exist", "s", ".", " ", "Del", "eti", "ng", " ", "it", "...'_", ",_", "self_", "._", "verbose_", ",_", "'", "warn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "rm", " ", "-", "rf", " ", "'_", "+_", "self_", "._", "folder", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "mkd", "ir", " ", "'_", "+_", "self_", "._", "folder", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "War", "p", " ", "template", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "War", "p", " ", "template", " ", "object", "s", "...'_", ",_", "self_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "\\u", "label_", "(_", "self_", "._", "path", "\\u", "template_", ",_", "self_", "._", "folder", "\\u", "template_", ",_", "param_", "._", "file", "\\u", "info", "\\u", "label_", ",_", "self_", "._", "fname", "\\u", "src_", ",_", "self_", "._", "fname", "\\u", "transf", "o_", ",_", "self_", "._", "folder", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "War", "p", " ", "atlas", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "warp", "\\u", "atlas", "_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "War", "p", " ", "atlas", " ", "of", " ", "white", " ", "matte", "r", " ", "tracts", "...'_", ",_", "self_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "\\u", "label_", "(_", "self_", "._", "path", "\\u", "template_", ",_", "self_", "._", "folder", "\\u", "atlas", "_", ",_", "param_", "._", "file", "\\u", "info", "\\u", "label_", ",_", "self_", "._", "fname", "\\u", "src_", ",_", "self_", "._", "fname", "\\u", "transf", "o_", ",_", "self_", "._", "folder", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "War", "p", " ", "spin", "al", " ", "levels_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "warp", "\\u", "spin", "al", "\\u", "levels_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "War", "p", " ", "spin", "al", " ", "level", "s", "...'_", ",_", "self_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "\\u", "label_", "(_", "self_", "._", "path", "\\u", "template_", ",_", "self_", "._", "folder", "\\u", "spin", "al", "\\u", "levels_", ",_", "param_", "._", "file", "\\u", "info", "\\u", "label_", ",_", "self_", "._", "fname", "\\u", "src_", ",_", "self_", "._", "fname", "\\u", "transf", "o_", ",_", "self_", "._", "folder", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "view", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Don", "e", "!", " ", "To", " ", "view", " ", "results", ",", " ", "type", ":'_", ",_", "self_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "fs", "lv", "iew", " ", "'_", "+_", "self_", "._", "fname", "\\u", "src_", "+_", "'", " ", "'_", "+_", "self_", "._", "folder", "\\u", "out_", "+_", "self_", "._", "folder", "\\u", "template_", "+_", "'", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "T2", ".", "ni", "i", ".", "gz", " ", "-", "b", " ", "0", ",", "4000", " ", "'_", "+_", "self_", "._", "folder", "\\u", "out_", "+_", "self_", "._", "folder", "\\u", "template_", "+_", "'", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "level", ".", "ni", "i", ".", "gz", " ", "-", "l", " ", "MG", "H", "-", "Cort", "ical", " ", "-", "t", " ", "0.", "5", " ", "'_", "+_", "self_", "._", "folder", "\\u", "out_", "+_", "self_", "._", "folder", "\\u", "template_", "+_", "'", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "GM", ".", "ni", "i", ".", "gz", " ", "-", "l", " ", "Red", "-", "Ye", "llow", " ", "-", "b", " ", "0.", "5", ",", "1", " ", "'_", "+_", "self_", "._", "folder", "\\u", "out_", "+_", "self_", "._", "folder", "\\u", "template_", "+_", "'", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "WM", ".", "ni", "i", ".", "gz", " ", "-", "l", " ", "Blue", "-", "Light", "blue", " ", "-", "b", " ", "0.", "5", ",", "1", " ", "&", "\\\\", "n", "'_", ",_", "self_", "._", "verbose_", ",_", "'", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "qc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "msc", "t", "\\u", "image_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "output", " ", "QC", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "im_", "=_", "Image_", "(_", "self_", "._", "fname", "\\u", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "wm_", "=_", "Image_", "(_", "self_", "._", "folder", "\\u", "out_", "+_", "self_", "._", "folder", "\\u", "template_", "+_", "'", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "WM", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im_", "._", "save", "\\u", "quali", "ty", "\\u", "control_", "(_", "plane_", "=_", "'", "axi", "al", "'_", ",_", "n", "\\u", "slices_", "=_", "4_", ",_", "seg_", "=_", "im", "\\u", "wm_", ",_", "thr_", "=_", "0.5_", ",_", "cmap", "\\u", "col_", "=_", "'", "blue", "-", "cya", "n", "'_", ",_", "path", "\\u", "output_", "=_", "self_", "._", "folder", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
`__eq__` not overridden when adding attributes
jaysw/ipydb/ipydb/completion.py
[ { "content": "class MonkeyString(str):\n \"\"\"This is to avoid the restriction in\n i.c.completer.IPCompleter.dispatch_custom_completer where\n matches must begin with the text being matched.\"\"\"\n\n", "metadata": "root.MonkeyString", "header": "['module', '___EOS___']", "index": 71 }, { "content": " def __new__(self, text, completion):\n self.text = text\n return str.__new__(self, completion)", "metadata": "root.MonkeyString.__new__", "header": "['class', 'MonkeyString', '(', 'str', ')', ':', '___EOS___']", "index": 76 }, { "content": " def startswith(self, text):\n if self.text == text:\n return True\n else:\n return super(MonkeyString, self).startswith(text)", "metadata": "root.MonkeyString.startswith", "header": "['class', 'MonkeyString', '(', 'str', ')', ':', '___EOS___']", "index": 80 } ]
[ { "span": "class MonkeyString(str):", "start_line": 71, "start_column": 0, "end_line": 71, "end_column": 24 } ]
[ { "span": "self.text ", "start_line": 77, "start_column": 8, "end_line": 77, "end_column": 17 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "eq\\u\\u_", "`_", "not_", "overrid", "den_", "when_", "addin", "g_", "attributes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Mon", "key", "String_", "(_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "is", " ", "to", " ", "avoid", " ", "the", " ", "restriction", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "i", ".", "c", ".", "completer", ".", "IPC", "omp", "lete", "r", ".", "dispatch", "\\u", "custom", "\\u", "completer", " ", "where", "\\", "10", ";", " ", " ", " ", " ", "matche", "s", " ", "must", " ", "begin", " ", "with", " ", "the", " ", "text", " ", "bei", "ng", " ", "matche", "d", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Mon", "key", "String_", "(_", "str_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "new\\u\\u_", "(_", "self_", ",_", "text_", ",_", "completion_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "=_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "._", "\\u\\u", "new\\u\\u_", "(_", "self_", ",_", "completion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "key", "String_", "(_", "str_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "startswith_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "text_", "==_", "text_", ":_", "\\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_", "super_", "(_", "Mon", "key", "String_", ",_", "self_", ")_", "._", "startswith_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 3, 1, 1, 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 ]
Unused import
AppScale/appscale/AppDB/cassandra/stress.py
[ { "content": "#!/usr/bin/python\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, 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# expects a Cassandra server to be running and listening on port 9160.\n# (read tests expect insert tests to have run first too.)\n\nfrom __future__ import with_statement\n\nhave_multiproc = False\ntry:\n from multiprocessing import Array as array, Process as Thread\n from uuid import uuid1 as get_ident\n array('i', 1) # catch \"This platform lacks a functioning sem_open implementation\"\n Thread.isAlive = Thread.is_alive\n have_multiproc = True\nexcept ImportError:\n from threading import Thread\n from thread import get_ident\n from array import array\nfrom hashlib import md5\nimport time, random, sys, os\nfrom random import randint, gauss\nfrom optparse import OptionParser\n\nfrom thrift.transport import TTransport\nfrom thrift.transport import TSocket\nfrom thrift.transport import THttpClient\nfrom thrift.protocol import TBinaryProtocol\n\ntry:\n from thrift_cass import Cassandra\n from thrift_cass.ttypes import *\nexcept ImportError:\n # add cassandra directory to sys.path\n L = os.path.abspath(__file__).split(os.path.sep)[:-3]\n root = os.path.sep.join(L)\n _ipath = os.path.join(root, 'interface', 'thrift', 'gen-py')\n sys.path.append(os.path.join(_ipath, 'cassandra'))\n import Cassandra\n from ttypes import *\nexcept ImportError:\n print \"Cassandra thrift bindings not found, please run 'ant gen-thrift-py'\"\n sys.exit(2)\n\ntry:\n from thrift.protocol import fastbinary\nexcept ImportError:\n print \"WARNING: thrift binary extension not found, benchmark will not be accurate!\"\n\nparser = OptionParser()\nparser.add_option('-n', '--num-keys', type=\"int\", dest=\"numkeys\",\n help=\"Number of keys\", default=1000**2)\nparser.add_option('-N', '--skip-keys', type=\"float\", dest=\"skipkeys\",\n help=\"Fraction of keys to skip initially\", default=0)\nparser.add_option('-t', '--threads', type=\"int\", dest=\"threads\",\n help=\"Number of threads/procs to use\", default=50)\nparser.add_option('-c', '--columns', type=\"int\", dest=\"columns\",\n help=\"Number of columns per key\", default=5)\nparser.add_option('-S', '--column-size', type=\"int\", dest=\"column_size\",\n help=\"Size of column values in bytes\", default=34)\nparser.add_option('-C', '--cardinality', type=\"int\", dest=\"cardinality\",\n help=\"Number of unique values stored in columns\", default=50)\nparser.add_option('-d', '--nodes', type=\"string\", dest=\"nodes\",\n help=\"Host nodes (comma separated)\", default=\"localhost\")\nparser.add_option('-D', '--nodefile', type=\"string\", dest=\"nodefile\",\n help=\"File containing list of nodes (one per line)\", default=None)\nparser.add_option('-s', '--stdev', type=\"float\", dest=\"stdev\", default=0.1,\n help=\"standard deviation factor\")\nparser.add_option('-r', '--random', action=\"store_true\", dest=\"random\",\n help=\"use random key generator (stdev will have no effect)\")\nparser.add_option('-f', '--file', type=\"string\", dest=\"file\", \n help=\"write output to file\")\nparser.add_option('-p', '--port', type=\"int\", default=9160, dest=\"port\",\n help=\"thrift port\")\nparser.add_option('-m', '--unframed', action=\"store_true\", dest=\"unframed\",\n help=\"use unframed transport\")\nparser.add_option('-o', '--operation', type=\"choice\", dest=\"operation\",\n default=\"insert\", choices=('insert', 'read', 'rangeslice',\n 'indexedrangeslice', 'multiget'),\n help=\"operation to perform\")\nparser.add_option('-u', '--supercolumns', type=\"int\", dest=\"supers\", default=1,\n help=\"number of super columns per key\")\nparser.add_option('-y', '--family-type', type=\"choice\", dest=\"cftype\",\n choices=('regular','super'), default='regular',\n help=\"column family type\")\nparser.add_option('-k', '--keep-going', action=\"store_true\", dest=\"ignore\",\n help=\"ignore errors inserting or reading\")\nparser.add_option('-i', '--progress-interval', type=\"int\", default=10,\n dest=\"interval\", help=\"progress report interval (seconds)\")\nparser.add_option('-g', '--keys-per-call', type=\"int\", default=1000,\n dest=\"rangecount\",\n help=\"amount of keys to get_range_slices or multiget per call\")\nparser.add_option('-l', '--replication-factor', type=\"int\", default=1,\n dest=\"replication\",\n help=\"replication factor to use when creating needed column families\")\nparser.add_option('-e', '--consistency-level', type=\"str\", default='ONE',\n dest=\"consistency\", help=\"consistency level to use\")\nparser.add_option('-x', '--create-index', type=\"choice\",\n choices=('keys','keys_bitmap', 'none'), default='none',\n dest=\"index\", help=\"type of index to create on needed column families\")\n\n(options, args) = parser.parse_args()\n \ntotal_keys = options.numkeys\nn_threads = options.threads\nkeys_per_thread = total_keys / n_threads\ncolumns_per_key = options.columns\nsupers_per_key = options.supers\n# this allows client to round robin requests directly for\n# simple request load-balancing\nnodes = options.nodes.split(',')\nif options.nodefile != None:\n with open(options.nodefile) as f:\n nodes = [n.strip() for n in f.readlines() if len(n.strip()) > 0]\n\n#format string for keys\nfmt = '%0' + str(len(str(total_keys))) + 'd'\n\n# a generator that generates all keys according to a bell curve centered\n# around the middle of the keys generated (0..total_keys). Remember that\n# about 68% of keys will be within stdev away from the mean and \n# about 95% within 2*stdev.\nstdev = total_keys * options.stdev\nmean = total_keys / 2\n\nconsistency = getattr(ConsistencyLevel, options.consistency, None)\nif consistency is None:\n print \"%s is not a valid consistency level\" % options.consistency\n sys.exit(3)\n\n# generates a list of unique, deterministic values\n\n \n# a generator that will generate all keys w/ equal probability. this is the\n# worst case for caching.\n\nkey_generator = key_generator_gauss\nif options.random:\n key_generator = key_generator_random\n\n\n\n\n\n\n\n\n\n# Each thread queries for a portion of the unique values\n# TODO: all threads start at the same key: implement wrapping, and start\n# from the thread's appointed range\n\n\n\n\n\n\n\nstresser = Stress()\nbenchmark = getattr(stresser, options.operation, None)\nif not have_multiproc:\n print \"\"\"WARNING: multiprocessing not present, threading will be used.\n Benchmark may not be accurate!\"\"\"\nif options.operation == 'insert':\n make_keyspaces()\nbenchmark()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def generate_values():\n values = []\n for i in xrange(0, options.cardinality):\n h = md5(str(i)).hexdigest()\n values.append(h * int(options.column_size/len(h)) + h[:options.column_size % len(h)])\n return values", "metadata": "root.generate_values", "header": "['module', '___EOS___']", "index": 145 }, { "content": "def key_generator_gauss():\n while True:\n guess = gauss(mean, stdev)\n if 0 <= guess < total_keys:\n return fmt % int(guess)", "metadata": "root.key_generator_gauss", "header": "['module', '___EOS___']", "index": 152 }, { "content": "def key_generator_random():\n return fmt % randint(0, total_keys - 1)", "metadata": "root.key_generator_random", "header": "['module', '___EOS___']", "index": 160 }, { "content": "def get_client(host='127.0.0.1', port=9160):\n socket = TSocket.TSocket(host, port)\n if options.unframed:\n transport = TTransport.TBufferedTransport(socket)\n else:\n transport = TTransport.TFramedTransport(socket)\n protocol = TBinaryProtocol.TBinaryProtocolAccelerated(transport)\n client = Cassandra.Client(protocol)\n client.transport = transport\n return client", "metadata": "root.get_client", "header": "['module', '___EOS___']", "index": 168 }, { "content": "def make_keyspaces():\n colms = []\n if options.index == 'keys':\n colms = [ColumnDef(name='C1', validation_class='UTF8Type', index_type=IndexType.KEYS)]\n elif options.index == 'keys_bitmap':\n colms = [ColumnDef(name='C1', validation_class='UTF8Type', index_type=IndexType.KEYS_BITMAP)]\n cfams = [CfDef(keyspace='Keyspace1', name='Standard1', column_metadata=colms),\n CfDef(keyspace='Keyspace1', name='Super1', column_type='Super')]\n keyspace = KsDef(name='Keyspace1', strategy_class='org.apache.cassandra.locator.SimpleStrategy', replication_factor=options.replication, cf_defs=cfams)\n client = get_client(nodes[0], options.port)\n client.transport.open()\n try:\n client.system_add_keyspace(keyspace)\n print \"Created keyspaces. Sleeping %ss for propagation.\" % len(nodes)\n time.sleep(len(nodes))\n except InvalidRequestException, e:\n print e.why\n client.transport.close()", "metadata": "root.make_keyspaces", "header": "['module', '___EOS___']", "index": 179 }, { "content": "class Operation(Thread):", "metadata": "root.Operation", "header": "['module', '___EOS___']", "index": 198 }, { "content": " def __init__(self, i, opcounts, keycounts, latencies):\n Thread.__init__(self)\n # generator of the keys to be used\n self.range = xrange(int(keys_per_thread * (i + options.skipkeys)), \n keys_per_thread * (i + 1))\n # we can't use a local counter, since that won't be visible to the parent\n # under multiprocessing. instead, the parent passes a \"opcounts\" array\n # and an index that is our assigned counter.\n self.idx = i\n self.opcounts = opcounts\n # similarly, a shared array for latency and key totals\n self.latencies = latencies\n self.keycounts = keycounts\n # random host for pseudo-load-balancing\n [hostname] = random.sample(nodes, 1)\n # open client\n self.cclient = get_client(hostname, options.port)\n self.cclient.transport.open()\n self.cclient.set_keyspace('Keyspace1')", "metadata": "root.Operation.__init__", "header": "['class', 'Operation', '(', 'Thread', ')', ':', '___EOS___']", "index": 199 }, { "content": "class Inserter(Operation):", "metadata": "root.Inserter", "header": "['module', '___EOS___']", "index": 219 }, { "content": " def run(self):\n values = generate_values()\n columns = [Column('C' + str(j), 'unset', time.time() * 1000000) for j in xrange(columns_per_key)]\n if 'super' == options.cftype:\n supers = [SuperColumn('S' + str(j), columns) for j in xrange(supers_per_key)]\n for i in self.range:\n key = fmt % i\n if 'super' == options.cftype:\n cfmap= {key: {'Super1' : [Mutation(ColumnOrSuperColumn(super_column=s)) for s in supers]}}\n else:\n cfmap = {key: {'Standard1': [Mutation(ColumnOrSuperColumn(column=c)) for c in columns]}}\n # set the correct column values for this row\n value = values[i % len(values)]\n for column in columns:\n column.value = value\n start = time.time()\n try:\n self.cclient.batch_mutate(cfmap, consistency)\n except KeyboardInterrupt:\n raise\n except Exception, e:\n if options.ignore:\n print e\n else:\n raise\n self.latencies[self.idx] += time.time() - start\n self.opcounts[self.idx] += 1\n self.keycounts[self.idx] += 1", "metadata": "root.Inserter.run", "header": "['class', 'Inserter', '(', 'Operation', ')', ':', '___EOS___']", "index": 220 }, { "content": "class Reader(Operation):", "metadata": "root.Reader", "header": "['module', '___EOS___']", "index": 250 }, { "content": " def run(self):\n p = SlicePredicate(slice_range=SliceRange('', '', False, columns_per_key))\n if 'super' == options.cftype:\n for i in xrange(keys_per_thread):\n key = key_generator()\n for j in xrange(supers_per_key):\n parent = ColumnParent('Super1', 'S' + str(j))\n start = time.time()\n try:\n r = self.cclient.get_slice(key, parent, p, consistency)\n if not r: raise RuntimeError(\"Key %s not found\" % key)\n except KeyboardInterrupt:\n raise\n except Exception, e:\n if options.ignore:\n print e\n else:\n raise\n self.latencies[self.idx] += time.time() - start\n self.opcounts[self.idx] += 1\n self.keycounts[self.idx] += 1\n else:\n parent = ColumnParent('Standard1')\n for i in xrange(keys_per_thread):\n key = key_generator()\n start = time.time()\n try:\n r = self.cclient.get_slice(key, parent, p, consistency)\n if not r: raise RuntimeError(\"Key %s not found\" % key)\n except KeyboardInterrupt:\n raise\n except Exception, e:\n if options.ignore:\n print e\n else:\n raise\n self.latencies[self.idx] += time.time() - start\n self.opcounts[self.idx] += 1\n self.keycounts[self.idx] += 1", "metadata": "root.Reader.run", "header": "['class', 'Reader', '(', 'Operation', ')', ':', '___EOS___']", "index": 251 }, { "content": "class RangeSlicer(Operation):", "metadata": "root.RangeSlicer", "header": "['module', '___EOS___']", "index": 291 }, { "content": " def run(self):\n begin = self.range[0]\n end = self.range[-1]\n current = begin\n last = current + options.rangecount\n p = SlicePredicate(slice_range=SliceRange('', '', False, columns_per_key))\n if 'super' == options.cftype:\n while current < end:\n keyrange = KeyRange(fmt % current, fmt % last, count = options.rangecount)\n res = []\n for j in xrange(supers_per_key):\n parent = ColumnParent('Super1', 'S' + str(j)) \n begin = time.time()\n try:\n res = self.cclient.get_range_slices(parent, p, keyrange, consistency)\n if not res: raise RuntimeError(\"Key %s not found\" % key)\n except KeyboardInterrupt:\n raise\n except Exception, e:\n if options.ignore:\n print e\n else:\n raise\n self.latencies[self.idx] += time.time() - begin\n self.opcounts[self.idx] += 1\n current += len(r) + 1\n last = current + len(r) + 1\n self.keycounts[self.idx] += len(r)\n else:\n parent = ColumnParent('Standard1')\n while current < end:\n start = fmt % current \n finish = fmt % last\n keyrange = KeyRange(start, finish, count = options.rangecount)\n begin = time.time()\n try:\n r = self.cclient.get_range_slices(parent, p, keyrange, consistency)\n if not r: raise RuntimeError(\"Range not found:\", start, finish)\n except KeyboardInterrupt:\n raise\n except Exception, e:\n if options.ignore:\n print e\n else:\n print start, finish\n raise\n current += len(r) + 1\n last = current + len(r) + 1\n self.latencies[self.idx] += time.time() - begin\n self.opcounts[self.idx] += 1\n self.keycounts[self.idx] += len(r)", "metadata": "root.RangeSlicer.run", "header": "['class', 'RangeSlicer', '(', 'Operation', ')', ':', '___EOS___']", "index": 292 }, { "content": "class IndexedRangeSlicer(Operation):", "metadata": "root.IndexedRangeSlicer", "header": "['module', '___EOS___']", "index": 347 }, { "content": " def run(self):\n p = SlicePredicate(slice_range=SliceRange('', '', False, columns_per_key))\n values = generate_values()\n parent = ColumnParent('Standard1')\n # the number of rows with a particular value and the number of values we should query for\n expected_per_value = total_keys // len(values)\n valuebegin = self.range[0] // expected_per_value\n valuecount = len(self.range) // expected_per_value\n for valueidx in xrange(valuebegin, valuebegin + valuecount):\n received = 0\n start = fmt % 0\n value = values[valueidx % len(values)]\n expressions = [IndexExpression(column_name='C1', op=IndexOperator.EQ, value=value)]\n while received < expected_per_value:\n clause = IndexClause(start_key=start, count=options.rangecount, expressions=expressions)\n begin = time.time()\n try:\n r = self.cclient.get_indexed_slices(parent, clause, p, consistency)\n if not r: raise RuntimeError(\"No indexed values from offset received:\", start)\n except KeyboardInterrupt:\n raise\n except Exception, e:\n if options.ignore:\n print e\n continue\n else:\n raise\n received += len(r)\n # convert max key found back to an integer, and increment it\n start = fmt % (1 + max([int(keyslice.key) for keyslice in r]))\n self.latencies[self.idx] += time.time() - begin\n self.opcounts[self.idx] += 1\n self.keycounts[self.idx] += len(r)", "metadata": "root.IndexedRangeSlicer.run", "header": "['class', 'IndexedRangeSlicer', '(', 'Operation', ')', ':', '___EOS___']", "index": 348 }, { "content": "class MultiGetter(Operation):", "metadata": "root.MultiGetter", "header": "['module', '___EOS___']", "index": 383 }, { "content": " def run(self):\n p = SlicePredicate(slice_range=SliceRange('', '', False, columns_per_key))\n offset = self.idx * keys_per_thread\n count = (((self.idx+1) * keys_per_thread) - offset) / options.rangecount\n if 'super' == options.cftype:\n for x in xrange(count):\n keys = [key_generator() for i in xrange(offset, offset + options.rangecount)]\n for j in xrange(supers_per_key):\n parent = ColumnParent('Super1', 'S' + str(j))\n start = time.time()\n try:\n r = self.cclient.multiget_slice(keys, parent, p, consistency)\n if not r: raise RuntimeError(\"Keys %s not found\" % keys)\n except KeyboardInterrupt:\n raise\n except Exception, e:\n if options.ignore:\n print e\n else:\n raise\n self.latencies[self.idx] += time.time() - start\n self.opcounts[self.idx] += 1\n self.keycounts[self.idx] += len(keys)\n offset += options.rangecount\n else:\n parent = ColumnParent('Standard1')\n for x in xrange(count):\n keys = [key_generator() for i in xrange(offset, offset + options.rangecount)]\n start = time.time()\n try:\n r = self.cclient.multiget_slice(keys, parent, p, consistency)\n if not r: raise RuntimeError(\"Keys %s not found\" % keys)\n except KeyboardInterrupt:\n raise\n except Exception, e:\n if options.ignore:\n print e\n else:\n raise\n self.latencies[self.idx] += time.time() - start\n self.opcounts[self.idx] += 1\n self.keycounts[self.idx] += len(keys)\n offset += options.rangecount", "metadata": "root.MultiGetter.run", "header": "['class', 'MultiGetter', '(', 'Operation', ')', ':', '___EOS___']", "index": 384 }, { "content": "class OperationFactory:", "metadata": "root.OperationFactory", "header": "['module', '___EOS___']", "index": 429 }, { "content": " @staticmethod\n def create(type, i, opcounts, keycounts, latencies):\n if type == 'read':\n return Reader(i, opcounts, keycounts, latencies)\n elif type == 'insert':\n return Inserter(i, opcounts, keycounts, latencies)\n elif type == 'rangeslice':\n return RangeSlicer(i, opcounts, keycounts, latencies)\n elif type == 'indexedrangeslice':\n return IndexedRangeSlicer(i, opcounts, keycounts, latencies)\n elif type == 'multiget':\n return MultiGetter(i, opcounts, keycounts, latencies)\n else:\n raise RuntimeError, 'Unsupported op!'", "metadata": "root.OperationFactory.create", "header": "['class', 'OperationFactory', ':', '___EOS___']", "index": 430 }, { "content": "class Stress(object):\n opcounts = array('i', [0] * n_threads)\n latencies = array('d', [0] * n_threads)\n keycounts = array('i', [0] * n_threads)\n\n\n\n\n \n\n", "metadata": "root.Stress", "header": "['module', '___EOS___']", "index": 446 }, { "content": " def create_threads(self,type):\n threads = []\n for i in xrange(n_threads):\n th = OperationFactory.create(type, i, self.opcounts, self.keycounts, self.latencies)\n threads.append(th)\n th.start()\n return threads", "metadata": "root.Stress.create_threads", "header": "['class', 'Stress', '(', 'object', ')', ':', '___EOS___']", "index": 451 }, { "content": " def run_test(self,filename,threads):\n start_t = time.time()\n if filename:\n outf = open(filename,'w')\n else:\n outf = sys.stdout\n outf.write('total,interval_op_rate,interval_key_rate,avg_latency,elapsed_time\\n')\n epoch = total = old_total = latency = keycount = old_keycount = old_latency = 0\n epoch_intervals = (options.interval * 10) # 1 epoch = 1 tenth of a second\n terminate = False\n while not terminate:\n time.sleep(0.1)\n if not [th for th in threads if th.isAlive()]:\n terminate = True\n epoch = epoch + 1\n if terminate or epoch > epoch_intervals:\n epoch = 0\n old_total, old_latency, old_keycount = total, latency, keycount\n total = sum(self.opcounts[th.idx] for th in threads)\n latency = sum(self.latencies[th.idx] for th in threads)\n keycount = sum(self.keycounts[th.idx] for th in threads)\n opdelta = total - old_total\n keydelta = keycount - old_keycount\n delta_latency = latency - old_latency\n if opdelta > 0:\n delta_formatted = (delta_latency / opdelta)\n else:\n delta_formatted = 'NaN'\n elapsed_t = int(time.time() - start_t)\n outf.write('%d,%d,%d,%s,%d\\n' \n % (total, opdelta / options.interval, keydelta / options.interval, delta_formatted, elapsed_t))", "metadata": "root.Stress.run_test", "header": "['class', 'Stress', '(', 'object', ')', ':', '___EOS___']", "index": 459 }, { "content": " def insert(self):\n threads = self.create_threads('insert')\n self.run_test(options.file,threads);", "metadata": "root.Stress.insert", "header": "['class', 'Stress', '(', 'object', ')', ':', '___EOS___']", "index": 491 }, { "content": " def read(self):\n threads = self.create_threads('read')\n self.run_test(options.file,threads);", "metadata": "root.Stress.read", "header": "['class', 'Stress', '(', 'object', ')', ':', '___EOS___']", "index": 495 }, { "content": " def rangeslice(self):\n threads = self.create_threads('rangeslice')\n self.run_test(options.file,threads);", "metadata": "root.Stress.rangeslice", "header": "['class', 'Stress', '(', 'object', ')', ':', '___EOS___']", "index": 499 }, { "content": " def indexedrangeslice(self):\n threads = self.create_threads('indexedrangeslice')\n self.run_test(options.file,threads);", "metadata": "root.Stress.indexedrangeslice", "header": "['class', 'Stress', '(', 'object', ')', ':', '___EOS___']", "index": 503 }, { "content": " def multiget(self):\n threads = self.create_threads('multiget')\n self.run_test(options.file,threads);", "metadata": "root.Stress.multiget", "header": "['class', 'Stress', '(', 'object', ')', ':', '___EOS___']", "index": 507 } ]
[ { "span": "from uuid import uuid1 as get_ident", "start_line": 25, "start_column": 4, "end_line": 25, "end_column": 39 }, { "span": "from thread import get_ident", "start_line": 31, "start_column": 4, "end_line": 31, "end_column": 32 }, { "span": "from thrift.transport import THttpClient", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 40 }, { "span": "from thrift.protocol import fastbinary", "start_line": 59, "start_column": 4, "end_line": 59, "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_", "#", " ", "License", "d", " ", "to", " ", "the", " ", "Ap", "ache", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", " ", "(", "AS", "F", ")", " ", "under", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "more", " ", "contributor", " ", "license", " ", "agreement", "s", ".", " ", " ", "See", " ", "the", " ", "NOTICE", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "with", " ", "this", " ", "work", " ", "for", " ", "addition", "al", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regarding", " ", "copyr", "ight", " ", "owner", "ship", ".", " ", " ", "The", " ", "AS", "F", " ", "license", "s", " ", "this", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "you", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "License", "\");", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "ance_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "the", " ", "License", ".", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "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_", "#", " ", "expect", "s", " ", "a", " ", "Cass", "andra", " ", "server", " ", "to", " ", "be", " ", "runn", "ing", " ", "and", " ", "listen", "ing", " ", "on", " ", "port", " ", "916", "0._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "read", " ", "tests", " ", "expect", " ", "insert", " ", "tests", " ", "to", " ", "have", " ", "run", " ", "first", " ", "too", ".)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "with", "\\u", "statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "have", "\\u", "multipro", "c_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "multiprocessing_", "import_", "Array_", "as_", "array_", ",_", "Process_", "as_", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "uuid_", "import_", "uuid1_", "as_", "get", "\\u", "ident_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "(_", "'", "i", "'_", ",_", "1_", ")_", "#", " ", "catch", " ", "\"", "Thi", "s", " ", "platform", " ", "lack", "s", " ", "a", " ", "function", "ing", " ", "sem", "\\u", "open", " ", "implementation", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Thread_", "._", "is", "Alive_", "=_", "Thread_", "._", "is", "\\u", "alive_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "have", "\\u", "multipro", "c_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "threading_", "import_", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thread_", "import_", "get", "\\u", "ident_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "array_", "import_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "hashlib_", "import_", "md5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", ",_", "random_", ",_", "sys_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "random_", "import_", "randint_", ",_", "gauss_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "optparse_", "import_", "Optio", "n", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "thrift", "_", "._", "transport_", "import_", "TT", "rans", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "_", "._", "transport_", "import_", "TS", "ocket", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "_", "._", "transport_", "import_", "TH", "ttp", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "_", "._", "protocol_", "import_", "TB", "inary", "Protocol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "thrift", "\\u", "cass", "_", "import_", "Cass", "andra", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "\\u", "cass", "_", "._", "ttype", "s_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "cass", "andra", " ", "director", "y", " ", "to", " ", "sys", ".", "path_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", "._", "split_", "(_", "os_", "._", "path_", "._", "sep_", ")_", "[_", ":_", "-_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "os_", "._", "path_", "._", "sep_", "._", "join_", "(_", "L_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "ipat", "h_", "=_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "'", "interface", "'_", ",_", "'", "thrift", "'_", ",_", "'", "gen", "-", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\\u", "ipat", "h_", ",_", "'", "cass", "andra", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Cass", "andra", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ttype", "s_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Cass", "andra", " ", "thrift", " ", "bindi", "ngs", " ", "not", " ", "found", ",", " ", "plea", "se", " ", "run", " ", "'", "ant", " ", "gen", "-", "thrift", "-", "py", "'\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "thrift", "_", "._", "protocol_", "import_", "fastbinary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "WARN", "ING", ":", " ", "thrift", " ", "binar", "y", " ", "extensi", "on", " ", "not", " ", "found", ",", " ", "bench", "mark", " ", "will", " ", "not", " ", "be", " ", "accurate", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser_", "=_", "Optio", "n", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "n", "'_", ",_", "'--", "num", "-", "keys", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "num", "keys", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Number", " ", "of", " ", "keys", "\"_", ",_", "default_", "=_", "1000_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "N", "'_", ",_", "'--", "skip", "-", "keys", "'_", ",_", "type_", "=_", "\"", "float", "\"_", ",_", "dest_", "=_", "\"", "skip", "keys", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Frac", "tion", " ", "of", " ", "keys", " ", "to", " ", "skip", " ", "initially", "\"_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "t", "'_", ",_", "'--", "thread", "s", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "thread", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Number", " ", "of", " ", "thread", "s", "/", "proc", "s", " ", "to", " ", "use", "\"_", ",_", "default_", "=_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "c", "'_", ",_", "'--", "column", "s", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "column", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Number", " ", "of", " ", "column", "s", " ", "per", " ", "key", "\"_", ",_", "default_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "S", "'_", ",_", "'--", "column", "-", "size", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "column", "\\u", "size", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Size", " ", "of", " ", "column", " ", "values", " ", "in", " ", "bytes", "\"_", ",_", "default_", "=_", "34_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "C", "'_", ",_", "'--", "cardinalit", "y", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "cardinalit", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Number", " ", "of", " ", "unique", " ", "values", " ", "store", "d", " ", "in", " ", "column", "s", "\"_", ",_", "default_", "=_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "d", "'_", ",_", "'--", "nodes", "'_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "dest_", "=_", "\"", "nodes", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Host", " ", "nodes", " ", "(", "comma", " ", "separate", "d", ")\"_", ",_", "default_", "=_", "\"", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "D", "'_", ",_", "'--", "node", "file", "'_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "dest_", "=_", "\"", "node", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "File", " ", "contain", "ing", " ", "list", " ", "of", " ", "nodes", " ", "(", "one", " ", "per", " ", "line", ")\"_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "s", "'_", ",_", "'--", "stdev", "'_", ",_", "type_", "=_", "\"", "float", "\"_", ",_", "dest_", "=_", "\"", "stdev", "\"_", ",_", "default_", "=_", "0.1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "standard", " ", "deviation", " ", "factor", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "r", "'_", ",_", "'--", "random", "'_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "random", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "use", " ", "random", " ", "key", " ", "generat", "or", " ", "(", "stdev", " ", "will", " ", "have", " ", "no", " ", "effect", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "f", "'_", ",_", "'--", "file", "'_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "dest_", "=_", "\"", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "write", " ", "output", " ", "to", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "p", "'_", ",_", "'--", "port", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "default_", "=_", "916", "0_", ",_", "dest_", "=_", "\"", "port", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "thrift", " ", "port", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "m", "'_", ",_", "'--", "unf", "rame", "d", "'_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "unf", "rame", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "use", " ", "unf", "rame", "d", " ", "transport", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "o", "'_", ",_", "'--", "operati", "on", "'_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "dest_", "=_", "\"", "operati", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "\"", "insert", "\"_", ",_", "choices_", "=_", "(_", "'", "insert", "'_", ",_", "'", "read", "'_", ",_", "'", "ranges", "lice", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "indexe", "dra", "nge", "slice", "'_", ",_", "'", "multi", "get", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "operati", "on", " ", "to", " ", "perform", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "u", "'_", ",_", "'--", "superc", "olu", "mn", "s", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "supers", "\"_", ",_", "default_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "number", " ", "of", " ", "super", " ", "column", "s", " ", "per", " ", "key", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "y", "'_", ",_", "'--", "famil", "y", "-", "type", "'_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "dest_", "=_", "\"", "cf", "type", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "(_", "'", "regular", "'_", ",_", "'", "super", "'_", ")_", ",_", "default_", "=_", "'", "regular", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "column", " ", "famil", "y", " ", "type", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "k", "'_", ",_", "'--", "keep", "-", "goi", "ng", "'_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "ignore", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "ignore", " ", "error", "s", " ", "insert", "ing", " ", "or", " ", "readi", "ng", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "i", "'_", ",_", "'--", "progress", "-", "interval", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "default_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dest_", "=_", "\"", "interval", "\"_", ",_", "help_", "=_", "\"", "progress", " ", "report", " ", "interval", " ", "(", "second", "s", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "g", "'_", ",_", "'--", "keys", "-", "per", "-", "call", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "default_", "=_", "1000_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dest_", "=_", "\"", "range", "count", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "amo", "unt", " ", "of", " ", "keys", " ", "to", " ", "get", "\\u", "range", "\\u", "slice", "s", " ", "or", " ", "multi", "get", " ", "per", " ", "call", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "l", "'_", ",_", "'--", "replication", "-", "factor", "'_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "default_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dest_", "=_", "\"", "replication", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "replication", " ", "factor", " ", "to", " ", "use", " ", "whe", "n", " ", "creati", "ng", " ", "need", "ed", " ", "column", " ", "families", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "e", "'_", ",_", "'--", "consiste", "nc", "y", "-", "level", "'_", ",_", "type_", "=_", "\"", "str", "\"_", ",_", "default_", "=_", "'", "ONE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dest_", "=_", "\"", "consiste", "nc", "y", "\"_", ",_", "help_", "=_", "\"", "consiste", "nc", "y", " ", "level", " ", "to", " ", "use", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "x", "'_", ",_", "'--", "create", "-", "index", "'_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "(_", "'", "keys", "'_", ",_", "'", "keys", "\\u", "bitmap", "'_", ",_", "'", "none", "'_", ")_", ",_", "default_", "=_", "'", "none", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dest_", "=_", "\"", "index", "\"_", ",_", "help_", "=_", "\"", "type", " ", "of", " ", "index", " ", "to", " ", "create", " ", "on", " ", "need", "ed", " ", "column", " ", "families", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "options_", ",_", "args_", ")_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "total", "\\u", "keys_", "=_", "options_", "._", "num", "keys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "threads_", "=_", "options_", "._", "threads_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys", "\\u", "per", "\\u", "thread_", "=_", "total", "\\u", "keys_", "/_", "n", "\\u", "threads_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column", "s", "\\u", "per", "\\u", "key_", "=_", "options_", "._", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "supers", "\\u", "per", "\\u", "key_", "=_", "options_", "._", "supers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "allow", "s", " ", "client", " ", "to", " ", "round", " ", "robi", "n", " ", "request", "s", " ", "direct", "ly", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simple", " ", "request", " ", "load", "-", "balancing", "_", "\\u\\u\\uNL\\u\\u\\u_", "nodes_", "=_", "options_", "._", "nodes_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "node", "file_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "options_", "._", "node", "file_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nodes_", "=_", "[_", "n_", "._", "strip_", "(_", ")_", "for_", "n_", "in_", "f_", "._", "readlines_", "(_", ")_", "if_", "len_", "(_", "n_", "._", "strip_", "(_", ")_", ")_", ">_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "format", " ", "string", " ", "for", " ", "keys_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fmt_", "=_", "'%", "0", "'_", "+_", "str_", "(_", "len_", "(_", "str_", "(_", "total", "\\u", "keys_", ")_", ")_", ")_", "+_", "'", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "generat", "or", " ", "tha", "t", " ", "generat", "es", " ", "all", " ", "keys", " ", "according", " ", "to", " ", "a", " ", "bell", " ", "curve", " ", "centered", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "aro", "und", " ", "the", " ", "middle", " ", "of", " ", "the", " ", "keys", " ", "generat", "ed", " ", "(", "0.", ".", "total", "\\u", "keys", ").", " ", " ", "Reme", "mber", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "abo", "ut", " ", "6", "8", "%", " ", "of", " ", "keys", " ", "will", " ", "be", " ", "within", " ", "stdev", " ", "awa", "y", " ", "from", " ", "the", " ", "mean", " ", "and", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "abo", "ut", " ", "9", "5", "%", " ", "within", " ", "2", "*", "stdev", "._", "\\u\\u\\uNL\\u\\u\\u_", "stdev_", "=_", "total", "\\u", "keys_", "*_", "options_", "._", "stdev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean_", "=_", "total", "\\u", "keys_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "consiste", "ncy_", "=_", "getattr_", "(_", "Cons", "iste", "nc", "y", "Level_", ",_", "options_", "._", "consiste", "ncy_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "consiste", "ncy_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"%", "s", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "consiste", "nc", "y", " ", "level", "\"_", "%_", "options_", "._", "consiste", "ncy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "es", " ", "a", " ", "list", " ", "of", " ", "unique", ",", " ", "deterministic", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "generat", "or", " ", "tha", "t", " ", "will", " ", "generat", "e", " ", "all", " ", "keys", " ", "w", "/", " ", "equal", " ", "probabilit", "y", ".", " ", " ", "this", " ", "is", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "worst", " ", "case", " ", "for", " ", "caching", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "key", "\\u", "generator_", "=_", "key", "\\u", "generat", "or", "\\u", "gauss_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "random_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "generator_", "=_", "key", "\\u", "generat", "or", "\\u", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ea", "ch", " ", "thread", " ", "querie", "s", " ", "for", " ", "a", " ", "porti", "on", " ", "of", " ", "the", " ", "unique", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "all", " ", "thread", "s", " ", "start", " ", "at", " ", "the", " ", "same", " ", "key", ":", " ", "implement", " ", "wrapp", "ing", ",", " ", "and", " ", "start_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "the", " ", "thread", "'", "s", " ", "app", "oint", "ed", " ", "range_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "stress", "er_", "=_", "Stre", "ss_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "benchmark_", "=_", "getattr_", "(_", "stress", "er_", ",_", "options_", "._", "operation_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "have", "\\u", "multipro", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\"\"", "WARN", "ING", ":", " ", "multipro", "cess", "ing", " ", "not", " ", "presen", "t", ",", " ", "thread", "ing", " ", "will", " ", "be", " ", "used", ".", "\\", "10", ";", " ", " ", " ", " ", "Benchmark", " ", "may", " ", "not", " ", "be", " ", "accurate", "!\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "operation_", "==_", "'", "insert", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "make", "\\u", "keyspace", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "benchmark_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "options_", "._", "cardinality_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "md5_", "(_", "str_", "(_", "i_", ")_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "._", "append_", "(_", "h_", "*_", "int_", "(_", "options_", "._", "column", "\\u", "size_", "/_", "len_", "(_", "h_", ")_", ")_", "+_", "h_", "[_", ":_", "options_", "._", "column", "\\u", "size_", "%_", "len_", "(_", "h_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "values_", "\\u\\u\\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_", "key", "\\u", "generat", "or", "\\u", "gauss_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "guess_", "=_", "gauss_", "(_", "mean_", ",_", "stdev_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", "<=_", "guess_", "<_", "total", "\\u", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fmt_", "%_", "int_", "(_", "guess_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "key", "\\u", "generat", "or", "\\u", "random_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fmt_", "%_", "randint_", "(_", "0_", ",_", "total", "\\u", "keys_", "-_", "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_", "get", "\\u", "client_", "(_", "host_", "=_", "'", "127", ".0", ".0", ".1", "'_", ",_", "port_", "=_", "916", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "socket_", "=_", "TS", "ocket", "_", "._", "TS", "ocket", "_", "(_", "host_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "unf", "rame", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transport_", "=_", "TT", "rans", "port_", "._", "TB", "uffe", "red", "Transport_", "(_", "socket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transport_", "=_", "TT", "rans", "port_", "._", "TF", "rame", "d", "Transport_", "(_", "socket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "protocol_", "=_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "(_", "transport_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "Cass", "andra", "_", "._", "Client_", "(_", "protocol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "transport_", "=_", "transport_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "keyspace", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "ms_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "index_", "==_", "'", "keys", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "ms_", "=_", "[_", "Colum", "n", "Def_", "(_", "name_", "=_", "'", "C1", "'_", ",_", "validation", "\\u", "class_", "=_", "'", "UT", "F8", "Type", "'_", ",_", "index", "\\u", "type_", "=_", "Index", "Type_", "._", "KEYS_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "index_", "==_", "'", "keys", "\\u", "bitmap", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "ms_", "=_", "[_", "Colum", "n", "Def_", "(_", "name_", "=_", "'", "C1", "'_", ",_", "validation", "\\u", "class_", "=_", "'", "UT", "F8", "Type", "'_", ",_", "index", "\\u", "type_", "=_", "Index", "Type_", "._", "KEYS", "\\u", "BITMAP", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cfa", "ms_", "=_", "[_", "Cf", "Def_", "(_", "keyspace_", "=_", "'", "Keys", "pace", "1", "'_", ",_", "name_", "=_", "'", "Standard", "1", "'_", ",_", "column", "\\u", "metadata_", "=_", "col", "ms_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Cf", "Def_", "(_", "keyspace_", "=_", "'", "Keys", "pace", "1", "'_", ",_", "name_", "=_", "'", "Super", "1", "'_", ",_", "column", "\\u", "type_", "=_", "'", "Super", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyspace_", "=_", "Ks", "Def_", "(_", "name_", "=_", "'", "Keys", "pace", "1", "'_", ",_", "strat", "eg", "y", "\\u", "class_", "=_", "'", "org", ".", "apa", "che", ".", "cass", "andra", ".", "locator", ".", "Simple", "Strat", "eg", "y", "'_", ",_", "replication", "\\u", "factor_", "=_", "options_", "._", "replication", "_", ",_", "cf", "\\u", "defs_", "=_", "cfa", "ms_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "get", "\\u", "client_", "(_", "nodes_", "[_", "0_", "]_", ",_", "options_", "._", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "transport_", "._", "open_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "system", "\\u", "add", "\\u", "keyspace_", "(_", "keyspace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Creat", "ed", " ", "keyspace", "s", ".", " ", " ", "Sleep", "ing", " ", "%", "ss", " ", "for", " ", "propagat", "ion", ".\"_", "%_", "len_", "(_", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "len_", "(_", "nodes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Request", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "why_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "client_", "._", "transport_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Operation_", "(_", "Thread_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Operation_", "(_", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "i_", ",_", "opc", "ount", "s_", ",_", "keyc", "ount", "s_", ",_", "latenc", "ies_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Thread_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "generat", "or", " ", "of", " ", "the", " ", "keys", " ", "to", " ", "be", " ", "used_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "range_", "=_", "xrange_", "(_", "int_", "(_", "keys", "\\u", "per", "\\u", "thread_", "*_", "(_", "i_", "+_", "options_", "._", "skip", "keys_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keys", "\\u", "per", "\\u", "thread_", "*_", "(_", "i_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "can", "'", "t", " ", "use", " ", "a", " ", "local", " ", "counter", ",", " ", "sinc", "e", " ", "tha", "t", " ", "won", "'", "t", " ", "be", " ", "visi", "ble", " ", "to", " ", "the", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "under", " ", "multipro", "cess", "ing", ".", " ", " ", "inst", "ead", ",", " ", "the", " ", "parent", " ", "pass", "es", " ", "a", " ", "\"", "opc", "ount", "s", "\"", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "an", " ", "index", " ", "tha", "t", " ", "is", " ", "our", " ", "assign", "ed", " ", "counter", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "idx_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "=_", "opc", "ount", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "similar", "ly", ",", " ", "a", " ", "shared", " ", "array", " ", "for", " ", "latenc", "y", " ", "and", " ", "key", " ", "totals_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "latenc", "ies_", "=_", "latenc", "ies_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "=_", "keyc", "ount", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "random", " ", "host", " ", "for", " ", "pseudo", "-", "load", "-", "balancing", "_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "hostname_", "]_", "=_", "random_", "._", "sample_", "(_", "nodes_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "open", " ", "client_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ccl", "ient_", "=_", "get", "\\u", "client_", "(_", "hostname_", ",_", "options_", "._", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ccl", "ient_", "._", "transport_", "._", "open_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ccl", "ient_", "._", "set\\u", "keyspace_", "(_", "'", "Keys", "pace", "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_", "Insert", "er_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Insert", "er_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "generat", "e\\u", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "columns_", "=_", "[_", "Column_", "(_", "'", "C", "'_", "+_", "str_", "(_", "j_", ")_", ",_", "'", "unse", "t", "'_", ",_", "time_", "._", "time_", "(_", ")_", "*_", "1000000_", ")_", "for_", "j_", "in_", "xrange_", "(_", "column", "s", "\\u", "per", "\\u", "key_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "super", "'_", "==_", "options_", "._", "cf", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "supers", "_", "=_", "[_", "Super", "Column_", "(_", "'", "S", "'_", "+_", "str_", "(_", "j_", ")_", ",_", "columns_", ")_", "for_", "j_", "in_", "xrange_", "(_", "supers", "\\u", "per", "\\u", "key_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "fmt_", "%_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "super", "'_", "==_", "options_", "._", "cf", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cfm", "ap_", "=_", "{_", "key_", ":_", "{_", "'", "Super", "1", "'_", ":_", "[_", "Mutation", "_", "(_", "Colum", "n", "Or", "Super", "Column_", "(_", "super", "\\u", "column_", "=_", "s_", ")_", ")_", "for_", "s_", "in_", "supers", "_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cfm", "ap_", "=_", "{_", "key_", ":_", "{_", "'", "Standard", "1", "'_", ":_", "[_", "Mutation", "_", "(_", "Colum", "n", "Or", "Super", "Column_", "(_", "column_", "=_", "c_", ")_", ")_", "for_", "c_", "in_", "columns_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "the", " ", "correct", " ", "column", " ", "values", " ", "for", " ", "this", " ", "row_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value_", "=_", "values_", "[_", "i_", "%_", "len_", "(_", "values_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "column_", "in_", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "column_", "._", "value_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ccl", "ient_", "._", "batch", "\\u", "mutate_", "(_", "cfm", "ap_", ",_", "consiste", "ncy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\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 ", " _", "if_", "options_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "latenc", "ies_", "[_", "self_", "._", "idx_", "]_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "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_", "Reader_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reader_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "Slice", "Predicate_", "(_", "slice", "\\u", "range_", "=_", "Slice", "Range_", "(_", "''_", ",_", "''_", ",_", "False_", ",_", "column", "s", "\\u", "per", "\\u", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "super", "'_", "==_", "options_", "._", "cf", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "xrange_", "(_", "keys", "\\u", "per", "\\u", "thread_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "key", "\\u", "generator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "xrange_", "(_", "supers", "\\u", "per", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parent_", "=_", "Colum", "n", "Parent_", "(_", "'", "Super", "1", "'_", ",_", "'", "S", "'_", "+_", "str_", "(_", "j_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "r_", "=_", "self_", "._", "ccl", "ient_", "._", "get", "\\u", "slice_", "(_", "key_", ",_", "parent_", ",_", "p_", ",_", "consiste", "ncy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "r_", ":_", "raise_", "Run", "time", "Error_", "(_", "\"", "Key", " ", "%", "s", " ", "not", " ", "found", "\"_", "%_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\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 ", " ", " _", "if_", "options_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "latenc", "ies_", "[_", "self_", "._", "idx_", "]_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parent_", "=_", "Colum", "n", "Parent_", "(_", "'", "Standard", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "keys", "\\u", "per", "\\u", "thread_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "key", "\\u", "generator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "=_", "self_", "._", "ccl", "ient_", "._", "get", "\\u", "slice_", "(_", "key_", ",_", "parent_", ",_", "p_", ",_", "consiste", "ncy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "r_", ":_", "raise_", "Run", "time", "Error_", "(_", "\"", "Key", " ", "%", "s", " ", "not", " ", "found", "\"_", "%_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\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 ", " ", "_", "if_", "options_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "latenc", "ies_", "[_", "self_", "._", "idx_", "]_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Range", "Slice", "r_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Range", "Slice", "r_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "begin_", "=_", "self_", "._", "range_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "self_", "._", "range_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current_", "=_", "begin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last_", "=_", "current_", "+_", "options_", "._", "range", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Slice", "Predicate_", "(_", "slice", "\\u", "range_", "=_", "Slice", "Range_", "(_", "''_", ",_", "''_", ",_", "False_", ",_", "column", "s", "\\u", "per", "\\u", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "super", "'_", "==_", "options_", "._", "cf", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "current_", "<_", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "range_", "=_", "Key", "Range_", "(_", "fmt_", "%_", "current_", ",_", "fmt_", "%_", "last_", ",_", "count_", "=_", "options_", "._", "range", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "xrange_", "(_", "supers", "\\u", "per", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parent_", "=_", "Colum", "n", "Parent_", "(_", "'", "Super", "1", "'_", ",_", "'", "S", "'_", "+_", "str_", "(_", "j_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "begin_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "res_", "=_", "self_", "._", "ccl", "ient_", "._", "get", "\\u", "range", "\\u", "slices_", "(_", "parent_", ",_", "p_", ",_", "key", "range_", ",_", "consiste", "ncy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "res_", ":_", "raise_", "Run", "time", "Error_", "(_", "\"", "Key", " ", "%", "s", " ", "not", " ", "found", "\"_", "%_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\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 ", " ", " _", "if_", "options_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "latenc", "ies_", "[_", "self_", "._", "idx_", "]_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "begin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "current_", "+=_", "len_", "(_", "r_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last_", "=_", "current_", "+_", "len_", "(_", "r_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "len_", "(_", "r_", ")_", "\\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 ", " _", "parent_", "=_", "Colum", "n", "Parent_", "(_", "'", "Standard", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "current_", "<_", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "fmt_", "%_", "current_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finish_", "=_", "fmt_", "%_", "last_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "range_", "=_", "Key", "Range_", "(_", "start_", ",_", "finish_", ",_", "count_", "=_", "options_", "._", "range", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "begin_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "=_", "self_", "._", "ccl", "ient_", "._", "get", "\\u", "range", "\\u", "slices_", "(_", "parent_", ",_", "p_", ",_", "key", "range_", ",_", "consiste", "ncy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "r_", ":_", "raise_", "Run", "time", "Error_", "(_", "\"", "Range", " ", "not", " ", "found", ":\"_", ",_", "start_", ",_", "finish_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\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 ", " ", "_", "if_", "options_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "start_", ",_", "finish_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "current_", "+=_", "len_", "(_", "r_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last_", "=_", "current_", "+_", "len_", "(_", "r_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "latenc", "ies_", "[_", "self_", "._", "idx_", "]_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "begin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "len_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Indexe", "d", "Range", "Slice", "r_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Indexe", "d", "Range", "Slice", "r_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "Slice", "Predicate_", "(_", "slice", "\\u", "range_", "=_", "Slice", "Range_", "(_", "''_", ",_", "''_", ",_", "False_", ",_", "column", "s", "\\u", "per", "\\u", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "generat", "e\\u", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "Colum", "n", "Parent_", "(_", "'", "Standard", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "number", " ", "of", " ", "rows", " ", "with", " ", "a", " ", "partic", "ular", " ", "value", " ", "and", " ", "the", " ", "number", " ", "of", " ", "values", " ", "we", " ", "shou", "ld", " ", "query", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "per", "\\u", "value_", "=_", "total", "\\u", "keys_", "//_", "len_", "(_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "begin_", "=_", "self_", "._", "range_", "[_", "0_", "]_", "//_", "expected", "\\u", "per", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "count_", "=_", "len_", "(_", "self_", "._", "range_", ")_", "//_", "expected", "\\u", "per", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "value", "idx_", "in_", "xrange_", "(_", "value", "begin_", ",_", "value", "begin_", "+_", "value", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "received_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "fmt_", "%_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "values_", "[_", "value", "idx_", "%_", "len_", "(_", "values_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expressions_", "=_", "[_", "Index", "Expression_", "(_", "column", "\\u", "name_", "=_", "'", "C1", "'_", ",_", "op_", "=_", "Index", "Operator_", "._", "EQ_", ",_", "value_", "=_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "received_", "<_", "expected", "\\u", "per", "\\u", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clause_", "=_", "Index", "Clause_", "(_", "start", "\\u", "key_", "=_", "start_", ",_", "count_", "=_", "options_", "._", "range", "count_", ",_", "expressions_", "=_", "expressions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "begin_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "=_", "self_", "._", "ccl", "ient_", "._", "get", "\\u", "indexe", "d\\u", "slices_", "(_", "parent_", ",_", "clause_", ",_", "p_", ",_", "consiste", "ncy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "r_", ":_", "raise_", "Run", "time", "Error_", "(_", "\"", "No", " ", "indexe", "d", " ", "values", " ", "from", " ", "offset", " ", "receive", "d", ":\"_", ",_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\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 ", " ", "_", "if_", "options_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "received_", "+=_", "len_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "convert", " ", "max", " ", "key", " ", "found", " ", "back", " ", "to", " ", "an", " ", "integ", "er", ",", " ", "and", " ", "increment", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "=_", "fmt_", "%_", "(_", "1_", "+_", "max_", "(_", "[_", "int_", "(_", "keys", "lice", "_", "._", "key_", ")_", "for_", "keys", "lice", "_", "in_", "r_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "latenc", "ies_", "[_", "self_", "._", "idx_", "]_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "begin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "len_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Multi", "Getter", "_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Multi", "Getter", "_", "(_", "Operation_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "Slice", "Predicate_", "(_", "slice", "\\u", "range_", "=_", "Slice", "Range_", "(_", "''_", ",_", "''_", ",_", "False_", ",_", "column", "s", "\\u", "per", "\\u", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "self_", "._", "idx_", "*_", "keys", "\\u", "per", "\\u", "thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "(_", "(_", "(_", "self_", "._", "idx_", "+_", "1_", ")_", "*_", "keys", "\\u", "per", "\\u", "thread_", ")_", "-_", "offset_", ")_", "/_", "options_", "._", "range", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "super", "'_", "==_", "options_", "._", "cf", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "xrange_", "(_", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "[_", "key", "\\u", "generator_", "(_", ")_", "for_", "i_", "in_", "xrange_", "(_", "offset_", ",_", "offset_", "+_", "options_", "._", "range", "count_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "xrange_", "(_", "supers", "\\u", "per", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parent_", "=_", "Colum", "n", "Parent_", "(_", "'", "Super", "1", "'_", ",_", "'", "S", "'_", "+_", "str_", "(_", "j_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "r_", "=_", "self_", "._", "ccl", "ient_", "._", "multi", "get", "\\u", "slice_", "(_", "keys_", ",_", "parent_", ",_", "p_", ",_", "consiste", "ncy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "r_", ":_", "raise_", "Run", "time", "Error_", "(_", "\"", "Keys", " ", "%", "s", " ", "not", " ", "found", "\"_", "%_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\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 ", " ", " _", "if_", "options_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "latenc", "ies_", "[_", "self_", "._", "idx_", "]_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "len_", "(_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "+=_", "options_", "._", "range", "count_", "\\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 ", " _", "parent_", "=_", "Colum", "n", "Parent_", "(_", "'", "Standard", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "[_", "key", "\\u", "generator_", "(_", ")_", "for_", "i_", "in_", "xrange_", "(_", "offset_", ",_", "offset_", "+_", "options_", "._", "range", "count_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "=_", "self_", "._", "ccl", "ient_", "._", "multi", "get", "\\u", "slice_", "(_", "keys_", ",_", "parent_", ",_", "p_", ",_", "consiste", "ncy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "r_", ":_", "raise_", "Run", "time", "Error_", "(_", "\"", "Keys", " ", "%", "s", " ", "not", " ", "found", "\"_", "%_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\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 ", " ", "_", "if_", "options_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "latenc", "ies_", "[_", "self_", "._", "idx_", "]_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyc", "ount", "s_", "[_", "self_", "._", "idx_", "]_", "+=_", "len_", "(_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "+=_", "options_", "._", "range", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Opera", "tion", "Factory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opera", "tion", "Factory_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create_", "(_", "type_", ",_", "i_", ",_", "opc", "ount", "s_", ",_", "keyc", "ount", "s_", ",_", "latenc", "ies_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "==_", "'", "read", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Reader_", "(_", "i_", ",_", "opc", "ount", "s_", ",_", "keyc", "ount", "s_", ",_", "latenc", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "'", "insert", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Insert", "er_", "(_", "i_", ",_", "opc", "ount", "s_", ",_", "keyc", "ount", "s_", ",_", "latenc", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "'", "ranges", "lice", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Range", "Slice", "r_", "(_", "i_", ",_", "opc", "ount", "s_", ",_", "keyc", "ount", "s_", ",_", "latenc", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "'", "indexe", "dra", "nge", "slice", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Indexe", "d", "Range", "Slice", "r_", "(_", "i_", ",_", "opc", "ount", "s_", ",_", "keyc", "ount", "s_", ",_", "latenc", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "'", "multi", "get", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Multi", "Getter", "_", "(_", "i_", ",_", "opc", "ount", "s_", ",_", "keyc", "ount", "s_", ",_", "latenc", "ies_", ")_", "\\u\\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_", "Run", "time", "Error_", ",_", "'", "Unsu", "ppo", "rted", " ", "op", "!'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Stre", "ss_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opc", "ount", "s_", "=_", "array_", "(_", "'", "i", "'_", ",_", "[_", "0_", "]_", "*_", "n", "\\u", "threads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "latenc", "ies_", "=_", "array_", "(_", "'", "d", "'_", ",_", "[_", "0_", "]_", "*_", "n", "\\u", "threads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyc", "ount", "s_", "=_", "array_", "(_", "'", "i", "'_", ",_", "[_", "0_", "]_", "*_", "n", "\\u", "threads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Stre", "ss_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create", "\\u", "threads_", "(_", "self_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "threads_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "n", "\\u", "threads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "th_", "=_", "Opera", "tion", "Factory_", "._", "create_", "(_", "type_", ",_", "i_", ",_", "self_", "._", "opc", "ount", "s_", ",_", "self_", "._", "keyc", "ount", "s_", ",_", "self_", "._", "latenc", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threads_", "._", "append_", "(_", "th_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "th_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "threads_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stre", "ss_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "test_", "(_", "self_", ",_", "filename_", ",_", "threads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "t_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filename_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outf_", "=_", "open_", "(_", "filename_", ",_", "'", "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_", "=_", "sys_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "outf_", "._", "write_", "(_", "'", "total", ",", "interval", "\\u", "op", "\\u", "rate", ",", "interval", "\\u", "key", "\\u", "rate", ",", "avg", "\\u", "latenc", "y", ",", "ela", "pse", "d\\u", "time", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "epoch_", "=_", "total_", "=_", "old", "\\u", "total_", "=_", "latency_", "=_", "keyc", "ount_", "=_", "old", "\\u", "keyc", "ount_", "=_", "old", "\\u", "latency_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "epoch", "\\u", "intervals_", "=_", "(_", "options_", "._", "interval_", "*_", "10_", ")_", "#", " ", "1", " ", "epoch", " ", "=", " ", "1", " ", "tent", "h", " ", "of", " ", "a", " ", "second_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "terminate_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "terminate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "[_", "th_", "for_", "th_", "in_", "threads_", "if_", "th_", "._", "is", "Alive_", "(_", ")_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "terminate_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "epoch_", "=_", "epoch_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "terminate_", "or_", "epoch_", ">_", "epoch", "\\u", "intervals_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "epoch_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "total_", ",_", "old", "\\u", "latency_", ",_", "old", "\\u", "keyc", "ount_", "=_", "total_", ",_", "latency_", ",_", "keyc", "ount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "sum_", "(_", "self_", "._", "opc", "ount", "s_", "[_", "th_", "._", "idx_", "]_", "for_", "th_", "in_", "threads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "latency_", "=_", "sum_", "(_", "self_", "._", "latenc", "ies_", "[_", "th_", "._", "idx_", "]_", "for_", "th_", "in_", "threads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyc", "ount_", "=_", "sum_", "(_", "self_", "._", "keyc", "ount", "s_", "[_", "th_", "._", "idx_", "]_", "for_", "th_", "in_", "threads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op", "delta_", "=_", "total_", "-_", "old", "\\u", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyd", "elt", "a_", "=_", "keyc", "ount_", "-_", "old", "\\u", "keyc", "ount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta", "\\u", "latency_", "=_", "latency_", "-_", "old", "\\u", "latency_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "op", "delta_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "delta", "\\u", "formatted_", "=_", "(_", "delta", "\\u", "latency_", "/_", "op", "delta_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "delta", "\\u", "formatted_", "=_", "'", "Na", "N", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ela", "pse", "d\\u", "t_", "=_", "int_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "start", "\\u", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outf_", "._", "write_", "(_", "'%", "d", ",%", "d", ",%", "d", ",%", "s", ",%", "d", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "total_", ",_", "op", "delta_", "/_", "options_", "._", "interval_", ",_", "keyd", "elt", "a_", "/_", "options_", "._", "interval_", ",_", "delta", "\\u", "formatted_", ",_", "ela", "pse", "d\\u", "t_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stre", "ss_", "(_", "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_", "insert_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "threads_", "=_", "self_", "._", "create", "\\u", "threads_", "(_", "'", "insert", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "test_", "(_", "options_", "._", "file_", ",_", "threads_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stre", "ss_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "threads_", "=_", "self_", "._", "create", "\\u", "threads_", "(_", "'", "read", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "test_", "(_", "options_", "._", "file_", ",_", "threads_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stre", "ss_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ranges", "lice", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "threads_", "=_", "self_", "._", "create", "\\u", "threads_", "(_", "'", "ranges", "lice", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "test_", "(_", "options_", "._", "file_", ",_", "threads_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stre", "ss_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "indexe", "dra", "nge", "slice_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "threads_", "=_", "self_", "._", "create", "\\u", "threads_", "(_", "'", "indexe", "dra", "nge", "slice", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "test_", "(_", "options_", "._", "file_", ",_", "threads_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stre", "ss_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "multi", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "threads_", "=_", "self_", "._", "create", "\\u", "threads_", "(_", "'", "multi", "get", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "test_", "(_", "options_", "._", "file_", ",_", "threads_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
`__eq__` not overridden when adding attributes
glemmaPaul/django-taggit-serializer/taggit_serializer/serializers.py
[ { "content": "class TagList(list):\n\n\n", "metadata": "root.TagList", "header": "['module', '___EOS___']", "index": 9 }, { "content": " def __init__(self, *args, **kwargs):\n pretty_print = kwargs.pop(\"pretty_print\", True)\n list.__init__(self, *args, **kwargs)\n self.pretty_print = pretty_print", "metadata": "root.TagList.__init__", "header": "['class', 'TagList', '(', 'list', ')', ':', '___EOS___']", "index": 10 }, { "content": " def __add__(self, rhs):\n return TagList(list.__add__(self, rhs))", "metadata": "root.TagList.__add__", "header": "['class', 'TagList', '(', 'list', ')', ':', '___EOS___']", "index": 15 }, { "content": " def __getitem__(self, item):\n result = list.__getitem__(self, item)\n try:\n return TagList(result)\n except TypeError:\n return result", "metadata": "root.TagList.__getitem__", "header": "['class', 'TagList', '(', 'list', ')', ':', '___EOS___']", "index": 18 }, { "content": " def __str__(self):\n if self.pretty_print:\n return json.dumps(\n self, sort_keys=True, indent=4, separators=(',', ': '))\n else:\n return json.dumps(self)", "metadata": "root.TagList.__str__", "header": "['class', 'TagList', '(', 'list', ')', ':', '___EOS___']", "index": 25 } ]
[ { "span": "class TagList(list):", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 20 } ]
[ { "span": "self.pretty_print ", "start_line": 13, "start_column": 8, "end_line": 13, "end_column": 25 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "eq\\u\\u_", "`_", "not_", "overrid", "den_", "when_", "addin", "g_", "attributes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Ta", "g", "List_", "(_", "list_", ")_", ":_", "\\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_", "Ta", "g", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pretty", "\\u", "print_", "=_", "kwargs_", "._", "pop_", "(_", "\"", "pretty", "\\u", "print", "\"_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ta", "g", "List_", "(_", "list_", ")_", ":_", "\\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_", ",_", "rhs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Ta", "g", "List_", "(_", "list_", "._", "\\u\\u", "add\\u\\u_", "(_", "self_", ",_", "rhs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ta", "g", "List_", "(_", "list_", ")_", ":_", "\\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_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "list_", "._", "\\u\\u", "getitem\\u\\u_", "(_", "self_", ",_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Ta", "g", "List_", "(_", "result_", ")_", "\\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_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ta", "g", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json_", "._", "dumps_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "sort", "\\u", "keys_", "=_", "True_", ",_", "indent_", "=_", "4_", ",_", "separators_", "=_", "(_", "','_", ",_", "':", " ", "'_", ")_", ")_", "\\u\\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_", "json_", "._", "dumps_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 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, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
openelections/openelections-core/openelex/us/nv/datasource.py
[ { "content": " def _url_for_fetch(self, mapping):\n try:\n return mapping['url']\n except KeyError:\n return # github url", "metadata": "root.Datasource._url_for_fetch", "header": "['class', 'Datasource', '(', 'BaseDatasource', ')', ':', '___NEWLINE___', '___NL___', '# PUBLIC INTERFACE', '___NL___', '___EOS___']", "index": 36 }, { "content": " def _url_for_fetch(self, mapping):\n if mapping['pre_processed_url']:\n return mapping['pre_processed_url']\n else:\n return mapping['raw_url']", "metadata": "root.Datasource._url_for_fetch", "header": "['class', 'Datasource', '(', 'BaseDatasource', ')', ':', '___NEWLINE___', '___NL___', '# PUBLIC INTERFACE', '___NL___', '___EOS___']", "index": 132 } ]
[ { "span": "_url_for_fetch(", "start_line": 36, "start_column": 8, "end_line": 36, "end_column": 22 } ]
[ { "span": "_url_for_fetch(", "start_line": 132, "start_column": 8, "end_line": 132, "end_column": 22 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Datas", "ource_", "(_", "Base", "Datas", "ource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "PUBLIC", " ", "INTERFACE_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "url", "\\u", "for", "\\u", "fetch_", "(_", "self_", ",_", "mapping_", ")_", ":_", "\\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_", "[_", "'", "url", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "#", " ", "git", "hub", " ", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Datas", "ource_", "(_", "Base", "Datas", "ource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "PUBLIC", " ", "INTERFACE_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "url", "\\u", "for", "\\u", "fetch_", "(_", "self_", ",_", "mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "mapping_", "[_", "'", "pre", "\\u", "process", "ed", "\\u", "url", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mapping_", "[_", "'", "pre", "\\u", "process", "ed", "\\u", "url", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mapping_", "[_", "'", "raw", "\\u", "url", "'_", "]_" ]
[ 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
google/anvil-build/anvil/rules/less_rules.py
[ { "content": "# Copyright 2012 Google Inc. All Rights Reserved.\n\n\"\"\"LESS stylesheets rules for the build system.\n\nContains the following rules:\nless_css_library\n\"\"\"\n\n__author__ = 'benvanik@google.com (Ben Vanik)'\n\n\nimport os\n\nfrom anvil.context import RuleContext\nfrom anvil.rule import Rule, build_rule\nfrom anvil.task import Task, NodeExecutableTask\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@build_rule('less_css_library')\nclass LessCssLibraryRule(Rule):\n \"\"\"A LESS transformed file.\n Uses the LESS compiler to process an input LESS file into a\n single output CSS file.\n\n Only the first source will be used as the root to less. The rest will be\n treated as dependencies.\n\n Inputs:\n srcs: The root LESS file..\n include_paths: Paths to search for include files.\n compiler_flags: A list of string compiler flags.\n out: Optional output name. If none is provided than the rule name will be\n used.\n\n Outputs:\n A single compiled CSS file. If no out is specified a file with the name of\n the rule will be created.\n \"\"\"\n\n\n class _Context(RuleContext):\n def begin(self):\n super(LessCssLibraryRule._Context, self).begin()\n\n args = [\n ]\n args.extend(self.rule.compiler_flags)\n\n if len(self.rule.include_paths):\n args.append('--include-path=%s' % (\n ':'.join(self.rule.include_paths)))\n\n output_path = self._get_out_path(name=self.rule.out, suffix='.css')\n self._ensure_output_exists(os.path.dirname(output_path))\n self._append_output_paths([output_path])\n\n args.append(self.src_paths[0])\n args.append(output_path)\n\n # Skip if cache hit\n if self._check_if_cached():\n self._succeed()\n return\n\n d = self._run_task_async(NodeExecutableTask(\n self.build_env, 'node_modules/less/bin/lessc', args))\n # TODO(benvanik): pull out (stdout, stderr) from result and the exception\n # to get better error logging\n self._chain(d)", "metadata": "root.LessCssLibraryRule", "header": "['module', '___EOS___']", "index": 18 }, { "content": " def __init__(self, name, include_paths=None,\n compiler_flags=None, out=None, *args, **kwargs):\n \"\"\"Initializes a LESS CSS rule.\n\n Args:\n srcs: The root LESS file.\n include_paths: Paths to search for include files.\n compiler_flags: A list of string compiler flags.\n out: Optional output name. If none is provided than the rule name will be\n used.\n \"\"\"\n super(LessCssLibraryRule, self).__init__(name, *args, **kwargs)\n\n self.include_paths = []\n if include_paths:\n self.include_paths.extend(include_paths)\n self._append_dependent_paths(self.include_paths)\n\n self.compiler_flags = []\n if compiler_flags:\n self.compiler_flags.extend(compiler_flags)\n\n self.out = out", "metadata": "root.LessCssLibraryRule.__init__", "header": "['class', 'LessCssLibraryRule', '(', 'Rule', ')', ':', '___EOS___']", "index": 39 } ]
[ { "span": "from anvil.task import Task, NodeExecutableTask", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 47 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2012", " ", "Goo", "gle", " ", "Inc", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "LESS", " ", "stylesheet", "s", " ", "rule", "s", " ", "for", " ", "the", " ", "build", " ", "system", ".", "\\", "10", ";", "\\", "10", ";", "Contain", "s", " ", "the", " ", "follow", "ing", " ", "rule", "s", ":", "\\", "10", ";", "less", "\\u", "css", "\\u", "librar", "y", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "ben", "vani", "k", "@", "google", ".", "com", " ", "(", "Ben", " ", "Van", "ik", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\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_", "from_", "anv", "il_", "._", "context_", "import_", "Rule", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "anv", "il_", "._", "rule_", "import_", "Rule_", ",_", "build", "\\u", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "anv", "il_", "._", "task_", "import_", "Task_", ",_", "Node", "Executable", "Task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "build", "\\u", "rule_", "(_", "'", "less", "\\u", "css", "\\u", "librar", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Less", "Cs", "s", "Libr", "ary", "Rule_", "(_", "Rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "LESS", " ", "transforme", "d", " ", "file", ".", "\\", "10", ";", " ", " ", "Us", "es", " ", "the", " ", "LESS", " ", "compiler", " ", "to", " ", "process", " ", "an", " ", "input", " ", "LESS", " ", "file", " ", "int", "o", " ", "a", "\\", "10", ";", " ", " ", "single", " ", "output", " ", "CS", "S", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "On", "ly", " ", "the", " ", "first", " ", "source", " ", "will", " ", "be", " ", "used", " ", "as", " ", "the", " ", "root", " ", "to", " ", "less", ".", " ", "The", " ", "rest", " ", "will", " ", "be", "\\", "10", ";", " ", " ", "treat", "ed", " ", "as", " ", "dependen", "cies", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Inp", "uts", ":", "\\", "10", ";", " ", " ", " ", " ", "srcs", ":", " ", "The", " ", "root", " ", "LESS", " ", "file", "..", "\\", "10", ";", " ", " ", " ", " ", "include", "\\u", "path", "s", ":", " ", "Path", "s", " ", "to", " ", "search", " ", "for", " ", "include", " ", "files", ".", "\\", "10", ";", " ", " ", " ", " ", "compiler", "\\u", "flags", ":", " ", "A", " ", "list", " ", "of", " ", "string", " ", "compiler", " ", "flags", ".", "\\", "10", ";", " ", " ", " ", " ", "out", ":", " ", "Optio", "nal", " ", "output", " ", "name", ".", " ", "If", " ", "none", " ", "is", " ", "provided", " ", "than", " ", "the", " ", "rule", " ", "name", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "used", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Output", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "single", " ", "compile", "d", " ", "CS", "S", " ", "file", ".", " ", "If", " ", "no", " ", "out", " ", "is", " ", "specified", " ", "a", " ", "file", " ", "with", " ", "the", " ", "name", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "rule", " ", "will", " ", "be", " ", "created", ".", "\\", "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\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Context_", "(_", "Rule", "Context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "begin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Less", "Cs", "s", "Libr", "ary", "Rule_", "._", "\\u", "Context_", ",_", "self_", ")_", "._", "begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "extend_", "(_", "self_", "._", "rule_", "._", "compiler", "\\u", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "rule_", "._", "include", "\\u", "paths_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "append_", "(_", "'--", "include", "-", "path", "=", "%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "':'_", "._", "join_", "(_", "self_", "._", "rule_", "._", "include", "\\u", "paths_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output", "\\u", "path_", "=_", "self_", "._", "\\u", "get", "\\u", "out", "\\u", "path_", "(_", "name_", "=_", "self_", "._", "rule_", "._", "out_", ",_", "suffix_", "=_", "'.", "css", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ensure", "\\u", "output", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "output", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "append", "\\u", "output", "\\u", "paths_", "(_", "[_", "output", "\\u", "path_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "._", "append_", "(_", "self_", "._", "src", "\\u", "paths_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "append_", "(_", "output", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ski", "p", " ", "if", " ", "cache", " ", "hit_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "check", "\\u", "if", "\\u", "cached_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "succeed_", "(_", ")_", "\\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_", "d_", "=_", "self_", "._", "\\u", "run", "\\u", "task", "\\u", "async_", "(_", "Node", "Executable", "Task_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "build", "\\u", "env_", ",_", "'", "node", "\\u", "module", "s", "/", "less", "/", "bin", "/", "less", "c", "'_", ",_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", "(", "ben", "vani", "k", "):", " ", "pull", " ", "out", " ", "(", "stdout", ",", " ", "std", "err", ")", " ", "from", " ", "result", " ", "and", " ", "the", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "get", " ", "bett", "er", " ", "error", " ", "logging_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "chain_", "(_", "d_", ")_", "[SEP]_", "class_", "Less", "Cs", "s", "Libr", "ary", "Rule_", "(_", "Rule_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "include", "\\u", "paths_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "compiler", "\\u", "flags_", "=_", "None_", ",_", "out_", "=_", "None_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initializ", "es", " ", "a", " ", "LESS", " ", "CS", "S", " ", "rule", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "srcs", ":", " ", "The", " ", "root", " ", "LESS", " ", "file", ".", "\\", "10", ";", " ", " ", "include", "\\u", "path", "s", ":", " ", "Path", "s", " ", "to", " ", "search", " ", "for", " ", "include", " ", "files", ".", "\\", "10", ";", " ", " ", "compiler", "\\u", "flags", ":", " ", "A", " ", "list", " ", "of", " ", "string", " ", "compiler", " ", "flags", ".", "\\", "10", ";", " ", " ", "out", ":", " ", "Optio", "nal", " ", "output", " ", "name", ".", " ", "If", " ", "none", " ", "is", " ", "provided", " ", "than", " ", "the", " ", "rule", " ", "name", " ", "will", " ", "be", "\\", "10", ";", " ", " ", "used", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Less", "Cs", "s", "Libr", "ary", "Rule_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "include", "\\u", "paths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "include", "\\u", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "include", "\\u", "paths_", "._", "extend_", "(_", "include", "\\u", "paths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "append", "\\u", "dependent", "\\u", "paths_", "(_", "self_", "._", "include", "\\u", "paths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "compiler", "\\u", "flags_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "compiler", "\\u", "flags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "compiler", "\\u", "flags_", "._", "extend_", "(_", "compiler", "\\u", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "out_", "=_", "out_", "\\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,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"\n Copyright 2013, 2014 Ricardo Tubio-Pardavila\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__author__ = 'rtubiopa@calpoly.edu'\n\nfrom services.communications import jrpc\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from services.communications import jrpc", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", "Copy", "right", " ", "2013", ",", " ", "2014", " ", "Ric", "ard", "o", " ", "Tu", "bio", "-", "Par", "davi", "la", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "\\", "10", ";", " ", " ", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", "\\", "10", ";", " ", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "\\", "10", ";", " ", " ", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", "\\", "10", ";", " ", " ", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", "\\", "10", ";", " ", " ", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", "\\", "10", ";", " ", " ", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "rtu", "bio", "pa", "@", "cal", "poly", ".", "edu", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "services_", "._", "communication", "s_", "import_", "jr", "pc_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
anandology/pyjamas/library/pyjamas/ui/BuilderWidget.py
[ { "content": "from gwt.ui.BuilderWidget import (\n BuilderWidget,\n Composite,\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from gwt.ui.BuilderWidget import (\n BuilderWidget,\n Composite,\n)", "start_line": 0, "start_column": 0, "end_line": 3, "end_column": 1 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "gw", "t_", "._", "ui_", "._", "Build", "er", "Widget_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Build", "er", "Widget_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Composit", "e_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused import
Djacket/djacket/core/backend/git/http.py
[ { "content": "from django.http import HttpResponse, HttpResponseNotFound\n\nfrom git.repo import Repo\nfrom git.service import GIT_SERVICE_UPLOAD_PACK, GIT_SERVICE_RECEIVE_PACK\n\nGIT_HTTP_INFO_REFS = 1\nGIT_HTTP_SERVICE_UPLOAD_PACK = 2\nGIT_HTTP_SERVICE_RECEIVE_PACK = 3\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_http_error(exception):\n \"\"\"\n Returns proper http failure status code according to the provided exception.\n \"\"\"\n\n if 'Not a git repository' in exception.args[0]:\n return HttpResponseNotFound()", "metadata": "root.get_http_error", "header": "['module', '___EOS___']", "index": 10 }, { "content": "class GitResponse(HttpResponse):\n \"\"\"\n Git http response.\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.GitResponse", "header": "['module', '___EOS___']", "index": 19 }, { "content": " def __init__(self, *args, **kwargs):\n self.service = kwargs.pop('service', None)\n self.action = kwargs.pop('action', None)\n self.repository = kwargs.pop('repository', None)\n self.data = kwargs.pop('data', None)\n super(GitResponse, self).__init__(*args, **kwargs)", "metadata": "root.GitResponse.__init__", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 24 }, { "content": " def get_packet_length(self, packet):\n \"\"\"\n Returns length of the given packet in a 4 byte hex string.\n This string is placed at the beginning of the response body.\n\n e.g.\n 001e\n \"\"\"\n\n hex = '0123456789abcdef'\n length = len(packet) + 4\n prefix = hex[int((length >> 12) & 0xf)]\n prefix = prefix + hex[int((length >> 8) & 0xf)]\n prefix = prefix + hex[int((length >> 4) & 0xf)]\n prefix = prefix + hex[int((length) & 0xf)]\n\n return prefix", "metadata": "root.GitResponse.get_packet_length", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 32 }, { "content": " def get_header_expires(self):\n \"\"\"\n Returns 'Expires' header value.\n\n e.g.\n 'Fri, 01 Jan 1980 00:00:00 GMT'\n \"\"\"\n\n return 'Fri, 01 Jan 1980 00:00:00 GMT'", "metadata": "root.GitResponse.get_header_expires", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 51 }, { "content": " def get_header_pragma(self):\n \"\"\"\n Returns 'Pragma' header value.\n\n e.g.\n 'no-cache'\n \"\"\"\n\n return 'no-cache'", "metadata": "root.GitResponse.get_header_pragma", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 62 }, { "content": " def get_header_cache_control(self):\n \"\"\"\n Returns 'Cache-Control' header value.\n\n e.g.\n 'no-cache, max-age=0, must-revalidate'\n \"\"\"\n\n return 'no-cache, max-age=0, must-revalidate'", "metadata": "root.GitResponse.get_header_cache_control", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 73 }, { "content": " def get_header_content_type(self):\n \"\"\"\n Creates the 'Content-Type' header according to the requested service and action.\n Structure of a 'Content-Type' header is 'application/x-\\{service\\}-\\{action\\}'\n\n e.g.\n 'application-git-receive-pack-advertisement'\n \"\"\"\n\n return 'application/x-{0}-{1}'.format(self.service, self.action)", "metadata": "root.GitResponse.get_header_content_type", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 84 }, { "content": " def set_response_header(self):\n \"\"\"\n Sets response headers, according to the requested service and action.\n Header contains values such as 'Expires', 'Pragma', 'Cache-Control' and 'Content-Type'.\n \"\"\"\n\n self.__setitem__('Expires', self.get_header_expires())\n self.__setitem__('Pragma', self.get_header_pragma())\n self.__setitem__('Cache-Control', self.get_header_cache_control())\n self.__setitem__('Content-Type', self.get_header_content_type())", "metadata": "root.GitResponse.set_response_header", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 96 }, { "content": " def set_response_first_line(self):\n \"\"\"\n Sets first line of git response that includes length and requested service.\n\n e.g.\n 001f# service=git-receive-pack\n \"\"\"\n\n first_line = '# service={0}\\n'.format(self.service)\n prefix = self.get_packet_length(first_line)\n self.write('{0}{1}0000'.format(prefix, first_line))", "metadata": "root.GitResponse.set_response_first_line", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 108 }, { "content": " def set_response_payload(self, payload_type):\n \"\"\"\n Writes 'refs' object information of the given repository to http response.\n \"\"\"\n\n if payload_type == GIT_HTTP_INFO_REFS:\n self.write(self.repository.get_info_refs(self.service))\n elif payload_type == GIT_HTTP_SERVICE_RECEIVE_PACK:\n self.write(self.repository.commit(self.data))\n elif payload_type == GIT_HTTP_SERVICE_UPLOAD_PACK:\n self.write(self.repository.pull(self.data))", "metadata": "root.GitResponse.set_response_payload", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 121 }, { "content": " def get_http_info_refs(self):\n \"\"\"\n Returns a HttpResponse for info/refs requests.\n \"\"\"\n\n try:\n self.set_response_header()\n self.set_response_first_line()\n self.set_response_payload(GIT_HTTP_INFO_REFS)\n return self\n except BaseException as e:\n return get_http_error(e)", "metadata": "root.GitResponse.get_http_info_refs", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 134 }, { "content": " def get_http_service_rpc(self):\n \"\"\"\n Returns a HttpResponse to 'git-upload-pack', 'git-receive-pack' requests.\n \"\"\"\n\n try:\n self.set_response_header()\n if self.service == GIT_SERVICE_RECEIVE_PACK:\n self.set_response_payload(GIT_HTTP_SERVICE_RECEIVE_PACK)\n elif self.service == GIT_SERVICE_UPLOAD_PACK:\n self.set_response_payload(GIT_HTTP_SERVICE_UPLOAD_PACK)\n return self\n except BaseException as e:\n return get_http_error(e)", "metadata": "root.GitResponse.get_http_service_rpc", "header": "['class', 'GitResponse', '(', 'HttpResponse', ')', ':', '___EOS___']", "index": 148 } ]
[ { "span": "from git.repo import Repo", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 25 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", ",_", "Http", "Respons", "e", "Not", "Found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "git_", "._", "repo_", "import_", "Repo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "git_", "._", "service_", "import_", "GIT", "\\u", "SERV", "ICE", "\\u", "UPLOAD", "\\u", "PACK", "_", ",_", "GIT", "\\u", "SERV", "ICE", "\\u", "RECEIVE", "\\u", "PACK", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "GIT", "\\u", "HTTP", "\\u", "INFO", "\\u", "REF", "S_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GIT", "\\u", "HTTP", "\\u", "SERV", "ICE", "\\u", "UPLOAD", "\\u", "PACK", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GIT", "\\u", "HTTP", "\\u", "SERV", "ICE", "\\u", "RECEIVE", "\\u", "PACK", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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", "\\u", "http", "\\u", "error_", "(_", "exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "proper", " ", "http", " ", "fail", "ure", " ", "status", " ", "code", " ", "according", " ", "to", " ", "the", " ", "provided", " ", "exception", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Not", " ", "a", " ", "git", " ", "repos", "itor", "y", "'_", "in_", "exception_", "._", "args_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Not", "Found_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Git", " ", "http", " ", "response", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "=_", "kwargs_", "._", "pop_", "(_", "'", "service", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "action_", "=_", "kwargs_", "._", "pop_", "(_", "'", "action", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repository_", "=_", "kwargs_", "._", "pop_", "(_", "'", "repos", "itor", "y", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "kwargs_", "._", "pop_", "(_", "'", "data", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Git", "Response_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "packet", "\\u", "length_", "(_", "self_", ",_", "packet_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "length", " ", "of", " ", "the", " ", "give", "n", " ", "packet", " ", "in", " ", "a", " ", "4", " ", "byte", " ", "hex", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "string", " ", "is", " ", "place", "d", " ", "at", " ", "the", " ", "beginn", "ing", " ", "of", " ", "the", " ", "response", " ", "body", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "g", ".", "\\", "10", ";", " ", " ", " ", " ", "001", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hex_", "=_", "'", "0123456", "789", "abcde", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "len_", "(_", "packet_", ")_", "+_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "hex_", "[_", "int_", "(_", "(_", "length_", ">>_", "12_", ")_", "&_", "0xf", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "prefix_", "+_", "hex_", "[_", "int_", "(_", "(_", "length_", ">>_", "8_", ")_", "&_", "0xf", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "prefix_", "+_", "hex_", "[_", "int_", "(_", "(_", "length_", ">>_", "4_", ")_", "&_", "0xf", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "prefix_", "+_", "hex_", "[_", "int_", "(_", "(_", "length_", ")_", "&_", "0xf", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "header", "\\u", "expires_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "'", "Expire", "s", "'", " ", "header", " ", "value", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "g", ".", "\\", "10", ";", " ", " ", " ", " ", "'", "Fri", ",", " ", "01", " ", "Jan", " ", "1980", " ", "00", ":", "00", ":", "00", " ", "GM", "T", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'", "Fri", ",", " ", "01", " ", "Jan", " ", "1980", " ", "00", ":", "00", ":", "00", " ", "GM", "T", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "header", "\\u", "pragma", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "'", "Pra", "gma", "'", " ", "header", " ", "value", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "g", ".", "\\", "10", ";", " ", " ", " ", " ", "'", "no", "-", "cache", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'", "no", "-", "cache", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "header", "\\u", "cache", "\\u", "control_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "'", "Cache", "-", "Control", "'", " ", "header", " ", "value", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "g", ".", "\\", "10", ";", " ", " ", " ", " ", "'", "no", "-", "cache", ",", " ", "max", "-", "age", "=", "0", ",", " ", "must", "-", "rev", "alid", "ate", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'", "no", "-", "cache", ",", " ", "max", "-", "age", "=", "0", ",", " ", "must", "-", "rev", "alid", "ate", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "header", "\\u", "content", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "es", " ", "the", " ", "'", "Conten", "t", "-", "Type", "'", " ", "header", " ", "according", " ", "to", " ", "the", " ", "request", "ed", " ", "service", " ", "and", " ", "action", ".", "\\", "10", ";", " ", " ", " ", " ", "Structur", "e", " ", "of", " ", "a", " ", "'", "Conten", "t", "-", "Type", "'", " ", "header", " ", "is", " ", "'", "applica", "tion", "/", "x", "-\\\\", "{", "service", "\\\\}", "-\\\\", "{", "action", "\\\\}", "'", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "g", ".", "\\", "10", ";", " ", " ", " ", " ", "'", "applica", "tion", "-", "git", "-", "receive", "-", "pack", "-", "advertise", "ment", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'", "applica", "tion", "/", "x", "-", "{", "0", "}-", "{", "1", "}'_", "._", "format_", "(_", "self_", "._", "service_", ",_", "self_", "._", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "response", "\\u", "header_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "s", " ", "response", " ", "header", "s", ",", " ", "according", " ", "to", " ", "the", " ", "request", "ed", " ", "service", " ", "and", " ", "action", ".", "\\", "10", ";", " ", " ", " ", " ", "Head", "er", " ", "contain", "s", " ", "values", " ", "suc", "h", " ", "as", " ", "'", "Expire", "s", "',", " ", "'", "Pra", "gma", "',", " ", "'", "Cache", "-", "Control", "'", " ", "and", " ", "'", "Conten", "t", "-", "Type", "'.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "'", "Expire", "s", "'_", ",_", "self_", "._", "get", "\\u", "header", "\\u", "expires_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "'", "Pra", "gma", "'_", ",_", "self_", "._", "get", "\\u", "header", "\\u", "pragma", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "'", "Cache", "-", "Control", "'_", ",_", "self_", "._", "get", "\\u", "header", "\\u", "cache", "\\u", "control_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "'", "Conten", "t", "-", "Type", "'_", ",_", "self_", "._", "get", "\\u", "header", "\\u", "content", "\\u", "type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "response", "\\u", "first", "\\u", "line_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "s", " ", "first", " ", "line", " ", "of", " ", "git", " ", "response", " ", "tha", "t", " ", "include", "s", " ", "length", " ", "and", " ", "request", "ed", " ", "service", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "g", ".", "\\", "10", ";", " ", " ", " ", " ", "001", "f", "#", " ", "service", "=", "git", "-", "receive", "-", "pack", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "line_", "=_", "'#", " ", "service", "={", "0", "}\\\\", "n", "'_", "._", "format_", "(_", "self_", "._", "service_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "self_", "._", "get", "\\u", "packet", "\\u", "length_", "(_", "first", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "'{", "0", "}{", "1", "}", "0000", "'_", "._", "format_", "(_", "prefix_", ",_", "first", "\\u", "line_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "response", "\\u", "payload_", "(_", "self_", ",_", "payload", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Write", "s", " ", "'", "refs", "'", " ", "object", " ", "informati", "on", " ", "of", " ", "the", " ", "give", "n", " ", "repos", "itor", "y", " ", "to", " ", "http", " ", "response", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "payload", "\\u", "type_", "==_", "GIT", "\\u", "HTTP", "\\u", "INFO", "\\u", "REF", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "repository_", "._", "get", "\\u", "info", "\\u", "refs_", "(_", "self_", "._", "service_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "payload", "\\u", "type_", "==_", "GIT", "\\u", "HTTP", "\\u", "SERV", "ICE", "\\u", "RECEIVE", "\\u", "PACK", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "repository_", "._", "commit_", "(_", "self_", "._", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "payload", "\\u", "type_", "==_", "GIT", "\\u", "HTTP", "\\u", "SERV", "ICE", "\\u", "UPLOAD", "\\u", "PACK", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "repository_", "._", "pull_", "(_", "self_", "._", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\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", "http", "\\u", "info", "\\u", "refs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "Http", "Respons", "e", " ", "for", " ", "info", "/", "refs", " ", "request", "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 ", " _", "self_", "._", "set\\u", "response", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "response", "\\u", "first", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "response", "\\u", "payload_", "(_", "GIT", "\\u", "HTTP", "\\u", "INFO", "\\u", "REF", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Base", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "\\u", "http", "\\u", "error_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Git", "Response_", "(_", "Http", "Response_", ")_", ":_", "\\u\\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", "http", "\\u", "service", "\\u", "rpc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "Http", "Respons", "e", " ", "to", " ", "'", "git", "-", "upload", "-", "pack", "',", " ", "'", "git", "-", "receive", "-", "pack", "'", " ", "request", "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 ", " _", "self_", "._", "set\\u", "response", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "service_", "==_", "GIT", "\\u", "SERV", "ICE", "\\u", "RECEIVE", "\\u", "PACK", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "response", "\\u", "payload_", "(_", "GIT", "\\u", "HTTP", "\\u", "SERV", "ICE", "\\u", "RECEIVE", "\\u", "PACK", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "service_", "==_", "GIT", "\\u", "SERV", "ICE", "\\u", "UPLOAD", "\\u", "PACK", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "response", "\\u", "payload_", "(_", "GIT", "\\u", "HTTP", "\\u", "SERV", "ICE", "\\u", "UPLOAD", "\\u", "PACK", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Base", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "\\u", "http", "\\u", "error_", "(_", "e_", ")_" ]
[ 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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 ]
Except block handles 'BaseException'
spadgenske/TYOS/src/receive.py
[ { "content": " def check(self, update):\n if io.input(4) == 0: #Check the GPIO connected to the key pin on the FONA\n try:\n #Get number of sms messages\n num_sms = self.fona.transmit('AT+CPMS?')\n num_sms = num_sms[1]\n num_sms = num_sms.split(',')\n num_sms = num_sms[1]\n num_sms = int(num_sms)\n if num_sms > self.total_sms: #If there is more messages than before, a SMS has arrived. otherwise a call is coming\n print 'New Message!'\n self.total_sms = num_sms\n else:\n self.call_coming = True\n except:\n pass\n \n update = True\n\n else:\n update = True\n \n if self.call_coming:\n self.incoming_call()\n return update", "metadata": "root.Receive.check", "header": "['class', 'Receive', '(', ')', ':', '___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_", "Receive", "_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check_", "(_", "self_", ",_", "update_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "io_", "._", "input_", "(_", "4_", ")_", "==_", "0_", ":_", "#", "Check", " ", "the", " ", "GPIO", " ", "connect", "ed", " ", "to", " ", "the", " ", "key", " ", "pin", " ", "on", " ", "the", " ", "FO", "NA_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "number", " ", "of", " ", "sms", " ", "messages_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "num", "\\u", "sms_", "=_", "self_", "._", "fon", "a_", "._", "transmit", "_", "(_", "'", "AT", "+", "CP", "MS", "?'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "sms_", "=_", "num", "\\u", "sms_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "sms_", "=_", "num", "\\u", "sms_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "sms_", "=_", "num", "\\u", "sms_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "sms_", "=_", "int_", "(_", "num", "\\u", "sms_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "num", "\\u", "sms_", ">_", "self_", "._", "total", "\\u", "sms_", ":_", "#", "If", " ", "there", " ", "is", " ", "more", " ", "message", "s", " ", "than", " ", "bef", "ore", ",", " ", "a", " ", "SMS", " ", "has", " ", "arrive", "d", ".", " ", "other", "wis", "e", " ", "a", " ", "call", " ", "is", " ", "comi", "ng_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "New", " ", "Messag", "e", "!'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "total", "\\u", "sms_", "=_", "num", "\\u", "sms_", "\\u\\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_", "._", "call", "\\u", "comi", "ng_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "update_", "=_", "True_", "\\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 ", " _", "update_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "call", "\\u", "comi", "ng_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "inco", "ming", "\\u", "call_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "update_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/util/common.py
[ { "content": "def subpackages(packagemod):\n \"\"\"\n Given a module object, returns an iterator which yields a tuple (modulename, moduleobject, ispkg)\n for the given module and all it's submodules/subpackages.\n \"\"\"\n modpkgs = []\n modpkgs_names = set()\n if hasattr(packagemod, '__path__'):\n yield packagemod.__name__, packagemod, True\n for importer, modname, ispkg in pkgutil.walk_packages(packagemod.__path__, packagemod.__name__+'.'):\n if modname not in sys.modules:\n try:\n mod = importer.find_module(modname).load_module(modname)\n except Exception, e:\n print \"error importing %s: %s\" % ( modname, e)\n else:\n mod = sys.modules[modname]\n yield modname, mod, ispkg\n else:\n yield packagemod.__name__, packagemod, False", "metadata": "root.subpackages", "header": "['module', '___EOS___']", "index": 119 } ]
[ { "span": "modpkgs ", "start_line": 124, "start_column": 4, "end_line": 124, "end_column": 11 }, { "span": "modpkgs_names ", "start_line": 125, "start_column": 4, "end_line": 125, "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_", "subpa", "ckage", "s_", "(_", "package", "mod_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "a", " ", "module", " ", "object", ",", " ", "return", "s", " ", "an", " ", "iter", "ator", " ", "whi", "ch", " ", "yield", "s", " ", "a", " ", "tuple", " ", "(", "modulename", ",", " ", "module", "object", ",", " ", "isp", "kg", ")", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "the", " ", "give", "n", " ", "module", " ", "and", " ", "all", " ", "it", "'", "s", " ", "submodules", "/", "subpa", "ckage", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modp", "kg", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modp", "kg", "s", "\\u", "names_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "package", "mod_", ",_", "'\\u", "\\u", "path", "\\u\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "package", "mod_", "._", "\\u\\u", "name\\u\\u_", ",_", "package", "mod_", ",_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "importer_", ",_", "modname_", ",_", "isp", "kg_", "in_", "pkg", "util_", "._", "walk", "\\u", "packages_", "(_", "package", "mod_", "._", "\\u\\u", "path\\u\\u_", ",_", "package", "mod_", "._", "\\u\\u", "name\\u\\u_", "+_", "'.'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "modname_", "not_", "in_", "sys_", "._", "modules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "mod_", "=_", "importer_", "._", "find", "\\u", "module_", "(_", "modname_", ")_", "._", "load", "\\u", "module_", "(_", "modname_", ")_", "\\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", " ", "import", "ing", " ", "%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "modname_", ",_", "e_", ")_", "\\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 ", " _", "mod_", "=_", "sys_", "._", "modules_", "[_", "modname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "modname_", ",_", "mod_", ",_", "isp", "kg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "package", "mod_", "._", "\\u\\u", "name\\u\\u_", ",_", "package", "mod_", ",_", "False_" ]
[ 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, 0, 1, 1, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
myusuf3/octogit/octogit/cli.py
[ { "content": "\"\"\"\noctogit\n\nthis file contains all the helper cli commands for octogit\n\n\"\"\"\nimport os\nimport re\nimport sys\nimport requests\n\nfrom docopt import docopt\nfrom clint import args\nfrom clint.textui import colored, puts, indent\n\nfrom .core import (get_issues, get_single_issue, create_repository,\n close_issue, view_issue, create_issue, find_github_remote)\nfrom .config import login, create_config, commit_changes, CONFIG_FILE\n\n\nGIT_REPO_ENDPOINT = 'https://api.github.com/repos/%s/%s'\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def version():\n from . import __version__\n return \".\".join(str(x) for x in __version__)", "metadata": "root.version", "header": "['module', '___EOS___']", "index": 22 }, { "content": "def get_help():\n puts('{0}. version {1} by Mahdi Yusuf {2}'.format(\n colored.blue('octogit'),\n version(),\n colored.green('@myusuf3')))\n puts('{0}: http://github.com/myusuf3/octogit'.format(colored.yellow('source')))\n\n puts('\\n{0}:'.format(colored.cyan('tentacles')))\n with indent(4):\n puts(colored.green('octogit login'))\n puts(colored.green(\"octogit create <repo> 'description'\"))\n puts(colored.green(\"octogit create <repo> 'description' <organization>\"))\n puts(colored.green('octogit issues [--assigned]'))\n puts(colored.green('octogit issues'))\n puts(colored.green(\"octogit issues create 'issue title' 'description'\"))\n puts(colored.green('octogit issues <number>'))\n puts(colored.green('octogit issues <number> close'))\n puts(colored.green('octogit issues <number> view'))\n puts('\\n')", "metadata": "root.get_help", "header": "['module', '___EOS___']", "index": 27 }, { "content": "def get_parent_repository(username_repo):\n username, repo = username_repo\n url = GIT_REPO_ENDPOINT % (username, repo)\n response = requests.get(url)\n data = response.json()\n try:\n parent = data['parent']['full_name']\n username_repo = parent.split('/')\n except KeyError:\n pass\n return username_repo", "metadata": "root.get_parent_repository", "header": "['module', '___EOS___']", "index": 48 }, { "content": "def get_username_and_repo(url):\n\n # matching origin of this type\n # http://www.github.com/myusuf3/delorean\n m = re.match(\"^.+?github.com/([a-zA-Z0-9_-]*)/([a-zA-Z0-9_-]*)\\/?$\", url)\n if m:\n return m.groups()\n else:\n # matching origin of this type\n # git@github.com:[/]myusuf3/delorean.git\n username_repo = url.split(':')[1].replace('.git', '').split('/')\n # Handle potential leading slash after :\n if username_repo[0] == '':\n username_repo = username_repo[1:]\n if len(username_repo) == 2:\n info = username_repo\n else:\n # matching url of this type\n # git://github.com/myusuf3/delorean.git\n username_repo = url.split('/')[3:]\n username_repo[1] = username_repo[1].replace('.git', '')\n info = username_repo\n parent_repo = get_parent_repository(info)\n return parent_repo", "metadata": "root.get_username_and_repo", "header": "['module', '___EOS___']", "index": 61 }, { "content": "def begin():\n \"\"\"\n Usage:\n octogit [subcommand] [arguments]\n octogit login | -l | --login [(username password)]\n octogit create <repo> [<description>] [<organization>]\n octogit (issues | -i | --issues) [--assigned | -a]\n octogit (issues | -i | --issues) create <issue-title> <description>\n octogit (issues | -i | --issues) <number> [close | view]\n octogit -v | --version\n octogit help | -h | --help\n\n \"\"\"\n\n if os.path.exists(CONFIG_FILE):\n pass\n else:\n # create config file\n create_config()\n # commit changes\n commit_changes()\n\n arguments = docopt(begin.__doc__, help=None)\n\n if arguments['--version'] or arguments['-v']:\n puts(version())\n sys.exit(0)\n\n elif arguments['--help'] or arguments['-h'] or arguments['help']:\n get_help()\n sys.exit(0)\n\n elif arguments['create']:\n if arguments['<repo>'] == None:\n puts('{0}. {1}'.format(colored.blue('octogit'),\n colored.red('You need to pass both a project name and description')))\n\n else:\n project_name = arguments['<repo>']\n description = arguments['<description>'] or ''\n organization = arguments['<organization>'] or None\n create_repository(project_name, description, organization=organization)\n sys.exit()\n\n elif arguments['--issues'] or arguments['-i'] or arguments['issues']:\n url = find_github_remote()\n username, url = get_username_and_repo(url)\n if arguments['create']:\n if ['<issue-title>'] == None:\n puts('{0}. {1}'.format(colored.blue('octogit'),\n colored.red('You need to pass an issue title')))\n sys.exit(-1)\n\n else:\n issue_name = arguments['<issue-title>']\n description = arguments['<description>']\n create_issue(username, url, issue_name, description)\n sys.exit(0)\n\n issue_number = arguments['<number>']\n\n if issue_number is not None:\n if issue_number.startswith('#'):\n issue_number = issue_number[1:]\n\n if arguments['close']:\n close_issue(username, url, issue_number)\n sys.exit(0)\n elif arguments['view']:\n view_issue(username, url, issue_number)\n sys.exit(0)\n elif arguments['--assigned']:\n get_issues(username, url, (arguments['-assigned'] or arguments['-a']))\n sys.exit(0)\n else:\n get_single_issue(username, url, issue_number)\n sys.exit(0)\n else:\n get_issues(username, url, False)\n sys.exit(0)\n\n elif arguments['--login'] or arguments['-l'] or arguments['login']:\n username = arguments['username'] or None\n if username is None:\n username = raw_input(\"Github username: \")\n if len(username) == 0:\n puts(\"{0}. {1}\".format(\n colored.blue(\"octogit\"),\n colored.red(\"Username was blank\")))\n\n password = arguments['password'] or None\n if password is None:\n import getpass\n password = getpass.getpass(\"Password for %s: \" % username)\n\n login(username, password)\n else:\n get_help()\n sys.exit(0)", "metadata": "root.begin", "header": "['module', '___EOS___']", "index": 87 } ]
[ { "span": "from clint import args", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 22 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "oct", "ogi", "t", "\\", "10", ";", "\\", "10", ";", "this", " ", "file", " ", "contain", "s", " ", "all", " ", "the", " ", "help", "er", " ", "cli", " ", "command", "s", " ", "for", " ", "oct", "ogi", "t", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "docopt_", "import_", "docopt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "clin", "t_", "import_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "clin", "t_", "._", "textu", "i_", "import_", "colored_", ",_", "puts_", ",_", "indent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "core_", "import_", "(_", "get", "\\u", "issues_", ",_", "get", "\\u", "single", "\\u", "issue_", ",_", "create", "\\u", "repository_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "close", "\\u", "issue_", ",_", "view", "\\u", "issue_", ",_", "create", "\\u", "issue_", ",_", "find", "\\u", "git", "hub", "\\u", "remote_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "config_", "import_", "login_", ",_", "create", "\\u", "config_", ",_", "commit", "\\u", "changes_", ",_", "CONFIG", "\\u", "FILE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "GIT", "\\u", "REPO", "\\u", "ENDPOINT_", "=_", "'", "https", "://", "api", ".", "git", "hub", ".", "com", "/", "repos", "/", "%", "s", "/", "%", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "._", "import_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\".\"_", "._", "join_", "(_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "\\u\\u", "version\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "help_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "puts_", "(_", "'{", "0", "}.", " ", "version", " ", "{", "1", "}", " ", "by", " ", "Ma", "hdi", " ", "Yu", "suf", " ", "{", "2", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "colored_", "._", "blue_", "(_", "'", "oct", "ogi", "t", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "colored_", "._", "green_", "(_", "'@", "myu", "suf", "3", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "'{", "0", "}:", " ", "http", "://", "git", "hub", ".", "com", "/", "myu", "suf", "3", "/", "oct", "ogi", "t", "'_", "._", "format_", "(_", "colored_", "._", "yellow_", "(_", "'", "source", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "puts_", "(_", "'\\\\", "n", "{", "0", "}:", "'_", "._", "format_", "(_", "colored_", "._", "cya", "n_", "(_", "'", "tent", "acl", "es", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "indent_", "(_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "puts_", "(_", "colored_", "._", "green_", "(_", "'", "oct", "ogi", "t", " ", "login", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "colored_", "._", "green_", "(_", "\"", "oct", "ogi", "t", " ", "create", " ", "<", "repo", ">", " ", "'", "description", "'\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "colored_", "._", "green_", "(_", "\"", "oct", "ogi", "t", " ", "create", " ", "<", "repo", ">", " ", "'", "description", "'", " ", "<", "organization", ">\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "colored_", "._", "green_", "(_", "'", "oct", "ogi", "t", " ", "issue", "s", " ", "[-", "-", "assign", "ed", "]'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "colored_", "._", "green_", "(_", "'", "oct", "ogi", "t", " ", "issue", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "colored_", "._", "green_", "(_", "\"", "oct", "ogi", "t", " ", "issue", "s", " ", "create", " ", "'", "issue", " ", "title", "'", " ", "'", "description", "'\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "colored_", "._", "green_", "(_", "'", "oct", "ogi", "t", " ", "issue", "s", " ", "<", "number", ">'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "colored_", "._", "green_", "(_", "'", "oct", "ogi", "t", " ", "issue", "s", " ", "<", "number", ">", " ", "close", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "colored_", "._", "green_", "(_", "'", "oct", "ogi", "t", " ", "issue", "s", " ", "<", "number", ">", " ", "view", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "puts_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "parent", "\\u", "repository_", "(_", "user", "name", "\\u", "repo_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", ",_", "repo_", "=_", "user", "name", "\\u", "repo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "GIT", "\\u", "REPO", "\\u", "ENDPOINT_", "%_", "(_", "username_", ",_", "repo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "requests_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "response_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parent_", "=_", "data_", "[_", "'", "parent", "'_", "]_", "[_", "'", "full", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "name", "\\u", "repo_", "=_", "parent_", "._", "split_", "(_", "'/'_", ")_", "\\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_", "return_", "user", "name", "\\u", "repo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "user", "name", "\\u", "and", "\\u", "repo_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "matchi", "ng", " ", "orig", "in", " ", "of", " ", "this", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "git", "hub", ".", "com", "/", "myu", "suf", "3", "/", "del", "ore", "an_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "re_", "._", "match_", "(_", "\"", "^", ".+?", "git", "hub", ".", "com", "/([", "a", "-", "z", "A", "-", "Z", "0", "-", "9", "\\u-]", "*)", "/([", "a", "-", "z", "A", "-", "Z", "0", "-", "9", "\\u-]", "*)\\\\", "/?", "$\"_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "m_", "._", "groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "matchi", "ng", " ", "orig", "in", " ", "of", " ", "this", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "git", "@", "git", "hub", ".", "com", ":[", "/]", "myu", "suf", "3", "/", "del", "ore", "an", ".", "git_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "name", "\\u", "repo_", "=_", "url_", "._", "split_", "(_", "':'_", ")_", "[_", "1_", "]_", "._", "replace_", "(_", "'.", "git", "'_", ",_", "''_", ")_", "._", "split_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Handle", " ", "potenti", "al", " ", "lead", "ing", " ", "slash", " ", "after", " ", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "user", "name", "\\u", "repo_", "[_", "0_", "]_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "name", "\\u", "repo_", "=_", "user", "name", "\\u", "repo_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "user", "name", "\\u", "repo_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info_", "=_", "user", "name", "\\u", "repo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "matchi", "ng", " ", "url", " ", "of", " ", "this", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "git", "://", "git", "hub", ".", "com", "/", "myu", "suf", "3", "/", "del", "ore", "an", ".", "git_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "name", "\\u", "repo_", "=_", "url_", "._", "split_", "(_", "'/'_", ")_", "[_", "3_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "name", "\\u", "repo_", "[_", "1_", "]_", "=_", "user", "name", "\\u", "repo_", "[_", "1_", "]_", "._", "replace_", "(_", "'.", "git", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "user", "name", "\\u", "repo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parent", "\\u", "repo_", "=_", "get", "\\u", "parent", "\\u", "repository_", "(_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "parent", "\\u", "repo_", "\\u\\u\\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_", "begin_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "age", ":", "\\", "10", ";", " ", " ", "oct", "ogi", "t", " ", "[", "subco", "mmand", "]", " ", "[", "argu", "ment", "s", "]", "\\", "10", ";", " ", " ", "oct", "ogi", "t", " ", "login", " ", "|", " ", "-", "l", " ", "|", " ", "--", "login", " ", "[(", "user", "name", " ", "password", ")]", "\\", "10", ";", " ", " ", "oct", "ogi", "t", " ", "create", " ", "<", "repo", ">", " ", "[", "<", "description", ">]", " ", "[", "<", "organization", ">]", "\\", "10", ";", " ", " ", "oct", "ogi", "t", " ", "(", "issue", "s", " ", "|", " ", "-", "i", " ", "|", " ", "--", "issue", "s", ")", " ", "[-", "-", "assign", "ed", " ", "|", " ", "-", "a", "]", "\\", "10", ";", " ", " ", "oct", "ogi", "t", " ", "(", "issue", "s", " ", "|", " ", "-", "i", " ", "|", " ", "--", "issue", "s", ")", " ", "create", " ", "<", "issue", "-", "title", ">", " ", "<", "description", ">", "\\", "10", ";", " ", " ", "oct", "ogi", "t", " ", "(", "issue", "s", " ", "|", " ", "-", "i", " ", "|", " ", "--", "issue", "s", ")", " ", "<", "number", ">", " ", "[", "close", " ", "|", " ", "view", "]", "\\", "10", ";", " ", " ", "oct", "ogi", "t", " ", "-", "v", " ", "|", " ", "--", "version", "\\", "10", ";", " ", " ", "oct", "ogi", "t", " ", "help", " ", "|", " ", "-", "h", " ", "|", " ", "--", "help", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "CONFIG", "\\u", "FILE_", ")_", ":_", "\\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_", "#", " ", "create", " ", "config", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "commit", " ", "changes_", "\\u\\u\\uNL\\u\\u\\u_", "commit", "\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "docopt_", "(_", "begin_", "._", "\\u\\u", "doc\\u\\u_", ",_", "help_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "version", "'_", "]_", "or_", "arguments_", "[_", "'-", "v", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "puts_", "(_", "version_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "arguments_", "[_", "'--", "help", "'_", "]_", "or_", "arguments_", "[_", "'-", "h", "'_", "]_", "or_", "arguments_", "[_", "'", "help", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get", "\\u", "help_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "arguments_", "[_", "'", "create", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "arguments_", "[_", "'<", "repo", ">'_", "]_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "puts_", "(_", "'{", "0", "}.", " ", "{", "1", "}'_", "._", "format_", "(_", "colored_", "._", "blue_", "(_", "'", "oct", "ogi", "t", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "colored_", "._", "red_", "(_", "'", "You", " ", "need", " ", "to", " ", "pass", " ", "bot", "h", " ", "a", " ", "project", " ", "name", " ", "and", " ", "description", "'_", ")_", ")_", ")_", "\\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 ", " _", "project", "\\u", "name_", "=_", "arguments_", "[_", "'<", "repo", ">'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "arguments_", "[_", "'<", "description", ">'_", "]_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "organization_", "=_", "arguments_", "[_", "'<", "organization", ">'_", "]_", "or_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "repository_", "(_", "project", "\\u", "name_", ",_", "description_", ",_", "organization_", "=_", "organization_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "arguments_", "[_", "'--", "issue", "s", "'_", "]_", "or_", "arguments_", "[_", "'-", "i", "'_", "]_", "or_", "arguments_", "[_", "'", "issue", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "find", "\\u", "git", "hub", "\\u", "remote_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", ",_", "url_", "=_", "get", "\\u", "user", "name", "\\u", "and", "\\u", "repo_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arguments_", "[_", "'", "create", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "[_", "'<", "issue", "-", "title", ">'_", "]_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "puts_", "(_", "'{", "0", "}.", " ", "{", "1", "}'_", "._", "format_", "(_", "colored_", "._", "blue_", "(_", "'", "oct", "ogi", "t", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "colored_", "._", "red_", "(_", "'", "You", " ", "need", " ", "to", " ", "pass", " ", "an", " ", "issue", " ", "title", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "issue", "\\u", "name_", "=_", "arguments_", "[_", "'<", "issue", "-", "title", ">'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "arguments_", "[_", "'<", "description", ">'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "issue_", "(_", "username_", ",_", "url_", ",_", "issue", "\\u", "name_", ",_", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "issue", "\\u", "number_", "=_", "arguments_", "[_", "'<", "number", ">'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "issue", "\\u", "number_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issue", "\\u", "number_", "._", "startswith_", "(_", "'#'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "issue", "\\u", "number_", "=_", "issue", "\\u", "number_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'", "close", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "close", "\\u", "issue_", "(_", "username_", ",_", "url_", ",_", "issue", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "arguments_", "[_", "'", "view", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view", "\\u", "issue_", "(_", "username_", ",_", "url_", ",_", "issue", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "arguments_", "[_", "'--", "assign", "ed", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get", "\\u", "issues_", "(_", "username_", ",_", "url_", ",_", "(_", "arguments_", "[_", "'-", "assign", "ed", "'_", "]_", "or_", "arguments_", "[_", "'-", "a", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "get", "\\u", "single", "\\u", "issue_", "(_", "username_", ",_", "url_", ",_", "issue", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "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 ", " _", "get", "\\u", "issues_", "(_", "username_", ",_", "url_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "arguments_", "[_", "'--", "login", "'_", "]_", "or_", "arguments_", "[_", "'-", "l", "'_", "]_", "or_", "arguments_", "[_", "'", "login", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "arguments_", "[_", "'", "user", "name", "'_", "]_", "or_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "username_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "raw", "\\u", "input_", "(_", "\"", "Git", "hub", " ", "user", "name", ":", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "username_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "puts_", "(_", "\"{", "0", "}.", " ", "{", "1", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "colored_", "._", "blue_", "(_", "\"", "oct", "ogi", "t", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "colored_", "._", "red_", "(_", "\"", "User", "name", " ", "was", " ", "blank", "\"_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "password_", "=_", "arguments_", "[_", "'", "password", "'_", "]_", "or_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "password_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "getpass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "getpass_", "._", "getpass_", "(_", "\"", "Passw", "ord", " ", "for", " ", "%", "s", ":", " ", "\"_", "%_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "login_", "(_", "username_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get", "\\u", "help_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
zeaphoo/cocopot/cocopot/_compat.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"\n Some py2/py3 compatibility support based on a stripped down\n version of six so we don't have to depend on a specific version\n of it.\n\n\"\"\"\nimport sys\n\nPY2 = sys.version_info[0] == 2\n_identity = lambda x: x\n\nimport sys\nimport operator\nimport functools\ntry:\n import builtins\nexcept ImportError:\n import __builtin__ as builtins\n\n\nif PY2:\n unichr = unichr\n text_type = unicode\n string_types = (str, unicode)\n integer_types = (int, long)\n int_to_byte = chr\n\n exec('def reraise(tp, value, tb=None):\\n raise tp, value, tb')\n\n from itertools import imap, izip, ifilter\n range_type = xrange\n\n from StringIO import StringIO\n from cStringIO import StringIO as BytesIO\n\nelse:\n unichr = chr\n text_type = str\n string_types = (str, )\n integer_types = (int, )\n\n\n imap = map\n izip = zip\n ifilter = filter\n range_type = range\n\n from io import StringIO, BytesIO\n\n# Some helpers for string/byte handling\n\n\n\nto_native = to_bytes if PY2 else to_unicode\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def reraise(tp, value, tb=None):\n if value.__traceback__ is not tb:\n raise value.with_traceback(tb)\n raise value", "metadata": "root.reraise", "header": "['module', '___EOS___']", "index": 42 }, { "content": "def to_bytes(s, enc='utf8'):\n if s is None:\n return None\n return s.encode(enc) if isinstance(s, text_type) else bytes(s)", "metadata": "root.to_bytes", "header": "['module', '___EOS___']", "index": 55 }, { "content": "def to_unicode(s, enc='utf8', err='strict'):\n if s is None:\n return None\n if isinstance(s, bytes):\n return s.decode(enc, err)\n else:\n return text_type(s)", "metadata": "root.to_unicode", "header": "['module', '___EOS___']", "index": 61 } ]
[ { "span": "import operator", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 15 }, { "span": "import functools", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 16 }, { "span": "import builtins", "start_line": 16, "start_column": 4, "end_line": 16, "end_column": 19 }, { "span": "import __builtin__ as builtins", "start_line": 18, "start_column": 4, "end_line": 18, "end_column": 34 }, { "span": "from io import StringIO, BytesIO", "start_line": 52, "start_column": 4, "end_line": 52, "end_column": 36 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Some", " ", "py2", "/", "py3", " ", "compatibility", " ", "support", " ", "based", " ", "on", " ", "a", " ", "strip", "ped", " ", "down", "\\", "10", ";", " ", " ", " ", " ", "version", " ", "of", " ", "si", "x", " ", "so", " ", "we", " ", "don", "'", "t", " ", "have", " ", "to", " ", "depend", " ", "on", " ", "a", " ", "specific", " ", "version", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "it", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PY", "2_", "=_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", "]_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "identity_", "=_", "lambda_", "x_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "functools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "builtins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "\\u\\u", "builtin\\u\\u_", "as_", "builtins_", "\\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_", "PY", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unichr_", "=_", "unichr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "type_", "=_", "unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string", "\\u", "types_", "=_", "(_", "str_", ",_", "unicode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "integ", "er", "\\u", "types_", "=_", "(_", "int_", ",_", "long_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "int\\u", "to", "\\u", "byte_", "=_", "chr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exec_", "(_", "'", "def", " ", "reraise", "(", "tp", ",", " ", "value", ",", " ", "tb", "=", "Non", "e", "):", "\\\\", "n", " ", "raise", " ", "tp", ",", " ", "value", ",", " ", "tb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "itertools_", "import_", "imap_", ",_", "izip_", ",_", "ifi", "lter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "range", "\\u", "type_", "=_", "xrange_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "as_", "Byte", "s", "IO_", "\\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 ", " _", "unichr_", "=_", "chr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "type_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string", "\\u", "types_", "=_", "(_", "str_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "integ", "er", "\\u", "types_", "=_", "(_", "int_", ",_", ")_", "\\u\\u\\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_", "imap_", "=_", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "izip_", "=_", "zip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ifi", "lter_", "=_", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "range", "\\u", "type_", "=_", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "io_", "import_", "String", "IO_", ",_", "Byte", "s", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Some", " ", "help", "ers", " ", "for", " ", "string", "/", "byte", " ", "handling", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "to", "\\u", "native_", "=_", "to", "\\u", "bytes_", "if_", "PY", "2_", "else_", "to", "\\u", "unicode_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "reraise", "_", "(_", "tp_", ",_", "value_", ",_", "tb_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "._", "\\u\\u", "traceback", "\\u\\u_", "is_", "not_", "tb_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "value_", "._", "with", "\\u", "traceback_", "(_", "tb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "bytes_", "(_", "s_", ",_", "enc_", "=_", "'", "utf", "8", "'_", ")_", ":_", "\\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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "s_", "._", "encode_", "(_", "enc_", ")_", "if_", "isinstance_", "(_", "s_", ",_", "text", "\\u", "type_", ")_", "else_", "bytes_", "(_", "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_", "to", "\\u", "unicode_", "(_", "s_", ",_", "enc_", "=_", "'", "utf", "8", "'_", ",_", "err_", "=_", "'", "strict", "'_", ")_", ":_", "\\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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "s_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "._", "decode_", "(_", "enc_", ",_", "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 ", " _", "return_", "text", "\\u", "type_", "(_", "s_", ")_", "\\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, 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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
dropbox/nsot/tests/api_tests/test_networks.py
[ { "content": "def test_creation(live_server, user, site):\n \"\"\"Test creation of Networks.\"\"\"\n admin_client = Client(live_server, 'admin')\n user_client = Client(live_server, 'user')\n cidr = '10.0.0.0/24'\n\n # URIs\n site_uri = site.list_uri()\n attr_uri = site.list_uri('attribute')\n net_uri = site.list_uri('network')\n\n admin_client.create(attr_uri, resource_name='Network', name='attr1')\n\n # Invalid permissions\n assert_error(\n user_client.create(\n net_uri, cidr=cidr, attributes={'attr1': 'foo'}\n ),\n status.HTTP_403_FORBIDDEN\n )\n\n # Missing required field (cidr)\n assert_error(\n admin_client.create(net_uri, attributes={'attr1': 'foo'}),\n status.HTTP_400_BAD_REQUEST\n )\n\n # Null cidr\n assert_error(\n admin_client.create(net_uri, cidr=None),\n status.HTTP_400_BAD_REQUEST\n )\n\n # Verify Successful Creation\n net_resp = admin_client.create(\n net_uri, cidr=cidr, attributes={'attr1': 'foo'},\n state='reserved',\n )\n net = get_result(net_resp)\n net_obj_uri = site.detail_uri('network', id=net['id'])\n\n assert_created(net_resp, net_obj_uri)\n\n # Verify Successful get of all Networks\n payload = get_result(net_resp)\n expected = [payload]\n\n assert_success(admin_client.get(net_uri), expected)\n\n # Verify Successful get of single Network\n assert_success(admin_client.get(net_obj_uri), net)\n\n # Verify successful get of single Network by natural_key\n net_natural_uri = site.detail_uri('network', id=cidr)\n assert_success(admin_client.get(net_natural_uri), net)\n\n # Test creation by network_address, prefix_length\n params = {'network_address': '10.8.0.0', 'prefix_length': 16}\n net2_resp = admin_client.create(net_uri, **params)\n net2 = get_result(net2_resp)\n net2_obj_uri = site.detail_uri('network', id=net2['id'])\n assert_created(net2_resp, net2_obj_uri)\n\n # Delete it and then re-recreate it w/ the original payload\n assert_deleted(admin_client.delete(net2_obj_uri))\n net2a_resp = admin_client.create(net_uri, **params)\n net2a = get_result(net2a_resp)\n net2a_obj_uri = site.detail_uri('network', id=net2a['id'])\n assert_created(net2a_resp, net2a_obj_uri)", "metadata": "root.test_creation", "header": "['module', '___EOS___']", "index": 24 }, { "content": "def test_filters(site, client):\n \"\"\"Test cidr/address/prefix/attribute filters for Networks.\"\"\"\n\n # URIs\n attr_uri = site.list_uri('attribute')\n net_uri = site.list_uri('network')\n\n # Pre-load the Attributes\n client.post(attr_uri, data=load('attributes.json'))\n\n # Populate the Network objects and retreive them for testing.\n client.post(net_uri, data=load('networks.json'))\n net_resp = client.retrieve(net_uri)\n networks = get_result(net_resp)\n\n # Test lookup by cidr\n wanted = ['10.0.0.0/8']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, cidr='10.0.0.0/8'),\n expected\n )\n\n # Test lookup by attributes\n wanted = ['192.168.0.0/16', '172.16.0.0/12']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, attributes='foo=baz'),\n expected\n )\n\n # Test lookup with multiple attributes\n wanted = ['172.16.0.0/12']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, attributes=['foo=baz', 'cluster=lax']),\n expected\n )\n\n # Test lookup by network_address\n wanted = ['169.254.0.0/16']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, network_address='169.254.0.0'),\n expected\n )\n\n # Test lookup by prefix_length\n wanted = ['192.168.0.0/16', '169.254.0.0/16']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, prefix_length=16),\n expected\n )\n\n # Test lookup by network_address + prefix_length\n wanted = ['10.0.0.0/8']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, network_address='10.0.0.0', prefix_length=8),\n expected\n )\n\n # Test include_ips=True, include_networks=False\n wanted = ['192.168.0.1/32']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, include_ips=True, include_networks=False),\n expected\n )\n\n # Test include_ips=False, include_networks=True\n wanted = ['192.168.0.0/16', '10.0.0.0/8', '172.16.0.0/12',\n '169.254.0.0/16', '192.168.0.0/24', '192.168.0.0/25']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, include_ips=False, include_networks=True),\n expected\n )\n\n # Test include_ips=True, include_networks=True\n wanted = ['192.168.0.0/16', '10.0.0.0/8', '172.16.0.0/12',\n '169.254.0.0/16', '192.168.0.1/32', '192.168.0.0/24',\n '192.168.0.0/25']\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, include_ips=True, include_networks=True),\n expected\n )\n\n # Test include_ips=False, include_networks=False\n wanted = []\n expected = filter_networks(networks, wanted)\n assert_success(\n client.retrieve(net_uri, include_ips=False, include_networks=False),\n expected\n )\n\n # Test lookup by ip_version (against ipv6)\n ipv6_resp = client.create(net_uri, cidr='2401:d:d0e::/64')\n ipv6 = get_result(ipv6_resp)\n wanted = ['2401:d:d0e::/64']\n expected = [ipv6]\n assert_success(\n client.retrieve(net_uri, ip_version='6'),\n expected\n )", "metadata": "root.test_filters", "header": "['module', '___EOS___']", "index": 130 }, { "content": "def test_update(live_server, user, site):\n \"\"\"Test updating Networks by pk and natural_key.\"\"\"\n admin_client = Client(live_server, 'admin')\n user_client = Client(live_server, 'user')\n cidr = '10.0.0.0/24'\n\n # URIs\n site_uri = site.list_uri()\n attr_uri = site.list_uri('attribute')\n net_uri = site.list_uri('network')\n\n admin_client.create(attr_uri, resource_name='Network', name='attr1')\n net_resp = admin_client.create(\n net_uri, cidr=cidr, attributes={'attr1': 'foo'},\n state='reserved'\n )\n\n # Extract the Network object so that we can play w/ it during update tests.\n net = get_result(net_resp)\n net_obj_uri = site.detail_uri('network', id=net['id'])\n\n # Empty attributes should only clear attributes. Change state to 'allocatd'\n params = {'attributes': {}, 'state': 'allocated'}\n net.update(params)\n\n assert_success(\n admin_client.update(net_obj_uri, **params),\n net\n )\n\n # Now put attributes back\n params['attributes'] = {'attr1': 'foo'}\n net.update(params)\n\n assert_success(\n admin_client.update(net_obj_uri, **params),\n net\n )\n\n # Invalid permissions\n assert_error(user_client.update(net_obj_uri), status.HTTP_403_FORBIDDEN)\n\n # Test update by natural_key by zeroing out the attribtues again.\n params = {'attributes': {}, 'state': 'orphaned'}\n net.update(params)\n\n net_natural_uri = site.detail_uri('network', id=cidr)\n assert_success(\n admin_client.update(net_natural_uri, **params),\n net\n )", "metadata": "root.test_update", "header": "['module', '___EOS___']", "index": 303 }, { "content": "def test_partial_update(site, client):\n \"\"\"\"Test PATCH operations to partially update a Network.\"\"\"\n net_uri = site.list_uri('network')\n attr_uri = site.list_uri('attribute')\n cidr = '10.0.0.0/24'\n\n client.create(attr_uri, resource_name='Network', name='attr1')\n net_resp = client.create(\n net_uri, cidr=cidr, attributes={'attr1': 'foo'}\n )\n\n # Extract the Network object so that we can play w/ it during update tests.\n net = get_result(net_resp)\n net_pk_uri = site.detail_uri('network', id=net['id'])\n net_natural_uri = site.detail_uri('network', id=cidr)\n\n # Now PATCH it by providing *only* the state, which wouldn't be\n # possible in a PUT.\n params = {'state': 'reserved'}\n net.update(params)\n\n assert_success(\n client.partial_update(net_pk_uri, **params),\n net\n )\n\n # And just to make sure a PUT with the same payload fails...\n assert_error(\n client.update(net_pk_uri, **params),\n status.HTTP_400_BAD_REQUEST\n )", "metadata": "root.test_partial_update", "header": "['module', '___EOS___']", "index": 356 }, { "content": "def test_deletion(site, client):\n \"\"\"Test deletion of Networks.\"\"\"\n net_uri = site.list_uri('network')\n attr_uri = site.list_uri('attribute')\n\n net1_resp = client.create(net_uri, cidr='10.0.0.0/24')\n net1 = get_result(net1_resp)\n net1_obj_uri = site.detail_uri('network', id=net1['id'])\n\n net2_resp = client.create(net_uri, cidr='10.0.0.1/32')\n net2 = get_result(net2_resp)\n net2_obj_uri = site.detail_uri('network', id=net2['id'])\n\n # Don't allow delete when there's an attached subnet/ip\n assert_error(client.delete(net1_obj_uri), status.HTTP_409_CONFLICT)\n\n # Delete the child Network\n client.delete(net2_obj_uri)\n\n # And safely delete the parent Network\n assert_deleted(client.delete(net1_obj_uri))\n\n # Create Network 3 and delete it by natural_key\n net3_resp = client.create(net_uri, cidr='10.0.0.0/8')\n net3 = get_result(net3_resp)\n net3_natural_uri = site.detail_uri('network', id=mkcidr(net3))\n assert_deleted(client.delete(net3_natural_uri))", "metadata": "root.test_deletion", "header": "['module', '___EOS___']", "index": 389 }, { "content": "def test_mptt_detail_routes(site, client):\n \"\"\"Test detail routes for ancestor/children/descendents/root methods.\"\"\"\n net_uri = site.list_uri('network')\n\n client.create(net_uri, cidr='10.0.0.0/8')\n client.create(net_uri, cidr='10.16.0.0/12')\n client.create(net_uri, cidr='10.16.0.0/14')\n client.create(net_uri, cidr='10.16.2.0/25')\n client.create(net_uri, cidr='10.16.2.1/32')\n client.create(net_uri, cidr='10.16.2.2/32')\n\n net_8_resp = client.retrieve(net_uri, cidr='10.0.0.0/8')\n net_8 = get_result(net_8_resp)[0]\n net_8_obj_uri = site.detail_uri('network', id=net_8['id'])\n\n net_12_resp = client.retrieve(net_uri, cidr='10.16.0.0/12')\n net_12 = get_result(net_12_resp)[0]\n net_12_obj_uri = site.detail_uri('network', id=net_12['id'])\n\n net_14_resp = client.retrieve(net_uri, cidr='10.16.0.0/14')\n net_14 = get_result(net_14_resp)[0]\n net_14_obj_uri = site.detail_uri('network', id=net_14['id'])\n\n net_25_resp = client.retrieve(net_uri, cidr='10.16.2.0/25')\n net_25 = get_result(net_25_resp)[0]\n net_25_obj_uri = site.detail_uri('network', id=net_25['id'])\n\n ip1_resp = client.retrieve(net_uri, cidr='10.16.2.1/32')\n ip1 = get_result(ip1_resp)[0]\n ip1_obj_uri = site.detail_uri('network', id=ip1['id'])\n\n ip2_resp = client.retrieve(net_uri, cidr='10.16.2.2/32')\n ip2 = get_result(ip2_resp)[0]\n ip2_obj_uri = site.detail_uri('network', id=ip2['id'])\n\n # ancestors\n expected = [net_8, net_12, net_14]\n uri = reverse('network-ancestors', args=(site.id, net_25['id']))\n natural_uri = reverse('network-ancestors', args=(site.id, mkcidr(net_25)))\n assert_success(client.retrieve(uri), expected)\n\n expected = [net_14, net_12, net_8]\n assert_success(client.retrieve(uri, ascending=True), expected)\n assert_success(client.retrieve(natural_uri, ascending=True), expected)\n\n # children\n uri = reverse('network-children', args=(site.id, net_25['id']))\n natural_uri = reverse('network-children', args=(site.id, mkcidr(net_25)))\n wanted = [ip1, ip2]\n expected = wanted\n assert_success(client.retrieve(uri), expected)\n assert_success(client.retrieve(natural_uri), expected)\n\n uri = reverse('network-children', args=(site.id, net_12['id']))\n natural_uri = reverse('network-children', args=(site.id, mkcidr(net_12)))\n wanted = [net_14]\n expected = wanted\n assert_success(client.retrieve(uri), expected)\n assert_success(client.retrieve(natural_uri), expected)\n\n # descendents\n uri = reverse('network-descendents', args=(site.id, net_8['id']))\n natural_uri = reverse('network-descendents', args=(site.id, mkcidr(net_8)))\n wanted = [net_12, net_14, net_25, ip1, ip2]\n expected = wanted\n assert_success(client.retrieve(uri), expected)\n assert_success(client.retrieve(natural_uri), expected)\n\n uri = reverse('network-descendents', args=(site.id, net_14['id']))\n natural_uri = reverse(\n 'network-descendents', args=(site.id, mkcidr(net_14))\n )\n wanted = [net_25, ip1, ip2]\n expected = wanted\n assert_success(client.retrieve(uri), expected)\n assert_success(client.retrieve(natural_uri), expected)\n\n uri = reverse('network-descendents', args=(site.id, ip2['id']))\n natural_uri = reverse('network-descendents', args=(site.id, mkcidr(ip2)))\n expected = []\n assert_success(client.retrieve(uri), expected)\n assert_success(client.retrieve(natural_uri), expected)\n\n # parent\n uri = reverse('network-parent', args=(site.id, ip2['id']))\n natural_uri = reverse('network-parent', args=(site.id, mkcidr(ip2)))\n assert_success(client.retrieve(uri), net_25)\n assert_success(client.retrieve(natural_uri), net_25)\n\n # root\n uri = reverse('network-root', args=(site.id, ip1['id']))\n natural_uri = reverse('network-root', args=(site.id, mkcidr(ip1)))\n assert_success(client.retrieve(uri), net_8)\n assert_success(client.retrieve(natural_uri), net_8)\n\n uri = reverse('network-root', args=(site.id, net_8['id']))\n natural_uri = reverse('network-root', args=(site.id, mkcidr(net_8)))\n assert_error(client.retrieve(uri), status.HTTP_404_NOT_FOUND)\n assert_error(client.retrieve(natural_uri), status.HTTP_404_NOT_FOUND)\n\n # siblings\n uri = reverse('network-siblings', args=(site.id, ip1['id']))\n natural_uri = reverse('network-siblings', args=(site.id, mkcidr(ip1)))\n wanted = [ip2]\n expected = wanted\n assert_success(client.retrieve(uri), expected)\n assert_success(client.retrieve(natural_uri), expected)\n\n wanted = [ip1, ip2]\n expected = wanted\n assert_success(client.retrieve(uri, include_self=True), expected)\n assert_success(client.retrieve(natural_uri, include_self=True), expected)", "metadata": "root.test_mptt_detail_routes", "header": "['module', '___EOS___']", "index": 418 }, { "content": "def test_get_next_detail_routes(site, client):\n \"\"\"Test the detail routes for getting next available networks/addresses.\"\"\"\n net_uri = site.list_uri('network')\n\n client.create(net_uri, cidr='10.16.2.0/25')\n client.create(net_uri, cidr='10.16.2.8/29')\n client.create(net_uri, cidr='10.16.2.1/32')\n client.create(net_uri, cidr='10.16.2.2/32')\n client.create(net_uri, cidr='10.16.2.4/32')\n client.create(net_uri, cidr='10.16.2.17/32')\n\n net_25_resp = client.retrieve(net_uri, cidr='10.16.2.0/25')\n net_25 = get_result(net_25_resp)[0]\n net_25_obj_uri = site.detail_uri('network', id=net_25['id'])\n\n net_29_resp = client.retrieve(net_uri, cidr='10.16.2.8/29')\n net_29 = get_result(net_29_resp)[0]\n net_29_obj_uri = site.detail_uri('network', id=net_29['id'])\n\n ip1_resp = client.retrieve(net_uri, cidr='10.16.2.1/32')\n ip1 = get_result(ip1_resp)[0]\n ip1_obj_uri = site.detail_uri('network', id=ip1['id'])\n\n ip2_resp = client.retrieve(net_uri, cidr='10.16.2.2/32')\n ip2 = get_result(ip2_resp)[0]\n ip2_obj_uri = site.detail_uri('network', id=ip2['id'])\n\n ip3_resp = client.retrieve(net_uri, cidr='10.16.2.2/32')\n ip3 = get_result(ip3_resp)[0]\n ip3_obj_uri = site.detail_uri('network', id=ip3['id'])\n\n #\n # next_network\n #\n uri = reverse('network-next-network', args=(site.id, net_25['id']))\n natural_uri = reverse(\n 'network-next-network', args=(site.id, mkcidr(net_25))\n )\n\n # A single /28\n expected = [u'10.16.2.0/28']\n assert_success(client.retrieve(uri, prefix_length=28), expected)\n assert_success(client.retrieve(natural_uri, prefix_length=28), expected)\n\n # 4x /27\n networks = [u'10.16.2.0/27', u'10.16.2.32/27', u'10.16.2.64/27', u'10.16.2.96/27']\n assert_success(\n client.retrieve(uri, prefix_length=27, num=4),\n networks\n )\n assert_success(\n client.retrieve(natural_uri, prefix_length=27, num=4),\n networks\n )\n\n # Missing/invalid prefix_length\n ## by pk\n assert_error(client.retrieve(uri), status.HTTP_400_BAD_REQUEST)\n assert_error(client.retrieve(uri, prefix_length='ralph'), status.HTTP_400_BAD_REQUEST)\n assert_error(client.retrieve(uri, prefix_length=14), status.HTTP_400_BAD_REQUEST)\n assert_error(client.retrieve(uri, prefix_length=65), status.HTTP_400_BAD_REQUEST)\n ## by natural_key\n assert_error(client.retrieve(natural_uri), status.HTTP_400_BAD_REQUEST)\n assert_error(\n client.retrieve(natural_uri, prefix_length='ralph'),\n status.HTTP_400_BAD_REQUEST\n )\n assert_error(\n client.retrieve(natural_uri, prefix_length=14),\n status.HTTP_400_BAD_REQUEST\n )\n assert_error(\n client.retrieve(natural_uri, prefix_length=65), status.HTTP_400_BAD_REQUEST\n )\n\n # Invalid num\n assert_error(\n client.retrieve(uri, prefix_length=28, num='potato'),\n status.HTTP_400_BAD_REQUEST\n )\n\n #\n # next_address\n #\n uri = reverse('network-next-address', args=(site.id, net_25['id']))\n natural_uri = reverse(\n 'network-next-address', args=(site.id, mkcidr(net_25))\n )\n\n # A single /32\n assert_success(client.retrieve(uri), [u'10.16.2.3/32'])\n assert_success(client.retrieve(natural_uri), [u'10.16.2.3/32'])\n\n # 3x /32\n addresses = [u'10.16.2.3/32', u'10.16.2.5/32', u'10.16.2.6/32']\n assert_success(client.retrieve(uri, num=3), addresses)\n assert_success(client.retrieve(natural_uri, num=3), addresses)\n\n # Invalid num is all we can really test for.\n assert_error(\n client.retrieve(uri, num='potato'),\n status.HTTP_400_BAD_REQUEST\n )\n assert_error(\n client.retrieve(natural_uri, num='potato'),\n status.HTTP_400_BAD_REQUEST\n )", "metadata": "root.test_get_next_detail_routes", "header": "['module', '___EOS___']", "index": 532 }, { "content": "def test_closest_parent_detail_route(site, client):\n \"\"\"\n Test the detail route for looking up the closest parent for a\n Network.\n\n GET /api/sites/1/networks/10.250.0.1/32/closest_parent/\n \"\"\"\n net_uri = site.list_uri('network')\n\n # Create networks\n root_resp = client.create(net_uri, cidr='10.250.0.0/16')\n root = get_result(root_resp)\n parent_resp = client.create(net_uri, cidr='10.250.0.0/24')\n parent = get_result(parent_resp)\n\n # Closest parent for non-existent /32 should be ``parent``\n closest_uri = reverse(\n 'network-closest-parent', args=(site.id, '10.250.0.1/32')\n )\n expected = parent\n assert_success(client.retrieve(closest_uri), expected)\n\n # Matching ip with shorter prefix_length should 404\n assert_error(\n client.retrieve(closest_uri, prefix_length=27),\n status.HTTP_404_NOT_FOUND\n )\n\n # Invalid prefix_length should 400\n assert_error(\n client.retrieve(closest_uri, prefix_length='shoe'),\n status.HTTP_400_BAD_REQUEST\n )\n\n # Invalid cidr should 400\n bad_closest_uri = reverse(\n 'network-closest-parent', args=(site.id, 1)\n )\n assert_error(client.retrieve(bad_closest_uri), status.HTTP_400_BAD_REQUEST)\n\n # Alpha cidr should 404\n abc_closest_uri = reverse(\n 'network-closest-parent', args=(site.id, 'bogus')\n )\n assert_error(client.retrieve(abc_closest_uri), status.HTTP_404_NOT_FOUND)\n\n # If a closest parent isn't found it should 404\n no_closest_uri = reverse(\n 'network-closest-parent', args=(site.id, '1.0.0.1/32')\n )\n assert_error(client.retrieve(no_closest_uri), status.HTTP_404_NOT_FOUND)", "metadata": "root.test_closest_parent_detail_route", "header": "['module', '___EOS___']", "index": 655 } ]
[ { "span": "site_uri ", "start_line": 31, "start_column": 4, "end_line": 31, "end_column": 12 }, { "span": "wanted ", "start_line": 231, "start_column": 4, "end_line": 231, "end_column": 10 }, { "span": "site_uri ", "start_line": 310, "start_column": 4, "end_line": 310, "end_column": 12 }, { "span": "net_natural_uri ", "start_line": 370, "start_column": 4, "end_line": 370, "end_column": 19 }, { "span": "attr_uri ", "start_line": 392, "start_column": 4, "end_line": 392, "end_column": 12 }, { "span": "net_8_obj_uri ", "start_line": 431, "start_column": 4, "end_line": 431, "end_column": 17 }, { "span": "net_12_obj_uri ", "start_line": 435, "start_column": 4, "end_line": 435, "end_column": 18 }, { "span": "net_14_obj_uri ", "start_line": 439, "start_column": 4, "end_line": 439, "end_column": 18 }, { "span": "net_25_obj_uri ", "start_line": 443, "start_column": 4, "end_line": 443, "end_column": 18 }, { "span": "ip1_obj_uri ", "start_line": 447, "start_column": 4, "end_line": 447, "end_column": 15 }, { "span": "ip2_obj_uri ", "start_line": 451, "start_column": 4, "end_line": 451, "end_column": 15 }, { "span": "net_25_obj_uri ", "start_line": 545, "start_column": 4, "end_line": 545, "end_column": 18 }, { "span": "net_29_obj_uri ", "start_line": 549, "start_column": 4, "end_line": 549, "end_column": 18 }, { "span": "ip1_obj_uri ", "start_line": 553, "start_column": 4, "end_line": 553, "end_column": 15 }, { "span": "ip2_obj_uri ", "start_line": 557, "start_column": 4, "end_line": 557, "end_column": 15 }, { "span": "ip3_obj_uri ", "start_line": 561, "start_column": 4, "end_line": 561, "end_column": 15 }, { "span": "root ", "start_line": 666, "start_column": 4, "end_line": 666, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "creation_", "(_", "live", "\\u", "server_", ",_", "user_", ",_", "site_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "creati", "on", " ", "of", " ", "Network", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin", "\\u", "client_", "=_", "Client_", "(_", "live", "\\u", "server_", ",_", "'", "admin", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "client_", "=_", "Client_", "(_", "live", "\\u", "server_", ",_", "'", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cidr_", "=_", "'", "10.", "0.", "0.", "0", "/", "24", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "URI", "s_", "\\u\\u\\uNL\\u\\u\\u_", "site", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attr", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "attribute", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "client_", "._", "create_", "(_", "attr", "\\u", "uri_", ",_", "resource", "\\u", "name_", "=_", "'", "Network", "'_", ",_", "name_", "=_", "'", "attr", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inva", "lid", " ", "permissions_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "client_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "cidr_", ",_", "attributes_", "=_", "{_", "'", "attr", "1", "'_", ":_", "'", "foo", "'_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "403", "\\u", "FORB", "IDD", "EN_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Missing", " ", "require", "d", " ", "field", " ", "(", "cid", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "attributes_", "=_", "{_", "'", "attr", "1", "'_", ":_", "'", "foo", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Null", " ", "cidr_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "Success", "ful", " ", "Creat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "resp_", "=_", "admin", "\\u", "client_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "cidr_", ",_", "attributes_", "=_", "{_", "'", "attr", "1", "'_", ":_", "'", "foo", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "=_", "'", "reserve", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "created_", "(_", "net", "\\u", "resp_", ",_", "net", "\\u", "obj", "\\u", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "Success", "ful", " ", "get", " ", "of", " ", "all", " ", "Network", "s_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "payload_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "success_", "(_", "admin", "\\u", "client_", "._", "get_", "(_", "net", "\\u", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "Success", "ful", " ", "get", " ", "of", " ", "single", " ", "Network_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "success_", "(_", "admin", "\\u", "client_", "._", "get_", "(_", "net", "\\u", "obj", "\\u", "uri_", ")_", ",_", "net_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "success", "ful", " ", "get", " ", "of", " ", "single", " ", "Network", " ", "by", " ", "natur", "al", "\\u", "key_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "natur", "al", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "cidr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "admin", "\\u", "client_", "._", "get_", "(_", "net", "\\u", "natur", "al", "\\u", "uri_", ")_", ",_", "net_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "creati", "on", " ", "by", " ", "network", "\\u", "address", ",", " ", "prefix", "\\u", "length_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "{_", "'", "network", "\\u", "address", "'_", ":_", "'", "10.", "8.0", ".0", "'_", ",_", "'", "prefix", "\\u", "length", "'_", ":_", "16_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "2", "\\u", "resp_", "=_", "admin", "\\u", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "**_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "2_", "=_", "get", "\\u", "result_", "(_", "net", "2", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "2", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "2_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "created_", "(_", "net", "2", "\\u", "resp_", ",_", "net", "2", "\\u", "obj", "\\u", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete", " ", "it", " ", "and", " ", "then", " ", "re", "-", "recreate", " ", "it", " ", "w", "/", " ", "the", " ", "original", " ", "payload_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "deleted_", "(_", "admin", "\\u", "client_", "._", "delete_", "(_", "net", "2", "\\u", "obj", "\\u", "uri_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "2a", "\\u", "resp_", "=_", "admin", "\\u", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "**_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "2a", "_", "=_", "get", "\\u", "result_", "(_", "net", "2a", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "2a", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "2a", "_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "created_", "(_", "net", "2a", "\\u", "resp_", ",_", "net", "2a", "\\u", "obj", "\\u", "uri_", ")_", "\\u\\u\\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", "filters_", "(_", "site_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "cid", "r", "/", "address", "/", "prefix", "/", "attribute", " ", "filter", "s", " ", "for", " ", "Network", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "URI", "s_", "\\u\\u\\uNL\\u\\u\\u_", "attr", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "attribute", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pre", "-", "load", " ", "the", " ", "Attributes_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "post_", "(_", "attr", "\\u", "uri_", ",_", "data_", "=_", "load_", "(_", "'", "attribute", "s", ".", "json", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Populate", " ", "the", " ", "Network", " ", "object", "s", " ", "and", " ", "retr", "eive", " ", "them", " ", "for", " ", "testi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "post_", "(_", "net", "\\u", "uri_", ",_", "data_", "=_", "load_", "(_", "'", "network", "s", ".", "json", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "networks_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "look", "up", " ", "by", " ", "cidr_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "10.", "0.", "0.", "0", "/", "8", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.", "0.", "0.", "0", "/", "8", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "look", "up", " ", "by", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "192", ".1", "68.", "0.", "0", "/", "16", "'_", ",_", "'", "172", ".1", "6.0", ".0", "/", "1", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "attributes_", "=_", "'", "foo", "=", "ba", "z", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "look", "up", " ", "with", " ", "multiple", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "172", ".1", "6.0", ".0", "/", "1", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "attributes_", "=_", "[_", "'", "foo", "=", "ba", "z", "'_", ",_", "'", "cluster", "=", "la", "x", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "look", "up", " ", "by", " ", "network", "\\u", "address_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "169", ".2", "54.", "0.", "0", "/", "16", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "network", "\\u", "address_", "=_", "'", "169", ".2", "54.", "0.", "0", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "look", "up", " ", "by", " ", "prefix", "\\u", "length_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "192", ".1", "68.", "0.", "0", "/", "16", "'_", ",_", "'", "169", ".2", "54.", "0.", "0", "/", "16", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "prefix", "\\u", "length_", "=_", "16_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "look", "up", " ", "by", " ", "network", "\\u", "address", " ", "+", " ", "prefix", "\\u", "length_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "10.", "0.", "0.", "0", "/", "8", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "network", "\\u", "address_", "=_", "'", "10.", "0.", "0.", "0", "'_", ",_", "prefix", "\\u", "length_", "=_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "include", "\\u", "ips", "=", "Tru", "e", ",", " ", "include", "\\u", "network", "s", "=", "False_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "192", ".1", "68.", "0.", "1", "/", "32", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "include", "\\u", "ips_", "=_", "True_", ",_", "include", "\\u", "networks_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "include", "\\u", "ips", "=", "Fal", "se", ",", " ", "include", "\\u", "network", "s", "=", "True_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "192", ".1", "68.", "0.", "0", "/", "16", "'_", ",_", "'", "10.", "0.", "0.", "0", "/", "8", "'_", ",_", "'", "172", ".1", "6.0", ".0", "/", "1", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "169", ".2", "54.", "0.", "0", "/", "16", "'_", ",_", "'", "192", ".1", "68.", "0.", "0", "/", "24", "'_", ",_", "'", "192", ".1", "68.", "0.", "0", "/", "25", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "include", "\\u", "ips_", "=_", "False_", ",_", "include", "\\u", "networks_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "include", "\\u", "ips", "=", "Tru", "e", ",", " ", "include", "\\u", "network", "s", "=", "True_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "'", "192", ".1", "68.", "0.", "0", "/", "16", "'_", ",_", "'", "10.", "0.", "0.", "0", "/", "8", "'_", ",_", "'", "172", ".1", "6.0", ".0", "/", "1", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "169", ".2", "54.", "0.", "0", "/", "16", "'_", ",_", "'", "192", ".1", "68.", "0.", "1", "/", "32", "'_", ",_", "'", "192", ".1", "68.", "0.", "0", "/", "24", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "192", ".1", "68.", "0.", "0", "/", "25", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "include", "\\u", "ips_", "=_", "True_", ",_", "include", "\\u", "networks_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "include", "\\u", "ips", "=", "Fal", "se", ",", " ", "include", "\\u", "network", "s", "=", "False_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "filter", "\\u", "networks_", "(_", "networks_", ",_", "wanted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "include", "\\u", "ips_", "=_", "False_", ",_", "include", "\\u", "networks_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "look", "up", " ", "by", " ", "ip", "\\u", "version", " ", "(", "against", " ", "ipv", "6", ")_", "\\u\\u\\uNL\\u\\u\\u_", "ipv", "6", "\\u", "resp_", "=_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "240", "1", ":", "d", ":", "d0", "e", "::", "/", "64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipv6_", "=_", "get", "\\u", "result_", "(_", "ipv", "6", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wanted_", "=_", "[_", "'", "240", "1", ":", "d", ":", "d0", "e", "::", "/", "64", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "ipv6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "ip", "\\u", "version_", "=_", "'", "6", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "\\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", "update_", "(_", "live", "\\u", "server_", ",_", "user_", ",_", "site_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "updat", "ing", " ", "Network", "s", " ", "by", " ", "pk", " ", "and", " ", "natur", "al", "\\u", "key", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin", "\\u", "client_", "=_", "Client_", "(_", "live", "\\u", "server_", ",_", "'", "admin", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "client_", "=_", "Client_", "(_", "live", "\\u", "server_", ",_", "'", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cidr_", "=_", "'", "10.", "0.", "0.", "0", "/", "24", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "URI", "s_", "\\u\\u\\uNL\\u\\u\\u_", "site", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attr", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "attribute", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "client_", "._", "create_", "(_", "attr", "\\u", "uri_", ",_", "resource", "\\u", "name_", "=_", "'", "Network", "'_", ",_", "name_", "=_", "'", "attr", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "resp_", "=_", "admin", "\\u", "client_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "cidr_", ",_", "attributes_", "=_", "{_", "'", "attr", "1", "'_", ":_", "'", "foo", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "=_", "'", "reserve", "d", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "the", " ", "Network", " ", "object", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "play", " ", "w", "/", " ", "it", " ", "dur", "ing", " ", "update", " ", "tests", "._", "\\u\\u\\uNL\\u\\u\\u_", "net_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Emp", "ty", " ", "attribute", "s", " ", "shou", "ld", " ", "only", " ", "clear", " ", "attribute", "s", ".", " ", "Change", " ", "state", " ", "to", " ", "'", "allocat", "d", "'_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "{_", "'", "attribute", "s", "'_", ":_", "{_", "}_", ",_", "'", "state", "'_", ":_", "'", "allocated", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net_", "._", "update_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "client_", "._", "update_", "(_", "net", "\\u", "obj", "\\u", "uri_", ",_", "**_", "params_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "net_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "put", " ", "attribute", "s", " ", "back_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "attribute", "s", "'_", "]_", "=_", "{_", "'", "attr", "1", "'_", ":_", "'", "foo", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net_", "._", "update_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "client_", "._", "update_", "(_", "net", "\\u", "obj", "\\u", "uri_", ",_", "**_", "params_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "net_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inva", "lid", " ", "permissions_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "user", "\\u", "client_", "._", "update_", "(_", "net", "\\u", "obj", "\\u", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "403", "\\u", "FORB", "IDD", "EN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "update", " ", "by", " ", "natur", "al", "\\u", "key", " ", "by", " ", "zero", "ing", " ", "out", " ", "the", " ", "attrib", "tu", "es", " ", "again", "._", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "{_", "'", "attribute", "s", "'_", ":_", "{_", "}_", ",_", "'", "state", "'_", ":_", "'", "orphan", "ed", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net_", "._", "update_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "natur", "al", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "cidr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "client_", "._", "update_", "(_", "net", "\\u", "natur", "al", "\\u", "uri_", ",_", "**_", "params_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "net_", "\\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", "partial", "\\u", "update_", "(_", "site_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\"", "Test", " ", "PATCH", " ", "operati", "ons", " ", "to", " ", "partial", "ly", " ", "update", " ", "a", " ", "Network", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attr", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "attribute", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cidr_", "=_", "'", "10.", "0.", "0.", "0", "/", "24", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "create_", "(_", "attr", "\\u", "uri_", ",_", "resource", "\\u", "name_", "=_", "'", "Network", "'_", ",_", "name_", "=_", "'", "attr", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "resp_", "=_", "client_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "cidr_", ",_", "attributes_", "=_", "{_", "'", "attr", "1", "'_", ":_", "'", "foo", "'_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "the", " ", "Network", " ", "object", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "play", " ", "w", "/", " ", "it", " ", "dur", "ing", " ", "update", " ", "tests", "._", "\\u\\u\\uNL\\u\\u\\u_", "net_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "pk", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "natur", "al", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "cidr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "PATCH", " ", "it", " ", "by", " ", "provi", "ding", " ", "*", "only", "*", " ", "the", " ", "state", ",", " ", "whi", "ch", " ", "wou", "ld", "n", "'", "t", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "possib", "le", " ", "in", " ", "a", " ", "PU", "T", "._", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "{_", "'", "state", "'_", ":_", "'", "reserve", "d", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net_", "._", "update_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "partial", "\\u", "update_", "(_", "net", "\\u", "pk", "\\u", "uri_", ",_", "**_", "params_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "net_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "just", " ", "to", " ", "make", " ", "sure", " ", "a", " ", "PU", "T", " ", "with", " ", "the", " ", "same", " ", "payload", " ", "fail", "s", "..._", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "update_", "(_", "net", "\\u", "pk", "\\u", "uri_", ",_", "**_", "params_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\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", "deletion_", "(_", "site_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "deletion", " ", "of", " ", "Network", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attr", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "attribute", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "1", "\\u", "resp_", "=_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.", "0.", "0.", "0", "/", "24", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "1_", "=_", "get", "\\u", "result_", "(_", "net", "1", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "1", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "1_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "2", "\\u", "resp_", "=_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.", "0.", "0.", "1", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "2_", "=_", "get", "\\u", "result_", "(_", "net", "2", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "2", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "2_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "allow", " ", "delete", " ", "whe", "n", " ", "there", "'", "s", " ", "an", " ", "attache", "d", " ", "subnet", "/", "ip_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "delete_", "(_", "net", "1", "\\u", "obj", "\\u", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "409", "\\u", "CONF", "LIC", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete", " ", "the", " ", "child", " ", "Network_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "delete_", "(_", "net", "2", "\\u", "obj", "\\u", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "safe", "ly", " ", "delete", " ", "the", " ", "parent", " ", "Network_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "deleted_", "(_", "client_", "._", "delete_", "(_", "net", "1", "\\u", "obj", "\\u", "uri_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "Network", " ", "3", " ", "and", " ", "delete", " ", "it", " ", "by", " ", "natur", "al", "\\u", "key_", "\\u\\u\\uNL\\u\\u\\u_", "net", "3", "\\u", "resp_", "=_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.", "0.", "0.", "0", "/", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "3_", "=_", "get", "\\u", "result_", "(_", "net", "3", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "3", "\\u", "natur", "al", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "mk", "cidr_", "(_", "net", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "deleted_", "(_", "client_", "._", "delete_", "(_", "net", "3", "\\u", "natur", "al", "\\u", "uri_", ")_", ")_", "\\u\\u\\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", "mpt", "t", "\\u", "deta", "il", "\\u", "routes_", "(_", "site_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "deta", "il", " ", "route", "s", " ", "for", " ", "ancestor", "/", "child", "ren", "/", "descend", "ents", "/", "root", " ", "method", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.", "0.", "0.", "0", "/", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.0", ".0", "/", "1", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.0", ".0", "/", "14", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".0", "/", "25", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".1", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".2", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "8", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.", "0.", "0.", "0", "/", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "8_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "8", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "8", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "\\u", "8_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "1", "2", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.0", ".0", "/", "1", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "12_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "1", "2", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "1", "2", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "\\u", "12_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "14", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.0", ".0", "/", "14", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "14_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "14", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "14", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "\\u", "14_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "25", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".0", "/", "25", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "25_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "25", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "25", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "\\u", "25_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "1", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".1", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "1_", "=_", "get", "\\u", "result_", "(_", "ip", "1", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "1", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "ip", "1_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "2", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".2", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "2_", "=_", "get", "\\u", "result_", "(_", "ip", "2", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "2", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "ip", "2_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ancestors_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "net", "\\u", "8_", ",_", "net", "\\u", "12_", ",_", "net", "\\u", "14_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "ancestor", "s", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "net", "\\u", "25_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "ancestor", "s", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "net", "\\u", "25_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "net", "\\u", "14_", ",_", "net", "\\u", "12_", ",_", "net", "\\u", "8_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "ascending_", "=_", "True_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "ascending_", "=_", "True_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "children_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "child", "ren", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "net", "\\u", "25_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "child", "ren", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "net", "\\u", "25_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wanted_", "=_", "[_", "ip", "1_", ",_", "ip", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "wanted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "child", "ren", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "net", "\\u", "12_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "child", "ren", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "net", "\\u", "12_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wanted_", "=_", "[_", "net", "\\u", "14_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "wanted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "descend", "ents_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "descend", "ents", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "net", "\\u", "8_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "descend", "ents", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "net", "\\u", "8_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wanted_", "=_", "[_", "net", "\\u", "12_", ",_", "net", "\\u", "14_", ",_", "net", "\\u", "25_", ",_", "ip", "1_", ",_", "ip", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "wanted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "descend", "ents", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "net", "\\u", "14_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "network", "-", "descend", "ents", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "net", "\\u", "14_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wanted_", "=_", "[_", "net", "\\u", "25_", ",_", "ip", "1_", ",_", "ip", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "wanted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "descend", "ents", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "ip", "2_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "descend", "ents", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "ip", "2_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "parent", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "ip", "2_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "parent", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "ip", "2_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "net", "\\u", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "net", "\\u", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "root_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "root", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "ip", "1_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "root", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "ip", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "net", "\\u", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "net", "\\u", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "root", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "net", "\\u", "8_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "root", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "net", "\\u", "8_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "404", "\\u", "NOT", "\\u", "FOUND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "404", "\\u", "NOT", "\\u", "FOUND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "siblings", "_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "siblings", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "ip", "1_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "siblings", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "ip", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wanted_", "=_", "[_", "ip", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "wanted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wanted_", "=_", "[_", "ip", "1_", ",_", "ip", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "wanted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "include", "\\u", "self_", "=_", "True_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "include", "\\u", "self_", "=_", "True_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "next", "\\u", "deta", "il", "\\u", "routes_", "(_", "site_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "the", " ", "deta", "il", " ", "route", "s", " ", "for", " ", "getti", "ng", " ", "next", " ", "avail", "able", " ", "network", "s", "/", "addresse", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".0", "/", "25", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".8", "/", "2", "9", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".1", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".2", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".4", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".1", "7", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "25", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".0", "/", "25", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "25_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "25", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "25", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "\\u", "25_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net", "\\u", "2", "9", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".8", "/", "2", "9", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "29_", "=_", "get", "\\u", "result_", "(_", "net", "\\u", "2", "9", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "2", "9", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "net", "\\u", "29_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "1", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".1", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "1_", "=_", "get", "\\u", "result_", "(_", "ip", "1", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "1", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "ip", "1_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "2", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".2", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "2_", "=_", "get", "\\u", "result_", "(_", "ip", "2", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "2", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "ip", "2_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "3", "\\u", "resp_", "=_", "client_", "._", "retrieve_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.1", "6.2", ".2", "/", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "3_", "=_", "get", "\\u", "result_", "(_", "ip", "3", "\\u", "resp_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "3", "\\u", "obj", "\\u", "uri_", "=_", "site_", "._", "deta", "il", "\\u", "uri_", "(_", "'", "network", "'_", ",_", "id_", "=_", "ip", "3_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "next", "\\u", "network_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "next", "-", "network", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "net", "\\u", "25_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "network", "-", "next", "-", "network", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "net", "\\u", "25_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "single", " ", "/", "28_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "u", "'", "10.1", "6.2", ".0", "/", "2", "8", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "prefix", "\\u", "length_", "=_", "28_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "prefix", "\\u", "length_", "=_", "28_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "4", "x", " ", "/", "27_", "\\u\\u\\uNL\\u\\u\\u_", "networks_", "=_", "[_", "u", "'", "10.1", "6.2", ".0", "/", "2", "7", "'_", ",_", "u", "'", "10.1", "6.2", ".3", "2", "/", "2", "7", "'_", ",_", "u", "'", "10.1", "6.2", ".6", "4", "/", "2", "7", "'_", ",_", "u", "'", "10.1", "6.2", ".96", "/", "2", "7", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "prefix", "\\u", "length_", "=_", "27_", ",_", "num_", "=_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "networks_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "prefix", "\\u", "length_", "=_", "27_", ",_", "num_", "=_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "networks_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Missing", "/", "invalid", " ", "prefix", "\\u", "length_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "by", " ", "pk_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "prefix", "\\u", "length_", "=_", "'", "ral", "ph", "'_", ")_", ",_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "prefix", "\\u", "length_", "=_", "14_", ")_", ",_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "prefix", "\\u", "length_", "=_", "65_", ")_", ",_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "by", " ", "natur", "al", "\\u", "key_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "prefix", "\\u", "length_", "=_", "'", "ral", "ph", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "prefix", "\\u", "length_", "=_", "14_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "prefix", "\\u", "length_", "=_", "65_", ")_", ",_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inva", "lid", " ", "num_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "prefix", "\\u", "length_", "=_", "28_", ",_", "num_", "=_", "'", "potato", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "next", "\\u", "address_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "reverse_", "(_", "'", "network", "-", "next", "-", "address", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "net", "\\u", "25_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "natur", "al", "\\u", "uri_", "=_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "network", "-", "next", "-", "address", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "mk", "cidr_", "(_", "net", "\\u", "25_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "single", " ", "/", "32_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ")_", ",_", "[_", "u", "'", "10.1", "6.2", ".3", "/", "32", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ")_", ",_", "[_", "u", "'", "10.1", "6.2", ".3", "/", "32", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "3x", " ", "/", "32_", "\\u\\u\\uNL\\u\\u\\u_", "addresses_", "=_", "[_", "u", "'", "10.1", "6.2", ".3", "/", "32", "'_", ",_", "u", "'", "10.1", "6.2", ".5", "/", "32", "'_", ",_", "u", "'", "10.1", "6.2", ".6", "/", "32", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "num_", "=_", "3_", ")_", ",_", "addresses_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "num_", "=_", "3_", ")_", ",_", "addresses_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inva", "lid", " ", "num", " ", "is", " ", "all", " ", "we", " ", "can", " ", "reall", "y", " ", "test", " ", "for", "._", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "uri_", ",_", "num_", "=_", "'", "potato", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "natur", "al", "\\u", "uri_", ",_", "num_", "=_", "'", "potato", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\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", "closest", "\\u", "parent", "\\u", "deta", "il", "\\u", "route_", "(_", "site_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "the", " ", "deta", "il", " ", "route", " ", "for", " ", "look", "ing", " ", "up", " ", "the", " ", "closest", " ", "parent", " ", "for", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "Network", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "GET", " ", "/", "api", "/", "sites", "/", "1", "/", "network", "s", "/", "10.2", "50.", "0.", "1", "/", "32", "/", "closest", "\\u", "parent", "/", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "\\u", "uri_", "=_", "site_", "._", "list", "\\u", "uri_", "(_", "'", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "networks_", "\\u\\u\\uNL\\u\\u\\u_", "root", "\\u", "resp_", "=_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.2", "50.", "0.", "0", "/", "16", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "get", "\\u", "result_", "(_", "root", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent", "\\u", "resp_", "=_", "client_", "._", "create_", "(_", "net", "\\u", "uri_", ",_", "cidr_", "=_", "'", "10.2", "50.", "0.", "0", "/", "24", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "get", "\\u", "result_", "(_", "parent", "\\u", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Closes", "t", " ", "parent", " ", "for", " ", "non", "-", "existen", "t", " ", "/", "32", " ", "shou", "ld", " ", "be", " ", "``", "parent", "``", "_", "\\u\\u\\uNL\\u\\u\\u_", "closest", "\\u", "uri_", "=_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "network", "-", "closest", "-", "parent", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "'", "10.2", "50.", "0.", "1", "/", "32", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "parent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "success_", "(_", "client_", "._", "retrieve_", "(_", "closest", "\\u", "uri_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Match", "ing", " ", "ip", " ", "with", " ", "shorter", " ", "prefix", "\\u", "length", " ", "shou", "ld", " ", "404_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "closest", "\\u", "uri_", ",_", "prefix", "\\u", "length_", "=_", "27_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "404", "\\u", "NOT", "\\u", "FOUND_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inva", "lid", " ", "prefix", "\\u", "length", " ", "shou", "ld", " ", "400_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "retrieve_", "(_", "closest", "\\u", "uri_", ",_", "prefix", "\\u", "length_", "=_", "'", "shoe", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inva", "lid", " ", "cid", "r", " ", "shou", "ld", " ", "400_", "\\u\\u\\uNL\\u\\u\\u_", "bad", "\\u", "closest", "\\u", "uri_", "=_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "network", "-", "closest", "-", "parent", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "bad", "\\u", "closest", "\\u", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "400", "\\u", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "pha", " ", "cid", "r", " ", "shou", "ld", " ", "404_", "\\u\\u\\uNL\\u\\u\\u_", "abc", "\\u", "closest", "\\u", "uri_", "=_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "network", "-", "closest", "-", "parent", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "'", "bog", "us", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "abc", "\\u", "closest", "\\u", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "404", "\\u", "NOT", "\\u", "FOUND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "closest", " ", "parent", " ", "isn", "'", "t", " ", "found", " ", "it", " ", "shou", "ld", " ", "404_", "\\u\\u\\uNL\\u\\u\\u_", "no", "\\u", "closest", "\\u", "uri_", "=_", "reverse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "network", "-", "closest", "-", "parent", "'_", ",_", "args_", "=_", "(_", "site_", "._", "id_", ",_", "'", "1.0", ".0", ".1", "/", "32", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "error_", "(_", "client_", "._", "retrieve_", "(_", "no", "\\u", "closest", "\\u", "uri_", ")_", ",_", "status_", "._", "HTTP", "\\u", "404", "\\u", "NOT", "\\u", "FOUND_", ")_" ]
[ 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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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 ]
`__init__` method calls overridden method
sassoftware/conary/conary/streams.py
[ { "content": "class FrozenVersionStream(InfoStream):\n\n __slots__ = \"v\"\n\n\n\n\n\n\n\n", "metadata": "root.FrozenVersionStream", "header": "['module', '___EOS___']", "index": 182 }, { "content": " def __call__(self):\n return self.v", "metadata": "root.FrozenVersionStream.__call__", "header": "['class', 'FrozenVersionStream', '(', 'InfoStream', ')', ':', '___EOS___']", "index": 186 }, { "content": " def set(self, val):\n assert(not val or min(val.timeStamps()) > 0)\n self.v = val", "metadata": "root.FrozenVersionStream.set", "header": "['class', 'FrozenVersionStream', '(', 'InfoStream', ')', ':', '___EOS___']", "index": 189 }, { "content": " def freeze(self, skipSet = {}):\n # If versionStrings is in skipSet, freeze the string w/o the timestamp.\n # This is a bit of a hack to allow trove signatures to exclude\n # the timestamps. Since those timestamps are reset on the server\n # at commit time, including them would make signing the to-be-committed\n # changeset impossible.\n if not self.v:\n return \"\"\n elif skipSet and 'versionStrings' in skipSet:\n return self.v.asString()\n else:\n return self.v.freeze()", "metadata": "root.FrozenVersionStream.freeze", "header": "['class', 'FrozenVersionStream', '(', 'InfoStream', ')', ':', '___EOS___']", "index": 193 }, { "content": " def diff(self, them):\n if self.v != them.v:\n return self.freeze()\n\n return None", "metadata": "root.FrozenVersionStream.diff", "header": "['class', 'FrozenVersionStream', '(', 'InfoStream', ')', ':', '___EOS___']", "index": 206 }, { "content": " def thaw(self, frz):\n if frz:\n self.v = versions.ThawVersion(frz)\n else:\n self.v = None", "metadata": "root.FrozenVersionStream.thaw", "header": "['class', 'FrozenVersionStream', '(', 'InfoStream', ')', ':', '___EOS___']", "index": 212 }, { "content": " def twm(self, diff, base):\n if self.v == base.v:\n self.thaw(diff)\n return False\n elif self.v != diff:\n return True\n\n return False", "metadata": "root.FrozenVersionStream.twm", "header": "['class', 'FrozenVersionStream', '(', 'InfoStream', ')', ':', '___EOS___']", "index": 218 }, { "content": " def __eq__(self, other, skipSet = None):\n return other.__class__ == self.__class__ and \\\n self.v == other.v", "metadata": "root.FrozenVersionStream.__eq__", "header": "['class', 'FrozenVersionStream', '(', 'InfoStream', ')', ':', '___EOS___']", "index": 227 }, { "content": " def __init__(self, v = None):\n self.thaw(v)", "metadata": "root.FrozenVersionStream.__init__", "header": "['class', 'FrozenVersionStream', '(', 'InfoStream', ')', ':', '___EOS___']", "index": 231 }, { "content": "class StringVersionStream(FrozenVersionStream):\n __slots__ = []\n\n\n", "metadata": "root.StringVersionStream", "header": "['module', '___EOS___']", "index": 234 }, { "content": " def set(self, val):\n # we can't use the function from FrozenVersionStream because it\n # checks for timestamps, which we don't need here\n self.v = val", "metadata": "root.StringVersionStream.set", "header": "['class', 'StringVersionStream', '(', 'FrozenVersionStream', ')', ':', '___EOS___']", "index": 237 }, { "content": " def thaw(self, frz):\n if frz:\n self.v = versions.VersionFromString(frz)\n else:\n self.v = None", "metadata": "root.StringVersionStream.thaw", "header": "['class', 'StringVersionStream', '(', 'FrozenVersionStream', ')', ':', '___EOS___']", "index": 242 }, { "content": " def freeze(self, skipSet = {}):\n if not self.v:\n return \"\"\n else:\n return self.v.asString()", "metadata": "root.StringVersionStream.freeze", "header": "['class', 'StringVersionStream', '(', 'FrozenVersionStream', ')', ':', '___EOS___']", "index": 248 }, { "content": "class StringsStream(list, InfoStream):\n \"\"\"\n Stores list of arbitrary strings\n \"\"\"\n\n\n\n\n\n\n\n", "metadata": "root.StringsStream", "header": "['module', '___EOS___']", "index": 344 }, { "content": " def set(self, val):\n assert(type(val) is str)\n if val not in self:\n self.append(val)\n self.sort()", "metadata": "root.StringsStream.set", "header": "['class', 'StringsStream', '(', 'list', ',', 'InfoStream', ')', ':', '___EOS___']", "index": 349 }, { "content": " def __eq__(self, other, skipSet = None):\n return list.__eq__(self, other)", "metadata": "root.StringsStream.__eq__", "header": "['class', 'StringsStream', '(', 'list', ',', 'InfoStream', ')', ':', '___EOS___']", "index": 355 }, { "content": " def freeze(self, skipSet = None):\n if not self:\n return ''\n return '\\0'.join(self)", "metadata": "root.StringsStream.freeze", "header": "['class', 'StringsStream', '(', 'list', ',', 'InfoStream', ')', ':', '___EOS___']", "index": 358 }, { "content": " def diff(self, them):\n if self != them:\n return self.freeze()\n return None", "metadata": "root.StringsStream.diff", "header": "['class', 'StringsStream', '(', 'list', ',', 'InfoStream', ')', ':', '___EOS___']", "index": 363 }, { "content": " def thaw(self, frz):\n del self[:]\n\n if len(frz) != 0:\n for s in frz.split('\\0'):\n self.set(s)", "metadata": "root.StringsStream.thaw", "header": "['class', 'StringsStream', '(', 'list', ',', 'InfoStream', ')', ':', '___EOS___']", "index": 368 }, { "content": " def twm(self, diff, base):\n self.thaw(diff)\n return False", "metadata": "root.StringsStream.twm", "header": "['class', 'StringsStream', '(', 'list', ',', 'InfoStream', ')', ':', '___EOS___']", "index": 375 }, { "content": " def __call__(self):\n return self", "metadata": "root.StringsStream.__call__", "header": "['class', 'StringsStream', '(', 'list', ',', 'InfoStream', ')', ':', '___EOS___']", "index": 379 }, { "content": " def __init__(self, frz = ''):\n self.thaw(frz)", "metadata": "root.StringsStream.__init__", "header": "['class', 'StringsStream', '(', 'list', ',', 'InfoStream', ')', ':', '___EOS___']", "index": 382 }, { "content": "class OrderedStringsStream(StringsStream):", "metadata": "root.OrderedStringsStream", "header": "['module', '___EOS___']", "index": 385 }, { "content": " def set(self, val):\n assert(type(val) is str)\n self.append(val)\n # like StringsStream except not sorted", "metadata": "root.OrderedStringsStream.set", "header": "['class', 'OrderedStringsStream', '(', 'StringsStream', ')', ':', '___EOS___']", "index": 386 }, { "content": "class OrderedBinaryStringsStream(StringsStream):\n # same as OrderedStringsStream, but stores length of each string\n", "metadata": "root.OrderedBinaryStringsStream", "header": "['module', '___EOS___']", "index": 391 }, { "content": " def freeze(self, skipSet = None):\n if not self:\n return ''\n l = []\n for s in self:\n l.append(pack.dynamicSize(len(s)))\n l.append(s)\n return ''.join(l)", "metadata": "root.OrderedBinaryStringsStream.freeze", "header": "['class', 'OrderedBinaryStringsStream', '(', 'StringsStream', ')', ':', '___NEWLINE___', '# same as OrderedStringsStream, but stores length of each string', '___NL___', '___EOS___']", "index": 393 }, { "content": " def thaw(self, frz):\n del self[:]\n if not frz:\n return\n i = 0\n while i < len(frz):\n i, (s,) = pack.unpack(\"!D\", i, frz)\n self.append(s)", "metadata": "root.OrderedBinaryStringsStream.thaw", "header": "['class', 'OrderedBinaryStringsStream', '(', 'StringsStream', ')', ':', '___NEWLINE___', '# same as OrderedStringsStream, but stores length of each string', '___NL___', '___EOS___']", "index": 402 } ]
[ { "span": "self.thaw(v)", "start_line": 232, "start_column": 8, "end_line": 232, "end_column": 20 }, { "span": "self.thaw(frz)", "start_line": 383, "start_column": 8, "end_line": 383, "end_column": 22 } ]
[ { "span": "def thaw(self, frz):", "start_line": 212, "start_column": 4, "end_line": 212, "end_column": 24 }, { "span": "def thaw(self, frz):", "start_line": 242, "start_column": 4, "end_line": 242, "end_column": 24 }, { "span": "def thaw(self, frz):", "start_line": 368, "start_column": 4, "end_line": 368, "end_column": 24 }, { "span": "def thaw(self, frz):", "start_line": 402, "start_column": 4, "end_line": 402, "end_column": 24 } ]
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_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "slots\\u\\u_", "=_", "\"", "v", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set_", "(_", "self_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "not_", "val_", "or_", "min_", "(_", "val_", "._", "time", "Sta", "mps_", "(_", ")_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "v_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "freeze_", "(_", "self_", ",_", "skip", "Set_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "version", "String", "s", " ", "is", " ", "in", " ", "skip", "Set", ",", " ", "freez", "e", " ", "the", " ", "string", " ", "w", "/", "o", " ", "the", " ", "timestamp", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "bit", " ", "of", " ", "a", " ", "hack", " ", "to", " ", "allow", " ", "trove", " ", "signa", "tures", " ", "to", " ", "exclude_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "timestamp", "s", ".", " ", "Sin", "ce", " ", "tho", "se", " ", "timestamp", "s", " ", "are", " ", "reset", " ", "on", " ", "the", " ", "server_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "at", " ", "commit", " ", "time", ",", " ", "inclu", "ding", " ", "them", " ", "wou", "ld", " ", "make", " ", "signin", "g", " ", "the", " ", "to", "-", "be", "-", "committ", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "changeset", " ", "impossible", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "skip", "Set_", "and_", "'", "version", "String", "s", "'_", "in_", "skip", "Set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "v_", "._", "as", "String_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "v_", "._", "freeze_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff_", "(_", "self_", ",_", "them", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "v_", "!=_", "them", "_", "._", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "freeze_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tha", "w_", "(_", "self_", ",_", "fr", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "fr", "z_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "v_", "=_", "versions_", "._", "Tha", "w", "Version_", "(_", "fr", "z_", ")_", "\\u\\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_", "._", "v_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tw", "m_", "(_", "self_", ",_", "diff_", ",_", "base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "v_", "==_", "base_", "._", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tha", "w_", "(_", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "v_", "!=_", "diff_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\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_", ",_", "skip", "Set_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "other_", "._", "\\u\\u", "class\\u\\u_", "==_", "self_", "._", "\\u\\u", "class\\u\\u_", "and_", "self_", "._", "v_", "==_", "other_", "._", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fro", "zen", "Version", "Stream_", "(_", "Info", "Stream_", ")_", ":_", "\\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_", ",_", "v_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tha", "w_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "String", "Version", "Stream_", "(_", "Fro", "zen", "Version", "Stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "slots\\u\\u_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "String", "Version", "Stream_", "(_", "Fro", "zen", "Version", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set_", "(_", "self_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "can", "'", "t", " ", "use", " ", "the", " ", "function", " ", "from", " ", "Fro", "zen", "Version", "Stream", " ", "bec", "aus", "e", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "for", " ", "timestamp", "s", ",", " ", "whi", "ch", " ", "we", " ", "don", "'", "t", " ", "need", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "v_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "Version", "Stream_", "(_", "Fro", "zen", "Version", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tha", "w_", "(_", "self_", ",_", "fr", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "fr", "z_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "v_", "=_", "versions_", "._", "Version", "Fro", "m", "String_", "(_", "fr", "z_", ")_", "\\u\\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_", "._", "v_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "Version", "Stream_", "(_", "Fro", "zen", "Version", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "freeze_", "(_", "self_", ",_", "skip", "Set_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "v_", "._", "as", "String_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Stor", "es", " ", "list", " ", "of", " ", "arbitra", "ry", " ", "string", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set_", "(_", "self_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "type_", "(_", "val_", ")_", "is_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", "not_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ",_", "skip", "Set_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "list_", "._", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "freeze_", "(_", "self_", ",_", "skip", "Set_", "=_", "None_", ")_", ":_", "\\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_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'\\\\", "0", "'_", "._", "join_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff_", "(_", "self_", ",_", "them", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "!=_", "them", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "freeze_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tha", "w_", "(_", "self_", ",_", "fr", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "fr", "z_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "s_", "in_", "fr", "z_", "._", "split_", "(_", "'\\\\", "0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tw", "m_", "(_", "self_", ",_", "diff_", ",_", "base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tha", "w_", "(_", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "s", "Stream_", "(_", "list_", ",_", "Info", "Stream_", ")_", ":_", "\\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_", ",_", "fr", "z_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tha", "w_", "(_", "fr", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Order", "ed", "String", "s", "Stream_", "(_", "String", "s", "Stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "String", "s", "Stream_", "(_", "String", "s", "Stream_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set_", "(_", "self_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "type_", "(_", "val_", ")_", "is_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "like", " ", "String", "s", "Stream", " ", "except", " ", "not", " ", "sorted_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Order", "ed", "Bin", "ary", "String", "s", "Stream_", "(_", "String", "s", "Stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "same", " ", "as", " ", "Order", "ed", "String", "s", "Stream", ",", " ", "but", " ", "store", "s", " ", "length", " ", "of", " ", "each", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Bin", "ary", "String", "s", "Stream_", "(_", "String", "s", "Stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "same", " ", "as", " ", "Order", "ed", "String", "s", "Stream", ",", " ", "but", " ", "store", "s", " ", "length", " ", "of", " ", "each", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "freeze_", "(_", "self_", ",_", "skip", "Set_", "=_", "None_", ")_", ":_", "\\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_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "._", "append_", "(_", "pack_", "._", "dynami", "c", "Size_", "(_", "len_", "(_", "s_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "._", "append_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "ed", "Bin", "ary", "String", "s", "Stream_", "(_", "String", "s", "Stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "same", " ", "as", " ", "Order", "ed", "String", "s", "Stream", ",", " ", "but", " ", "store", "s", " ", "length", " ", "of", " ", "each", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tha", "w_", "(_", "self_", ",_", "fr", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "fr", "z_", ":_", "\\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_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "i_", "<_", "len_", "(_", "fr", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", ",_", "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AO-Framework/openmdao.main/src/openmdao/main/linearsolver.py
[ { "content": " def calc_gradient(self, inputs, outputs, return_format='array'):\n \"\"\" Run GMRES solver to return a Jacobian of outputs\n with respect to inputs.\n \"\"\"\n\n system = self._system\n RHS = system.rhs_buf\n A = self.A\n\n if return_format == 'dict':\n J = {}\n for okey in outputs:\n J[okey] = {}\n for ikey in inputs:\n if isinstance(ikey, tuple):\n ikey = ikey[0]\n J[okey][ikey] = None\n else:\n num_input = system.get_size(inputs)\n num_output = system.get_size(outputs)\n J = np.zeros((num_output, num_input))\n\n if system.mode == 'adjoint':\n outputs, inputs = inputs, outputs\n\n # If Forward mode, solve linear system for each parameter\n # If Adjoint mode, solve linear system for each requested output\n j = 0\n for param in inputs:\n\n if isinstance(param, tuple):\n param = param[0]\n\n in_indices = system.vec['u'].indices(system, param)\n jbase = j\n\n # Did the user define a custom Jacobian for a constraint?\n if system.mode == 'adjoint' and param in self.custom_jacs:\n self.user_defined_jacobian(param, outputs, J)\n j += len(in_indices)\n continue\n\n for irhs in in_indices:\n\n RHS[irhs] = 1.0\n\n # Call GMRES to solve the linear system\n dx = self.solve(RHS)\n\n RHS[irhs] = 0.0\n\n i = 0\n for item in outputs:\n\n if isinstance(item, tuple):\n item = item[0]\n\n out_indices = system.vec['u'].indices(system, item)\n nk = len(out_indices)\n\n if return_format == 'dict':\n if system.mode == 'forward':\n if J[item][param] is None:\n J[item][param] = np.zeros((nk, len(in_indices)))\n J[item][param][:, j-jbase] = dx[out_indices]\n else:\n if J[param][item] is None:\n J[param][item] = np.zeros((len(in_indices), nk))\n J[param][item][j-jbase, :] = dx[out_indices]\n\n else:\n if system.mode == 'forward':\n J[i:i+nk, j] = dx[out_indices]\n else:\n J[j, i:i+nk] = dx[out_indices]\n i += nk\n\n j += 1\n\n #print inputs, '\\n', outputs, '\\n', J\n return J", "metadata": "root.ScipyGMRES.calc_gradient", "header": "['class', 'ScipyGMRES', '(', 'LinearSolver', ')', ':', '___EOS___']", "index": 119 }, { "content": " def solve(self, arg):\n \"\"\" Executes an iterative solver \"\"\"\n system = self._system\n #print \"START\", system.name\n\n system.rhs_buf[:] = arg[:]\n system.sol_buf[:] = system.sol_vec.array[:]\n options = self.options\n system = self._system\n\n norm0, norm = 1.0, 1.0\n counter = 0\n if self.options.iprint > 0:\n self.print_norm(self.ln_string, counter, norm, norm0)\n\n while counter < options.maxiter and norm > options.atol and \\\n norm/norm0 > options.rtol:\n\n if system.mode == 'forward':\n #print \"Start Forward\", system.name, system; sys.stdout.flush()\n for subsystem in system.subsystems(local=True):\n #print subsystem.name; sys.stdout.flush()\n #print \"Z1\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n system.scatter('du', 'dp', subsystem=subsystem)\n #print \"Z2\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n system.rhs_vec.array[:] = 0.0\n subsystem.applyJ(system.flat_vars.keys())\n system.rhs_vec.array[:] *= -1.0\n system.rhs_vec.array[:] += system.rhs_buf[:]\n sub_options = options if subsystem.options is None \\\n else subsystem.options\n #print \"Z4\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n subsystem.solve_linear(sub_options)\n #print \"Z5\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array\n #print subsystem.name, system.rhs_vec.array, system.sol_vec.array; sys.stdout.flush()\n\n #print \"End\", system.name; sys.stdout.flush()\n elif system.mode == 'adjoint':\n #print \"Start Adjoint\", system.name, system; sys.stdout.flush()\n\n rev_systems = [item for item in reversed(list(system.subsystems(local=True)))]\n\n for subsystem in rev_systems:\n #print \"Outer\", subsystem.name; sys.stdout.flush()\n system.sol_buf[:] = system.rhs_buf[:]\n\n # Instead of a double loop, we can use the graph to only\n # call applyJ on the component behind us. This led to a\n # nice speedup.\n succs = [str(node) for node in system.graph.successors(subsystem.node)]\n\n for subsystem2 in rev_systems:\n if subsystem2.name in succs:\n #print \"Inner\", subsystem2.name; sys.stdout.flush()\n system.rhs_vec.array[:] = 0.0\n args = subsystem.flat_vars.keys()\n #print \"Z1\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n subsystem2.applyJ(args)\n #print \"Z2\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n system.scatter('du', 'dp', subsystem=subsystem2)\n #print subsystem2.name, subsystem2.vec['dp'].keys(), subsystem2.vec['du'].keys()\n #print \"Z3\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n system.sol_buf[:] -= system.rhs_vec.array[:]\n system.vec['dp'].array[:] = 0.0\n #print \"Z4\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n system.rhs_vec.array[:] = system.sol_buf[:]\n #print \"Z5\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n\n subsystem.solve_linear(options)\n #print \"Z6\", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()\n\n norm = self._norm()\n counter += 1\n if self.options.iprint > 0:\n self.print_norm(self.ln_string, counter, norm, norm0)\n\n #print 'return', options.parent.name, np.linalg.norm(system.rhs_vec.array), system.rhs_vec.array\n #print 'Linear solution vec', system.sol_vec.array; sys.stdout.flush()\n if len(system.vec['dp'].array) == 0:\n psys = system._parent_system\n #print \"pZZ\", psys.vec['du'].array, psys.vec['dp'].array, psys.vec['df'].array; sys.stdout.flush()\n\n return system.sol_vec.array", "metadata": "root.LinearGS.solve", "header": "['class', 'LinearGS', '(', 'LinearSolver', ')', ':', '___EOS___']", "index": 546 } ]
[ { "span": "A ", "start_line": 126, "start_column": 8, "end_line": 126, "end_column": 9 }, { "span": "psys ", "start_line": 625, "start_column": 12, "end_line": 625, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Sci", "py", "GM", "RES", "_", "(_", "Linea", "r", "Solver_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calc", "\\u", "gradient_", "(_", "self_", ",_", "inputs_", ",_", "outputs_", ",_", "return", "\\u", "format_", "=_", "'", "array", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Run", " ", "GM", "RES", " ", "solve", "r", " ", "to", " ", "return", " ", "a", " ", "Jacob", "ian", " ", "of", " ", "output", "s", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "respec", "t", " ", "to", " ", "inputs", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "system_", "=_", "self_", "._", "\\u", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RHS", "_", "=_", "system_", "._", "rhs", "\\u", "buf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "self_", "._", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "return", "\\u", "format_", "==_", "'", "dict", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "J_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "oke", "y_", "in_", "outputs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "J_", "[_", "oke", "y_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ike", "y_", "in_", "inputs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "ike", "y_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ike", "y_", "=_", "ike", "y_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "J_", "[_", "oke", "y_", "]_", "[_", "ike", "y_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "num", "\\u", "input_", "=_", "system_", "._", "get", "\\u", "size_", "(_", "inputs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "output_", "=_", "system_", "._", "get", "\\u", "size_", "(_", "outputs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "np_", "._", "zeros_", "(_", "(_", "num", "\\u", "output_", ",_", "num", "\\u", "input_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "system_", "._", "mode_", "==_", "'", "adjoint", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outputs_", ",_", "inputs_", "=_", "inputs_", ",_", "outputs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "Forward", " ", "mode", ",", " ", "solve", " ", "linear", " ", "system", " ", "for", " ", "each", " ", "parameter_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "Adj", "oint", " ", "mode", ",", " ", "solve", " ", "linear", " ", "system", " ", "for", " ", "each", " ", "request", "ed", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "j_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param_", "in_", "inputs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "param_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param_", "=_", "param_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "in", "\\u", "indices_", "=_", "system_", "._", "vec_", "[_", "'", "u", "'_", "]_", "._", "indices_", "(_", "system_", ",_", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jb", "ase_", "=_", "j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Di", "d", " ", "the", " ", "user", " ", "defin", "e", " ", "a", " ", "custom", " ", "Jacob", "ian", " ", "for", " ", "a", " ", "constraint", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "system_", "._", "mode_", "==_", "'", "adjoint", "'_", "and_", "param_", "in_", "self_", "._", "custom", "\\u", "jac", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "user", "\\u", "defin", "ed", "\\u", "jacobian", "_", "(_", "param_", ",_", "outputs_", ",_", "J_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "+=_", "len_", "(_", "in", "\\u", "indices_", ")_", "\\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_", "for_", "ir", "hs_", "in_", "in", "\\u", "indices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "RHS", "_", "[_", "ir", "hs_", "]_", "=_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Call", " ", "GM", "RES", " ", "to", " ", "solve", " ", "the", " ", "linear", " ", "system_", "\\u\\u\\uNL\\u\\u\\u_", "dx_", "=_", "self_", "._", "solve_", "(_", "RHS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RHS", "_", "[_", "ir", "hs_", "]_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "outputs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "item_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "item_", "=_", "item_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out", "\\u", "indices_", "=_", "system_", "._", "vec_", "[_", "'", "u", "'_", "]_", "._", "indices_", "(_", "system_", ",_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nk_", "=_", "len_", "(_", "out", "\\u", "indices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "return", "\\u", "format_", "==_", "'", "dict", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "system_", "._", "mode_", "==_", "'", "forward", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "J_", "[_", "item_", "]_", "[_", "param_", "]_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "J_", "[_", "item_", "]_", "[_", "param_", "]_", "=_", "np_", "._", "zeros_", "(_", "(_", "nk_", ",_", "len_", "(_", "in", "\\u", "indices_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "J_", "[_", "item_", "]_", "[_", "param_", "]_", "[_", ":_", ",_", "j_", "-_", "jb", "ase_", "]_", "=_", "dx_", "[_", "out", "\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "J_", "[_", "param_", "]_", "[_", "item_", "]_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "J_", "[_", "param_", "]_", "[_", "item_", "]_", "=_", "np_", "._", "zeros_", "(_", "(_", "len_", "(_", "in", "\\u", "indices_", ")_", ",_", "nk_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "J_", "[_", "param_", "]_", "[_", "item_", "]_", "[_", "j_", "-_", "jb", "ase_", ",_", ":_", "]_", "=_", "dx_", "[_", "out", "\\u", "indices_", "]_", "\\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 ", " ", " _", "if_", "system_", "._", "mode_", "==_", "'", "forward", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "J_", "[_", "i_", ":_", "i_", "+_", "nk_", ",_", "j_", "]_", "=_", "dx_", "[_", "out", "\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "J_", "[_", "j_", ",_", "i_", ":_", "i_", "+_", "nk_", "]_", "=_", "dx_", "[_", "out", "\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "nk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "j_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "inputs", ",", " ", "'\\\\", "n", "',", " ", "output", "s", ",", " ", "'\\\\", "n", "',", " ", "J_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "J_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Linea", "r", "GS", "_", "(_", "Linea", "r", "Solver_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "solve_", "(_", "self_", ",_", "arg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Execut", "es", " ", "an", " ", "iterative", " ", "solve", "r", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "self_", "._", "\\u", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "START", "\",", " ", "system", ".", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "system_", "._", "rhs", "\\u", "buf_", "[_", ":_", "]_", "=_", "arg_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "._", "sol", "\\u", "buf_", "[_", ":_", "]_", "=_", "system_", "._", "sol", "\\u", "vec_", "._", "array_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "=_", "self_", "._", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "self_", "._", "\\u", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "norm", "0_", ",_", "norm_", "=_", "1.0_", ",_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "options_", "._", "ipr", "int_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "print", "\\u", "norm_", "(_", "self_", "._", "ln", "\\u", "string_", ",_", "counter_", ",_", "norm_", ",_", "norm", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "counter_", "<_", "options_", "._", "maxiter_", "and_", "norm_", ">_", "options_", "._", "atol_", "and_", "norm_", "/_", "norm", "0_", ">_", "options_", "._", "rtol_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "system_", "._", "mode_", "==_", "'", "forward", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Start", " ", "Forward", "\",", " ", "system", ".", "name", ",", " ", "system", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "subsystem", "_", "in_", "system_", "._", "subsystem", "s_", "(_", "local_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "subsystem", ".", "name", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "Z", "1", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "system_", "._", "scatter_", "(_", "'", "du", "'_", ",_", "'", "dp", "'_", ",_", "subsystem", "_", "=_", "subsystem", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Z2", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "system_", "._", "rhs", "\\u", "vec_", "._", "array_", "[_", ":_", "]_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subsystem", "_", "._", "appl", "y", "J_", "(_", "system_", "._", "flat", "\\u", "vars_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "._", "rhs", "\\u", "vec_", "._", "array_", "[_", ":_", "]_", "*=_", "-_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "._", "rhs", "\\u", "vec_", "._", "array_", "[_", ":_", "]_", "+=_", "system_", "._", "rhs", "\\u", "buf_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub\\u", "options_", "=_", "options_", "if_", "subsystem", "_", "._", "options_", "is_", "None_", "else_", "subsystem", "_", "._", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Z", "4", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "subsystem", "_", "._", "solve", "\\u", "linear_", "(_", "sub\\u", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Z", "5", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "subsystem", ".", "name", ",", " ", "system", ".", "rhs", "\\u", "vec", ".", "array", ",", " ", "system", ".", "sol", "\\u", "vec", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "End", "\",", " ", "system", ".", "name", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "system_", "._", "mode_", "==_", "'", "adjoint", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Start", " ", "Adj", "oint", "\",", " ", "system", ".", "name", ",", " ", "system", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rev", "\\u", "systems_", "=_", "[_", "item_", "for_", "item_", "in_", "reversed_", "(_", "list_", "(_", "system_", "._", "subsystem", "s_", "(_", "local_", "=_", "True_", ")_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "subsystem", "_", "in_", "rev", "\\u", "systems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Out", "er", "\",", " ", "subsystem", ".", "name", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "system_", "._", "sol", "\\u", "buf_", "[_", ":_", "]_", "=_", "system_", "._", "rhs", "\\u", "buf_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ins", "tea", "d", " ", "of", " ", "a", " ", "double", " ", "loop", ",", " ", "we", " ", "can", " ", "use", " ", "the", " ", "graph", " ", "to", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "call", " ", "appl", "y", "J", " ", "on", " ", "the", " ", "component", " ", "beh", "ind", " ", "us", ".", " ", "Thi", "s", " ", "led", " ", "to", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nice", " ", "speed", "up", "._", "\\u\\u\\uNL\\u\\u\\u_", "succ", "s_", "=_", "[_", "str_", "(_", "node_", ")_", "for_", "node_", "in_", "system_", "._", "graph_", "._", "successors_", "(_", "subsystem", "_", "._", "node_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "subsystem", "2_", "in_", "rev", "\\u", "systems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "subsystem", "2_", "._", "name_", "in_", "succ", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "In", "ner", "\",", " ", "subsystem", "2", ".", "name", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "system_", "._", "rhs", "\\u", "vec_", "._", "array_", "[_", ":_", "]_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "subsystem", "_", "._", "flat", "\\u", "vars_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Z", "1", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "subsystem", "2_", "._", "appl", "y", "J_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Z2", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "system_", "._", "scatter_", "(_", "'", "du", "'_", ",_", "'", "dp", "'_", ",_", "subsystem", "_", "=_", "subsystem", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "subsystem", "2", ".", "name", ",", " ", "subsystem", "2", ".", "vec", "['", "dp", "']", ".", "keys", "()", ",", " ", "subsystem", "2", ".", "vec", "['", "du", "']", ".", "keys", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "Z", "3", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "system_", "._", "sol", "\\u", "buf_", "[_", ":_", "]_", "-=_", "system_", "._", "rhs", "\\u", "vec_", "._", "array_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "._", "vec_", "[_", "'", "dp", "'_", "]_", "._", "array_", "[_", ":_", "]_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Z", "4", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "system_", "._", "rhs", "\\u", "vec_", "._", "array_", "[_", ":_", "]_", "=_", "system_", "._", "sol", "\\u", "buf_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Z", "5", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "subsystem", "_", "._", "solve", "\\u", "linear_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Z", "6", "\",", " ", "system", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "system", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "norm_", "=_", "self_", "._", "\\u", "norm_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counter_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "options_", "._", "ipr", "int_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "print", "\\u", "norm_", "(_", "self_", "._", "ln", "\\u", "string_", ",_", "counter_", ",_", "norm_", ",_", "norm", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'", "return", "',", " ", "options", ".", "parent", ".", "name", ",", " ", "np", ".", "linalg", ".", "norm", "(", "system", ".", "rhs", "\\u", "vec", ".", "array", "),", " ", "system", ".", "rhs", "\\u", "vec", ".", "array_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'", "Linea", "r", " ", "solut", "ion", " ", "vec", "',", " ", "system", ".", "sol", "\\u", "vec", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "system_", "._", "vec_", "[_", "'", "dp", "'_", "]_", "._", "array_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "psy", "s_", "=_", "system_", "._", "\\u", "parent", "\\u", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "p", "ZZ", "\",", " ", "psy", "s", ".", "vec", "['", "du", "']", ".", "array", ",", " ", "psy", "s", ".", "vec", "['", "dp", "']", ".", "array", ",", " ", "psy", "s", ".", "vec", "['", "df", "']", ".", "array", ";", " ", "sys", ".", "stdout", ".", "flush", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "system_", "._", "sol", "\\u", "vec_", "._", "array_" ]
[ 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused import
scrapinghub/frontera/frontera/__init__.py
[ { "content": "from core.manager import FrontierManager\nfrom core.models import Request, Response\nfrom core.components import Backend, DistributedBackend, Middleware\nfrom settings import Settings\nfrom utils import graphs\nfrom utils.tester import FrontierTester\n\nfrom ._version import get_versions\n__version__ = get_versions()['version']\ndel get_versions\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from core.manager import FrontierManager", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 40 }, { "span": "from core.models import Request, Response", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 41 }, { "span": "from core.components import Backend, DistributedBackend, Middleware", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 67 }, { "span": "from settings import Settings", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 29 }, { "span": "from utils import graphs", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 24 }, { "span": "from utils.tester import FrontierTester", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 39 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "core_", "._", "manager_", "import_", "Front", "ier", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "models_", "import_", "Request_", ",_", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "components_", "import_", "Backend_", ",_", "Distribut", "ed", "Backend_", ",_", "Middleware_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "settings_", "import_", "Settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "import_", "graphs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "._", "tester_", "import_", "Front", "ier", "Tester_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "\\u", "version_", "import_", "get", "\\u", "versions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "get", "\\u", "versions_", "(_", ")_", "[_", "'", "version", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "get", "\\u", "versions_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 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, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
jxtech/wechatpy/tests/test_replies.py
[ { "content": " def test_reply_render(self):\n timestamp = int(time.time())\n reply = TextReply(\n source='user1',\n target='user2',\n time=timestamp,\n content='test'\n )\n r = reply.render()\n\n self.assertTrue(r.startswith('<xml>\\n'))\n self.assertTrue(r.endswith('\\n</xml>'))\n self.assertTrue('<ToUserName><![CDATA[user2]]></ToUserName>' in r)\n self.assertTrue('<FromUserName><![CDATA[user1]]></FromUserName>' in r)\n self.assertTrue('<MsgType><![CDATA[text]]></MsgType>' in r)\n self.assertTrue('<Content><![CDATA[test]]></Content>' in r)\n create_time = '<CreateTime>{time}</CreateTime>'.format(time=timestamp)\n self.assertTrue(create_time in r)", "metadata": "root.ReplyTestCase.test_reply_render", "header": "['class', 'ReplyTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_music_reply_properties(self):\n from wechatpy.replies import MusicReply\n\n reply = MusicReply()\n reply.thumb_media_id = '123456'\n reply.title = 'test'\n reply.description = 'test'\n reply.music_url = 'http://www.qq.com'\n reply.hq_music_url = None\n self.assertEqual('123456', reply.thumb_media_id)\n self.assertEqual('test', reply.title)\n self.assertEqual('test', reply.description)\n self.assertEqual('http://www.qq.com', reply.music_url)\n self.assertTrue(reply.hq_music_url is None)\n\n reply = MusicReply(\n thumb_media_id='123456',\n title='test',\n description='test',\n music_url='http://www.qq.com',\n hq_music_url=None\n )\n self.assertEqual('123456', reply.thumb_media_id)\n self.assertEqual('test', reply.title)\n self.assertEqual('test', reply.description)\n self.assertEqual('http://www.qq.com', reply.music_url)\n self.assertTrue(reply.hq_music_url is None)", "metadata": "root.ReplyTestCase.test_music_reply_properties", "header": "['class', 'ReplyTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 76 }, { "content": " def test_multi_article_reply(self):\n from wechatpy.replies import ArticlesReply\n\n article = {'title': 'test', 'url': 'http://www.qq.com'}\n\n r1 = ArticlesReply()\n r1.add_article(article)\n r2 = ArticlesReply()\n self.assertTrue(r1.render() != r2.render())", "metadata": "root.ReplyTestCase.test_multi_article_reply", "header": "['class', 'ReplyTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 104 } ]
[ { "span": "self.assertTrue('<ToUserName><![CDATA[user2]]></ToUserName>' in r)", "start_line": 29, "start_column": 8, "end_line": 29, "end_column": 74 }, { "span": "self.assertTrue('<FromUserName><![CDATA[user1]]></FromUserName>' in r)", "start_line": 30, "start_column": 8, "end_line": 30, "end_column": 78 }, { "span": "self.assertTrue('<MsgType><![CDATA[text]]></MsgType>' in r)", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 67 }, { "span": "self.assertTrue('<Content><![CDATA[test]]></Content>' in r)", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 67 }, { "span": "self.assertTrue(create_time in r)", "start_line": 34, "start_column": 8, "end_line": 34, "end_column": 41 }, { "span": "self.assertTrue(reply.hq_music_url is None)", "start_line": 89, "start_column": 8, "end_line": 89, "end_column": 51 }, { "span": "self.assertTrue(reply.hq_music_url is None)", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 51 }, { "span": "self.assertTrue(r1.render() != r2.render())", "start_line": 112, "start_column": 8, "end_line": 112, "end_column": 51 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Repl", "y", "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", "repl", "y", "\\u", "render_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timestamp_", "=_", "int_", "(_", "time_", "._", "time_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "=_", "Text", "Reply_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "'", "user", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target_", "=_", "'", "user", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "=_", "timestamp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content_", "=_", "'", "test", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "reply_", "._", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "r_", "._", "startswith_", "(_", "'<", "xml", ">\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "r_", "._", "endswith_", "(_", "'\\\\", "n", "</", "xml", ">'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'<", "To", "User", "Name", "><", "![", "CD", "ATA", "[", "user", "2", "]]", "><", "/", "To", "User", "Name", ">'_", "in_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'<", "Fro", "m", "User", "Name", "><", "![", "CD", "ATA", "[", "user", "1", "]]", "><", "/", "Fro", "m", "User", "Name", ">'_", "in_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'<", "Msg", "Type", "><", "![", "CD", "ATA", "[", "text", "]]", "><", "/", "Msg", "Type", ">'_", "in_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'<", "Conten", "t", "><", "![", "CD", "ATA", "[", "test", "]]", "><", "/", "Conten", "t", ">'_", "in_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "time_", "=_", "'<", "Creat", "e", "Time", ">", "{", "time", "}", "</", "Creat", "e", "Time", ">'_", "._", "format_", "(_", "time_", "=_", "timestamp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "create", "\\u", "time_", "in_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Repl", "y", "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", "music", "\\u", "repl", "y", "\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "we", "chat", "py_", "._", "replies_", "import_", "Music", "Reply_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reply_", "=_", "Music", "Reply_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "._", "thumb", "\\u", "media", "\\u", "id_", "=_", "'", "12345", "6", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "._", "title_", "=_", "'", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "._", "description_", "=_", "'", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "._", "music", "\\u", "url_", "=_", "'", "http", "://", "www", ".", "qq", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "._", "hq", "\\u", "music", "\\u", "url_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "12345", "6", "'_", ",_", "reply_", "._", "thumb", "\\u", "media", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "test", "'_", ",_", "reply_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "test", "'_", ",_", "reply_", "._", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "www", ".", "qq", ".", "com", "'_", ",_", "reply_", "._", "music", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "reply_", "._", "hq", "\\u", "music", "\\u", "url_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reply_", "=_", "Music", "Reply_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "thumb", "\\u", "media", "\\u", "id_", "=_", "'", "12345", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "music", "\\u", "url_", "=_", "'", "http", "://", "www", ".", "qq", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hq", "\\u", "music", "\\u", "url_", "=_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "12345", "6", "'_", ",_", "reply_", "._", "thumb", "\\u", "media", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "test", "'_", ",_", "reply_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "test", "'_", ",_", "reply_", "._", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "www", ".", "qq", ".", "com", "'_", ",_", "reply_", "._", "music", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "reply_", "._", "hq", "\\u", "music", "\\u", "url_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Repl", "y", "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", "multi", "\\u", "article", "\\u", "reply_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "we", "chat", "py_", "._", "replies_", "import_", "Artic", "les", "Reply_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "article_", "=_", "{_", "'", "title", "'_", ":_", "'", "test", "'_", ",_", "'", "url", "'_", ":_", "'", "http", "://", "www", ".", "qq", ".", "com", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r1_", "=_", "Artic", "les", "Reply_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r1_", "._", "add", "\\u", "article_", "(_", "article_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r2_", "=_", "Artic", "les", "Reply_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "r1_", "._", "render_", "(_", ")_", "!=_", "r2_", "._", "render_", "(_", ")_", ")_" ]
[ 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unnecessary pass
awslabs/simplebeerservice/sbsunit/sbs/reader.py
[ { "content": " @gen.coroutine\n def read_once(self):\n try:\n values = {}\n values['ultrasonic'] = self.board.read_ultrasonic_ranger()\n values['dht'] = self.board.read_dht()\n Tools.log(str(values))\n self.sensor_buffer[\"temp\"].append(int(values['dht'][0]))\n self.sensor_buffer[\"humidity\"].append(int(values['dht'][1]))\n self.sensor_buffer[\"ultrasonic\"].append(values['ultrasonic'])\n except IOError, e:\n Tools.log('I/O Error reading sensors. Exception: %s' % str(e),1)\n except Exception, e:\n Tools.log('Error reading sensors: %s' % str(e),1)\n pass", "metadata": "root.SBSReader.read_once", "header": "['class', 'SBSReader', '(', 'object', ')', ':', '___EOS___']", "index": 36 }, { "content": " @gen.coroutine\n def read(self):\n try:\n values = {}\n values['flow'] = self.board.read_flow_sensor()\n values['sound'] = self.board.read_sound_sensor()\n Tools.log(str(values))\n self.sensor_buffer[\"flow\"].append(values['flow'])\n self.sensor_buffer[\"sound\"].append(values['sound'])\n except IOError, e:\n Tools.log('I/O Error reading sensors. Exception: %s' % str(e),1)\n except Exception, e:\n Tools.log('Error reading sensors: %s' % str(e),1)\n pass", "metadata": "root.SBSReader.read", "header": "['class', 'SBSReader', '(', 'object', ')', ':', '___EOS___']", "index": 53 } ]
[ { "span": "pass", "start_line": 50, "start_column": 12, "end_line": 50, "end_column": 16 }, { "span": "pass", "start_line": 66, "start_column": 12, "end_line": 66, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "SB", "SR", "eader", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "gen_", "._", "coroutine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "read", "\\u", "once_", "(_", "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 ", " _", "values_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "[_", "'", "ultr", "aso", "nic", "'_", "]_", "=_", "self_", "._", "board_", "._", "read", "\\u", "ultr", "aso", "nic", "\\u", "range", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "[_", "'", "dht", "'_", "]_", "=_", "self_", "._", "board_", "._", "read", "\\u", "dht", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Tools_", "._", "log_", "(_", "str_", "(_", "values_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sensor", "\\u", "buffer_", "[_", "\"", "temp", "\"_", "]_", "._", "append_", "(_", "int_", "(_", "values_", "[_", "'", "dht", "'_", "]_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sensor", "\\u", "buffer_", "[_", "\"", "humid", "it", "y", "\"_", "]_", "._", "append_", "(_", "int_", "(_", "values_", "[_", "'", "dht", "'_", "]_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sensor", "\\u", "buffer_", "[_", "\"", "ultr", "aso", "nic", "\"_", "]_", "._", "append_", "(_", "values_", "[_", "'", "ultr", "aso", "nic", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Tools_", "._", "log_", "(_", "'", "I", "/", "O", " ", "Error", " ", "readi", "ng", " ", "sensor", "s", ".", " ", "Except", "ion", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "e_", ")_", ",_", "1_", ")_", "\\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 ", " _", "Tools_", "._", "log_", "(_", "'", "Error", " ", "readi", "ng", " ", "sensor", "s", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "e_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SB", "SR", "eader", "_", "(_", "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_", "@_", "gen_", "._", "coroutine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "read_", "(_", "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 ", " _", "values_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "[_", "'", "flow", "'_", "]_", "=_", "self_", "._", "board_", "._", "read", "\\u", "flow", "\\u", "sensor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "[_", "'", "sound", "'_", "]_", "=_", "self_", "._", "board_", "._", "read", "\\u", "sound", "\\u", "sensor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Tools_", "._", "log_", "(_", "str_", "(_", "values_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sensor", "\\u", "buffer_", "[_", "\"", "flow", "\"_", "]_", "._", "append_", "(_", "values_", "[_", "'", "flow", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sensor", "\\u", "buffer_", "[_", "\"", "sound", "\"_", "]_", "._", "append_", "(_", "values_", "[_", "'", "sound", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Tools_", "._", "log_", "(_", "'", "I", "/", "O", " ", "Error", " ", "readi", "ng", " ", "sensor", "s", ".", " ", "Except", "ion", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "e_", ")_", ",_", "1_", ")_", "\\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 ", " _", "Tools_", "._", "log_", "(_", "'", "Error", " ", "readi", "ng", " ", "sensor", "s", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "e_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 0, 2 ]
Imprecise assert
lsbardel/python-stdnet/tests/all/apps/columnts/manipulate.py
[ { "content": " def test_contains(self):\n ts = yield self.create()\n all_dates = yield ts.itimes()\n dt = all_dates[10]\n self.assertTrue(dt in ts)\n # now lets pop dt\n v = ts.pop(dt)\n self.assertEqual(len(v), 6)\n self.assertFalse(dt in ts)\n #\n dn = datetime.now()\n self.assertFalse(dn in ts)", "metadata": "root.TestManipulate.test_contains", "header": "['class', 'TestManipulate', '(', 'ColumnMixin', ',', 'test', '.', 'TestCase', ')', ':', '___EOS___']", "index": 59 } ]
[ { "span": "self.assertTrue(dt in ts)", "start_line": 63, "start_column": 8, "end_line": 63, "end_column": 33 }, { "span": "self.assertFalse(dt in ts)", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 34 }, { "span": "self.assertFalse(dn in ts)", "start_line": 70, "start_column": 8, "end_line": 70, "end_column": 34 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Manipulat", "e_", "(_", "Colum", "n", "Mixin_", ",_", "test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "contains_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ts_", "=_", "yield_", "self_", "._", "create_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "dates_", "=_", "yield_", "ts_", "._", "iti", "mes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt_", "=_", "all", "\\u", "dates_", "[_", "10_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dt_", "in_", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "lets", " ", "pop", " ", "dt_", "\\u\\u\\uNL\\u\\u\\u_", "v_", "=_", "ts_", "._", "pop_", "(_", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "v_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "dt_", "in_", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "dn_", "=_", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "dn_", "in_", "ts_", ")_" ]
[ 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused import
googlei18n/nototools/nototools/coverage.py
[ { "content": "#!/usr/bin/python\n#\n# Copyright 2014 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\"\"\"Routines for character coverage of fonts.\"\"\"\n\n__author__ = 'roozbeh@google.com (Roozbeh Pournader)'\n\nimport argparse\nimport codecs\nimport os\nfrom os import path\nimport re\nimport sys\nimport unicode_data\n\nfrom nototools import lint_config\n\nfrom fontTools import ttLib\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 character_set(font):\n \"\"\"Returns the character coverage of a font.\n\n Args:\n font: The input font's file name, or a TTFont.\n\n Returns:\n A frozenset listing the characters supported in the font.\n \"\"\"\n if type(font) is str:\n font = ttLib.TTFont(font)\n cmap_table = font['cmap']\n cmaps = {}\n for table in cmap_table.tables:\n if (table.format, table.platformID, table.platEncID) in [\n (4, 3, 1), (12, 3, 10)\n ]:\n cmaps[table.format] = table.cmap\n if 12 in cmaps:\n cmap = cmaps[12]\n elif 4 in cmaps:\n cmap = cmaps[4]\n else:\n cmap = {}\n return frozenset(cmap.keys())", "metadata": "root.character_set", "header": "['module', '___EOS___']", "index": 32 }, { "content": "def convert_set_to_ranges(charset):\n \"\"\"Converts a set of characters to a list of ranges.\"\"\"\n working_set = set(charset)\n output_list = []\n while working_set:\n start = min(working_set)\n end = start + 1\n while end in working_set:\n end += 1\n output_list.append((start, end - 1))\n working_set.difference_update(range(start, end))\n return output_list", "metadata": "root.convert_set_to_ranges", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def _print_char_info(chars):\n for char in chars:\n try:\n name = unicode_data.name(char)\n except ValueError:\n name = '<Unassigned>'\n print 'U+%04X %s' % (char, name)", "metadata": "root._print_char_info", "header": "['module', '___EOS___']", "index": 73 }, { "content": "def _write_char_text(chars, filepath, chars_per_line, sep):\n def accept_cp(cp):\n cat = unicode_data.category(cp)\n return cat[0] not in ['M', 'C', 'Z'] or cat == 'Co'\n\n text = [unichr(cp) for cp in chars if accept_cp(cp)]\n filename, _ = path.splitext(path.basename(filepath))\n m = re.match(r'(.*)-(?:Regular|Bold|Italic|BoldItalic)', filename)\n if m:\n filename = m.group(1)\n filename += '_chars.txt'\n print 'writing file: %s' % filename\n print '%d characters (of %d)' % (len(text), len(chars))\n if chars_per_line > 0:\n lines = []\n for n in range(0, len(text), chars_per_line):\n substr = text[n:n + chars_per_line]\n lines.append(sep.join(cp for cp in substr))\n text = '\\n'.join(lines)\n with codecs.open(filename, 'w', 'utf-8') as f:\n f.write(text)", "metadata": "root._write_char_text", "header": "['module', '___EOS___']", "index": 82 }, { "content": "def _process_font(filepath, args):\n char_set = character_set(filepath)\n if args.limit_set:\n char_set = char_set & args.limit_set\n if not char_set:\n print 'limit excludes all chars in %s' % filepath\n return\n sorted_chars = sorted(char_set)\n if args.info:\n _print_char_info(sorted_chars)\n if args.text:\n _write_char_text(sorted_chars, filepath, args.chars_per_line, args.sep)\n if args.ranges:\n print 'ranges:\\n ' + lint_config.write_int_ranges(sorted_chars, True)", "metadata": "root._process_font", "header": "['module', '___EOS___']", "index": 105 }, { "content": "def main():\n parser = argparse.ArgumentParser()\n parser.add_argument('files', help='Files to dump', metavar='file', nargs='+')\n parser.add_argument('--ranges',\n help='Dump cmap as hex ranges',\n action='store_true')\n parser.add_argument('--text',\n help='Dump cmap as sample text',\n action='store_true')\n parser.add_argument('--sep',\n help='Separator between chars in text, default space',\n default=' ')\n parser.add_argument('--info',\n help='Dump cmap as cp and unicode name, one per line',\n action='store_true')\n parser.add_argument('--chars_per_line',\n help='Format text in lines of at most this '\n 'many codepoints, 0 to format as a single line',\n type=int,\n metavar='N',\n default=32)\n parser.add_argument('--limit',\n help='string of hex codepoint ranges limiting cmap '\n 'to output',\n metavar='ranges')\n args = parser.parse_args()\n\n if not (args.ranges or args.text or args.info):\n args.info = True\n\n if args.limit:\n args.limit_set = lint_config.parse_int_ranges(args.limit)\n print 'limit to: ' + lint_config.write_int_ranges(args.limit_set)\n else:\n # make sure it exists so checks don't have to care\n args.limit_set = None\n\n for fontpath in args.files:\n print 'Font: ' + path.normpath(fontpath)\n _process_font(fontpath, args)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 121 } ]
[ { "span": "import os", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 9 }, { "span": "import sys", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2014", " ", "Goo", "gle", " ", "Inc", ".", " ", "All", " ", "rights", " ", "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_", "\"\"\"", "Routine", "s", " ", "for", " ", "character", " ", "covera", "ge", " ", "of", " ", "font", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "roo", "zb", "eh", "@", "google", ".", "com", " ", "(", "Roo", "zb", "eh", " ", "Pou", "rna", "der", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "codecs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "import_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unicode", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "not", "oto", "ols_", "import_", "lint", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "font", "Tools_", "import_", "tt", "Lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "character", "\\u", "set_", "(_", "font_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "the", " ", "character", " ", "covera", "ge", " ", "of", " ", "a", " ", "font", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "font", ":", " ", "The", " ", "input", " ", "font", "'", "s", " ", "file", " ", "name", ",", " ", "or", " ", "a", " ", "TT", "Font", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "frozen", "set", " ", "listi", "ng", " ", "the", " ", "character", "s", " ", "support", "ed", " ", "in", " ", "the", " ", "font", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "font_", ")_", "is_", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "font_", "=_", "tt", "Lib_", "._", "TT", "Font_", "(_", "font_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmap", "\\u", "table_", "=_", "font_", "[_", "'", "cmap", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmap", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "table_", "in_", "cmap", "\\u", "table_", "._", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "table_", "._", "format_", ",_", "table_", "._", "platform", "ID_", ",_", "table_", "._", "plat", "Enc", "ID_", ")_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "4_", ",_", "3_", ",_", "1_", ")_", ",_", "(_", "12_", ",_", "3_", ",_", "10_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmap", "s_", "[_", "table_", "._", "format_", "]_", "=_", "table_", "._", "cmap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "12_", "in_", "cmap", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmap_", "=_", "cmap", "s_", "[_", "12_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "4_", "in_", "cmap", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmap_", "=_", "cmap", "s_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmap_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "frozenset_", "(_", "cmap_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\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_", "convert", "\\u", "set\\u", "to", "\\u", "ranges_", "(_", "charset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Convert", "s", " ", "a", " ", "set", " ", "of", " ", "character", "s", " ", "to", " ", "a", " ", "list", " ", "of", " ", "ranges", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "working", "\\u", "set_", "=_", "set_", "(_", "charset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "working", "\\u", "set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "min_", "(_", "working", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "start_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "end_", "in_", "working", "\\u", "set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "end_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output", "\\u", "list_", "._", "append_", "(_", "(_", "start_", ",_", "end_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "working", "\\u", "set_", "._", "difference", "\\u", "update_", "(_", "range_", "(_", "start_", ",_", "end_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "output", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "print", "\\u", "char", "\\u", "info_", "(_", "chars_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "char_", "in_", "chars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "unicode", "\\u", "data_", "._", "name_", "(_", "char_", ")_", "\\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 ", " _", "name_", "=_", "'<", "Una", "ssi", "gned", ">'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "U", "+", "%", "04", "X", " ", "%", "s", "'_", "%_", "(_", "char_", ",_", "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_", "\\u", "write", "\\u", "char", "\\u", "text_", "(_", "chars_", ",_", "filepath_", ",_", "char", "s", "\\u", "per", "\\u", "line_", ",_", "sep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "accept", "\\u", "cp_", "(_", "cp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cat_", "=_", "unicode", "\\u", "data_", "._", "category_", "(_", "cp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cat_", "[_", "0_", "]_", "not_", "in_", "[_", "'", "M", "'_", ",_", "'", "C", "'_", ",_", "'", "Z", "'_", "]_", "or_", "cat_", "==_", "'", "Co", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "[_", "unichr_", "(_", "cp_", ")_", "for_", "cp_", "in_", "chars_", "if_", "accept", "\\u", "cp_", "(_", "cp_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", ",_", "\\u_", "=_", "path_", "._", "splitext_", "(_", "path_", "._", "basename_", "(_", "filepath_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "re_", "._", "match_", "(_", "r", "'(.*", ")-", "(?:", "Regula", "r", "|", "Bol", "d", "|", "Italic", "|", "Bol", "d", "Italic", ")'_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "m_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "filename_", "+=_", "'\\u", "char", "s", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "writ", "ing", " ", "file", ":", " ", "%", "s", "'_", "%_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "d", " ", "character", "s", " ", "(", "of", " ", "%", "d", ")'_", "%_", "(_", "len_", "(_", "text_", ")_", ",_", "len_", "(_", "chars_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "char", "s", "\\u", "per", "\\u", "line_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "text_", ")_", ",_", "char", "s", "\\u", "per", "\\u", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "substr_", "=_", "text_", "[_", "n_", ":_", "n_", "+_", "char", "s", "\\u", "per", "\\u", "line_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "._", "append_", "(_", "sep_", "._", "join_", "(_", "cp_", "for_", "cp_", "in_", "substr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "codecs_", "._", "open_", "(_", "filename_", ",_", "'", "w", "'_", ",_", "'", "utf", "-", "8", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "process", "\\u", "font_", "(_", "filepath_", ",_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "\\u", "set_", "=_", "character", "\\u", "set_", "(_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "limit", "\\u", "set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "\\u", "set_", "=_", "char", "\\u", "set_", "&_", "args_", "._", "limit", "\\u", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "char", "\\u", "set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "limit", " ", "excludes", " ", "all", " ", "char", "s", " ", "in", " ", "%", "s", "'_", "%_", "filepath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sorte", "d\\u", "chars_", "=_", "sorted_", "(_", "char", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "print", "\\u", "char", "\\u", "info_", "(_", "sorte", "d\\u", "chars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "write", "\\u", "char", "\\u", "text_", "(_", "sorte", "d\\u", "chars_", ",_", "filepath_", ",_", "args_", "._", "char", "s", "\\u", "per", "\\u", "line_", ",_", "args_", "._", "sep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "ranges_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ranges", ":\\\\", "n", " ", " ", "'_", "+_", "lint", "\\u", "config_", "._", "write", "\\u", "int\\u", "ranges_", "(_", "sorte", "d\\u", "chars_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "files", "'_", ",_", "help_", "=_", "'", "Files", " ", "to", " ", "dump", "'_", ",_", "metavar_", "=_", "'", "file", "'_", ",_", "nargs_", "=_", "'+'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "ranges", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Dump", " ", "cmap", " ", "as", " ", "hex", " ", "ranges", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "text", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Dump", " ", "cmap", " ", "as", " ", "sample", " ", "text", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "sep", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Sepa", "rator", " ", "bet", "ween", " ", "char", "s", " ", "in", " ", "text", ",", " ", "default", " ", "space", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "info", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Dump", " ", "cmap", " ", "as", " ", "cp", " ", "and", " ", "unicode", " ", "name", ",", " ", "one", " ", "per", " ", "line", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "char", "s", "\\u", "per", "\\u", "line", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Format", " ", "text", " ", "in", " ", "lines", " ", "of", " ", "at", " ", "most", " ", "this", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "many", " ", "codepoint", "s", ",", " ", " ", "0", " ", "to", " ", "format", " ", "as", " ", "a", " ", "single", " ", "line", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "metavar_", "=_", "'", "N", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "limit", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "string", " ", "of", " ", "hex", " ", "codepoint", " ", "ranges", " ", "limit", "ing", " ", "cmap", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "to", " ", "output", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "metavar_", "=_", "'", "ranges", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "(_", "args_", "._", "ranges_", "or_", "args_", "._", "text_", "or_", "args_", "._", "info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "info_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "limit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "limit", "\\u", "set_", "=_", "lint", "\\u", "config_", "._", "parse", "\\u", "int\\u", "ranges_", "(_", "args_", "._", "limit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "limit", " ", "to", ":", " ", "'_", "+_", "lint", "\\u", "config_", "._", "write", "\\u", "int\\u", "ranges_", "(_", "args_", "._", "limit", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "it", " ", "exist", "s", " ", "so", " ", "checks", " ", "don", "'", "t", " ", "have", " ", "to", " ", "care", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "limit", "\\u", "set_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "font", "path_", "in_", "args_", "._", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Font", ":", " ", "'_", "+_", "path_", "._", "normpath_", "(_", "font", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "process", "\\u", "font_", "(_", "font", "path_", ",_", "args_", ")_", "\\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,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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 ]
Except block handles 'BaseException'
django-nonrel/djangoappengine/setup.py
[ { "content": "from setuptools import find_packages, setup\n\n\nDESCRIPTION = 'App Engine backends for Django-nonrel'\nLONG_DESCRIPTION = None\ntry:\n LONG_DESCRIPTION = open('README.rst').read()\nexcept:\n pass\n\nsetup(name='djangoappengine',\n version='1.7.1',\n description=DESCRIPTION,\n long_description=LONG_DESCRIPTION,\n author='Waldemar Kornewald',\n author_email='wkornewald@gmail.com',\n url='https://github.com/django-nonrel/djangoappengine',\n packages=find_packages(exclude=['docs']),\n include_package_data=True,\n install_requires=['djangotoolbox>=1.6.0'],\n zip_safe=False,\n license='3-clause BSD',\n test_suite='djangoappengine.tests',\n classifiers=[\n 'Development Status :: 5 - Production/Stable',\n 'Environment :: Web Environment',\n 'Framework :: Django',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: BSD License',\n 'Operating System :: OS Independent',\n 'Programming Language :: Python',\n 'Programming Language :: Python :: 2.5',\n 'Programming Language :: Python :: 2.6',\n 'Programming Language :: Python :: 2.7',\n 'Topic :: Database',\n 'Topic :: Software Development :: Libraries :: Application Frameworks',\n 'Topic :: Software Development :: Libraries :: Python Modules',\n ],\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "setuptools_", "import_", "find", "\\u", "packages_", ",_", "setup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DESCRIPTION_", "=_", "'", "App", " ", "Engine", " ", "back", "ends", " ", "for", " ", "Dj", "ang", "o", "-", "non", "rel", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LONG", "\\u", "DESCRIPTION_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LONG", "\\u", "DESCRIPTION_", "=_", "open_", "(_", "'", "READ", "ME", ".", "rst", "'_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup_", "(_", "name_", "=_", "'", "django", "appengine", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "1.7", ".1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "DESCRIPTION_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "description_", "=_", "LONG", "\\u", "DESCRIPTION_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "'", "Wal", "dem", "ar", " ", "Kor", "newa", "ld", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author", "\\u", "email_", "=_", "'", "wk", "orn", "ewa", "ld", "@", "gma", "il", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "https", "://", "git", "hub", ".", "com", "/", "django", "-", "non", "rel", "/", "django", "appengine", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "packages_", "=_", "find", "\\u", "packages_", "(_", "exclude_", "=_", "[_", "'", "docs", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "package", "\\u", "data_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "install", "\\u", "requires_", "=_", "[_", "'", "django", "toolb", "ox", ">=", "1.6", ".0", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "zip", "\\u", "safe_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "license_", "=_", "'", "3", "-", "clause", " ", "BS", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "suite_", "=_", "'", "django", "appengine", ".", "tests", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "classifiers_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Dev", "elo", "pme", "nt", " ", "Status", " ", "::", " ", "5", " ", "-", " ", "Product", "ion", "/", "Sta", "ble", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Environ", "ment", " ", "::", " ", "Web", " ", "Environ", "ment", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Frame", "work", " ", "::", " ", "Dj", "ang", "o", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Inten", "ded", " ", "Audi", "ence", " ", "::", " ", "Dev", "elope", "rs", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "License", " ", "::", " ", "OSI", " ", "Appro", "ved", " ", "::", " ", "BS", "D", " ", "License", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Opera", "ting", " ", "System", " ", "::", " ", "OS", " ", "Inde", "pend", "ent", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", " ", "::", " ", "2.5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", " ", "::", " ", "2.6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", " ", "::", " ", "2.7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Topic", " ", "::", " ", "Databa", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Topic", " ", "::", " ", "Sof", "twa", "re", " ", "Dev", "elo", "pme", "nt", " ", "::", " ", "Libr", "aries", " ", "::", " ", "Applica", "tion", " ", "Frame", "works", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Topic", " ", "::", " ", "Sof", "twa", "re", " ", "Dev", "elo", "pme", "nt", " ", "::", " ", "Libr", "aries", " ", "::", " ", "Pyth", "on", " ", "Modul", "es", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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import
datasift/datasift-python/examples/identity_api.py
[ { "content": "from __future__ import print_function\nimport time\nfrom datasift import Client\nimport json\n\nuser_name = \"your username\"\napi_key = \"your API key\"\ndatasift = Client(user_name, api_key, False)\n\n\nprint(\"Create an identity for a customer\")\nidentity = datasift.account.identity.create('New Customer name')\nprint(identity)\n\nprint(\"Update the identity\")\ndatasift.account.identity.update(identity['id'], 'Updated Customer name')\n\nprint(\"Get the updated identity\")\nprint(datasift.account.identity.get(identity['id']))\n\nprint(\"Create a Datasift token for this identity using a token from the third party service\")\ntoken = datasift.account.identity.token.create(identity['id'], 'facebook', '<Facebook Token>')\nprint(token)\n\nprint(\"Create a client for the token so API calls can be made for this customer\")\ncustomer_client = Client(user_name, identity['api_key'])\n\nprint(\"Get all PYLON recordings for this customer\")\nprint(customer_client.pylon.list())\n\nprint(\"Create a limit for this identity and service\")\ndatasift.account.identity.limit.create(identity['id'], 'facebook', 1000)\n\nprint(\"Get the newly created limit\")\nprint(datasift.account.identity.limit.get(identity['id'], 'facebook'))\n\nprint(\"Delete the identity\")\ndatasift.account.identity.delete(identity['id'])\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import time", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 11 }, { "span": "import json", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 11 } ]
[]
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_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datas", "ift", "_", "import_", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "name_", "=_", "\"", "your", " ", "user", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "api", "\\u", "key_", "=_", "\"", "your", " ", "API", " ", "key", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas", "ift", "_", "=_", "Client_", "(_", "user", "\\u", "name_", ",_", "api", "\\u", "key_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Creat", "e", " ", "an", " ", "identi", "ty", " ", "for", " ", "a", " ", "customer", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "identity_", "=_", "datas", "ift", "_", "._", "account_", "._", "identity_", "._", "create_", "(_", "'", "New", " ", "Custom", "er", " ", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "identity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Update", " ", "the", " ", "identi", "ty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas", "ift", "_", "._", "account_", "._", "identity_", "._", "update_", "(_", "identity_", "[_", "'", "id", "'_", "]_", ",_", "'", "Update", "d", " ", "Custom", "er", " ", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Get", " ", "the", " ", "update", "d", " ", "identi", "ty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "datas", "ift", "_", "._", "account_", "._", "identity_", "._", "get_", "(_", "identity_", "[_", "'", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Creat", "e", " ", "a", " ", "Datas", "ift", " ", "token", " ", "for", " ", "this", " ", "identi", "ty", " ", "usi", "ng", " ", "a", " ", "token", " ", "from", " ", "the", " ", "third", " ", "part", "y", " ", "service", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token_", "=_", "datas", "ift", "_", "._", "account_", "._", "identity_", "._", "token_", "._", "create_", "(_", "identity_", "[_", "'", "id", "'_", "]_", ",_", "'", "facebook", "'_", ",_", "'<", "Face", "book", " ", "Token", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Creat", "e", " ", "a", " ", "client", " ", "for", " ", "the", " ", "token", " ", "so", " ", "API", " ", "calls", " ", "can", " ", "be", " ", "made", " ", "for", " ", "this", " ", "customer", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "customer", "\\u", "client_", "=_", "Client_", "(_", "user", "\\u", "name_", ",_", "identity_", "[_", "'", "api", "\\u", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Get", " ", "all", " ", "PY", "LON", " ", "recordings", " ", "for", " ", "this", " ", "customer", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "customer", "\\u", "client_", "._", "pylon", "_", "._", "list_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Creat", "e", " ", "a", " ", "limit", " ", "for", " ", "this", " ", "identi", "ty", " ", "and", " ", "service", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas", "ift", "_", "._", "account_", "._", "identity_", "._", "limit_", "._", "create_", "(_", "identity_", "[_", "'", "id", "'_", "]_", ",_", "'", "facebook", "'_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Get", " ", "the", " ", "newl", "y", " ", "created", " ", "limit", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "datas", "ift", "_", "._", "account_", "._", "identity_", "._", "limit_", "._", "get_", "(_", "identity_", "[_", "'", "id", "'_", "]_", ",_", "'", "facebook", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Delete", " ", "the", " ", "identi", "ty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas", "ift", "_", "._", "account_", "._", "identity_", "._", "delete_", "(_", "identity_", "[_", "'", "id", "'_", "]_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
bluquar/cubr/cube.py
[ { "content": " def timer(self):\n needsRedraw = self.move() or (not self.status == self.PAUSED)\n\n if self.rotating:\n self.rotationCount -= 1\n if self.rotationCount <= 0:\n self.rotating = False\n self.rotatingValues = [ ]\n self.state.rotate(self.rotationItem)\n del self.rotationItem\n needsRedraw = True\n\n if self.timeUntilNextRotation > 0:\n self.timeUntilNextRotation -= 1\n\n if (not self.rotating) and (self.timeUntilNextRotation <= 0):\n if (self.status == self.PLAYING) or (self.status == self.STEP):\n if self.moveIndex >= (len(self.moveList) - 1):\n self.status = self.PAUSED\n self.updateMessage('')\n self.shuffling = False\n else:\n self.moveIndex += 1\n needsRedraw = self.makeMove(self.moveList[self.moveIndex],\n animate = not self.shuffling, \n render = not self.shuffling or (self.moveIndex % 20 == 0))\n\n if (self.status == self.REVERSING) or (self.status == self.BACK):\n if self.moveIndex < 0:\n self.status = self.PAUSED\n else:\n needsRedraw = self.makeMove(reversal(self.moveList[self.moveIndex]))\n self.moveIndex -= 1\n\n if (self.status == self.STEP) or (self.status == self.BACK):\n self.status = self.PAUSED\n self.timeUntilNextRotation = self.timeBetweenRotations\n\n\n if needsRedraw:\n try:\n self.redraw()\n except:\n self.updateMessage('Could not read cube.')\n self.state.setSolved()\n self.redraw()", "metadata": "root.Cube.timer", "header": "['class', 'Cube', '(', 'object', ')', ':', '___EOS___']", "index": 481 }, { "content": " def redraw(self):\n self.canvas.delete(ALL)\n\n # Top message\n self.canvas.create_text(self.camera.width/2, 40, text=self.message, fill='white', font='Arial 24 bold')\n\n # Bottom message\n sol = self.sol\n lineWidth = 100\n margin = 15\n y = self.camera.height - margin - 20\n while len(sol) > 0:\n self.canvas.create_text(self.camera.width/2, \n y, text=sol[-lineWidth:], fill='white', font='Courier 12')\n y -= margin\n sol = sol[:-lineWidth]\n\n # Progress bar\n if self.showingPB:\n w = (self.width * (self.moveIndex - self.pbMin + 1) / \n (max(1, self.pbMax - self.pbMin)))\n self.canvas.create_rectangle(0, self.height-20, w, self.height, fill='#00ff66')\n\n toDraw = [ ]\n\n for z in xrange(self.size):\n for y in xrange(self.size):\n for x in xrange(self.size):\n try:\n (pieceID, rotationKey) = self.state.state[z][y][x]\n except:\n pieceID = 1\n rotationKey = 210\n\n pieceCenter = self.center + self.pieceOffset(x, y, z)\n outDirections = [d for d in Cube.directions if d**pieceCenter > 0]\n sod = [ ] #sorted out directions\n for od in outDirections:\n if od // CubeState.keys[rotationKey / 100]:\n sod.append(od)\n for od in outDirections:\n if od // CubeState.keys[(rotationKey / 10) % 10]:\n sod.append(od)\n for od in outDirections:\n if od // CubeState.keys[rotationKey % 10]:\n sod.append(od)\n\n pieceRotation = Vector(0,0,0)\n theta = 0.\n\n if pieceID in self.rotatingValues:\n oldCenter = pieceCenter\n pieceOffset = pieceCenter - (pieceCenter > self.rotationAxis)\n pieceRotation = self.rotationAxis * pieceOffset\n theta = self.rotationDTheta * (self.maxRot - self.rotationCount)\n\n if self.rotationDirection:\n theta *= -1\n\n pieceCenter = (pieceCenter > self.rotationAxis)\n pieceCenter = pieceCenter + cos(theta) * pieceOffset\n pieceCenter = pieceCenter + sin(theta) * pieceRotation\n\n faceColors = Cube.faceColors[pieceID]\n for direc, color in zip(sod, faceColors):\n axes = ()\n faceCenter = pieceCenter + (direc / 2)\n\n if pieceID in self.rotatingValues:\n if direc // self.rotationAxis:\n faceCenter = pieceCenter + (direc / 2)\n if self.rotationAxis // Vector(0,1,0):\n axis0temp = Vector(1,0,0)\n else:\n axis0temp = Vector(0,1,0)\n axis1temp = direc * axis0temp\n axis0 = axis0temp * cos(theta) + axis1temp * sin(theta)\n axis1 = axis0 * direc\n axes = (axis0, axis1)\n else:\n perp = -1 * (direc * self.rotationAxis)\n perp = perp ^ (direc.mag)\n faceCenter = pieceCenter + (sin(theta) * (perp / 2) + \n cos(theta) * (direc / 2))\n axis0 = self.rotationAxis\n axis1 = (faceCenter - pieceCenter) * self.rotationAxis * 2\n axes = (axis0, axis1)\n \n visible = (faceCenter - pieceCenter) ** (faceCenter - self.camera.pos) < 0\n corners = self.corners(faceCenter, pieceCenter - faceCenter, *axes)\n corners = [corner.flatten(self.camera) for corner in corners]\n state = 'disabled' # if visible else 'hidden'\n outline = '#888888' if visible else 'gray'\n if not visible: color = 'gray'\n a = 0 if visible else 1000\n spec = (corners, color, state, outline)\n toDraw.append(((pieceCenter-self.camera.pos).mag + a, spec))\n #a = self.canvas.create_polygon(corners, fill=color, \n # width=2, state=state, outline='#888888'\n # #,activewidth=4, activefill=darken(color)\n # )\n if self.debug:\n self.canvas.create_text(faceCenter.flatten(self.camera), text=str(pieceID))\n\n #if pieceCenter.mag() == 1:\n # b = CenterPiece(pieceCenter, self)\n # self.canvas.tag_bind(a, '<Button-1>', b.callback)\n\n \"\"\"\n newCorners = ()\n for corner in corners: newCorners += corner.flatten(self.camera)\n if visible:\n self.canvas.create_polygon(self.faces[(pieceID,color)], newCorners)\n #self.canvas.itemconfig(self.faces[(pieceID,color)], state=state)\n \n \"\"\"\n\n toDraw.sort(lambda a,b: cmp(b,a))\n for polygon in toDraw:\n spec = polygon[1]\n (corners, color, state, outline) = spec\n self.canvas.create_polygon(corners, fill=color, width=2, state=state, outline=outline)\n\n self.drawHelp()", "metadata": "root.Cube.redraw", "header": "['class', 'Cube', '(', 'object', ')', ':', '___EOS___']", "index": 588 }, { "content": " def gatherStats(self):\n self.statString = 'Unable to fetch solution logs.'\n stats = None\n try:\n with open('solutionLogs.txt') as file:\n stats = eval(file.read())\n except: return\n if stats is not None:\n self.statString = ''\n\n stats = [s.split(';') for s in stats]\n\n moves = [stat[-1] for stat in stats] # Gets last element\n moves = [mv[6:] for mv in moves] # Remove \"Moves:\"\n moves = [int(mv) for mv in moves]\n if len(moves) == 0:\n self.statString += \"No solutions generated yet.\"\n return\n self.statString += \"%d solution%s logged.\\n\" % (len(moves), '' if len(moves)==1 else 's')\n avgMoves = sum(moves)/len(moves)\n self.statString += \"Average number of 90 degree face rotations per solution: %d\\n\" % (avgMoves)\n\n times = [stat[-2] for stat in stats] # gets 2nd to last element\n times = [tm[6:-4] for tm in times] # removes \"Time: \" ... \" sec\"\n times = [float(tm) for tm in times]\n avgTime = sum(times)/(max(1, len(times)))\n self.statString += \"Average time needed to generate a solution: %0.4f seconds\" % (avgTime)", "metadata": "root.Cube.gatherStats", "header": "['class', 'Cube', '(', 'object', ')', ':', '___EOS___']", "index": 714 }, { "content": " def resetStats(self):\n try:\n with open('solutionLogs.txt', 'r+') as file:\n file.seek(0) # beginning\n file.truncate()\n file.writelines(['[]'])\n except: return", "metadata": "root.Cube.resetStats", "header": "['class', 'Cube', '(', 'object', ')', ':', '___EOS___']", "index": 742 }, { "content": " def setConfig(self, config):\n try:\n self.state = CubeState('barebones')\n\n if self.debug:\n print self.state\n\n # Modify the state to include [(color, direction), (color, direction), ...]\n # And then parse pieceId and orientationKey out of that\n\n def faceToAxis(face):\n if self.debug:\n print face\n center = face[1][1]\n axis = [vec for vec in Cube.directions if \n Cube.directions[vec].lower() == center.lower()][0]\n return axis\n\n def setAxes(normal, known, dirString):\n dirString = dirString.lower()\n if dirString == 'up':\n up = known\n elif dirString == 'down':\n up = known * -1\n elif dirString == 'left':\n up = (normal * known)\n elif dirString == 'right':\n up = (known * normal)\n\n down = up * -1\n left = (up * normal)\n right = left * -1\n\n return (up, down, left, right)\n\n timesTouched = [[[0,0,0],[0,0,0],[0,0,0]],[[0,0,0],[0,0,0],[0,0,0]],[[0,0,0],[0,0,0],[0,0,0]]]\n\n for faceInfo in config:\n axis = faceToAxis(faceInfo.currentFace)\n prevAxis = nextAxis = None\n if faceInfo.prevFace:\n prevAxis = faceToAxis(faceInfo.prevFace)\n if faceInfo.nextFace:\n nextAxis = faceToAxis(faceInfo.nextFace)\n prevTurn = faceInfo.prevTurn\n nextTurn = faceInfo.nextTurn\n\n if self.debug:\n print 'axis:', axis, Cube.directions[axis]\n print 'prevAxis:', prevAxis,\n if prevAxis:\n print Cube.directions[prevAxis]\n print 'nextAxis:', nextAxis, \n if nextAxis:\n print Cube.directions[nextAxis]\n print 'prevTurn:', prevTurn \n print 'nextTurn:', nextTurn\n\n if prevTurn:\n (up, down, left, right) = setAxes(axis, prevAxis, prevTurn)\n elif nextTurn:\n (up, down, left, right) = setAxes(axis, nextAxis * -1, nextTurn)\n\n if self.debug:\n print 'up:', up, Cube.directions[up]\n print 'down:', down, Cube.directions[down]\n print 'left:', left, Cube.directions[left]\n print 'right:', right, Cube.directions[right]\n\n for row in xrange(3):\n for col in xrange(3):\n pos = axis\n pos = pos + (down * (row - 1))\n pos = pos + (right * (col - 1))\n\n (x, y, z) = pos.components\n (x, y, z) = (int(x+1), int(y+1), int(z+1))\n if self.debug:\n print 'x,y,z', x, y, z,\n print 'pos=', pos\n\n timesTouched[z][y][x] += 1\n\n cell = self.state.state[z][y][x]\n if type(cell) == list:\n cell.append((faceInfo.currentFace[row][col], axis))\n\n if self.debug:\n print 'state=', self.state\n print 'times', timesTouched\n\n # Cast each [ ] list to a ( ) tuple\n # [(color,dir),(color,dir),(color,dir)] ----> (pieceId, orientationKey)\n\n reverseZ = -1 if self.camera.view ** Vector(0,0,1) < 0 else 1\n reverseY = -1 if self.camera.view ** Vector(0,1,0) < 0 else 1\n reverseX = -1 if self.camera.view ** Vector(1,0,0) < 0 else 1\n\n zRange = range(3)[::reverseZ]\n yRange = range(3)[::reverseY]\n xRange = range(3)[::reverseX]\n\n\n for z in zRange:\n for y in yRange:\n for x in xRange:\n \n cell = self.state.state[z][y][x]\n if type(cell) == list:\n pieceId = -1\n colors = set()\n for i in cell:\n colors.add(i[0])\n for key in Cube.faceColors:\n if set(Cube.faceColors[key]) == colors:\n pieceId = key\n break\n if pieceId >= 0:\n desiredColorOrder = Cube.faceColors[pieceId]\n currentOrder = [ ]\n ori = 0\n notAdded = set([0,1,2])\n\n cell.sort(lambda a,b: cmp(desiredColorOrder.index(a[0]),\n desiredColorOrder.index(b[0])))\n\n for i in cell:\n ori *= 10\n if i[1] // Vector(0,0,1):\n ori += 2\n notAdded.discard(2)\n elif i[1] // Vector(0,1,0):\n ori += 1\n notAdded.discard(1)\n elif i[1] // Vector(1,0,0):\n ori += 0\n notAdded.discard(0)\n\n while len(notAdded) > 0:\n ori *= 10\n ori += notAdded.pop()\n\n orientationKey = ori\n\n else:\n raise ValueError('Invalid Cube')\n\n if pieceId in (5, 11, 13, 14, 15, 17, 23):\n raise ValueError('Invalid Cube') # Center piece\n\n desired = Cube.faceColors[CubeState.solvedState[z][y][x][0]]\n\n if self.debug:\n print 'The piece with colors %s is at the position of %s' % (colors, desired)\n print 'setting (%d,%d,%d) to (%s, %s)' % (z,y,x,pieceId,orientationKey)\n\n self.state.state[z][y][x] = (pieceId, orientationKey)\n except:\n self.updateMessage('Unable to read camera input.')\n self.state.setSolved()\n self.redraw()\n if self.debug:\n print 'final state=', self.state\n \n self.redraw()", "metadata": "root.Cube.setConfig", "header": "['class', 'Cube', '(', 'object', ')', ':', '___EOS___']", "index": 813 } ]
[ { "span": "except:", "start_line": 523, "start_column": 12, "end_line": 523, "end_column": 19 }, { "span": "except:", "start_line": 618, "start_column": 20, "end_line": 618, "end_column": 27 }, { "span": "except: ", "start_line": 720, "start_column": 8, "end_line": 720, "end_column": 15 }, { "span": "except: ", "start_line": 748, "start_column": 8, "end_line": 748, "end_column": 15 }, { "span": "except:", "start_line": 970, "start_column": 8, "end_line": 970, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Cube_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "timer_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "need", "s", "Red", "raw_", "=_", "self_", "._", "move_", "(_", ")_", "or_", "(_", "not_", "self_", "._", "status_", "==_", "self_", "._", "PAUSE", "D_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "rotati", "ng_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rotati", "on", "Count_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rotati", "on", "Count_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rotati", "ng_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rotati", "ng", "Values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "rotate_", "(_", "self_", "._", "rotati", "on", "Item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "self_", "._", "rotati", "on", "Item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "need", "s", "Red", "raw_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "time", "Unti", "l", "Ne", "xt", "Rotation_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "time", "Unti", "l", "Ne", "xt", "Rotation_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "rotati", "ng_", ")_", "and_", "(_", "self_", "._", "time", "Unti", "l", "Ne", "xt", "Rotation_", "<=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "status_", "==_", "self_", "._", "PLAY", "ING_", ")_", "or_", "(_", "self_", "._", "status_", "==_", "self_", "._", "STEP_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "move", "Index_", ">=_", "(_", "len_", "(_", "self_", "._", "move", "List_", ")_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "status_", "=_", "self_", "._", "PAUSE", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Message_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "shu", "ffl", "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 ", " ", "_", "self_", "._", "move", "Index_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "need", "s", "Red", "raw_", "=_", "self_", "._", "make", "Move_", "(_", "self_", "._", "move", "List_", "[_", "self_", "._", "move", "Index_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "animate", "_", "=_", "not_", "self_", "._", "shu", "ffl", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "render_", "=_", "not_", "self_", "._", "shu", "ffl", "ing_", "or_", "(_", "self_", "._", "move", "Index_", "%_", "20_", "==_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "status_", "==_", "self_", "._", "REV", "ERS", "ING_", ")_", "or_", "(_", "self_", "._", "status_", "==_", "self_", "._", "BACK_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "move", "Index_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "status_", "=_", "self_", "._", "PAUSE", "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 ", " ", "_", "need", "s", "Red", "raw_", "=_", "self_", "._", "make", "Move_", "(_", "rever", "sal", "_", "(_", "self_", "._", "move", "List_", "[_", "self_", "._", "move", "Index_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "move", "Index_", "-=_", "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_", "(_", "self_", "._", "status_", "==_", "self_", "._", "STEP_", ")_", "or_", "(_", "self_", "._", "status_", "==_", "self_", "._", "BACK_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "status_", "=_", "self_", "._", "PAUSE", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "time", "Unti", "l", "Ne", "xt", "Rotation_", "=_", "self_", "._", "time", "Bet", "ween", "Rot", "ations_", "\\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_", "need", "s", "Red", "raw_", ":_", "\\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_", "._", "redraw_", "(_", ")_", "\\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_", "._", "update", "Message_", "(_", "'", "Cou", "ld", " ", "not", " ", "read", " ", "cube", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "set", "Solve", "d_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "redraw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cube_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "redraw_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "canvas_", "._", "delete_", "(_", "ALL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Top", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "canvas_", "._", "create", "\\u", "text_", "(_", "self_", "._", "camera_", "._", "width_", "/_", "2_", ",_", "40_", ",_", "text_", "=_", "self_", "._", "message_", ",_", "fill_", "=_", "'", "white", "'_", ",_", "font_", "=_", "'", "Ari", "al", " ", "24", " ", "bold", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bott", "om", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "sol_", "=_", "self_", "._", "sol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "Width_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "margin_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "self_", "._", "camera_", "._", "height_", "-_", "margin_", "-_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "sol_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "canvas_", "._", "create", "\\u", "text_", "(_", "self_", "._", "camera_", "._", "width_", "/_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "y_", ",_", "text_", "=_", "sol_", "[_", "-_", "line", "Width_", ":_", "]_", ",_", "fill_", "=_", "'", "white", "'_", ",_", "font_", "=_", "'", "Cour", "ier", " ", "1", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "-=_", "margin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sol_", "=_", "sol_", "[_", ":_", "-_", "line", "Width_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Progres", "s", " ", "bar_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "showin", "g", "PB", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w_", "=_", "(_", "self_", "._", "width_", "*_", "(_", "self_", "._", "move", "Index_", "-_", "self_", "._", "pb", "Min_", "+_", "1_", ")_", "/_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "max_", "(_", "1_", ",_", "self_", "._", "pb", "Max_", "-_", "self_", "._", "pb", "Min_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "._", "create", "\\u", "rectangle_", "(_", "0_", ",_", "self_", "._", "height_", "-_", "20_", ",_", "w_", ",_", "self_", "._", "height_", ",_", "fill_", "=_", "'#", "00", "ff", "6", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "to", "Draw_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "z_", "in_", "xrange_", "(_", "self_", "._", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "y_", "in_", "xrange_", "(_", "self_", "._", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "xrange_", "(_", "self_", "._", "size_", ")_", ":_", "\\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 ", " ", " _", "(_", "piece", "ID_", ",_", "rotati", "on", "Key_", ")_", "=_", "self_", "._", "state_", "._", "state_", "[_", "z_", "]_", "[_", "y_", "]_", "[_", "x_", "]_", "\\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 ", " ", " _", "piece", "ID_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rotati", "on", "Key_", "=_", "210_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "piece", "Center_", "=_", "self_", "._", "center_", "+_", "self_", "._", "piece", "Offset_", "(_", "x_", ",_", "y_", ",_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out", "Directi", "ons_", "=_", "[_", "d_", "for_", "d_", "in_", "Cube_", "._", "directions_", "if_", "d_", "**_", "piece", "Center_", ">_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sod", "_", "=_", "[_", "]_", "#", "sorte", "d", " ", "out", " ", "directions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "od_", "in_", "out", "Directi", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "od_", "//_", "Cub", "e", "State_", "._", "keys_", "[_", "rotati", "on", "Key_", "/_", "100_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sod", "_", "._", "append_", "(_", "od_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "od_", "in_", "out", "Directi", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "od_", "//_", "Cub", "e", "State_", "._", "keys_", "[_", "(_", "rotati", "on", "Key_", "/_", "10_", ")_", "%_", "10_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sod", "_", "._", "append_", "(_", "od_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "od_", "in_", "out", "Directi", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "od_", "//_", "Cub", "e", "State_", "._", "keys_", "[_", "rotati", "on", "Key_", "%_", "10_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sod", "_", "._", "append_", "(_", "od_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "piece", "Rotation_", "=_", "Vector_", "(_", "0_", ",_", "0_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "theta_", "=_", "0._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "piece", "ID_", "in_", "self_", "._", "rotati", "ng", "Values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "old", "Center_", "=_", "piece", "Center_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "piece", "Offset_", "=_", "piece", "Center_", "-_", "(_", "piece", "Center_", ">_", "self_", "._", "rotati", "on", "Axis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "piece", "Rotation_", "=_", "self_", "._", "rotati", "on", "Axis_", "*_", "piece", "Offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "theta_", "=_", "self_", "._", "rotati", "on", "DT", "heta", "_", "*_", "(_", "self_", "._", "max", "Rot", "_", "-_", "self_", "._", "rotati", "on", "Count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "rotati", "on", "Direction_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "theta_", "*=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "piece", "Center_", "=_", "(_", "piece", "Center_", ">_", "self_", "._", "rotati", "on", "Axis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "piece", "Center_", "=_", "piece", "Center_", "+_", "cos_", "(_", "theta_", ")_", "*_", "piece", "Offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "piece", "Center_", "=_", "piece", "Center_", "+_", "sin_", "(_", "theta_", ")_", "*_", "piece", "Rotation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "face", "Colors_", "=_", "Cube_", "._", "face", "Colors_", "[_", "piece", "ID_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "direc", "_", ",_", "color_", "in_", "zip_", "(_", "sod", "_", ",_", "face", "Colors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "axes_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "face", "Center_", "=_", "piece", "Center_", "+_", "(_", "direc", "_", "/_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "piece", "ID_", "in_", "self_", "._", "rotati", "ng", "Values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "direc", "_", "//_", "self_", "._", "rotati", "on", "Axis_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "face", "Center_", "=_", "piece", "Center_", "+_", "(_", "direc", "_", "/_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rotati", "on", "Axis_", "//_", "Vector_", "(_", "0_", ",_", "1_", ",_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "axis", "0", "temp_", "=_", "Vector_", "(_", "1_", ",_", "0_", ",_", "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 ", " ", " _", "axis", "0", "temp_", "=_", "Vector_", "(_", "0_", ",_", "1_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "axis", "1", "temp_", "=_", "direc", "_", "*_", "axis", "0", "temp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axis", "0_", "=_", "axis", "0", "temp_", "*_", "cos_", "(_", "theta_", ")_", "+_", "axis", "1", "temp_", "*_", "sin_", "(_", "theta_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axis", "1_", "=_", "axis", "0_", "*_", "direc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axes_", "=_", "(_", "axis", "0_", ",_", "axis", "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 ", " ", " _", "perp", "_", "=_", "-_", "1_", "*_", "(_", "direc", "_", "*_", "self_", "._", "rotati", "on", "Axis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "perp", "_", "=_", "perp", "_", "^_", "(_", "direc", "_", "._", "mag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "face", "Center_", "=_", "piece", "Center_", "+_", "(_", "sin_", "(_", "theta_", ")_", "*_", "(_", "perp", "_", "/_", "2_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "cos_", "(_", "theta_", ")_", "*_", "(_", "direc", "_", "/_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axis", "0_", "=_", "self_", "._", "rotati", "on", "Axis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axis", "1_", "=_", "(_", "face", "Center_", "-_", "piece", "Center_", ")_", "*_", "self_", "._", "rotati", "on", "Axis_", "*_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axes_", "=_", "(_", "axis", "0_", ",_", "axis", "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_", "visible_", "=_", "(_", "face", "Center_", "-_", "piece", "Center_", ")_", "**_", "(_", "face", "Center_", "-_", "self_", "._", "camera_", "._", "pos_", ")_", "<_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corners_", "=_", "self_", "._", "corners_", "(_", "face", "Center_", ",_", "piece", "Center_", "-_", "face", "Center_", ",_", "*_", "axes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corners_", "=_", "[_", "corner_", "._", "flatten_", "(_", "self_", "._", "camera_", ")_", "for_", "corner_", "in_", "corners_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "'", "disable", "d", "'_", "#", " ", "if", " ", "visi", "ble", " ", "else", " ", "'", "hidden", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outline_", "=_", "'#", "888888", "'_", "if_", "visible_", "else_", "'", "gray", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "visible_", ":_", "color_", "=_", "'", "gray", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "0_", "if_", "visible_", "else_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spec_", "=_", "(_", "corners_", ",_", "color_", ",_", "state_", ",_", "outline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "to", "Draw_", "._", "append_", "(_", "(_", "(_", "piece", "Center_", "-_", "self_", "._", "camera_", "._", "pos_", ")_", "._", "mag_", "+_", "a_", ",_", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "a", " ", "=", " ", "self", ".", "canv", "as", ".", "create", "\\u", "poly", "gon", "(", "corners", ",", " ", "fill", "=", "color", ",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "widt", "h", "=", "2", ",", " ", "state", "=", "state", ",", " ", "outline", "='", "#", "888888", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "#", ",", "active", "widt", "h", "=", "4", ",", " ", "active", "fill", "=", "dark", "en", "(", "color", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "canvas_", "._", "create", "\\u", "text_", "(_", "face", "Center_", "._", "flatten_", "(_", "self_", "._", "camera_", ")_", ",_", "text_", "=_", "str_", "(_", "piece", "ID_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "piece", "Center", ".", "mag", "()", " ", "==", " ", "1", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "b", " ", "=", " ", "Center", "Piece", "(", "piece", "Center", ",", " ", "self", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "canv", "as", ".", "tag", "\\u", "bind", "(", "a", ",", " ", "'<", "Butt", "on", "-1", ">'", ",", " ", "b", ".", "callback", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", "new", "Corner", "s", " ", "=", " ", "()", "\\", "10", ";", " ", " ", "for", " ", "corn", "er", " ", "in", " ", "corners", ":", " ", "new", "Corner", "s", " ", "+=", " ", "corn", "er", ".", "flat", "ten", "(", "self", ".", "came", "ra", ")", "\\", "10", ";", " ", " ", "if", " ", "visi", "ble", ":", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "self", ".", "canv", "as", ".", "create", "\\u", "poly", "gon", "(", "self", ".", "face", "s", "[(", "piece", "ID", ",", "color", ")]", ",", " ", "new", "Corner", "s", ")", "\\", "10", ";", " ", " ", "#", "self", ".", "canv", "as", ".", "item", "config", "(", "self", ".", "face", "s", "[(", "piece", "ID", ",", "color", ")]", ",", " ", "state", "=", "state", ")", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "\\", "10", ";", " ", " ", "\"\"\"_", "\\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_", "to", "Draw_", "._", "sort_", "(_", "lambda_", "a_", ",_", "b_", ":_", "cmp_", "(_", "b_", ",_", "a_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "polygon_", "in_", "to", "Draw_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spec_", "=_", "polygon_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "corners_", ",_", "color_", ",_", "state_", ",_", "outline_", ")_", "=_", "spec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "._", "create", "\\u", "polygon_", "(_", "corners_", ",_", "fill_", "=_", "color_", ",_", "width_", "=_", "2_", ",_", "state_", "=_", "state_", ",_", "outline_", "=_", "outline_", ")_", "\\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_", "._", "draw", "Help_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cube_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gather", "Stats_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stat", "String_", "=_", "'", "Una", "ble", " ", "to", " ", "fetch", " ", "solut", "ion", " ", "logs", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stats_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "'", "solut", "ion", "Log", "s", ".", "txt", "'_", ")_", "as_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stats_", "=_", "eval_", "(_", "file_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stats_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stat", "String_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stats_", "=_", "[_", "s_", "._", "split_", "(_", "';'_", ")_", "for_", "s_", "in_", "stats_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "moves_", "=_", "[_", "stat_", "[_", "-_", "1_", "]_", "for_", "stat_", "in_", "stats_", "]_", "#", " ", "Get", "s", " ", "last", " ", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "moves_", "=_", "[_", "mv_", "[_", "6_", ":_", "]_", "for_", "mv_", "in_", "moves_", "]_", "#", " ", "Remove", " ", "\"", "Moves", ":\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "moves_", "=_", "[_", "int_", "(_", "mv_", ")_", "for_", "mv_", "in_", "moves_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "moves_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stat", "String_", "+=_", "\"", "No", " ", "solut", "ion", "s", " ", "generat", "ed", " ", "ye", "t", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stat", "String_", "+=_", "\"%", "d", " ", "solut", "ion", "%", "s", " ", "logged", ".\\\\", "n", "\"_", "%_", "(_", "len_", "(_", "moves_", ")_", ",_", "''_", "if_", "len_", "(_", "moves_", ")_", "==_", "1_", "else_", "'", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "avg", "Moves", "_", "=_", "sum_", "(_", "moves_", ")_", "/_", "len_", "(_", "moves_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stat", "String_", "+=_", "\"", "Average", " ", "number", " ", "of", " ", "90", " ", "degr", "ee", " ", "face", " ", "rotations", " ", "per", " ", "solut", "ion", ":", " ", "%", "d", "\\\\", "n", "\"_", "%_", "(_", "avg", "Moves", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "times_", "=_", "[_", "stat_", "[_", "-_", "2_", "]_", "for_", "stat_", "in_", "stats_", "]_", "#", " ", "gets", " ", "2n", "d", " ", "to", " ", "last", " ", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "=_", "[_", "tm_", "[_", "6_", ":_", "-_", "4_", "]_", "for_", "tm_", "in_", "times_", "]_", "#", " ", "remove", "s", " ", "\"", "Time", ":", " ", "\"", " ", "...", " ", "\"", " ", "sec", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "=_", "[_", "float_", "(_", "tm_", ")_", "for_", "tm_", "in_", "times_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "avg", "Time_", "=_", "sum_", "(_", "times_", ")_", "/_", "(_", "max_", "(_", "1_", ",_", "len_", "(_", "times_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stat", "String_", "+=_", "\"", "Average", " ", "time", " ", "need", "ed", " ", "to", " ", "generat", "e", " ", "a", " ", "solut", "ion", ":", " ", "%", "0.", "4f", " ", "second", "s", "\"_", "%_", "(_", "avg", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cube_", "(_", "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_", "reset", "Stats_", "(_", "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 ", " _", "with_", "open_", "(_", "'", "solut", "ion", "Log", "s", ".", "txt", "'_", ",_", "'", "r", "+'_", ")_", "as_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file_", "._", "seek_", "(_", "0_", ")_", "#", " ", "beginn", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file_", "._", "truncate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file_", "._", "writelines_", "(_", "[_", "'[]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cube_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Config_", "(_", "self_", ",_", "config_", ")_", ":_", "\\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_", "._", "state_", "=_", "Cub", "e", "State_", "(_", "'", "bare", "bone", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "self_", "._", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Modif", "y", " ", "the", " ", "state", " ", "to", " ", "include", " ", "[(", "color", ",", " ", "direction", "),", " ", "(", "color", ",", " ", "direction", "),", " ", "...]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "then", " ", "parse", " ", "piece", "Id", " ", "and", " ", "orientation", "Key", " ", "out", " ", "of", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "face", "To", "Axis_", "(_", "face_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "face_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "center_", "=_", "face_", "[_", "1_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axis_", "=_", "[_", "vec_", "for_", "vec_", "in_", "Cube_", "._", "directions_", "if_", "\\u\\u\\uNL\\u\\u\\u_", "Cube_", "._", "directions_", "[_", "vec_", "]_", "._", "lower_", "(_", ")_", "==_", "center_", "._", "lower_", "(_", ")_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "axis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Axes_", "(_", "normal_", ",_", "known_", ",_", "dir", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dir", "String_", "=_", "dir", "String_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dir", "String_", "==_", "'", "up", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "up_", "=_", "known_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "dir", "String_", "==_", "'", "down", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "up_", "=_", "known_", "*_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "dir", "String_", "==_", "'", "left", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "up_", "=_", "(_", "normal_", "*_", "known_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "dir", "String_", "==_", "'", "right", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "up_", "=_", "(_", "known_", "*_", "normal_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "down_", "=_", "up_", "*_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left_", "=_", "(_", "up_", "*_", "normal_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right_", "=_", "left_", "*_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "up_", ",_", "down_", ",_", "left_", ",_", "right_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "times", "Tou", "ched", "_", "=_", "[_", "[_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", "]_", ",_", "[_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", "]_", ",_", "[_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "face", "Info_", "in_", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "axis_", "=_", "face", "To", "Axis_", "(_", "face", "Info_", "._", "current", "Face_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "Axis_", "=_", "next", "Axis_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "face", "Info_", "._", "prev", "Face_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "prev", "Axis_", "=_", "face", "To", "Axis_", "(_", "face", "Info_", "._", "prev", "Face_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "face", "Info_", "._", "next", "Face_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "next", "Axis_", "=_", "face", "To", "Axis_", "(_", "face", "Info_", "._", "next", "Face_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prev", "Turn", "_", "=_", "face", "Info_", "._", "prev", "Turn", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "Turn", "_", "=_", "face", "Info_", "._", "next", "Turn", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "axis", ":'_", ",_", "axis_", ",_", "Cube_", "._", "directions_", "[_", "axis_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "prev", "Axi", "s", ":'_", ",_", "prev", "Axis_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prev", "Axis_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "Cube_", "._", "directions_", "[_", "prev", "Axis_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "next", "Axi", "s", ":'_", ",_", "next", "Axis_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "next", "Axis_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "Cube_", "._", "directions_", "[_", "next", "Axis_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "prev", "Turn", ":'_", ",_", "prev", "Turn", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "next", "Turn", ":'_", ",_", "next", "Turn", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "prev", "Turn", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "(_", "up_", ",_", "down_", ",_", "left_", ",_", "right_", ")_", "=_", "set", "Axes_", "(_", "axis_", ",_", "prev", "Axis_", ",_", "prev", "Turn", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "next", "Turn", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "(_", "up_", ",_", "down_", ",_", "left_", ",_", "right_", ")_", "=_", "set", "Axes_", "(_", "axis_", ",_", "next", "Axis_", "*_", "-_", "1_", ",_", "next", "Turn", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "up", ":'_", ",_", "up_", ",_", "Cube_", "._", "directions_", "[_", "up_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "down", ":'_", ",_", "down_", ",_", "Cube_", "._", "directions_", "[_", "down_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "left", ":'_", ",_", "left_", ",_", "Cube_", "._", "directions_", "[_", "left_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "right", ":'_", ",_", "right_", ",_", "Cube_", "._", "directions_", "[_", "right_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "row_", "in_", "xrange_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "col_", "in_", "xrange_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pos_", "=_", "axis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "pos_", "+_", "(_", "down_", "*_", "(_", "row_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "pos_", "+_", "(_", "right_", "*_", "(_", "col_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "x_", ",_", "y_", ",_", "z_", ")_", "=_", "pos_", "._", "components_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "x_", ",_", "y_", ",_", "z_", ")_", "=_", "(_", "int_", "(_", "x_", "+_", "1_", ")_", ",_", "int_", "(_", "y_", "+_", "1_", ")_", ",_", "int_", "(_", "z_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", "x", ",", "y", ",", "z", "'_", ",_", "x_", ",_", "y_", ",_", "z_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "pos", "='_", ",_", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "times", "Tou", "ched", "_", "[_", "z_", "]_", "[_", "y_", "]_", "[_", "x_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cell_", "=_", "self_", "._", "state_", "._", "state_", "[_", "z_", "]_", "[_", "y_", "]_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "cell_", ")_", "==_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cell_", "._", "append_", "(_", "(_", "face", "Info_", "._", "current", "Face_", "[_", "row_", "]_", "[_", "col_", "]_", ",_", "axis_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "state", "='_", ",_", "self_", "._", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "times", "'_", ",_", "times", "Tou", "ched", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cast", " ", "each", " ", "[", " ", "]", " ", "list", " ", "to", " ", "a", " ", "(", " ", ")", " ", "tuple_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "[(", "color", ",", "dir", "),", "(", "color", ",", "dir", "),", "(", "color", ",", "dir", ")]", " ", "----", ">", " ", "(", "piece", "Id", ",", " ", "orientation", "Key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reverse", "Z_", "=_", "-_", "1_", "if_", "self_", "._", "camera_", "._", "view_", "**_", "Vector_", "(_", "0_", ",_", "0_", ",_", "1_", ")_", "<_", "0_", "else_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reverse", "Y_", "=_", "-_", "1_", "if_", "self_", "._", "camera_", "._", "view_", "**_", "Vector_", "(_", "0_", ",_", "1_", ",_", "0_", ")_", "<_", "0_", "else_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reverse", "X_", "=_", "-_", "1_", "if_", "self_", "._", "camera_", "._", "view_", "**_", "Vector_", "(_", "1_", ",_", "0_", ",_", "0_", ")_", "<_", "0_", "else_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "z", "Range_", "=_", "range_", "(_", "3_", ")_", "[_", ":_", ":_", "reverse", "Z_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "Range_", "=_", "range_", "(_", "3_", ")_", "[_", ":_", ":_", "reverse", "Y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "Range_", "=_", "range_", "(_", "3_", ")_", "[_", ":_", ":_", "reverse", "X_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "z_", "in_", "z", "Range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "y_", "in_", "y", "Range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "x_", "in_", "x", "Range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cell_", "=_", "self_", "._", "state_", "._", "state_", "[_", "z_", "]_", "[_", "y_", "]_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "cell_", ")_", "==_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "piece", "Id_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colors_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "cell_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "colors_", "._", "add_", "(_", "i_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "Cube_", "._", "face", "Colors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "set_", "(_", "Cube_", "._", "face", "Colors_", "[_", "key_", "]_", ")_", "==_", "colors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "piece", "Id_", "=_", "key_", "\\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_", "piece", "Id_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "desi", "red", "Color", "Order_", "=_", "Cube_", "._", "face", "Colors_", "[_", "piece", "Id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Order_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ori_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "not", "Added", "_", "=_", "set_", "(_", "[_", "0_", ",_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cell_", "._", "sort_", "(_", "lambda_", "a_", ",_", "b_", ":_", "cmp_", "(_", "desi", "red", "Color", "Order_", "._", "index_", "(_", "a_", "[_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "desi", "red", "Color", "Order_", "._", "index_", "(_", "b_", "[_", "0_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "cell_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ori_", "*=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "[_", "1_", "]_", "//_", "Vector_", "(_", "0_", ",_", "0_", ",_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "ori_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "not", "Added", "_", "._", "discard_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "[_", "1_", "]_", "//_", "Vector_", "(_", "0_", ",_", "1_", ",_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "ori_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "not", "Added", "_", "._", "discard_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "[_", "1_", "]_", "//_", "Vector_", "(_", "1_", ",_", "0_", ",_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "ori_", "+=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "not", "Added", "_", "._", "discard_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "len_", "(_", "not", "Added", "_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ori_", "*=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ori_", "+=_", "not", "Added", "_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "orientation", "Key_", "=_", "ori_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Value", "Error_", "(_", "'", "Inva", "lid", " ", "Cub", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "piece", "Id_", "in_", "(_", "5_", ",_", "11_", ",_", "13_", ",_", "14_", ",_", "15_", ",_", "17_", ",_", "23_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Value", "Error_", "(_", "'", "Inva", "lid", " ", "Cub", "e", "'_", ")_", "#", " ", "Center", " ", "piece_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "desired_", "=_", "Cube_", "._", "face", "Colors_", "[_", "Cub", "e", "State_", "._", "solved", "State_", "[_", "z_", "]_", "[_", "y_", "]_", "[_", "x_", "]_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", "The", " ", "piece", " ", "with", " ", "colors", " ", "%", "s", " ", "is", " ", "at", " ", "the", " ", "position", " ", "of", " ", "%", "s", "'_", "%_", "(_", "colors_", ",_", "desired_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "setti", "ng", " ", "(%", "d", ",%", "d", ",%", "d", ")", " ", "to", " ", "(%", "s", ",", " ", "%", "s", ")'_", "%_", "(_", "z_", ",_", "y_", ",_", "x_", ",_", "piece", "Id_", ",_", "orientation", "Key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "state_", "._", "state_", "[_", "z_", "]_", "[_", "y_", "]_", "[_", "x_", "]_", "=_", "(_", "piece", "Id_", ",_", "orientation", "Key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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 ", " _", "self_", "._", "update", "Message_", "(_", "'", "Una", "ble", " ", "to", " ", "read", " ", "came", "ra", " ", "input", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "set", "Solve", "d_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "redraw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "final", " ", "state", "='_", ",_", "self_", "._", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u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]
Imprecise assert
wadey/python-ostrich/ostrich/test/unit/test_stats.py
[ { "content": " def test_timing_with(self):\n with stats.time(\"test\"):\n time.sleep(0.01)\n test = stats.get_timing(\"test\")\n self.assertTrue(test.get().average >= 10)", "metadata": "root.StatsTest.test_timing_with", "header": "['class', 'StatsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 63 }, { "content": " def test_timing_decorator(self):\n @stats.time(\"test\")\n def _test_timing_decorator():\n time.sleep(0.01)\n _test_timing_decorator()\n test = stats.get_timing(\"test\")\n self.assertTrue(test.get().average >= 10)", "metadata": "root.StatsTest.test_timing_decorator", "header": "['class', 'StatsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 69 } ]
[ { "span": "self.assertTrue(test.get().average >= 10)", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 49 }, { "span": "self.assertTrue(test.get().average >= 10)", "start_line": 75, "start_column": 8, "end_line": 75, "end_column": 49 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Stat", "s", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tim", "ing", "\\u", "with_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "stats_", "._", "time_", "(_", "\"", "test", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "test_", "=_", "stats_", "._", "get", "\\u", "timing_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "test_", "._", "get_", "(_", ")_", "._", "average_", ">=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stat", "s", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tim", "ing", "\\u", "decorator_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "stats_", "._", "time_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "test\\u", "tim", "ing", "\\u", "decorator_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "test\\u", "tim", "ing", "\\u", "decorator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "stats_", "._", "get", "\\u", "timing_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "test_", "._", "get_", "(_", ")_", "._", "average_", ">=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
ejeschke/ginga/ginga/AstroImage.py
[ { "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 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": "prev ", "start_line": 245, "start_column": 12, "end_line": 245, "end_column": 16 }, { "span": "ref_rot ", "start_line": 440, "start_column": 8, "end_line": 440, "end_column": 15 }, { "span": "ascale_x,", "start_line": 497, "start_column": 26, "end_line": 497, "end_column": 34 }, { "span": "ascale_y)", "start_line": 497, "start_column": 36, "end_line": 497, "end_column": 44 }, { "span": "te ", "start_line": 723, "start_column": 8, "end_line": 723, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[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_", "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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
ask/ghettoq/docs/conf.py
[ { "content": "# -*- coding: utf-8 -*-\n#\nimport sys\nimport os\n\n# If your extensions are in another directory, add it here. If the directory\n# is relative to the documentation root, use os.path.abspath to make it\n# absolute, like shown here.\nsys.path.insert(0, \"../\")\nimport ghettoq\n\nfrom django.conf import settings\nif not settings.configured:\n settings.configure()\n\n# General configuration\n# ---------------------\n\n# Add any Sphinx extension module names here, as strings.\n# They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = ['sphinx.ext.autodoc']\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 = u'ghettoq'\ncopyright = u'2009, Opera Softare (WebTeam)'\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 = \".\".join(map(str, ghettoq.VERSION[0:2]))\n# The full version, including alpha/beta/rc tags.\nrelease = ghettoq.__version__\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of 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\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\nadd_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 = 'trac'\n\n#html_translator_class = \"djangodocs.DjangoHTMLTranslator\"\n\n\n# Options for HTML output\n# -----------------------\n\n# The style sheet to use for HTML and HTML Help pages. A file of that name\n# must exist either in Sphinx' static/ path, or in one of the custom paths\n# given in html_static_path.\n#html_style = 'agogo.css'\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.\nhtml_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\nhtml_use_modindex = True\n\n# If false, no index is generated.\nhtml_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, the reST sources are included in the HTML build as _sources/<name>.\n#html_copy_source = 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 = 'ghettoqdoc'\n\n\n# Options for LaTeX output\n# ------------------------\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, document class\n# [howto/manual]).\nlatex_documents = [\n ('index', 'ghettoq.tex', ur'ghettoq Documentation',\n ur'Ask Solem', '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\nhtml_theme = \"nature\"\nhtml_theme_path = [\"_theme\"]\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import os", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\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", " ", "your", " ", "extensi", "ons", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",", " ", "add", " ", "it", " ", "here", ".", " ", "If", " ", "the", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "relative", " ", "to", " ", "the", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "\"..", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ghe", "tto", "q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "settings_", "._", "configured_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings_", "._", "configure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "-------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "extensions_", "=_", "[_", "'", "sphinx", ".", "ext", ".", "autod", "oc", "'_", "]_", "\\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_", "=_", "[_", "'.", "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_", "=_", "u", "'", "ghe", "tto", "q", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "u", "'", "200", "9", ",", " ", "Opera", " ", "Sof", "tare", " ", "(", "Web", "Tea", "m", ")'_", "\\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_", "=_", "\".\"_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "ghe", "tto", "q_", "._", "VERSION_", "[_", "0_", ":_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "release_", "=_", "ghe", "tto", "q_", "._", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "language", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "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_", "=_", "[_", "'.", "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_", "\\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\\uNEWLINE\\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_", "=_", "'", "trac", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "translator", "\\u", "class", " ", "=", " ", "\"", "django", "docs", ".", "Dj", "ang", "o", "HTM", "LT", "rans", "lator", "\"_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "style", " ", "sheet", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", "A", " ", "file", " ", "of", " ", "tha", "t", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "must", " ", "exist", " ", "eit", "her", " ", "in", " ", "Sph", "inx", "'", " ", "static", "/", " ", "path", ",", " ", "or", " ", "in", " ", "one", " ", "of", " ", "the", " ", "custom", " ", "paths_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", "n", " ", "in", " ", "html", "\\u", "static", "\\u", "path", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "style", " ", "=", " ", "'", "ago", "go", ".", "css", "'_", "\\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_", "=_", "[_", "'.", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "use", "\\u", "smart", "ypa", "nts_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "use", "\\u", "modi", "ndex_", "=_", "True_", "\\u\\u\\uNEWLINE\\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\\uNEWLINE\\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", ",", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "include", "d", " ", "in", " ", "the", " ", "HTM", "L", " ", "build", " ", "as", " ", "\\u", "source", "s", "/", "<", "name", ">.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "copy", "\\u", "source", " ", "=", " ", "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_", "=_", "'", "ghe", "tto", "qd", "oc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "[", "how", "to", "/", "manu", "al", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "ghe", "tto", "q", ".", "tex", "'_", ",_", "ur_", "'", "ghe", "tto", "q", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ur_", "'", "As", "k", " ", "Sol", "em", "'_", ",_", "'", "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\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "modi", "nde", "x", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "theme_", "=_", "\"", "natur", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "them", "e\\u", "path_", "=_", "[_", "\"\\u", "them", "e", "\"_", "]_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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Unused local variable
ardekantur/pyglet/tools/epydoc/epydoc/markup/epytext.py
[ { "content": "def _colorize(doc, token, errors, tagName='para'):\n \"\"\"\n Given a string containing the contents of a paragraph, produce a\n DOM C{Element} encoding that paragraph. Colorized regions are\n represented using DOM C{Element}s, and text is represented using\n DOM C{Text}s.\n\n @param errors: A list of errors. Any newly generated errors will\n be appended to this list.\n @type errors: C{list} of C{string}\n \n @param tagName: The element tag for the DOM C{Element} that should\n be generated.\n @type tagName: C{string}\n \n @return: a DOM C{Element} encoding the given paragraph.\n @returntype: C{Element}\n \"\"\"\n str = token.contents\n linenum = 0\n \n # Maintain a stack of DOM elements, containing the ancestors of\n # the text currently being analyzed. New elements are pushed when \n # \"{\" is encountered, and old elements are popped when \"}\" is\n # encountered. \n stack = [Element(tagName)]\n\n # This is just used to make error-reporting friendlier. It's a\n # stack parallel to \"stack\" containing the index of each element's \n # open brace.\n openbrace_stack = [0]\n\n # Process the string, scanning for '{' and '}'s. start is the\n # index of the first unprocessed character. Each time through the\n # loop, we process the text from the first unprocessed character\n # to the next open or close brace.\n start = 0\n while 1:\n match = _BRACE_RE.search(str, start)\n if match == None: break\n end = match.start()\n \n # Open braces start new colorizing elements. When preceeded\n # by a capital letter, they specify a colored region, as\n # defined by the _COLORIZING_TAGS dictionary. Otherwise, \n # use a special \"literal braces\" element (with tag \"litbrace\"),\n # and convert them to literal braces once we find the matching \n # close-brace.\n if match.group() == '{':\n if (end>0) and 'A' <= str[end-1] <= 'Z':\n if (end-1) > start:\n stack[-1].children.append(str[start:end-1])\n if not _COLORIZING_TAGS.has_key(str[end-1]):\n estr = \"Unknown inline markup tag.\"\n errors.append(ColorizingError(estr, token, end-1))\n stack.append(Element('unknown'))\n else:\n tag = _COLORIZING_TAGS[str[end-1]]\n stack.append(Element(tag))\n else:\n if end > start:\n stack[-1].children.append(str[start:end])\n stack.append(Element('litbrace'))\n openbrace_stack.append(end)\n stack[-2].children.append(stack[-1])\n \n # Close braces end colorizing elements.\n elif match.group() == '}':\n # Check for (and ignore) unbalanced braces.\n if len(stack) <= 1:\n estr = \"Unbalanced '}'.\"\n errors.append(ColorizingError(estr, token, end))\n start = end + 1\n continue\n\n # Add any remaining text.\n if end > start:\n stack[-1].children.append(str[start:end])\n\n # Special handling for symbols:\n if stack[-1].tag == 'symbol':\n if (len(stack[-1].children) != 1 or\n not isinstance(stack[-1].children[0], basestring)):\n estr = \"Invalid symbol code.\"\n errors.append(ColorizingError(estr, token, end))\n else:\n symb = stack[-1].children[0]\n if _SYMBOLS.has_key(symb):\n # It's a symbol\n stack[-2].children[-1] = Element('symbol', symb)\n else:\n estr = \"Invalid symbol code.\"\n errors.append(ColorizingError(estr, token, end))\n \n # Special handling for escape elements:\n if stack[-1].tag == 'escape':\n if (len(stack[-1].children) != 1 or\n not isinstance(stack[-1].children[0], basestring)):\n estr = \"Invalid escape code.\"\n errors.append(ColorizingError(estr, token, end))\n else:\n escp = stack[-1].children[0]\n if _ESCAPES.has_key(escp):\n # It's an escape from _ESCPAES\n stack[-2].children[-1] = _ESCAPES[escp]\n elif len(escp) == 1:\n # It's a single-character escape (eg E{.})\n stack[-2].children[-1] = escp\n else:\n estr = \"Invalid escape code.\"\n errors.append(ColorizingError(estr, token, end))\n\n # Special handling for literal braces elements:\n if stack[-1].tag == 'litbrace':\n stack[-2].children[-1:] = ['{'] + stack[-1].children + ['}']\n\n # Special handling for graphs:\n if stack[-1].tag == 'graph':\n _colorize_graph(doc, stack[-1], token, end, errors)\n\n # Special handling for link-type elements:\n if stack[-1].tag in _LINK_COLORIZING_TAGS:\n _colorize_link(doc, stack[-1], token, end, errors)\n\n # Pop the completed element.\n openbrace_stack.pop()\n stack.pop()\n\n start = end+1\n\n # Add any final text.\n if start < len(str):\n stack[-1].children.append(str[start:])\n \n if len(stack) != 1: \n estr = \"Unbalanced '{'.\"\n errors.append(ColorizingError(estr, token, openbrace_stack[-1]))\n\n return stack[0]", "metadata": "root._colorize", "header": "['module', '___EOS___']", "index": 958 }, { "content": "def to_epytext(tree, indent=0, seclevel=0):\n \"\"\"\n Convert a DOM document encoding epytext back to an epytext string.\n This is the inverse operation from L{parse}. I.e., assuming there\n are no errors, the following is true:\n - C{parse(to_epytext(tree)) == tree}\n\n The inverse is true, except that whitespace, line wrapping, and\n character escaping may be done differently.\n - C{to_epytext(parse(str)) == str} (approximately)\n\n @param tree: A DOM document encoding of an epytext string.\n @type tree: C{Element}\n @param indent: The indentation for the string representation of\n C{tree}. Each line of the returned string will begin with\n C{indent} space characters.\n @type indent: C{int}\n @param seclevel: The section level that C{tree} appears at. This\n is used to generate section headings.\n @type seclevel: C{int}\n @return: The epytext string corresponding to C{tree}.\n @rtype: C{string}\n \"\"\"\n if isinstance(tree, basestring):\n str = re.sub(r'\\{', '\\0', tree)\n str = re.sub(r'\\}', '\\1', str)\n return str\n\n if tree.tag == 'epytext': indent -= 2\n if tree.tag == 'section': seclevel += 1\n variables = [to_epytext(c, indent+2, seclevel) for c in tree.children]\n childstr = ''.join(variables)\n\n # Clean up for literal blocks (add the double \"::\" back)\n childstr = re.sub(':(\\s*)\\2', '::\\\\1', childstr)\n\n if tree.tag == 'para':\n str = wordwrap(childstr, indent)+'\\n'\n str = re.sub(r'((^|\\n)\\s*\\d+)\\.', r'\\1E{.}', str)\n str = re.sub(r'((^|\\n)\\s*)-', r'\\1E{-}', str)\n str = re.sub(r'((^|\\n)\\s*)@', r'\\1E{@}', str)\n str = re.sub(r'::(\\s*($|\\n))', r'E{:}E{:}\\1', str)\n str = re.sub('\\0', 'E{lb}', str)\n str = re.sub('\\1', 'E{rb}', str)\n return str\n elif tree.tag == 'li':\n bullet = tree.attribs.get('bullet') or '-'\n return indent*' '+ bullet + ' ' + childstr.lstrip()\n elif tree.tag == 'heading':\n str = re.sub('\\0', 'E{lb}',childstr)\n str = re.sub('\\1', 'E{rb}', str)\n uline = len(childstr)*_HEADING_CHARS[seclevel-1]\n return (indent-2)*' ' + str + '\\n' + (indent-2)*' '+uline+'\\n'\n elif tree.tag == 'doctestblock':\n str = re.sub('\\0', '{', childstr)\n str = re.sub('\\1', '}', str)\n lines = [' '+indent*' '+line for line in str.split('\\n')]\n return '\\n'.join(lines) + '\\n\\n'\n elif tree.tag == 'literalblock':\n str = re.sub('\\0', '{', childstr)\n str = re.sub('\\1', '}', str)\n lines = [(indent+1)*' '+line for line in str.split('\\n')]\n return '\\2' + '\\n'.join(lines) + '\\n\\n'\n elif tree.tag == 'field':\n numargs = 0\n while tree.children[numargs+1].tag == 'arg': numargs += 1\n tag = variables[0]\n args = variables[1:1+numargs]\n body = variables[1+numargs:]\n str = (indent)*' '+'@'+variables[0]\n if args: str += '(' + ', '.join(args) + ')'\n return str + ':\\n' + ''.join(body)\n elif tree.tag == 'target':\n return '<%s>' % childstr\n elif tree.tag in ('fieldlist', 'tag', 'arg', 'epytext',\n 'section', 'olist', 'ulist', 'name'):\n return childstr\n elif tree.tag == 'symbol':\n return 'E{%s}' % childstr\n elif tree.tag == 'graph':\n return 'G{%s}' % ' '.join(variables)\n else:\n for (tag, name) in _COLORIZING_TAGS.items():\n if name == tree.tag:\n return '%s{%s}' % (tag, childstr)\n raise ValueError('Unknown DOM element %r' % tree.tag)", "metadata": "root.to_epytext", "header": "['module', '___EOS___']", "index": 1191 }, { "content": "def to_plaintext(tree, indent=0, seclevel=0):\n \"\"\" \n Convert a DOM document encoding epytext to a string representation.\n This representation is similar to the string generated by\n C{to_epytext}, but C{to_plaintext} removes inline markup, prints\n escaped characters in unescaped form, etc.\n\n @param tree: A DOM document encoding of an epytext string.\n @type tree: C{Element}\n @param indent: The indentation for the string representation of\n C{tree}. Each line of the returned string will begin with\n C{indent} space characters.\n @type indent: C{int}\n @param seclevel: The section level that C{tree} appears at. This\n is used to generate section headings.\n @type seclevel: C{int}\n @return: The epytext string corresponding to C{tree}.\n @rtype: C{string}\n \"\"\"\n if isinstance(tree, basestring): return tree\n\n if tree.tag == 'section': seclevel += 1\n\n # Figure out the child indent level.\n if tree.tag == 'epytext': cindent = indent\n elif tree.tag == 'li' and tree.attribs.get('bullet'):\n cindent = indent + 1 + len(tree.attribs.get('bullet'))\n else:\n cindent = indent + 2\n variables = [to_plaintext(c, cindent, seclevel) for c in tree.children]\n childstr = ''.join(variables)\n\n if tree.tag == 'para':\n return wordwrap(childstr, indent)+'\\n'\n elif tree.tag == 'li':\n # We should be able to use getAttribute here; but there's no\n # convenient way to test if an element has an attribute..\n bullet = tree.attribs.get('bullet') or '-'\n return indent*' ' + bullet + ' ' + childstr.lstrip()\n elif tree.tag == 'heading':\n uline = len(childstr)*_HEADING_CHARS[seclevel-1]\n return ((indent-2)*' ' + childstr + '\\n' +\n (indent-2)*' ' + uline + '\\n')\n elif tree.tag == 'doctestblock':\n lines = [(indent+2)*' '+line for line in childstr.split('\\n')]\n return '\\n'.join(lines) + '\\n\\n'\n elif tree.tag == 'literalblock':\n lines = [(indent+1)*' '+line for line in childstr.split('\\n')]\n return '\\n'.join(lines) + '\\n\\n'\n elif tree.tag == 'fieldlist':\n return childstr\n elif tree.tag == 'field':\n numargs = 0\n while tree.children[numargs+1].tag == 'arg': numargs += 1\n tag = variables[0]\n args = variables[1:1+numargs]\n body = variables[1+numargs:]\n str = (indent)*' '+'@'+variables[0]\n if args: str += '(' + ', '.join(args) + ')'\n return str + ':\\n' + ''.join(body)\n elif tree.tag == 'uri':\n if len(variables) != 2: raise ValueError('Bad URI ')\n elif variables[0] == variables[1]: return '<%s>' % variables[1]\n else: return '%r<%s>' % (variables[0], variables[1])\n elif tree.tag == 'link':\n if len(variables) != 2: raise ValueError('Bad Link')\n return '%s' % variables[0]\n elif tree.tag in ('olist', 'ulist'):\n # [xx] always use condensed lists.\n ## Use a condensed list if each list item is 1 line long.\n #for child in variables:\n # if child.count('\\n') > 2: return childstr\n return childstr.replace('\\n\\n', '\\n')+'\\n'\n elif tree.tag == 'symbol':\n return '%s' % SYMBOL_TO_PLAINTEXT.get(childstr, childstr)\n elif tree.tag == 'graph':\n return '<<%s graph: %s>>' % (variables[0], ', '.join(variables[1:]))\n else:\n # Assume that anything else can be passed through.\n return childstr", "metadata": "root.to_plaintext", "header": "['module', '___EOS___']", "index": 1282 }, { "content": "def to_debug(tree, indent=4, seclevel=0):\n \"\"\" \n Convert a DOM document encoding epytext back to an epytext string,\n annotated with extra debugging information. This function is\n similar to L{to_epytext}, but it adds explicit information about\n where different blocks begin, along the left margin.\n\n @param tree: A DOM document encoding of an epytext string.\n @type tree: C{Element}\n @param indent: The indentation for the string representation of\n C{tree}. Each line of the returned string will begin with\n C{indent} space characters.\n @type indent: C{int}\n @param seclevel: The section level that C{tree} appears at. This\n is used to generate section headings.\n @type seclevel: C{int}\n @return: The epytext string corresponding to C{tree}.\n @rtype: C{string}\n \"\"\"\n if isinstance(tree, basestring):\n str = re.sub(r'\\{', '\\0', tree)\n str = re.sub(r'\\}', '\\1', str)\n return str\n\n if tree.tag == 'section': seclevel += 1\n variables = [to_debug(c, indent+2, seclevel) for c in tree.children]\n childstr = ''.join(variables)\n\n # Clean up for literal blocks (add the double \"::\" back)\n childstr = re.sub(':( *\\n \\|\\n)\\2', '::\\\\1', childstr)\n\n if tree.tag == 'para':\n str = wordwrap(childstr, indent-6, 69)+'\\n'\n str = re.sub(r'((^|\\n)\\s*\\d+)\\.', r'\\1E{.}', str)\n str = re.sub(r'((^|\\n)\\s*)-', r'\\1E{-}', str)\n str = re.sub(r'((^|\\n)\\s*)@', r'\\1E{@}', str)\n str = re.sub(r'::(\\s*($|\\n))', r'E{:}E{:}\\1', str)\n str = re.sub('\\0', 'E{lb}', str)\n str = re.sub('\\1', 'E{rb}', str)\n lines = str.rstrip().split('\\n')\n lines[0] = ' P>|' + lines[0]\n lines[1:] = [' |'+l for l in lines[1:]]\n return '\\n'.join(lines)+'\\n |\\n'\n elif tree.tag == 'li':\n bullet = tree.attribs.get('bullet') or '-'\n return ' LI>|'+ (indent-6)*' '+ bullet + ' ' + childstr[6:].lstrip()\n elif tree.tag in ('olist', 'ulist'):\n return 'LIST>|'+(indent-4)*' '+childstr[indent+2:]\n elif tree.tag == 'heading':\n str = re.sub('\\0', 'E{lb}', childstr)\n str = re.sub('\\1', 'E{rb}', str)\n uline = len(childstr)*_HEADING_CHARS[seclevel-1]\n return ('SEC'+`seclevel`+'>|'+(indent-8)*' ' + str + '\\n' +\n ' |'+(indent-8)*' ' + uline + '\\n')\n elif tree.tag == 'doctestblock':\n str = re.sub('\\0', '{', childstr)\n str = re.sub('\\1', '}', str)\n lines = [' |'+(indent-4)*' '+line for line in str.split('\\n')]\n lines[0] = 'DTST>'+lines[0][5:]\n return '\\n'.join(lines) + '\\n |\\n'\n elif tree.tag == 'literalblock':\n str = re.sub('\\0', '{', childstr)\n str = re.sub('\\1', '}', str)\n lines = [' |'+(indent-5)*' '+line for line in str.split('\\n')]\n lines[0] = ' LIT>'+lines[0][5:]\n return '\\2' + '\\n'.join(lines) + '\\n |\\n'\n elif tree.tag == 'field':\n numargs = 0\n while tree.children[numargs+1].tag == 'arg': numargs += 1\n tag = variables[0]\n args = variables[1:1+numargs]\n body = variables[1+numargs:]\n str = ' FLD>|'+(indent-6)*' '+'@'+variables[0]\n if args: str += '(' + ', '.join(args) + ')'\n return str + ':\\n' + ''.join(body)\n elif tree.tag == 'target':\n return '<%s>' % childstr\n elif tree.tag in ('fieldlist', 'tag', 'arg', 'epytext',\n 'section', 'olist', 'ulist', 'name'):\n return childstr\n elif tree.tag == 'symbol':\n return 'E{%s}' % childstr\n elif tree.tag == 'graph':\n return 'G{%s}' % ' '.join(variables)\n else:\n for (tag, name) in _COLORIZING_TAGS.items():\n if name == tree.tag:\n return '%s{%s}' % (tag, childstr)\n raise ValueError('Unknown DOM element %r' % tree.tag)", "metadata": "root.to_debug", "header": "['module', '___EOS___']", "index": 1363 } ]
[ { "span": "linenum ", "start_line": 977, "start_column": 4, "end_line": 977, "end_column": 11 }, { "span": "tag ", "start_line": 1257, "start_column": 8, "end_line": 1257, "end_column": 11 }, { "span": "tag ", "start_line": 1336, "start_column": 8, "end_line": 1336, "end_column": 11 }, { "span": "tag ", "start_line": 1432, "start_column": 8, "end_line": 1432, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "colorize_", "(_", "doc_", ",_", "token_", ",_", "errors_", ",_", "tag", "Name_", "=_", "'", "para", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "a", " ", "string", " ", "contain", "ing", " ", "the", " ", "content", "s", " ", "of", " ", "a", " ", "paragraph", ",", " ", "produce", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "DOM", " ", "C", "{", "Element", "}", " ", "encoding", " ", "tha", "t", " ", "paragraph", ".", " ", " ", "Color", "ize", "d", " ", "regions", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "represent", "ed", " ", "usi", "ng", " ", "DOM", " ", "C", "{", "Element", "}", "s", ",", " ", "and", " ", "text", " ", "is", " ", "represent", "ed", " ", "usi", "ng", "\\", "10", ";", " ", " ", " ", " ", "DOM", " ", "C", "{", "Text", "}", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "error", "s", ":", " ", "A", " ", "list", " ", "of", " ", "error", "s", ".", " ", " ", "Any", " ", "newl", "y", " ", "generat", "ed", " ", "error", "s", " ", "will", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "append", "ed", " ", "to", " ", "this", " ", "list", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "error", "s", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "string", "}", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "tag", "Name", ":", " ", "The", " ", "element", " ", "tag", " ", "for", " ", "the", " ", "DOM", " ", "C", "{", "Element", "}", " ", "tha", "t", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "generat", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "tag", "Name", ":", " ", "C", "{", "string", "}", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "a", " ", "DOM", " ", "C", "{", "Element", "}", " ", "encoding", " ", "the", " ", "give", "n", " ", "paragraph", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "return", "type", ":", " ", "C", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "token_", "._", "contents_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linenum_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Maint", "ain", " ", "a", " ", "stack", " ", "of", " ", "DOM", " ", "element", "s", ",", " ", "contain", "ing", " ", "the", " ", "ancestor", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "text", " ", "currentl", "y", " ", "bei", "ng", " ", "analyze", "d", ".", " ", " ", "New", " ", "element", "s", " ", "are", " ", "pushed", " ", "whe", "n", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"{", "\"", " ", "is", " ", "encounter", "ed", ",", " ", "and", " ", "old", " ", "element", "s", " ", "are", " ", "popp", "ed", " ", "whe", "n", " ", "\"}", "\"", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "encounter", "ed", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "stack_", "=_", "[_", "Element_", "(_", "tag", "Name_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "just", " ", "used", " ", "to", " ", "make", " ", "error", "-", "reporting", " ", "frie", "ndl", "ier", ".", " ", " ", "It", "'", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stack", " ", "parall", "el", " ", "to", " ", "\"", "stack", "\"", " ", "contain", "ing", " ", "the", " ", "index", " ", "of", " ", "each", " ", "element", "'", "s", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "open", " ", "brace", "._", "\\u\\u\\uNL\\u\\u\\u_", "openb", "race", "\\u", "stack_", "=_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Process", " ", "the", " ", "string", ",", " ", "scanning", " ", "for", " ", "'{", "'", " ", "and", " ", "'}", "'", "s", ".", " ", " ", "start", " ", "is", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "index", " ", "of", " ", "the", " ", "first", " ", "unprocess", "ed", " ", "character", ".", " ", " ", "Ea", "ch", " ", "time", " ", "through", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "loop", ",", " ", "we", " ", "process", " ", "the", " ", "text", " ", "from", " ", "the", " ", "first", " ", "unprocess", "ed", " ", "character_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "next", " ", "open", " ", "or", " ", "close", " ", "brace", "._", "\\u\\u\\uNL\\u\\u\\u_", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "\\u", "BRAC", "E", "\\u", "RE_", "._", "search_", "(_", "str_", ",_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "==_", "None_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "match_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Open", " ", "braces", " ", "start", " ", "new", " ", "coloriz", "ing", " ", "element", "s", ".", " ", " ", "Whe", "n", " ", "prece", "eded", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "a", " ", "capital", " ", "letter", ",", " ", "the", "y", " ", "speci", "fy", " ", "a", " ", "colore", "d", " ", "region", ",", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "ed", " ", "by", " ", "the", " ", "\\u", "COLOR", "IZ", "ING", "\\u", "TAG", "S", " ", "dictionar", "y", ".", " ", " ", "Ot", "her", "wis", "e", ",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "use", " ", "a", " ", "special", " ", "\"", "literal", " ", "braces", "\"", " ", "element", " ", "(", "with", " ", "tag", " ", "\"", "lit", "brace", "\")", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "convert", " ", "them", " ", "to", " ", "literal", " ", "braces", " ", "onc", "e", " ", "we", " ", "find", " ", "the", " ", "matchi", "ng", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "close", "-", "brace", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "match_", "._", "group_", "(_", ")_", "==_", "'{'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "end_", ">_", "0_", ")_", "and_", "'", "A", "'_", "<=_", "str_", "[_", "end_", "-_", "1_", "]_", "<=_", "'", "Z", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "end_", "-_", "1_", ")_", ">_", "start_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "._", "append_", "(_", "str_", "[_", "start_", ":_", "end_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "\\u", "COLOR", "IZ", "ING", "\\u", "TAGS_", "._", "has", "\\u", "key_", "(_", "str_", "[_", "end_", "-_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "estr", "_", "=_", "\"", "Un", "know", "n", " ", "inline", " ", "markup", " ", "tag", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "Color", "izi", "ng", "Error_", "(_", "estr", "_", ",_", "token_", ",_", "end_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack_", "._", "append_", "(_", "Element_", "(_", "'", "unknown", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tag_", "=_", "\\u", "COLOR", "IZ", "ING", "\\u", "TAGS_", "[_", "str_", "[_", "end_", "-_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack_", "._", "append_", "(_", "Element_", "(_", "tag_", ")_", ")_", "\\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_", "end_", ">_", "start_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "._", "append_", "(_", "str_", "[_", "start_", ":_", "end_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stack_", "._", "append_", "(_", "Element_", "(_", "'", "lit", "brace", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "openb", "race", "\\u", "stack_", "._", "append_", "(_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack_", "[_", "-_", "2_", "]_", "._", "children_", "._", "append_", "(_", "stack_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Clos", "e", " ", "braces", " ", "end", " ", "coloriz", "ing", " ", "element", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "match_", "._", "group_", "(_", ")_", "==_", "'}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "(", "and", " ", "ignore", ")", " ", "unb", "alance", "d", " ", "braces", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "stack_", ")_", "<=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "estr", "_", "=_", "\"", "Unb", "alance", "d", " ", "'}", "'.\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "Color", "izi", "ng", "Error_", "(_", "estr", "_", ",_", "token_", ",_", "end_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "end_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "rema", "inin", "g", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "end_", ">_", "start_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "._", "append_", "(_", "str_", "[_", "start_", ":_", "end_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Special", " ", "handling", " ", "for", " ", "symbols", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stack_", "[_", "-_", "1_", "]_", "._", "tag_", "==_", "'", "symbol", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "len_", "(_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", ")_", "!=_", "1_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "isinstance_", "(_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "[_", "0_", "]_", ",_", "basestring_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "estr", "_", "=_", "\"", "Inva", "lid", " ", "symbol", " ", "code", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "Color", "izi", "ng", "Error_", "(_", "estr", "_", ",_", "token_", ",_", "end_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "symb", "_", "=_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u", "SYMBOL", "S_", "._", "has", "\\u", "key_", "(_", "symb", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "It", "'", "s", " ", "a", " ", "symbol_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "stack_", "[_", "-_", "2_", "]_", "._", "children_", "[_", "-_", "1_", "]_", "=_", "Element_", "(_", "'", "symbol", "'_", ",_", "symb", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "estr", "_", "=_", "\"", "Inva", "lid", " ", "symbol", " ", "code", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "Color", "izi", "ng", "Error_", "(_", "estr", "_", ",_", "token_", ",_", "end_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Special", " ", "handling", " ", "for", " ", "escape", " ", "element", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stack_", "[_", "-_", "1_", "]_", "._", "tag_", "==_", "'", "escape", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "len_", "(_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", ")_", "!=_", "1_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "isinstance_", "(_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "[_", "0_", "]_", ",_", "basestring_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "estr", "_", "=_", "\"", "Inva", "lid", " ", "escape", " ", "code", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "Color", "izi", "ng", "Error_", "(_", "estr", "_", ",_", "token_", ",_", "end_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "esc", "p_", "=_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u", "ESCAPE", "S_", "._", "has", "\\u", "key_", "(_", "esc", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "It", "'", "s", " ", "an", " ", "escape", " ", "from", " ", "\\u", "ESC", "PA", "ES_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "stack_", "[_", "-_", "2_", "]_", "._", "children_", "[_", "-_", "1_", "]_", "=_", "\\u", "ESCAPE", "S_", "[_", "esc", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "esc", "p_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "It", "'", "s", " ", "a", " ", "single", "-", "character", " ", "escape", " ", "(", "eg", " ", "E", "{.", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "stack_", "[_", "-_", "2_", "]_", "._", "children_", "[_", "-_", "1_", "]_", "=_", "esc", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "estr", "_", "=_", "\"", "Inva", "lid", " ", "escape", " ", "code", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "Color", "izi", "ng", "Error_", "(_", "estr", "_", ",_", "token_", ",_", "end_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Special", " ", "handling", " ", "for", " ", "literal", " ", "braces", " ", "element", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stack_", "[_", "-_", "1_", "]_", "._", "tag_", "==_", "'", "lit", "brace", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stack_", "[_", "-_", "2_", "]_", "._", "children_", "[_", "-_", "1_", ":_", "]_", "=_", "[_", "'{'_", "]_", "+_", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "+_", "[_", "'}'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Special", " ", "handling", " ", "for", " ", "graph", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stack_", "[_", "-_", "1_", "]_", "._", "tag_", "==_", "'", "graph", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "coloriz", "e\\u", "graph_", "(_", "doc_", ",_", "stack_", "[_", "-_", "1_", "]_", ",_", "token_", ",_", "end_", ",_", "errors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Special", " ", "handling", " ", "for", " ", "link", "-", "type", " ", "element", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stack_", "[_", "-_", "1_", "]_", "._", "tag_", "in_", "\\u", "LINK", "\\u", "COLOR", "IZ", "ING", "\\u", "TAGS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "coloriz", "e\\u", "link_", "(_", "doc_", ",_", "stack_", "[_", "-_", "1_", "]_", ",_", "token_", ",_", "end_", ",_", "errors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pop", " ", "the", " ", "complete", "d", " ", "element", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "openb", "race", "\\u", "stack_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "=_", "end_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "final", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "start_", "<_", "len_", "(_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stack_", "[_", "-_", "1_", "]_", "._", "children_", "._", "append_", "(_", "str_", "[_", "start_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "stack_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "estr", "_", "=_", "\"", "Unb", "alance", "d", " ", "'{", "'.\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "Color", "izi", "ng", "Error_", "(_", "estr", "_", ",_", "token_", ",_", "openb", "race", "\\u", "stack_", "[_", "-_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "stack_", "[_", "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_", "to", "\\u", "ep", "yte", "xt_", "(_", "tree_", ",_", "indent_", "=_", "0_", ",_", "sec", "level_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", " ", "a", " ", "DOM", " ", "document", " ", "encoding", " ", "ep", "yte", "xt", " ", "back", " ", "to", " ", "an", " ", "ep", "yte", "xt", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "the", " ", "inv", "erse", " ", "operati", "on", " ", "from", " ", "L", "{", "parse", "}.", " ", " ", "I", ".", "e", ".,", " ", "ass", "umi", "ng", " ", "there", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "no", " ", "error", "s", ",", " ", "the", " ", "follow", "ing", " ", "is", " ", "true", ":", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "C", "{", "parse", "(", "to", "\\u", "ep", "yte", "xt", "(", "tree", "))", " ", "==", " ", "tree", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "inv", "erse", " ", "is", " ", "true", ",", " ", "except", " ", "tha", "t", " ", "whitespace", ",", " ", "line", " ", "wrapp", "ing", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "character", " ", "esca", "ping", " ", "may", " ", "be", " ", "don", "e", " ", "different", "ly", ".", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "C", "{", "to", "\\u", "ep", "yte", "xt", "(", "parse", "(", "str", "))", " ", "==", " ", "str", "}", " ", "(", "approximate", "ly", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "tree", ":", " ", "A", " ", "DOM", " ", "document", " ", "encoding", " ", "of", " ", "an", " ", "ep", "yte", "xt", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "tree", ":", " ", "C", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "indent", ":", " ", "The", " ", "indent", "ation", " ", "for", " ", "the", " ", "string", " ", "represent", "ation", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "tree", "}.", " ", " ", "Ea", "ch", " ", "line", " ", "of", " ", "the", " ", "return", "ed", " ", "string", " ", "will", " ", "begin", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "indent", "}", " ", "space", " ", "character", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "indent", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "sec", "level", ":", " ", "The", " ", "section", " ", "level", " ", "tha", "t", " ", "C", "{", "tree", "}", " ", "appear", "s", " ", "at", ".", " ", " ", "Thi", "s", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "used", " ", "to", " ", "generat", "e", " ", "section", " ", "heading", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "sec", "level", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "The", " ", "ep", "yte", "xt", " ", "string", " ", "correspond", "ing", " ", "to", " ", "C", "{", "tree", "}.", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "string", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "tree_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'\\\\", "{'_", ",_", "'\\\\", "0", "'_", ",_", "tree_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'\\\\", "}'_", ",_", "'\\\\", "1", "'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tree_", "._", "tag_", "==_", "'", "ep", "yte", "xt", "'_", ":_", "indent_", "-=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tree_", "._", "tag_", "==_", "'", "section", "'_", ":_", "sec", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variables_", "=_", "[_", "to", "\\u", "ep", "yte", "xt_", "(_", "c_", ",_", "indent_", "+_", "2_", ",_", "sec", "level_", ")_", "for_", "c_", "in_", "tree_", "._", "children_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "str_", "=_", "''_", "._", "join_", "(_", "variables_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Clean", " ", "up", " ", "for", " ", "literal", " ", "blocks", " ", "(", "add", " ", "the", " ", "double", " ", "\":", ":\"", " ", "back", ")_", "\\u\\u\\uNL\\u\\u\\u_", "child", "str_", "=_", "re_", "._", "sub_", "(_", "':", "(\\\\", "s", "*)\\\\", "2", "'_", ",_", "':", ":\\\\", "\\\\", "1", "'_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tree_", "._", "tag_", "==_", "'", "para", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "word", "wrap_", "(_", "child", "str_", ",_", "indent_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'((", "^", "|\\\\", "n", ")\\\\", "s", "*\\\\", "d", "+)\\\\", ".'_", ",_", "r", "'\\\\", "1E", "{.", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'((", "^", "|\\\\", "n", ")\\\\", "s", "*)", "-'_", ",_", "r", "'\\\\", "1E", "{-", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'((", "^", "|\\\\", "n", ")\\\\", "s", "*)", "@'_", ",_", "r", "'\\\\", "1E", "{", "@", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "':", ":(", "\\\\", "s", "*(", "$", "|\\\\", "n", "))'_", ",_", "r", "'", "E", "{:", "}", "E", "{:", "}\\\\", "1", "'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "0", "'_", ",_", "'", "E", "{", "lb", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "1", "'_", ",_", "'", "E", "{", "rb", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "li", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bullet_", "=_", "tree_", "._", "attribs_", "._", "get_", "(_", "'", "bullet", "'_", ")_", "or_", "'-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "indent_", "*_", "'", " ", "'_", "+_", "bullet_", "+_", "'", " ", "'_", "+_", "child", "str_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "heading", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "0", "'_", ",_", "'", "E", "{", "lb", "}'_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "1", "'_", ",_", "'", "E", "{", "rb", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ulin", "e_", "=_", "len_", "(_", "child", "str_", ")_", "*_", "\\u", "HEAD", "ING", "\\u", "CHARS_", "[_", "sec", "level_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "indent_", "-_", "2_", ")_", "*_", "'", " ", "'_", "+_", "str_", "+_", "'\\\\", "n", "'_", "+_", "(_", "indent_", "-_", "2_", ")_", "*_", "'", " ", "'_", "+_", "ulin", "e_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "docte", "stb", "lock", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "0", "'_", ",_", "'{'_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "1", "'_", ",_", "'}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "[_", "'", " ", " ", "'_", "+_", "indent_", "*_", "'", " ", "'_", "+_", "line_", "for_", "line_", "in_", "str_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "literal", "block", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "0", "'_", ",_", "'{'_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "1", "'_", ",_", "'}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "[_", "(_", "indent_", "+_", "1_", ")_", "*_", "'", " ", "'_", "+_", "line_", "for_", "line_", "in_", "str_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "2", "'_", "+_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "field", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "numa", "rgs_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "tree_", "._", "children_", "[_", "numa", "rgs_", "+_", "1_", "]_", "._", "tag_", "==_", "'", "arg", "'_", ":_", "numa", "rgs_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag_", "=_", "variables_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "variables_", "[_", "1_", ":_", "1_", "+_", "numa", "rgs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "variables_", "[_", "1_", "+_", "numa", "rgs_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "(_", "indent_", ")_", "*_", "'", " ", "'_", "+_", "'@'_", "+_", "variables_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "str_", "+=_", "'('_", "+_", "',", " ", "'_", "._", "join_", "(_", "args_", ")_", "+_", "')'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "+_", "':", "\\\\", "n", "'_", "+_", "''_", "._", "join_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "target", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'<", "%", "s", ">'_", "%_", "child", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "in_", "(_", "'", "field", "list", "'_", ",_", "'", "tag", "'_", ",_", "'", "arg", "'_", ",_", "'", "ep", "yte", "xt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "section", "'_", ",_", "'", "oli", "st", "'_", ",_", "'", "uli", "st", "'_", ",_", "'", "name", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "child", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "symbol", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "E", "{%", "s", "}'_", "%_", "child", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "graph", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "G", "{%", "s", "}'_", "%_", "'", " ", "'_", "._", "join_", "(_", "variables_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "tag_", ",_", "name_", ")_", "in_", "\\u", "COLOR", "IZ", "ING", "\\u", "TAGS_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "==_", "tree_", "._", "tag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "{%", "s", "}'_", "%_", "(_", "tag_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "'", "Un", "know", "n", " ", "DOM", " ", "element", " ", "%", "r", "'_", "%_", "tree_", "._", "tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "to", "\\u", "plaintext_", "(_", "tree_", ",_", "indent_", "=_", "0_", ",_", "sec", "level_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Convert", " ", "a", " ", "DOM", " ", "document", " ", "encoding", " ", "ep", "yte", "xt", " ", "to", " ", "a", " ", "string", " ", "represent", "ation", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "represent", "ation", " ", "is", " ", "similar", " ", "to", " ", "the", " ", "string", " ", "generat", "ed", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "to", "\\u", "ep", "yte", "xt", "},", " ", "but", " ", "C", "{", "to", "\\u", "plain", "text", "}", " ", "remove", "s", " ", "inline", " ", "markup", ",", " ", "print", "s", "\\", "10", ";", " ", " ", " ", " ", "escaped", " ", "character", "s", " ", "in", " ", "unescape", "d", " ", "form", ",", " ", "etc", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "tree", ":", " ", "A", " ", "DOM", " ", "document", " ", "encoding", " ", "of", " ", "an", " ", "ep", "yte", "xt", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "tree", ":", " ", "C", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "indent", ":", " ", "The", " ", "indent", "ation", " ", "for", " ", "the", " ", "string", " ", "represent", "ation", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "tree", "}.", " ", " ", "Ea", "ch", " ", "line", " ", "of", " ", "the", " ", "return", "ed", " ", "string", " ", "will", " ", "begin", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "indent", "}", " ", "space", " ", "character", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "indent", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "sec", "level", ":", " ", "The", " ", "section", " ", "level", " ", "tha", "t", " ", "C", "{", "tree", "}", " ", "appear", "s", " ", "at", ".", " ", " ", "Thi", "s", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "used", " ", "to", " ", "generat", "e", " ", "section", " ", "heading", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "sec", "level", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "The", " ", "ep", "yte", "xt", " ", "string", " ", "correspond", "ing", " ", "to", " ", "C", "{", "tree", "}.", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "string", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "tree_", ",_", "basestring_", ")_", ":_", "return_", "tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tree_", "._", "tag_", "==_", "'", "section", "'_", ":_", "sec", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fig", "ure", " ", "out", " ", "the", " ", "child", " ", "indent", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tree_", "._", "tag_", "==_", "'", "ep", "yte", "xt", "'_", ":_", "cinde", "nt_", "=_", "indent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "li", "'_", "and_", "tree_", "._", "attribs_", "._", "get_", "(_", "'", "bullet", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cinde", "nt_", "=_", "indent_", "+_", "1_", "+_", "len_", "(_", "tree_", "._", "attribs_", "._", "get_", "(_", "'", "bullet", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cinde", "nt_", "=_", "indent_", "+_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "variables_", "=_", "[_", "to", "\\u", "plaintext_", "(_", "c_", ",_", "cinde", "nt_", ",_", "sec", "level_", ")_", "for_", "c_", "in_", "tree_", "._", "children_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "str_", "=_", "''_", "._", "join_", "(_", "variables_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tree_", "._", "tag_", "==_", "'", "para", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "word", "wrap_", "(_", "child", "str_", ",_", "indent_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "li", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "shou", "ld", " ", "be", " ", "able", " ", "to", " ", "use", " ", "get", "Attribute", " ", "here", ";", " ", "but", " ", "there", "'", "s", " ", "no_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convenien", "t", " ", "way", " ", "to", " ", "test", " ", "if", " ", "an", " ", "element", " ", "has", " ", "an", " ", "attribute", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bullet_", "=_", "tree_", "._", "attribs_", "._", "get_", "(_", "'", "bullet", "'_", ")_", "or_", "'-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "indent_", "*_", "'", " ", "'_", "+_", "bullet_", "+_", "'", " ", "'_", "+_", "child", "str_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "heading", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ulin", "e_", "=_", "len_", "(_", "child", "str_", ")_", "*_", "\\u", "HEAD", "ING", "\\u", "CHARS_", "[_", "sec", "level_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "(_", "indent_", "-_", "2_", ")_", "*_", "'", " ", "'_", "+_", "child", "str_", "+_", "'\\\\", "n", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "indent_", "-_", "2_", ")_", "*_", "'", " ", "'_", "+_", "ulin", "e_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "docte", "stb", "lock", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "[_", "(_", "indent_", "+_", "2_", ")_", "*_", "'", " ", "'_", "+_", "line_", "for_", "line_", "in_", "child", "str_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "literal", "block", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "[_", "(_", "indent_", "+_", "1_", ")_", "*_", "'", " ", "'_", "+_", "line_", "for_", "line_", "in_", "child", "str_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "field", "list", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "child", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "field", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "numa", "rgs_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "tree_", "._", "children_", "[_", "numa", "rgs_", "+_", "1_", "]_", "._", "tag_", "==_", "'", "arg", "'_", ":_", "numa", "rgs_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag_", "=_", "variables_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "variables_", "[_", "1_", ":_", "1_", "+_", "numa", "rgs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "variables_", "[_", "1_", "+_", "numa", "rgs_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "(_", "indent_", ")_", "*_", "'", " ", "'_", "+_", "'@'_", "+_", "variables_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "str_", "+=_", "'('_", "+_", "',", " ", "'_", "._", "join_", "(_", "args_", ")_", "+_", "')'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "+_", "':", "\\\\", "n", "'_", "+_", "''_", "._", "join_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "uri", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "variables_", ")_", "!=_", "2_", ":_", "raise_", "Value", "Error_", "(_", "'", "Ba", "d", " ", "URI", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "variables_", "[_", "0_", "]_", "==_", "variables_", "[_", "1_", "]_", ":_", "return_", "'<", "%", "s", ">'_", "%_", "variables_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "return_", "'%", "r", "<", "%", "s", ">'_", "%_", "(_", "variables_", "[_", "0_", "]_", ",_", "variables_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "link", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "variables_", ")_", "!=_", "2_", ":_", "raise_", "Value", "Error_", "(_", "'", "Ba", "d", " ", "Link", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", "'_", "%_", "variables_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "in_", "(_", "'", "oli", "st", "'_", ",_", "'", "uli", "st", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "[", "xx", "]", " ", "alw", "ay", "s", " ", "use", " ", "condense", "d", " ", "lists", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Us", "e", " ", "a", " ", "condense", "d", " ", "list", " ", "if", " ", "each", " ", "list", " ", "item", " ", "is", " ", "1", " ", "line", " ", "long", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "for", " ", "child", " ", "in", " ", "variab", "les", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "child", ".", "count", "('\\", "\\", "n", "')", " ", ">", " ", "2", ":", " ", "return", " ", "child", "str_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "child", "str_", "._", "replace_", "(_", "'\\\\", "n", "\\\\", "n", "'_", ",_", "'\\\\", "n", "'_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "symbol", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "'_", "%_", "SYMBOL", "\\u", "TO", "\\u", "PLAIN", "TEXT_", "._", "get_", "(_", "child", "str_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "graph", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'<<", "%", "s", " ", "graph", ":", " ", "%", "s", ">>'_", "%_", "(_", "variables_", "[_", "0_", "]_", ",_", "',", " ", "'_", "._", "join_", "(_", "variables_", "[_", "1_", ":_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Assume", " ", "tha", "t", " ", "anyt", "hing", " ", "else", " ", "can", " ", "be", " ", "pass", "ed", " ", "through", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "child", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "debug_", "(_", "tree_", ",_", "indent_", "=_", "4_", ",_", "sec", "level_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Convert", " ", "a", " ", "DOM", " ", "document", " ", "encoding", " ", "ep", "yte", "xt", " ", "back", " ", "to", " ", "an", " ", "ep", "yte", "xt", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "annotated", " ", "with", " ", "extra", " ", "debugg", "ing", " ", "informati", "on", ".", " ", " ", "Thi", "s", " ", "function", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "similar", " ", "to", " ", "L", "{", "to", "\\u", "ep", "yte", "xt", "},", " ", "but", " ", "it", " ", "adds", " ", "explicit", " ", "informati", "on", " ", "abo", "ut", "\\", "10", ";", " ", " ", " ", " ", "where", " ", "different", " ", "blocks", " ", "begin", ",", " ", "along", " ", "the", " ", "left", " ", "marg", "in", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "tree", ":", " ", "A", " ", "DOM", " ", "document", " ", "encoding", " ", "of", " ", "an", " ", "ep", "yte", "xt", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "tree", ":", " ", "C", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "indent", ":", " ", "The", " ", "indent", "ation", " ", "for", " ", "the", " ", "string", " ", "represent", "ation", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "tree", "}.", " ", " ", "Ea", "ch", " ", "line", " ", "of", " ", "the", " ", "return", "ed", " ", "string", " ", "will", " ", "begin", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "indent", "}", " ", "space", " ", "character", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "indent", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "sec", "level", ":", " ", "The", " ", "section", " ", "level", " ", "tha", "t", " ", "C", "{", "tree", "}", " ", "appear", "s", " ", "at", ".", " ", " ", "Thi", "s", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "used", " ", "to", " ", "generat", "e", " ", "section", " ", "heading", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "sec", "level", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "The", " ", "ep", "yte", "xt", " ", "string", " ", "correspond", "ing", " ", "to", " ", "C", "{", "tree", "}.", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "string", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "tree_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'\\\\", "{'_", ",_", "'\\\\", "0", "'_", ",_", "tree_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'\\\\", "}'_", ",_", "'\\\\", "1", "'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tree_", "._", "tag_", "==_", "'", "section", "'_", ":_", "sec", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variables_", "=_", "[_", "to", "\\u", "debug_", "(_", "c_", ",_", "indent_", "+_", "2_", ",_", "sec", "level_", ")_", "for_", "c_", "in_", "tree_", "._", "children_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "str_", "=_", "''_", "._", "join_", "(_", "variables_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Clean", " ", "up", " ", "for", " ", "literal", " ", "blocks", " ", "(", "add", " ", "the", " ", "double", " ", "\":", ":\"", " ", "back", ")_", "\\u\\u\\uNL\\u\\u\\u_", "child", "str_", "=_", "re_", "._", "sub_", "(_", "':", "(", " ", "*\\\\", "n", " ", "\\\\|", "\\\\", "n", ")\\\\", "2", "'_", ",_", "':", ":\\\\", "\\\\", "1", "'_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tree_", "._", "tag_", "==_", "'", "para", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "word", "wrap_", "(_", "child", "str_", ",_", "indent_", "-_", "6_", ",_", "69_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'((", "^", "|\\\\", "n", ")\\\\", "s", "*\\\\", "d", "+)\\\\", ".'_", ",_", "r", "'\\\\", "1E", "{.", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'((", "^", "|\\\\", "n", ")\\\\", "s", "*)", "-'_", ",_", "r", "'\\\\", "1E", "{-", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "'((", "^", "|\\\\", "n", ")\\\\", "s", "*)", "@'_", ",_", "r", "'\\\\", "1E", "{", "@", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "r", "':", ":(", "\\\\", "s", "*(", "$", "|\\\\", "n", "))'_", ",_", "r", "'", "E", "{:", "}", "E", "{:", "}\\\\", "1", "'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "0", "'_", ",_", "'", "E", "{", "lb", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "1", "'_", ",_", "'", "E", "{", "rb", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "str_", "._", "rstrip_", "(_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "[_", "0_", "]_", "=_", "'", " ", " ", " ", "P", ">", "|'_", "+_", "lines_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "[_", "1_", ":_", "]_", "=_", "[_", "'", " ", "|'_", "+_", "l_", "for_", "l_", "in_", "lines_", "[_", "1_", ":_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "+_", "'\\\\", "n", " ", "|\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "li", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bullet_", "=_", "tree_", "._", "attribs_", "._", "get_", "(_", "'", "bullet", "'_", ")_", "or_", "'-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", " ", " ", "LI", ">", "|'_", "+_", "(_", "indent_", "-_", "6_", ")_", "*_", "'", " ", "'_", "+_", "bullet_", "+_", "'", " ", "'_", "+_", "child", "str_", "[_", "6_", ":_", "]_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "in_", "(_", "'", "oli", "st", "'_", ",_", "'", "uli", "st", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "LIST", ">", "|'_", "+_", "(_", "indent_", "-_", "4_", ")_", "*_", "'", " ", "'_", "+_", "child", "str_", "[_", "indent_", "+_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "heading", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "0", "'_", ",_", "'", "E", "{", "lb", "}'_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "1", "'_", ",_", "'", "E", "{", "rb", "}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ulin", "e_", "=_", "len_", "(_", "child", "str_", ")_", "*_", "\\u", "HEAD", "ING", "\\u", "CHARS_", "[_", "sec", "level_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "'", "SEC", "'_", "+_", "`_", "sec", "level_", "`_", "+_", "'>", "|'_", "+_", "(_", "indent_", "-_", "8_", ")_", "*_", "'", " ", "'_", "+_", "str_", "+_", "'\\\\", "n", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "|'_", "+_", "(_", "indent_", "-_", "8_", ")_", "*_", "'", " ", "'_", "+_", "ulin", "e_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "docte", "stb", "lock", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "0", "'_", ",_", "'{'_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "1", "'_", ",_", "'}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "[_", "'", " ", "|'_", "+_", "(_", "indent_", "-_", "4_", ")_", "*_", "'", " ", "'_", "+_", "line_", "for_", "line_", "in_", "str_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "[_", "0_", "]_", "=_", "'", "DT", "ST", ">'_", "+_", "lines_", "[_", "0_", "]_", "[_", "5_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "+_", "'\\\\", "n", " ", "|\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "literal", "block", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "0", "'_", ",_", "'{'_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "1", "'_", ",_", "'}'_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "[_", "'", " ", "|'_", "+_", "(_", "indent_", "-_", "5_", ")_", "*_", "'", " ", "'_", "+_", "line_", "for_", "line_", "in_", "str_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "[_", "0_", "]_", "=_", "'", " ", "LIT", ">'_", "+_", "lines_", "[_", "0_", "]_", "[_", "5_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "2", "'_", "+_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "+_", "'\\\\", "n", " ", "|\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "field", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "numa", "rgs_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "tree_", "._", "children_", "[_", "numa", "rgs_", "+_", "1_", "]_", "._", "tag_", "==_", "'", "arg", "'_", ":_", "numa", "rgs_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag_", "=_", "variables_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "variables_", "[_", "1_", ":_", "1_", "+_", "numa", "rgs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "variables_", "[_", "1_", "+_", "numa", "rgs_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "'", " ", "FL", "D", ">", "|'_", "+_", "(_", "indent_", "-_", "6_", ")_", "*_", "'", " ", "'_", "+_", "'@'_", "+_", "variables_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "str_", "+=_", "'('_", "+_", "',", " ", "'_", "._", "join_", "(_", "args_", ")_", "+_", "')'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "+_", "':", "\\\\", "n", "'_", "+_", "''_", "._", "join_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "target", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'<", "%", "s", ">'_", "%_", "child", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "in_", "(_", "'", "field", "list", "'_", ",_", "'", "tag", "'_", ",_", "'", "arg", "'_", ",_", "'", "ep", "yte", "xt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "section", "'_", ",_", "'", "oli", "st", "'_", ",_", "'", "uli", "st", "'_", ",_", "'", "name", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "child", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "symbol", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "E", "{%", "s", "}'_", "%_", "child", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tree_", "._", "tag_", "==_", "'", "graph", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "G", "{%", "s", "}'_", "%_", "'", " ", "'_", "._", "join_", "(_", "variables_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "tag_", ",_", "name_", ")_", "in_", "\\u", "COLOR", "IZ", "ING", "\\u", "TAGS_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "==_", "tree_", "._", "tag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "{%", "s", "}'_", "%_", "(_", "tag_", ",_", "child", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "'", "Un", "know", "n", " ", "DOM", " ", "element", " ", "%", "r", "'_", "%_", "tree_", "._", "tag_", ")_", "\\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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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 ]
Unused local variable
chrisdembia/agent-bicycle/randlov1998/tasks.py
[ { "content": " def getObservation(self):\n (theta, thetad, omega, omegad, omegadd,\n xf, yf, xb, yb, psi, psig) = self.env.getSensors()\n # TODO not calling superclass to do normalization, etc.\n return self.env.getSensors()[0:5]", "metadata": "root.BalanceTask.getObservation", "header": "['class', 'BalanceTask', '(', 'pybrain', '.', 'rl', '.', 'environments', '.', 'EpisodicTask', ')', ':', '___EOS___']", "index": 103 }, { "content": " def getObservation(self):\n # let the learner know about the front tire position and \n # the heading.\n (theta, thetad, omega, omegad, omegadd,\n xf, yf, xb, yb, psi, psig) = self.env.getSensors()\n \n # TODO not calling superclass to do normalization, etc.\n return [ self.env.getSensors()[i] for i in [0, 1, 2, 3, 4, 5, 6, 9, 10] ]", "metadata": "root.GotoTask.getObservation", "header": "['class', 'GotoTask', '(', 'BalanceTask', ')', ':', '___EOS___']", "index": 144 }, { "content": " def __init__(self, five_actions = False, rewardType = 1, *args, **kwargs):\n BalanceTask.__init__(self, *args,**kwargs)\n #self.env.x_goal = x_goal\n #self.env.y_goal = y_goal\n self.five_actions = five_actions\n goto = True\n if self.five_actions :\n self.nactions = 5\n self.action_history = np.zeros(self.nactions)\n self.rewardType = rewardType", "metadata": "root.LSPIGotoTask.__init__", "header": "['class', 'LSPIGotoTask', '(', 'BalanceTask', ')', ':', '___EOS___']", "index": 351 }, { "content": " def getReward(self):\n # -1 reward for falling over\n # 0.01 reward for close to goal\n # return reward inversely proportional to heading error otherwise\n psig = self.env.getPSIG()\n \n r_factor = 0.01\n rh_factor = 0.00001\n\n if np.abs(self.env.getTilt()) > self.max_tilt:\n return -1.0\n else:\n distance = self.calc_dist_to_goal()\n #heading = self.calc_angle_to_goal()\n if (distance > self.max_distance):\n print 'MAX DISTANCE REACHED'\n return -1.0\n if (distance < 1e-3):\n print 'DEBUG: GOAL REACHED'\n return 0.01\n else:\n # reward from Randlov's 1998 paper\n r1 = (4 - psig**2) * .00004\n #return (4 - psig**2) * 0.00004\n \n # reward from Randlov's C code\n #return (0.95 - heading**2) * r_factor\n \n # our own proportional reward function\n r2 = -np.abs(self.env.getSensors()[0])\n #heading_reward = 0.1/(heading**2 + 0.1) * r_factor\n #dist_reward = -distance**2 * rh_factor\n #return 0.1/(heading**2 + 0.1) * r_factor\n #return heading_reward + dist_reward\n return r1", "metadata": "root.LinearFATileCoding3476GoToTask.getReward", "header": "['class', 'LinearFATileCoding3476GoToTask', '(', 'BalanceTask', ')', ':', '___EOS___']", "index": 590 } ]
[ { "span": "theta,", "start_line": 104, "start_column": 9, "end_line": 104, "end_column": 14 }, { "span": "thetad,", "start_line": 104, "start_column": 16, "end_line": 104, "end_column": 22 }, { "span": "omega,", "start_line": 104, "start_column": 24, "end_line": 104, "end_column": 29 }, { "span": "omegad,", "start_line": 104, "start_column": 31, "end_line": 104, "end_column": 37 }, { "span": "omegadd,", "start_line": 104, "start_column": 39, "end_line": 104, "end_column": 46 }, { "span": "xf,", "start_line": 105, "start_column": 16, "end_line": 105, "end_column": 18 }, { "span": "yf,", "start_line": 105, "start_column": 20, "end_line": 105, "end_column": 22 }, { "span": "xb,", "start_line": 105, "start_column": 24, "end_line": 105, "end_column": 26 }, { "span": "yb,", "start_line": 105, "start_column": 28, "end_line": 105, "end_column": 30 }, { "span": "psi,", "start_line": 105, "start_column": 32, "end_line": 105, "end_column": 35 }, { "span": "psig)", "start_line": 105, "start_column": 37, "end_line": 105, "end_column": 41 }, { "span": "theta,", "start_line": 147, "start_column": 9, "end_line": 147, "end_column": 14 }, { "span": "thetad,", "start_line": 147, "start_column": 16, "end_line": 147, "end_column": 22 }, { "span": "omega,", "start_line": 147, "start_column": 24, "end_line": 147, "end_column": 29 }, { "span": "omegad,", "start_line": 147, "start_column": 31, "end_line": 147, "end_column": 37 }, { "span": "omegadd,", "start_line": 147, "start_column": 39, "end_line": 147, "end_column": 46 }, { "span": "xf,", "start_line": 148, "start_column": 16, "end_line": 148, "end_column": 18 }, { "span": "yf,", "start_line": 148, "start_column": 20, "end_line": 148, "end_column": 22 }, { "span": "xb,", "start_line": 148, "start_column": 24, "end_line": 148, "end_column": 26 }, { "span": "yb,", "start_line": 148, "start_column": 28, "end_line": 148, "end_column": 30 }, { "span": "psi,", "start_line": 148, "start_column": 32, "end_line": 148, "end_column": 35 }, { "span": "psig)", "start_line": 148, "start_column": 37, "end_line": 148, "end_column": 41 }, { "span": "goto ", "start_line": 356, "start_column": 8, "end_line": 356, "end_column": 12 }, { "span": "r_factor ", "start_line": 596, "start_column": 8, "end_line": 596, "end_column": 16 }, { "span": "rh_factor ", "start_line": 597, "start_column": 8, "end_line": 597, "end_column": 17 }, { "span": "r2 ", "start_line": 619, "start_column": 16, "end_line": 619, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Balance", "Task_", "(_", "pyb", "rain_", "._", "rl_", "._", "environments_", "._", "Episod", "ic", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Observation", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "theta_", ",_", "theta", "d_", ",_", "omega_", ",_", "omega", "d_", ",_", "omega", "dd_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xf_", ",_", "yf", "_", ",_", "xb_", ",_", "yb", "_", ",_", "psi_", ",_", "psi", "g_", ")_", "=_", "self_", "._", "env_", "._", "get", "Sensors", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "not", " ", "calling", " ", "superclass", " ", "to", " ", "do", " ", "normaliza", "tion", ",", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "env_", "._", "get", "Sensors", "_", "(_", ")_", "[_", "0_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Got", "o", "Task_", "(_", "Balance", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Observation", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "let", " ", "the", " ", "learner", " ", "know", " ", "abo", "ut", " ", "the", " ", "front", " ", "tir", "e", " ", "position", " ", "and", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "heading", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "theta_", ",_", "theta", "d_", ",_", "omega_", ",_", "omega", "d_", ",_", "omega", "dd_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xf_", ",_", "yf", "_", ",_", "xb_", ",_", "yb", "_", ",_", "psi_", ",_", "psi", "g_", ")_", "=_", "self_", "._", "env_", "._", "get", "Sensors", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", "not", " ", "calling", " ", "superclass", " ", "to", " ", "do", " ", "normaliza", "tion", ",", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "[_", "self_", "._", "env_", "._", "get", "Sensors", "_", "(_", ")_", "[_", "i_", "]_", "for_", "i_", "in_", "[_", "0_", ",_", "1_", ",_", "2_", ",_", "3_", ",_", "4_", ",_", "5_", ",_", "6_", ",_", "9_", ",_", "10_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LS", "PI", "Got", "o", "Task_", "(_", "Balance", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "five", "\\u", "actions_", "=_", "False_", ",_", "reward", "Type_", "=_", "1_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Balance", "Task_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "env", ".", "x", "\\u", "goal", " ", "=", " ", "x", "\\u", "goal_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "env", ".", "y", "\\u", "goal", " ", "=", " ", "y", "\\u", "goal_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "five", "\\u", "actions_", "=_", "five", "\\u", "actions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "goto_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "five", "\\u", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "nac", "tions_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "action", "\\u", "history_", "=_", "np_", "._", "zeros_", "(_", "self_", "._", "nac", "tions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "reward", "Type_", "=_", "reward", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "347", "6", "Go", "To", "Task_", "(_", "Balance", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Reward", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "-1", " ", " ", " ", " ", "reward", " ", "for", " ", "falling", " ", "over_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "0.01", " ", "reward", " ", "for", " ", "close", " ", "to", " ", "goal_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "return", " ", "reward", " ", "inv", "erse", "ly", " ", "proportional", " ", "to", " ", "heading", " ", "error", " ", "other", "wise_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "psi", "g_", "=_", "self_", "._", "env_", "._", "get", "PS", "IG", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "factor_", "=_", "0.01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rh", "\\u", "factor_", "=_", "0.00001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "np_", "._", "abs_", "(_", "self_", "._", "env_", "._", "get", "Til", "t_", "(_", ")_", ")_", ">_", "self_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "distance_", "=_", "self_", "._", "calc", "\\u", "dist", "\\u", "to", "\\u", "goal_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "heading", " ", "=", " ", "self", ".", "calc", "\\u", "angle", "\\u", "to", "\\u", "goal", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "distance_", ">_", "self_", "._", "max", "\\u", "distance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "MAX", " ", "DISTANCE", " ", "REAC", "HED", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "-_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "distance_", "<_", "1e-3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "DEBU", "G", ":", " ", "GO", "AL", " ", "REAC", "HED", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0.01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "reward", " ", "from", " ", "Ran", "dlo", "v", "'", "s", " ", "199", "8", " ", "paper_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r1_", "=_", "(_", "4_", "-_", "psi", "g_", "**_", "2_", ")_", "*_", ".0000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "return", " ", "(", "4", " ", "-", " ", "psi", "g", "**", "2", ")", " ", "*", " ", "0.0000", "4_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reward", " ", "from", " ", "Ran", "dlo", "v", "'", "s", " ", "C", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "(", "0.95", " ", "-", " ", "heading", "**", "2", ")", " ", "*", " ", "r", "\\u", "factor_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "our", " ", "own", " ", "proportional", " ", "reward", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "r2_", "=_", "-_", "np_", "._", "abs_", "(_", "self_", "._", "env_", "._", "get", "Sensors", "_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "heading", "\\u", "reward", " ", "=", " ", "0.", "1", "/(", "heading", "**", "2", " ", "+", " ", "0.", "1", ")", " ", "*", " ", "r", "\\u", "factor_", "\\u\\u\\uNL\\u\\u\\u_", "#", "dist", "\\u", "reward", " ", "=", " ", "-", "distance", "**", "2", " ", "*", " ", "rh", "\\u", "factor_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "0.", "1", "/(", "heading", "**", "2", " ", "+", " ", "0.", "1", ")", " ", "*", " ", "r", "\\u", "factor_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "heading", "\\u", "reward", " ", "+", " ", "dist", "\\u", "reward_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "r1_", "\\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, 0, 2, 0, 1, 2, 0, 2, 0, 1, 2, 0, 1, 2, 2, 0, 2, 0, 1, 2, 0, 2, 0, 1, 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 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 ]
Unused import
AppScale/appscale/AppServer/lib/jinja2-2.6/jinja2/loaders.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.loaders\n ~~~~~~~~~~~~~~\n\n Jinja loader classes.\n\n :copyright: (c) 2010 by the Jinja Team.\n :license: BSD, see LICENSE for more details.\n\"\"\"\nimport os\nimport sys\nimport weakref\nfrom types import ModuleType\nfrom os import path\ntry:\n from hashlib import sha1\nexcept ImportError:\n from sha import new as sha1\nfrom jinja2.exceptions import TemplateNotFound\nfrom jinja2.utils import LRUCache, open_if_exists, internalcode\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 split_template_path(template):\n \"\"\"Split a path into segments and perform a sanity check. If it detects\n '..' in the path it will raise a `TemplateNotFound` error.\n \"\"\"\n pieces = []\n for piece in template.split('/'):\n if path.sep in piece \\\n or (path.altsep and path.altsep in piece) or \\\n piece == path.pardir:\n raise TemplateNotFound(template)\n elif piece and piece != '.':\n pieces.append(piece)\n return pieces", "metadata": "root.split_template_path", "header": "['module', '___EOS___']", "index": 23 }, { "content": "class BaseLoader(object):\n \"\"\"Baseclass for all loaders. Subclass this and override `get_source` to\n implement a custom loading mechanism. The environment provides a\n `get_template` method that calls the loader's `load` method to get the\n :class:`Template` object.\n\n A very basic example for a loader that looks up templates on the file\n system could look like this::\n\n from jinja2 import BaseLoader, TemplateNotFound\n from os.path import join, exists, getmtime\n\n class MyLoader(BaseLoader):\n\n def __init__(self, path):\n self.path = path\n\n def get_source(self, environment, template):\n path = join(self.path, template)\n if not exists(path):\n raise TemplateNotFound(template)\n mtime = getmtime(path)\n with file(path) as f:\n source = f.read().decode('utf-8')\n return source, path, lambda: mtime == getmtime(path)\n \"\"\"\n\n #: if set to `False` it indicates that the loader cannot provide access\n #: to the source of templates.\n #:\n #: .. versionadded:: 2.4\n has_source_access = True\n\n\n", "metadata": "root.BaseLoader", "header": "['module', '___EOS___']", "index": 38 }, { "content": " def get_source(self, environment, template):\n \"\"\"Get the template source, filename and reload helper for a template.\n It's passed the environment and template name and has to return a\n tuple in the form ``(source, filename, uptodate)`` or raise a\n `TemplateNotFound` error if it can't locate the template.\n\n The source part of the returned tuple must be the source of the\n template as unicode string or a ASCII bytestring. The filename should\n be the name of the file on the filesystem if it was loaded from there,\n otherwise `None`. The filename is used by python for the tracebacks\n if no loader extension is used.\n\n The last item in the tuple is the `uptodate` function. If auto\n reloading is enabled it's always called to check if the template\n changed. No arguments are passed so the function must store the\n old state somewhere (for example in a closure). If it returns `False`\n the template will be reloaded.\n \"\"\"\n if not self.has_source_access:\n raise RuntimeError('%s cannot provide access to the source' %\n self.__class__.__name__)\n raise TemplateNotFound(template)", "metadata": "root.BaseLoader.get_source", "header": "['class', 'BaseLoader', '(', 'object', ')', ':', '___EOS___']", "index": 71 }, { "content": " def list_templates(self):\n \"\"\"Iterates over all templates. If the loader does not support that\n it should raise a :exc:`TypeError` which is the default behavior.\n \"\"\"\n raise TypeError('this loader cannot iterate over all templates')", "metadata": "root.BaseLoader.list_templates", "header": "['class', 'BaseLoader', '(', 'object', ')', ':', '___EOS___']", "index": 94 }, { "content": " @internalcode\n def load(self, environment, name, globals=None):\n \"\"\"Loads a template. This method looks up the template in the cache\n or loads one by calling :meth:`get_source`. Subclasses should not\n override this method as loaders working on collections of other\n loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)\n will not call this method but `get_source` directly.\n \"\"\"\n code = None\n if globals is None:\n globals = {}\n\n # first we try to get the source for this template together\n # with the filename and the uptodate function.\n source, filename, uptodate = self.get_source(environment, name)\n\n # try to load the code from the bytecode cache if there is a\n # bytecode cache configured.\n bcc = environment.bytecode_cache\n if bcc is not None:\n bucket = bcc.get_bucket(environment, name, filename, source)\n code = bucket.code\n\n # if we don't have code so far (not cached, no longer up to\n # date) etc. we compile the template\n if code is None:\n code = environment.compile(source, name, filename)\n\n # if the bytecode cache is available and the bucket doesn't\n # have a code so far, we give the bucket the new code and put\n # it back to the bytecode cache.\n if bcc is not None and bucket.code is None:\n bucket.code = code\n bcc.set_bucket(bucket)\n\n return environment.template_class.from_code(environment, code,\n globals, uptodate)", "metadata": "root.BaseLoader.load", "header": "['class', 'BaseLoader', '(', 'object', ')', ':', '___EOS___']", "index": 100 }, { "content": "class FileSystemLoader(BaseLoader):\n \"\"\"Loads templates from the file system. This loader can find templates\n in folders on the file system and is the preferred way to load them.\n\n The loader takes the path to the templates as string, or if multiple\n locations are wanted a list of them which is then looked up in the\n given order:\n\n >>> loader = FileSystemLoader('/path/to/templates')\n >>> loader = FileSystemLoader(['/path/to/templates', '/other/path'])\n\n Per default the template encoding is ``'utf-8'`` which can be changed\n by setting the `encoding` parameter to something else.\n \"\"\"\n\n\n", "metadata": "root.FileSystemLoader", "header": "['module', '___EOS___']", "index": 139 }, { "content": " def __init__(self, searchpath, encoding='utf-8'):\n if isinstance(searchpath, basestring):\n searchpath = [searchpath]\n self.searchpath = list(searchpath)\n self.encoding = encoding", "metadata": "root.FileSystemLoader.__init__", "header": "['class', 'FileSystemLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 154 }, { "content": " def get_source(self, environment, template):\n pieces = split_template_path(template)\n for searchpath in self.searchpath:\n filename = path.join(searchpath, *pieces)\n f = open_if_exists(filename)\n if f is None:\n continue\n try:\n contents = f.read().decode(self.encoding)\n finally:\n f.close()\n\n mtime = path.getmtime(filename)\n def uptodate():\n try:\n return path.getmtime(filename) == mtime\n except OSError:\n return False\n return contents, filename, uptodate\n raise TemplateNotFound(template)", "metadata": "root.FileSystemLoader.get_source", "header": "['class', 'FileSystemLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 160 }, { "content": " def list_templates(self):\n found = set()\n for searchpath in self.searchpath:\n for dirpath, dirnames, filenames in os.walk(searchpath):\n for filename in filenames:\n template = os.path.join(dirpath, filename) \\\n [len(searchpath):].strip(os.path.sep) \\\n .replace(os.path.sep, '/')\n if template[:2] == './':\n template = template[2:]\n if template not in found:\n found.add(template)\n return sorted(found)", "metadata": "root.FileSystemLoader.list_templates", "header": "['class', 'FileSystemLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 181 }, { "content": "class PackageLoader(BaseLoader):\n \"\"\"Load templates from python eggs or packages. It is constructed with\n the name of the python package and the path to the templates in that\n package::\n\n loader = PackageLoader('mypackage', 'views')\n\n If the package path is not given, ``'templates'`` is assumed.\n\n Per default the template encoding is ``'utf-8'`` which can be changed\n by setting the `encoding` parameter to something else. Due to the nature\n of eggs it's only possible to reload templates if the package was loaded\n from the file system and not a zip file.\n \"\"\"\n\n\n", "metadata": "root.PackageLoader", "header": "['module', '___EOS___']", "index": 196 }, { "content": " def __init__(self, package_name, package_path='templates',\n encoding='utf-8'):\n from pkg_resources import DefaultProvider, ResourceManager, \\\n get_provider\n provider = get_provider(package_name)\n self.encoding = encoding\n self.manager = ResourceManager()\n self.filesystem_bound = isinstance(provider, DefaultProvider)\n self.provider = provider\n self.package_path = package_path", "metadata": "root.PackageLoader.__init__", "header": "['class', 'PackageLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 211 }, { "content": " def get_source(self, environment, template):\n pieces = split_template_path(template)\n p = '/'.join((self.package_path,) + tuple(pieces))\n if not self.provider.has_resource(p):\n raise TemplateNotFound(template)\n\n filename = uptodate = None\n if self.filesystem_bound:\n filename = self.provider.get_resource_filename(self.manager, p)\n mtime = path.getmtime(filename)\n def uptodate():\n try:\n return path.getmtime(filename) == mtime\n except OSError:\n return False\n\n source = self.provider.get_resource_string(self.manager, p)\n return source.decode(self.encoding), filename, uptodate", "metadata": "root.PackageLoader.get_source", "header": "['class', 'PackageLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 222 }, { "content": " def list_templates(self):\n path = self.package_path\n if path[:2] == './':\n path = path[2:]\n elif path == '.':\n path = ''\n offset = len(path)\n results = []\n def _walk(path):\n for filename in self.provider.resource_listdir(path):\n fullname = path + '/' + filename\n if self.provider.resource_isdir(fullname):\n _walk(fullname)\n else:\n results.append(fullname[offset:].lstrip('/'))\n _walk(path)\n results.sort()\n return results", "metadata": "root.PackageLoader.list_templates", "header": "['class', 'PackageLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 241 }, { "content": "class DictLoader(BaseLoader):\n \"\"\"Loads a template from a python dict. It's passed a dict of unicode\n strings bound to template names. This loader is useful for unittesting:\n\n >>> loader = DictLoader({'index.html': 'source here'})\n\n Because auto reloading is rarely useful this is disabled per default.\n \"\"\"\n\n\n", "metadata": "root.DictLoader", "header": "['module', '___EOS___']", "index": 261 }, { "content": " def __init__(self, mapping):\n self.mapping = mapping", "metadata": "root.DictLoader.__init__", "header": "['class', 'DictLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 270 }, { "content": " def get_source(self, environment, template):\n if template in self.mapping:\n source = self.mapping[template]\n return source, None, lambda: source != self.mapping.get(template)\n raise TemplateNotFound(template)", "metadata": "root.DictLoader.get_source", "header": "['class', 'DictLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 273 }, { "content": " def list_templates(self):\n return sorted(self.mapping)", "metadata": "root.DictLoader.list_templates", "header": "['class', 'DictLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 279 }, { "content": "class FunctionLoader(BaseLoader):\n \"\"\"A loader that is passed a function which does the loading. The\n function becomes the name of the template passed and has to return either\n an unicode string with the template source, a tuple in the form ``(source,\n filename, uptodatefunc)`` or `None` if the template does not exist.\n\n >>> def load_template(name):\n ... if name == 'index.html':\n ... return '...'\n ...\n >>> loader = FunctionLoader(load_template)\n\n The `uptodatefunc` is a function that is called if autoreload is enabled\n and has to return `True` if the template is still up to date. For more\n details have a look at :meth:`BaseLoader.get_source` which has the same\n return value.\n \"\"\"\n\n", "metadata": "root.FunctionLoader", "header": "['module', '___EOS___']", "index": 283 }, { "content": " def __init__(self, load_func):\n self.load_func = load_func", "metadata": "root.FunctionLoader.__init__", "header": "['class', 'FunctionLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 301 }, { "content": " def get_source(self, environment, template):\n rv = self.load_func(template)\n if rv is None:\n raise TemplateNotFound(template)\n elif isinstance(rv, basestring):\n return rv, None, None\n return rv", "metadata": "root.FunctionLoader.get_source", "header": "['class', 'FunctionLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 304 }, { "content": "class PrefixLoader(BaseLoader):\n \"\"\"A loader that is passed a dict of loaders where each loader is bound\n to a prefix. The prefix is delimited from the template by a slash per\n default, which can be changed by setting the `delimiter` argument to\n something else::\n\n loader = PrefixLoader({\n 'app1': PackageLoader('mypackage.app1'),\n 'app2': PackageLoader('mypackage.app2')\n })\n\n By loading ``'app1/index.html'`` the file from the app1 package is loaded,\n by loading ``'app2/index.html'`` the file from the second.\n \"\"\"\n\n\n", "metadata": "root.PrefixLoader", "header": "['module', '___EOS___']", "index": 313 }, { "content": " def __init__(self, mapping, delimiter='/'):\n self.mapping = mapping\n self.delimiter = delimiter", "metadata": "root.PrefixLoader.__init__", "header": "['class', 'PrefixLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 328 }, { "content": " def get_source(self, environment, template):\n try:\n prefix, name = template.split(self.delimiter, 1)\n loader = self.mapping[prefix]\n except (ValueError, KeyError):\n raise TemplateNotFound(template)\n try:\n return loader.get_source(environment, name)\n except TemplateNotFound:\n # re-raise the exception with the correct fileame here.\n # (the one that includes the prefix)\n raise TemplateNotFound(template)", "metadata": "root.PrefixLoader.get_source", "header": "['class', 'PrefixLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 332 }, { "content": " def list_templates(self):\n result = []\n for prefix, loader in self.mapping.iteritems():\n for template in loader.list_templates():\n result.append(prefix + self.delimiter + template)\n return result", "metadata": "root.PrefixLoader.list_templates", "header": "['class', 'PrefixLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 345 }, { "content": "class ChoiceLoader(BaseLoader):\n \"\"\"This loader works like the `PrefixLoader` just that no prefix is\n specified. If a template could not be found by one loader the next one\n is tried.\n\n >>> loader = ChoiceLoader([\n ... FileSystemLoader('/path/to/user/templates'),\n ... FileSystemLoader('/path/to/system/templates')\n ... ])\n\n This is useful if you want to allow users to override builtin templates\n from a different location.\n \"\"\"\n\n\n", "metadata": "root.ChoiceLoader", "header": "['module', '___EOS___']", "index": 353 }, { "content": " def __init__(self, loaders):\n self.loaders = loaders", "metadata": "root.ChoiceLoader.__init__", "header": "['class', 'ChoiceLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 367 }, { "content": " def get_source(self, environment, template):\n for loader in self.loaders:\n try:\n return loader.get_source(environment, template)\n except TemplateNotFound:\n pass\n raise TemplateNotFound(template)", "metadata": "root.ChoiceLoader.get_source", "header": "['class', 'ChoiceLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 370 }, { "content": " def list_templates(self):\n found = set()\n for loader in self.loaders:\n found.update(loader.list_templates())\n return sorted(found)", "metadata": "root.ChoiceLoader.list_templates", "header": "['class', 'ChoiceLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 378 }, { "content": "class _TemplateModule(ModuleType):\n \"\"\"Like a normal module but with support for weak references\"\"\"", "metadata": "root._TemplateModule", "header": "['module', '___EOS___']", "index": 385 }, { "content": "class ModuleLoader(BaseLoader):\n \"\"\"This loader loads templates from precompiled templates.\n\n Example usage:\n\n >>> loader = ChoiceLoader([\n ... ModuleLoader('/path/to/compiled/templates'),\n ... FileSystemLoader('/path/to/templates')\n ... ])\n\n Templates can be precompiled with :meth:`Environment.compile_templates`.\n \"\"\"\n\n has_source_access = False\n\n\n\n", "metadata": "root.ModuleLoader", "header": "['module', '___EOS___']", "index": 389 }, { "content": " def __init__(self, path):\n package_name = '_jinja2_module_templates_%x' % id(self)\n\n # create a fake module that looks for the templates in the\n # path given.\n mod = _TemplateModule(package_name)\n if isinstance(path, basestring):\n path = [path]\n else:\n path = list(path)\n mod.__path__ = path\n\n sys.modules[package_name] = weakref.proxy(mod,\n lambda x: sys.modules.pop(package_name, None))\n\n # the only strong reference, the sys.modules entry is weak\n # so that the garbage collector can remove it once the\n # loader that created it goes out of business.\n self.module = mod\n self.package_name = package_name", "metadata": "root.ModuleLoader.__init__", "header": "['class', 'ModuleLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 404 }, { "content": " @staticmethod\n def get_template_key(name):\n return 'tmpl_' + sha1(name.encode('utf-8')).hexdigest()", "metadata": "root.ModuleLoader.get_template_key", "header": "['class', 'ModuleLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 425 }, { "content": " @staticmethod\n def get_module_filename(name):\n return ModuleLoader.get_template_key(name) + '.py'", "metadata": "root.ModuleLoader.get_module_filename", "header": "['class', 'ModuleLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 429 }, { "content": " @internalcode\n def load(self, environment, name, globals=None):\n key = self.get_template_key(name)\n module = '%s.%s' % (self.package_name, key)\n mod = getattr(self.module, module, None)\n if mod is None:\n try:\n mod = __import__(module, None, None, ['root'])\n except ImportError:\n raise TemplateNotFound(name)\n\n # remove the entry from sys.modules, we only want the attribute\n # on the module object we have stored on the loader.\n sys.modules.pop(module, None)\n\n return environment.template_class.from_module_dict(\n environment, mod.__dict__, globals)", "metadata": "root.ModuleLoader.load", "header": "['class', 'ModuleLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 433 } ]
[ { "span": "from jinja2.utils import LRUCache, open_if_exists, internalcode", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 63 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "jin", "ja", "2", ".", "load", "ers", "\\", "10", ";", " ", " ", " ", " ", "~~~~~~~~~~~", "~~~", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Jin", "ja", " ", "load", "er", " ", "classe", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "copyr", "ight", ":", " ", "(", "c", ")", " ", "2010", " ", "by", " ", "the", " ", "Jin", "ja", " ", "Tea", "m", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "license", ":", " ", "BS", "D", ",", " ", "see", " ", "LICENSE", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "weakref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "Modul", "e", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "import_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "hashlib_", "import_", "sha1_", "\\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_", "sha_", "import_", "new_", "as_", "sha1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "jinja2_", "._", "exceptions_", "import_", "Templa", "te", "Not", "Found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jinja2_", "._", "utils_", "import_", "LR", "UC", "ache_", ",_", "open", "\\u", "if", "\\u", "exists_", ",_", "internal", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "split", "\\u", "template", "\\u", "path_", "(_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Split", " ", "a", " ", "path", " ", "int", "o", " ", "segments", " ", "and", " ", "perform", " ", "a", " ", "sanity", " ", "check", ".", " ", " ", "If", " ", "it", " ", "detect", "s", "\\", "10", ";", " ", " ", " ", " ", "'..", "'", " ", "in", " ", "the", " ", "path", " ", "it", " ", "will", " ", "raise", " ", "a", " ", "`", "Templa", "te", "Not", "Foun", "d", "`", " ", "error", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "piece_", "in_", "template_", "._", "split_", "(_", "'/'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "path_", "._", "sep_", "in_", "piece_", "or_", "(_", "path_", "._", "alts", "ep_", "and_", "path_", "._", "alts", "ep_", "in_", "piece_", ")_", "or_", "piece_", "==_", "path_", "._", "pardir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "piece_", "and_", "piece_", "!=_", "'.'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "piece_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pieces_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Base", "Loader_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", "class", " ", "for", " ", "all", " ", "load", "ers", ".", " ", " ", "Subc", "lass", " ", "this", " ", "and", " ", "override", " ", "`", "get", "\\u", "source", "`", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "implement", " ", "a", " ", "custom", " ", "load", "ing", " ", "mechanism", ".", " ", " ", "The", " ", "environ", "ment", " ", "provide", "s", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "`", "get", "\\u", "template", "`", " ", "method", " ", "tha", "t", " ", "calls", " ", "the", " ", "load", "er", "'", "s", " ", "`", "load", "`", " ", "method", " ", "to", " ", "get", " ", "the", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "Templa", "te", "`", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "very", " ", "basic", " ", "example", " ", "for", " ", "a", " ", "load", "er", " ", "tha", "t", " ", "look", "s", " ", "up", " ", "template", "s", " ", "on", " ", "the", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "system", " ", "coul", "d", " ", "look", " ", "like", " ", "this", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "jin", "ja", "2", " ", "import", " ", "Base", "Load", "er", ",", " ", "Templa", "te", "Not", "Foun", "d", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "os", ".", "path", " ", "import", " ", "join", ",", " ", "exist", "s", ",", " ", "getm", "time", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "My", "Load", "er", "(", "Base", "Load", "er", "):", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "\\u\\u", "init", "\\u\\u", "(", "self", ",", " ", "path", "):", "\\", "10", ";", " ", " ", " ", " ", "self", ".", "path", " ", "=", " ", "path", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "get", "\\u", "source", "(", "self", ",", " ", "environ", "ment", ",", " ", "template", "):", "\\", "10", ";", " ", " ", " ", " ", "path", " ", "=", " ", "join", "(", "self", ".", "path", ",", " ", "template", ")", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "not", " ", "exist", "s", "(", "path", "):", "\\", "10", ";", " ", " ", "raise", " ", "Templa", "te", "Not", "Foun", "d", "(", "template", ")", "\\", "10", ";", " ", " ", " ", " ", "mti", "me", " ", "=", " ", "getm", "time", "(", "path", ")", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "file", "(", "path", ")", " ", "as", " ", "f", ":", "\\", "10", ";", " ", " ", "source", " ", "=", " ", "f", ".", "read", "()", ".", "decode", "('", "utf", "-", "8", "')", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "source", ",", " ", "path", ",", " ", "lambda", ":", " ", "mti", "me", " ", "==", " ", "getm", "time", "(", "path", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "if", " ", "set", " ", "to", " ", "`", "Fal", "se", "`", " ", "it", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "load", "er", " ", "cann", "ot", " ", "provide", " ", "access_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "to", " ", "the", " ", "source", " ", "of", " ", "template", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "..", " ", "version", "adde", "d", "::", " ", "2.4", "_", "\\u\\u\\uNL\\u\\u\\u_", "has", "\\u", "source", "\\u", "access_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Loader_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "source_", "(_", "self_", ",_", "environment_", ",_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "template", " ", "source", ",", " ", "filename", " ", "and", " ", "relo", "ad", " ", "help", "er", " ", "for", " ", "a", " ", "template", ".", "\\", "10", ";", " ", " ", " ", " ", "It", "'", "s", " ", "pass", "ed", " ", "the", " ", "environ", "ment", " ", "and", " ", "template", " ", "name", " ", "and", " ", "has", " ", "to", " ", "return", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "tuple", " ", "in", " ", "the", " ", "form", " ", "``", "(", "source", ",", " ", "filename", ",", " ", "upto", "date", ")`", "`", " ", "or", " ", "raise", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "`", "Templa", "te", "Not", "Foun", "d", "`", " ", "error", " ", "if", " ", "it", " ", "can", "'", "t", " ", "locat", "e", " ", "the", " ", "template", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "source", " ", "part", " ", "of", " ", "the", " ", "return", "ed", " ", "tuple", " ", "must", " ", "be", " ", "the", " ", "source", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "template", " ", "as", " ", "unicode", " ", "string", " ", "or", " ", "a", " ", "ASCII", " ", "bytestr", "ing", ".", " ", " ", "The", " ", "filename", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "the", " ", "name", " ", "of", " ", "the", " ", "file", " ", "on", " ", "the", " ", "filesystem", " ", "if", " ", "it", " ", "was", " ", "load", "ed", " ", "from", " ", "there", ",", "\\", "10", ";", " ", " ", " ", " ", "other", "wis", "e", " ", "`", "Non", "e", "`.", " ", " ", "The", " ", "filename", " ", "is", " ", "used", " ", "by", " ", "python", " ", "for", " ", "the", " ", "traceback", "s", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "no", " ", "load", "er", " ", "extensi", "on", " ", "is", " ", "used", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "last", " ", "item", " ", "in", " ", "the", " ", "tuple", " ", "is", " ", "the", " ", "`", "upto", "date", "`", " ", "function", ".", " ", " ", "If", " ", "auto", "\\", "10", ";", " ", " ", " ", " ", "relo", "ading", " ", "is", " ", "enable", "d", " ", "it", "'", "s", " ", "alw", "ay", "s", " ", "call", "ed", " ", "to", " ", "check", " ", "if", " ", "the", " ", "template", "\\", "10", ";", " ", " ", " ", " ", "change", "d", ".", " ", " ", "No", " ", "argu", "ment", "s", " ", "are", " ", "pass", "ed", " ", "so", " ", "the", " ", "function", " ", "must", " ", "store", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "old", " ", "state", " ", "some", "where", " ", "(", "for", " ", "example", " ", "in", " ", "a", " ", "clos", "ure", ").", " ", " ", "If", " ", "it", " ", "return", "s", " ", "`", "Fal", "se", "`", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "template", " ", "will", " ", "be", " ", "reloade", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "has", "\\u", "source", "\\u", "access_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'%", "s", " ", "cann", "ot", " ", "provide", " ", "access", " ", "to", " ", "the", " ", "source", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Loader_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "\\u", "templates_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Iterat", "es", " ", "over", " ", "all", " ", "template", "s", ".", " ", " ", "If", " ", "the", " ", "load", "er", " ", "doe", "s", " ", "not", " ", "support", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "shou", "ld", " ", "raise", " ", "a", " ", ":", "exc", ":`", "Type", "Error", "`", " ", "whi", "ch", " ", "is", " ", "the", " ", "default", " ", "behavior", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Type", "Error_", "(_", "'", "this", " ", "load", "er", " ", "cann", "ot", " ", "iterate", " ", "over", " ", "all", " ", "template", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Loader_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "internal", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "load_", "(_", "self_", ",_", "environment_", ",_", "name_", ",_", "globals_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Load", "s", " ", "a", " ", "template", ".", " ", " ", "Thi", "s", " ", "method", " ", "look", "s", " ", "up", " ", "the", " ", "template", " ", "in", " ", "the", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "load", "s", " ", "one", " ", "by", " ", "calling", " ", ":", "meth", ":`", "get", "\\u", "source", "`.", " ", " ", "Subc", "lasse", "s", " ", "shou", "ld", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "override", " ", "this", " ", "method", " ", "as", " ", "load", "ers", " ", "working", " ", "on", " ", "collection", "s", " ", "of", " ", "other", "\\", "10", ";", " ", " ", " ", " ", "load", "ers", " ", "(", "suc", "h", " ", "as", " ", ":", "class", ":`", "Pref", "ix", "Load", "er", "`", " ", "or", " ", ":", "class", ":`", "Choi", "ce", "Load", "er", "`)", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "not", " ", "call", " ", "this", " ", "method", " ", "but", " ", "`", "get", "\\u", "source", "`", " ", "direct", "ly", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "globals_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "globals_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "we", " ", "try", " ", "to", " ", "get", " ", "the", " ", "source", " ", "for", " ", "this", " ", "template", " ", "together_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "the", " ", "filename", " ", "and", " ", "the", " ", "upto", "date", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "source_", ",_", "filename_", ",_", "upto", "date_", "=_", "self_", "._", "get", "\\u", "source_", "(_", "environment_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "to", " ", "load", " ", "the", " ", "code", " ", "from", " ", "the", " ", "bytecode", " ", "cache", " ", "if", " ", "there", " ", "is", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bytecode", " ", "cache", " ", "configur", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "bcc", "_", "=_", "environment_", "._", "bytecode", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "bcc", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bucket_", "=_", "bcc", "_", "._", "get", "\\u", "bucket_", "(_", "environment_", ",_", "name_", ",_", "filename_", ",_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code_", "=_", "bucket_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "have", " ", "code", " ", "so", " ", "far", " ", "(", "not", " ", "cache", "d", ",", " ", "no", " ", "long", "er", " ", "up", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "date", ")", " ", "etc", ".", " ", "we", " ", "compile", " ", "the", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "code_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "=_", "environment_", "._", "compile_", "(_", "source_", ",_", "name_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "bytecode", " ", "cache", " ", "is", " ", "avail", "able", " ", "and", " ", "the", " ", "bucket", " ", "doe", "sn", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "have", " ", "a", " ", "code", " ", "so", " ", "far", ",", " ", "we", " ", "give", " ", "the", " ", "bucket", " ", "the", " ", "new", " ", "code", " ", "and", " ", "put_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "back", " ", "to", " ", "the", " ", "bytecode", " ", "cache", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "bcc", "_", "is_", "not_", "None_", "and_", "bucket_", "._", "code_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bucket_", "._", "code_", "=_", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bcc", "_", "._", "set\\u", "bucket_", "(_", "bucket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "environment_", "._", "template", "\\u", "class_", "._", "from", "\\u", "code_", "(_", "environment_", ",_", "code_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "globals_", ",_", "upto", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "File", "System", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Load", "s", " ", "template", "s", " ", "from", " ", "the", " ", "file", " ", "system", ".", " ", " ", "Thi", "s", " ", "load", "er", " ", "can", " ", "find", " ", "template", "s", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "folder", "s", " ", "on", " ", "the", " ", "file", " ", "system", " ", "and", " ", "is", " ", "the", " ", "prefer", "red", " ", "way", " ", "to", " ", "load", " ", "them", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "load", "er", " ", "take", "s", " ", "the", " ", "path", " ", "to", " ", "the", " ", "template", "s", " ", "as", " ", "string", ",", " ", "or", " ", "if", " ", "multiple", "\\", "10", ";", " ", " ", " ", " ", "location", "s", " ", "are", " ", "want", "ed", " ", "a", " ", "list", " ", "of", " ", "them", " ", "whi", "ch", " ", "is", " ", "then", " ", "looke", "d", " ", "up", " ", "in", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "give", "n", " ", "order", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "load", "er", " ", "=", " ", "File", "System", "Load", "er", "('", "/", "path", "/", "to", "/", "template", "s", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "load", "er", " ", "=", " ", "File", "System", "Load", "er", "([", "'/", "path", "/", "to", "/", "template", "s", "',", " ", "'/", "other", "/", "path", "'])", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Per", " ", "default", " ", "the", " ", "template", " ", "encoding", " ", "is", " ", "``", "'", "utf", "-", "8", "'``", " ", "whi", "ch", " ", "can", " ", "be", " ", "change", "d", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "setti", "ng", " ", "the", " ", "`", "encoding", "`", " ", "parameter", " ", "to", " ", "somet", "hing", " ", "else", ".", "\\", "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_", "File", "System", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "search", "path_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "search", "path_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "path_", "=_", "[_", "search", "path_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "search", "path_", "=_", "list_", "(_", "search", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "encoding_", "=_", "encoding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "System", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "source_", "(_", "self_", ",_", "environment_", ",_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "=_", "split", "\\u", "template", "\\u", "path_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "search", "path_", "in_", "self_", "._", "search", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "path_", "._", "join_", "(_", "search", "path_", ",_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open", "\\u", "if", "\\u", "exists_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f_", "is_", "None_", ":_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contents_", "=_", "f_", "._", "read_", "(_", ")_", "._", "decode_", "(_", "self_", "._", "encoding_", ")_", "\\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 ", " _", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mtime_", "=_", "path_", "._", "getmtime_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "upto", "date_", "(_", ")_", ":_", "\\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_", "path_", "._", "getmtime_", "(_", "filename_", ")_", "==_", "mtime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", ":_", "\\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_", "contents_", ",_", "filename_", ",_", "upto", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "System", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "\\u", "templates_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "search", "path_", "in_", "self_", "._", "search", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "dirpath_", ",_", "dirnames_", ",_", "filenames_", "in_", "os_", "._", "walk_", "(_", "search", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "filename_", "in_", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "template_", "=_", "os_", "._", "path_", "._", "join_", "(_", "dirpath_", ",_", "filename_", ")_", "[_", "len_", "(_", "search", "path_", ")_", ":_", "]_", "._", "strip_", "(_", "os_", "._", "path_", "._", "sep_", ")_", "._", "replace_", "(_", "os_", "._", "path_", "._", "sep_", ",_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "template_", "[_", ":_", "2_", "]_", "==_", "'./'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "template_", "=_", "template_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "template_", "not_", "in_", "found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "found_", "._", "add_", "(_", "template_", ")_", "\\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_", "sorted_", "(_", "found_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Packa", "ge", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Load", " ", "template", "s", " ", "from", " ", "python", " ", "egg", "s", " ", "or", " ", "package", "s", ".", " ", " ", "It", " ", "is", " ", "construct", "ed", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "name", " ", "of", " ", "the", " ", "python", " ", "package", " ", "and", " ", "the", " ", "path", " ", "to", " ", "the", " ", "template", "s", " ", "in", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "package", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "load", "er", " ", "=", " ", "Packa", "ge", "Load", "er", "('", "mypa", "ckage", "',", " ", "'", "views", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "package", " ", "path", " ", "is", " ", "not", " ", "give", "n", ",", " ", "``", "'", "template", "s", "'``", " ", "is", " ", "assume", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Per", " ", "default", " ", "the", " ", "template", " ", "encoding", " ", "is", " ", "``", "'", "utf", "-", "8", "'``", " ", "whi", "ch", " ", "can", " ", "be", " ", "change", "d", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "setti", "ng", " ", "the", " ", "`", "encoding", "`", " ", "parameter", " ", "to", " ", "somet", "hing", " ", "else", ".", " ", " ", "Du", "e", " ", "to", " ", "the", " ", "natur", "e", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "egg", "s", " ", "it", "'", "s", " ", "only", " ", "possib", "le", " ", "to", " ", "relo", "ad", " ", "template", "s", " ", "if", " ", "the", " ", "package", " ", "was", " ", "load", "ed", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "the", " ", "file", " ", "system", " ", "and", " ", "not", " ", "a", " ", "zip", " ", "file", ".", "\\", "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_", "Packa", "ge", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "package", "\\u", "name_", ",_", "package", "\\u", "path_", "=_", "'", "template", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "pkg", "\\u", "resources_", "import_", "Default", "Provider_", ",_", "Reso", "urc", "e", "Manager_", ",_", "get", "\\u", "provider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provider_", "=_", "get", "\\u", "provider_", "(_", "package", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "encoding_", "=_", "encoding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "manager_", "=_", "Reso", "urc", "e", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "filesystem", "\\u", "bound_", "=_", "isinstance_", "(_", "provider_", ",_", "Default", "Provider_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "provider_", "=_", "provider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "package", "\\u", "path_", "=_", "package", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Packa", "ge", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "source_", "(_", "self_", ",_", "environment_", ",_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "=_", "split", "\\u", "template", "\\u", "path_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "'/'_", "._", "join_", "(_", "(_", "self_", "._", "package", "\\u", "path_", ",_", ")_", "+_", "tuple_", "(_", "pieces_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "provider_", "._", "has", "\\u", "resource_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "filename_", "=_", "upto", "date_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "filesystem", "\\u", "bound_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "self_", "._", "provider_", "._", "get", "\\u", "resource", "\\u", "filename_", "(_", "self_", "._", "manager_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mtime_", "=_", "path_", "._", "getmtime_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "upto", "date_", "(_", ")_", ":_", "\\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_", "path_", "._", "getmtime_", "(_", "filename_", ")_", "==_", "mtime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "source_", "=_", "self_", "._", "provider_", "._", "get", "\\u", "resource", "\\u", "string_", "(_", "self_", "._", "manager_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "source_", "._", "decode_", "(_", "self_", "._", "encoding_", ")_", ",_", "filename_", ",_", "upto", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Packa", "ge", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "\\u", "templates_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "self_", "._", "package", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "path_", "[_", ":_", "2_", "]_", "==_", "'./'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "path_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "path_", "==_", "'.'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "offset_", "=_", "len_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "walk_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "filename_", "in_", "self_", "._", "provider_", "._", "resource", "\\u", "listdir_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fullname_", "=_", "path_", "+_", "'/'_", "+_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "provider_", "._", "resource", "\\u", "isdir_", "(_", "fullname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "\\u", "walk_", "(_", "fullname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "results_", "._", "append_", "(_", "fullname_", "[_", "offset_", ":_", "]_", "._", "lstrip_", "(_", "'/'_", ")_", ")_", "\\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", "walk_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Dict", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Load", "s", " ", "a", " ", "template", " ", "from", " ", "a", " ", "python", " ", "dict", ".", " ", " ", "It", "'", "s", " ", "pass", "ed", " ", "a", " ", "dict", " ", "of", " ", "unicode", "\\", "10", ";", " ", " ", " ", " ", "string", "s", " ", "bound", " ", "to", " ", "template", " ", "names", ".", " ", " ", "Thi", "s", " ", "load", "er", " ", "is", " ", "usef", "ul", " ", "for", " ", "unittest", "ing", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "load", "er", " ", "=", " ", "Dict", "Load", "er", "({", "'", "index", ".", "html", "':", " ", "'", "source", " ", "here", "'})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Be", "caus", "e", " ", "auto", " ", "relo", "ading", " ", "is", " ", "rare", "ly", " ", "usef", "ul", " ", "this", " ", "is", " ", "disable", "d", " ", "per", " ", "default", ".", "\\", "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_", "Dict", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mapping_", "=_", "mapping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "source_", "(_", "self_", ",_", "environment_", ",_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "template_", "in_", "self_", "._", "mapping_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "=_", "self_", "._", "mapping_", "[_", "template_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "source_", ",_", "None_", ",_", "lambda_", ":_", "source_", "!=_", "self_", "._", "mapping_", "._", "get_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "\\u", "templates_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "sorted_", "(_", "self_", "._", "mapping_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Function", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "load", "er", " ", "tha", "t", " ", "is", " ", "pass", "ed", " ", "a", " ", "function", " ", "whi", "ch", " ", "doe", "s", " ", "the", " ", "load", "ing", ".", " ", " ", "The", "\\", "10", ";", " ", " ", " ", " ", "function", " ", "bec", "ome", "s", " ", "the", " ", "name", " ", "of", " ", "the", " ", "template", " ", "pass", "ed", " ", "and", " ", "has", " ", "to", " ", "return", " ", "eit", "her", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "unicode", " ", "string", " ", "with", " ", "the", " ", "template", " ", "source", ",", " ", "a", " ", "tuple", " ", "in", " ", "the", " ", "form", " ", "``", "(", "source", ",", "\\", "10", ";", " ", " ", " ", " ", "filename", ",", " ", "upto", "datef", "unc", ")`", "`", " ", "or", " ", "`", "Non", "e", "`", " ", "if", " ", "the", " ", "template", " ", "doe", "s", " ", "not", " ", "exist", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "def", " ", "load", "\\u", "template", "(", "name", "):", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "if", " ", "name", " ", "==", " ", "'", "index", ".", "html", "':", "\\", "10", ";", " ", " ", " ", " ", "...", " ", " ", " ", " ", " ", "return", " ", "'...", "'", "\\", "10", ";", " ", " ", " ", " ", "...", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "load", "er", " ", "=", " ", "Function", "Load", "er", "(", "load", "\\u", "template", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "`", "upto", "datef", "unc", "`", " ", "is", " ", "a", " ", "function", " ", "tha", "t", " ", "is", " ", "call", "ed", " ", "if", " ", "autore", "load", " ", "is", " ", "enable", "d", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "has", " ", "to", " ", "return", " ", "`", "Tru", "e", "`", " ", "if", " ", "the", " ", "template", " ", "is", " ", "still", " ", "up", " ", "to", " ", "date", ".", " ", " ", "For", " ", "more", "\\", "10", ";", " ", " ", " ", " ", "deta", "il", "s", " ", "have", " ", "a", " ", "look", " ", "at", " ", ":", "meth", ":`", "Base", "Load", "er", ".", "get", "\\u", "source", "`", " ", "whi", "ch", " ", "has", " ", "the", " ", "same", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Function", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "load", "\\u", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "load", "\\u", "func_", "=_", "load", "\\u", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Function", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "source_", "(_", "self_", ",_", "environment_", ",_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", "=_", "self_", "._", "load", "\\u", "func_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rv_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "rv_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rv_", ",_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "rv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Pref", "ix", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "load", "er", " ", "tha", "t", " ", "is", " ", "pass", "ed", " ", "a", " ", "dict", " ", "of", " ", "load", "ers", " ", "where", " ", "each", " ", "load", "er", " ", "is", " ", "bound", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "a", " ", "prefix", ".", " ", " ", "The", " ", "prefix", " ", "is", " ", "delim", "ited", " ", "from", " ", "the", " ", "template", " ", "by", " ", "a", " ", "slash", " ", "per", "\\", "10", ";", " ", " ", " ", " ", "default", ",", " ", "whi", "ch", " ", "can", " ", "be", " ", "change", "d", " ", "by", " ", "setti", "ng", " ", "the", " ", "`", "delimiter", "`", " ", "argu", "ment", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "somet", "hing", " ", "else", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "load", "er", " ", "=", " ", "Pref", "ix", "Load", "er", "({", "\\", "10", ";", " ", " ", " ", " ", "'", "app", "1", "':", " ", "Packa", "ge", "Load", "er", "('", "mypa", "ckage", ".", "app", "1", "')", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "app", "2", "':", " ", "Packa", "ge", "Load", "er", "('", "mypa", "ckage", ".", "app", "2", "')", "\\", "10", ";", " ", " ", " ", " ", "})", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "By", " ", "load", "ing", " ", "``", "'", "app", "1", "/", "index", ".", "html", "'``", " ", "the", " ", "file", " ", "from", " ", "the", " ", "app", "1", " ", "package", " ", "is", " ", "load", "ed", ",", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "load", "ing", " ", "``", "'", "app", "2", "/", "index", ".", "html", "'``", " ", "the", " ", "file", " ", "from", " ", "the", " ", "second", ".", "\\", "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_", "Pref", "ix", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "mapping_", ",_", "delimiter_", "=_", "'/'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mapping_", "=_", "mapping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delimiter_", "=_", "delimiter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pref", "ix", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "source_", "(_", "self_", ",_", "environment_", ",_", "template_", ")_", ":_", "\\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 ", " _", "prefix_", ",_", "name_", "=_", "template_", "._", "split_", "(_", "self_", "._", "delimiter_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "=_", "self_", "._", "mapping_", "[_", "prefix_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Value", "Error_", ",_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "loader_", "._", "get", "\\u", "source_", "(_", "environment_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Templa", "te", "Not", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "re", "-", "raise", " ", "the", " ", "exception", " ", "with", " ", "the", " ", "correct", " ", "file", "ame", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "the", " ", "one", " ", "tha", "t", " ", "include", "s", " ", "the", " ", "prefix", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pref", "ix", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "\\u", "templates_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "prefix_", ",_", "loader_", "in_", "self_", "._", "mapping_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "template_", "in_", "loader_", "._", "list", "\\u", "templates_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "prefix_", "+_", "self_", "._", "delimiter_", "+_", "template_", ")_", "\\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]_", "module_", "\\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_", "Choi", "ce", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "load", "er", " ", "works", " ", "like", " ", "the", " ", "`", "Pref", "ix", "Load", "er", "`", " ", "just", " ", "tha", "t", " ", "no", " ", "prefix", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "specified", ".", " ", " ", "If", " ", "a", " ", "template", " ", "coul", "d", " ", "not", " ", "be", " ", "found", " ", "by", " ", "one", " ", "load", "er", " ", "the", " ", "next", " ", "one", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "trie", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "load", "er", " ", "=", " ", "Choi", "ce", "Load", "er", "([", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "File", "System", "Load", "er", "('", "/", "path", "/", "to", "/", "user", "/", "template", "s", "')", ",", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "File", "System", "Load", "er", "('", "/", "path", "/", "to", "/", "system", "/", "template", "s", "')", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "])", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "usef", "ul", " ", "if", " ", "you", " ", "want", " ", "to", " ", "allow", " ", "users", " ", "to", " ", "override", " ", "bui", "lti", "n", " ", "template", "s", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "a", " ", "different", " ", "location", ".", "\\", "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_", "Choi", "ce", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "loaders_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "loaders_", "=_", "loaders_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Choi", "ce", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "source_", "(_", "self_", ",_", "environment_", ",_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "loader_", "in_", "self_", "._", "loaders_", ":_", "\\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_", "loader_", "._", "get", "\\u", "source_", "(_", "environment_", ",_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Templa", "te", "Not", "Found_", ":_", "\\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_", "raise_", "Templa", "te", "Not", "Found_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Choi", "ce", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "\\u", "templates_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "loader_", "in_", "self_", "._", "loaders_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "._", "update_", "(_", "loader_", "._", "list", "\\u", "templates_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sorted_", "(_", "found_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Templa", "te", "Module_", "(_", "Modul", "e", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Lik", "e", " ", "a", " ", "normal", " ", "module", " ", "but", " ", "with", " ", "support", " ", "for", " ", "weak", " ", "reference", "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_", "class_", "Modul", "e", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "load", "er", " ", "load", "s", " ", "template", "s", " ", "from", " ", "precom", "pile", "d", " ", "template", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ple", " ", "usage", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "load", "er", " ", "=", " ", "Choi", "ce", "Load", "er", "([", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "Modul", "e", "Load", "er", "('", "/", "path", "/", "to", "/", "compile", "d", "/", "template", "s", "')", ",", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "File", "System", "Load", "er", "('", "/", "path", "/", "to", "/", "template", "s", "')", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "])", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Templa", "tes", " ", "can", " ", "be", " ", "precom", "pile", "d", " ", "with", " ", ":", "meth", ":`", "Environ", "ment", ".", "compile", "\\u", "template", "s", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "has", "\\u", "source", "\\u", "access_", "=_", "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_", "[SEP]_", "class_", "Modul", "e", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package", "\\u", "name_", "=_", "'\\u", "jin", "ja", "2", "\\u", "module", "\\u", "template", "s", "\\u", "%", "x", "'_", "%_", "id_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "fake", " ", "module", " ", "tha", "t", " ", "look", "s", " ", "for", " ", "the", " ", "template", "s", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "path", " ", "give", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "mod_", "=_", "\\u", "Templa", "te", "Module_", "(_", "package", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "path_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "[_", "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 ", " _", "path_", "=_", "list_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mod_", "._", "\\u\\u", "path\\u\\u_", "=_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "modules_", "[_", "package", "\\u", "name_", "]_", "=_", "weakref_", "._", "proxy_", "(_", "mod_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "x_", ":_", "sys_", "._", "modules_", "._", "pop_", "(_", "package", "\\u", "name_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "only", " ", "strong", " ", "reference", ",", " ", "the", " ", "sys", ".", "module", "s", " ", "entry", " ", "is", " ", "weak", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "tha", "t", " ", "the", " ", "gar", "bage", " ", "collect", "or", " ", "can", " ", "remove", " ", "it", " ", "onc", "e", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", "er", " ", "tha", "t", " ", "created", " ", "it", " ", "go", "es", " ", "out", " ", "of", " ", "business", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "module_", "=_", "mod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "package", "\\u", "name_", "=_", "package", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "template", "\\u", "key_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "tmpl", "\\u'_", "+_", "sha1_", "(_", "name_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "module", "\\u", "filename_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Modul", "e", "Loader_", "._", "get", "\\u", "template", "\\u", "key_", "(_", "name_", ")_", "+_", "'.", "py", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "internal", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "load_", "(_", "self_", ",_", "environment_", ",_", "name_", ",_", "globals_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "get", "\\u", "template", "\\u", "key_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "=_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "self_", "._", "package", "\\u", "name_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "=_", "getattr_", "(_", "self_", "._", "module_", ",_", "module_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mod_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mod_", "=_", "\\u\\u", "import\\u\\u_", "(_", "module_", ",_", "None_", ",_", "None_", ",_", "[_", "'", "root", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Templa", "te", "Not", "Found_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", " ", "the", " ", "entry", " ", "from", " ", "sys", ".", "module", "s", ",", " ", "we", " ", "only", " ", "want", " ", "the", " ", "attribute_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "the", " ", "module", " ", "object", " ", "we", " ", "have", " ", "store", "d", " ", "on", " ", "the", " ", "load", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "modules_", "._", "pop_", "(_", "module_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "environment_", "._", "template", "\\u", "class_", "._", "from", "\\u", "module", "\\u", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "environment_", ",_", "mod_", "._", "\\u\\u", "dict\\u\\u_", ",_", "globals_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
cemoody/lda2vec/examples/twenty_newsgroups/data/preprocess.py
[ { "content": "# Author: Chris Moody <chrisemoody@gmail.com>\n# License: MIT\n\n# This simple example loads the newsgroups data from sklearn\n# and train an LDA-like model on it\nimport logging\nimport pickle\n\nfrom sklearn.datasets import fetch_20newsgroups\nimport numpy as np\n\nfrom lda2vec import preprocess, Corpus\n\nlogging.basicConfig()\n\n# Fetch data\nremove = ('headers', 'footers', 'quotes')\ntexts = fetch_20newsgroups(subset='train', remove=remove).data\n# Remove tokens with these substrings\nbad = set([\"ax>\", '`@(\"', '---', '===', '^^^'])\n\n\n\n# Preprocess data\nmax_length = 10000 # Limit of 10k words per document\n# Convert to unicode (spaCy only works with unicode)\ntexts = [unicode(clean(d)) for d in texts]\ntokens, vocab = preprocess.tokenize(texts, max_length, merge=True,\n n_threads=4)\ncorpus = Corpus()\n# Make a ranked list of rare vs frequent words\ncorpus.update_word_count(tokens)\ncorpus.finalize()\n# The tokenization uses spaCy indices, and so may have gaps\n# between indices for words that aren't present in our dataset.\n# This builds a new compact index\ncompact = corpus.to_compact(tokens)\n# Remove extremely rare words\npruned = corpus.filter_count(compact, min_count=30)\n# Convert the compactified arrays into bag of words arrays\nbow = corpus.compact_to_bow(pruned)\n# Words tend to have power law frequency, so selectively\n# downsample the most prevalent words\nclean = corpus.subsample_frequent(pruned)\n# Now flatten a 2D array of document per row and word position\n# per column to a 1D array of words. This will also remove skips\n# and OoV words\ndoc_ids = np.arange(pruned.shape[0])\nflattened, (doc_ids,) = corpus.compact_to_flat(pruned, doc_ids)\nassert flattened.min() >= 0\n# Fill in the pretrained word vectors\nn_dim = 300\nvectors = np.random.randn((flattened.max() + 1, n_dim)) * 0.1331\nfn_wordvc = 'GoogleNews-vectors-negative300.bin'\nvectors, s, f = corpus.compact_word_vectors(vocab, filename=fn_wordvc,\n use_spacy=False)\n# Save all of the preprocessed files\npickle.dump(vocab, open('vocab.pkl', 'w'))\npickle.dump(corpus, open('corpus.pkl', 'w'))\nnp.save(\"flattened\", flattened)\nnp.save(\"doc_ids\", doc_ids)\nnp.save(\"pruned\", pruned)\nnp.save(\"bow\", bow)\nnp.save(\"vectors\", vectors)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "vectors ", "start_line": 54, "start_column": 0, "end_line": 54, "end_column": 7 } ]
[ { "span": "vectors,", "start_line": 56, "start_column": 0, "end_line": 56, "end_column": 7 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Author", ":", " ", "Chr", "is", " ", "Moo", "dy", " ", "<", "chris", "emo", "ody", "@", "gma", "il", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", "MIT", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "simple", " ", "example", " ", "load", "s", " ", "the", " ", "news", "group", "s", " ", "data", " ", "from", " ", "sklearn_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "train", " ", "an", " ", "LDA", "-", "like", " ", "model", " ", "on", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sklearn_", "._", "datasets_", "import_", "fetch", "\\u", "20", "news", "groups_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lda", "2v", "ec_", "import_", "preprocess_", ",_", "Corpus_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fe", "tch", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "remove_", "=_", "(_", "'", "header", "s", "'_", ",_", "'", "footer", "s", "'_", ",_", "'", "quote", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "texts_", "=_", "fetch", "\\u", "20", "news", "groups_", "(_", "subset_", "=_", "'", "train", "'_", ",_", "remove_", "=_", "remove_", ")_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "token", "s", " ", "with", " ", "these", " ", "substring", "s_", "\\u\\u\\uNL\\u\\u\\u_", "bad_", "=_", "set_", "(_", "[_", "\"", "ax", ">\"_", ",_", "'`", "@(", "\"'_", ",_", "'---", "'_", ",_", "'===", "'_", ",_", "'", "^", "^", "^", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Preprocess", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "max", "\\u", "length_", "=_", "10000_", "#", " ", "Limit", " ", "of", " ", "10", "k", " ", "words", " ", "per", " ", "document_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Convert", " ", "to", " ", "unicode", " ", "(", "spa", "Cy", " ", "only", " ", "works", " ", "with", " ", "unicode", ")_", "\\u\\u\\uNL\\u\\u\\u_", "texts_", "=_", "[_", "unicode_", "(_", "clean_", "(_", "d_", ")_", ")_", "for_", "d_", "in_", "texts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", ",_", "vocab_", "=_", "preprocess_", "._", "tokenize_", "(_", "texts_", ",_", "max", "\\u", "length_", ",_", "merge_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "threads_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corpus_", "=_", "Corpus_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "a", " ", "ranked", " ", "list", " ", "of", " ", "rare", " ", "vs", " ", "frequent", " ", "words_", "\\u\\u\\uNL\\u\\u\\u_", "corpus_", "._", "update", "\\u", "word", "\\u", "count_", "(_", "tokens_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corpus_", "._", "finalize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "tokeni", "zatio", "n", " ", "use", "s", " ", "spa", "Cy", " ", "indice", "s", ",", " ", "and", " ", "so", " ", "may", " ", "have", " ", "gaps_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bet", "ween", " ", "indice", "s", " ", "for", " ", "words", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "presen", "t", " ", "in", " ", "our", " ", "dataset", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "builds", " ", "a", " ", "new", " ", "compact", " ", "index_", "\\u\\u\\uNL\\u\\u\\u_", "compact_", "=_", "corpus_", "._", "to", "\\u", "compact_", "(_", "tokens_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "extreme", "ly", " ", "rare", " ", "words_", "\\u\\u\\uNL\\u\\u\\u_", "pruned", "_", "=_", "corpus_", "._", "filter", "\\u", "count_", "(_", "compact_", ",_", "min", "\\u", "count_", "=_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Convert", " ", "the", " ", "compact", "ified", " ", "arrays", " ", "int", "o", " ", "bag", " ", "of", " ", "words", " ", "arrays_", "\\u\\u\\uNL\\u\\u\\u_", "bow_", "=_", "corpus_", "._", "compact", "\\u", "to", "\\u", "bow_", "(_", "pruned", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Word", "s", " ", "tend", " ", "to", " ", "have", " ", "power", " ", "law", " ", "freque", "nc", "y", ",", " ", "so", " ", "selecti", "vel", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "downsample", " ", "the", " ", "most", " ", "prev", "alen", "t", " ", "words_", "\\u\\u\\uNL\\u\\u\\u_", "clean_", "=_", "corpus_", "._", "subsample", "\\u", "frequent", "_", "(_", "pruned", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "flat", "ten", " ", "a", " ", "2", "D", " ", "array", " ", "of", " ", "document", " ", "per", " ", "row", " ", "and", " ", "word", " ", "position_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "per", " ", "column", " ", "to", " ", "a", " ", "1", "D", " ", "array", " ", "of", " ", "words", ".", " ", "Thi", "s", " ", "will", " ", "als", "o", " ", "remove", " ", "skips", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "Oo", "V", " ", "words_", "\\u\\u\\uNL\\u\\u\\u_", "doc", "\\u", "ids_", "=_", "np_", "._", "arange_", "(_", "pruned", "_", "._", "shape_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flattened", "_", ",_", "(_", "doc", "\\u", "ids_", ",_", ")_", "=_", "corpus_", "._", "compact", "\\u", "to", "\\u", "flat_", "(_", "pruned", "_", ",_", "doc", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "flattened", "_", "._", "min_", "(_", ")_", ">=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fil", "l", " ", "in", " ", "the", " ", "pretrained", " ", "word", " ", "vectors_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "dim_", "=_", "300_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vectors_", "=_", "np_", "._", "random_", "._", "randn_", "(_", "(_", "flattened", "_", "._", "max_", "(_", ")_", "+_", "1_", ",_", "n", "\\u", "dim_", ")_", ")_", "*_", "0.13", "31_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fn", "\\u", "word", "vc_", "=_", "'", "Goo", "gle", "News", "-", "vector", "s", "-", "negati", "ve", "300", ".", "bin", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vectors_", ",_", "s_", ",_", "f_", "=_", "corpus_", "._", "compact", "\\u", "word", "\\u", "vectors_", "(_", "vocab_", ",_", "filename_", "=_", "fn", "\\u", "word", "vc_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "spac", "y_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Save", " ", "all", " ", "of", " ", "the", " ", "preprocessed", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "pickle_", "._", "dump_", "(_", "vocab_", ",_", "open_", "(_", "'", "vocab", ".", "pkl", "'_", ",_", "'", "w", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pickle_", "._", "dump_", "(_", "corpus_", ",_", "open_", "(_", "'", "corp", "us", ".", "pkl", "'_", ",_", "'", "w", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "save_", "(_", "\"", "flattened", "\"_", ",_", "flattened", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "save_", "(_", "\"", "doc", "\\u", "ids", "\"_", ",_", "doc", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_",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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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
yajiemiao/pdnn/models/cnn_sat.py
[ { "content": "# Copyright 2014 Yajie Miao Carnegie Mellon University\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\n# WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\n# MERCHANTABLITY OR NON-INFRINGEMENT.\n# See the Apache 2 License for the specific language governing permissions and\n# limitations under the License.\n\nimport cPickle\nimport gzip\nimport os\nimport sys\nimport time\nimport collections\n\nimport numpy\nimport json\n\nimport theano\nimport theano.tensor as T\nfrom theano.tensor.signal import downsample\nfrom theano.tensor.nnet import conv\n\nfrom layers.logistic_sgd import LogisticRegression\nfrom layers.mlp import HiddenLayer\n\nfrom layers.conv import ConvLayer, ConvLayerForward\nfrom dnn import DNN\nfrom cnn import CNN\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CNN_SAT(object):\n\n", "metadata": "root.CNN_SAT", "header": "['module', '___EOS___']", "index": 37 }, { "content": " def __init__(self, numpy_rng, theano_rng=None, cfg_si = None, cfg_adapt = None, testing = False):\n\n # allocate symbolic variables for the data\n self.x = T.matrix('x')\n self.y = T.ivector('y')\n\n # we assume that i-vectors are appended to speech features in a frame-wise manner \n cnn_input_shape = cfg_si.conv_layer_configs[0]['input_shape']\n self.feat_dim = cnn_input_shape[-1] * cnn_input_shape[-2] * cnn_input_shape[-3]\n self.ivec_dim = cfg_adapt.n_ins\n\n self.iv = self.x[:,self.feat_dim:self.feat_dim+self.ivec_dim]\n self.feat = self.x[:,0:self.feat_dim]\n\n self.params = []\n self.delta_params = []\n\n # the i-vector network\n dnn_adapt = DNN(numpy_rng=numpy_rng, theano_rng = theano_rng, cfg = cfg_adapt, input = self.iv)\n self.dnn_adapt = dnn_adapt\n \n # the final output layer which has the same dimension as the input features\n linear_func = lambda x: x\n adapt_output_layer = HiddenLayer(rng=numpy_rng,\n input=dnn_adapt.layers[-1].output,\n n_in=cfg_adapt.hidden_layers_sizes[-1],\n n_out=self.feat_dim,\n activation=linear_func)\n dnn_adapt.layers.append(adapt_output_layer)\n dnn_adapt.params.extend(adapt_output_layer.params)\n dnn_adapt.delta_params.extend(adapt_output_layer.delta_params)\n\n\n # construct the cnn architecture\n cnn_si = CNN(numpy_rng=numpy_rng, theano_rng = theano_rng, cfg = cfg_si, input = self.feat + dnn_adapt.layers[-1].output)\n self.cnn_si = cnn_si\n\n # construct a function that implements one step of finetunining\n # compute the cost for second phase of training,\n # defined as the negative log likelihood\n self.finetune_cost = cnn_si.fc_dnn.logLayer.negative_log_likelihood(self.y)\n self.errors = cnn_si.fc_dnn.logLayer.errors(self.y)", "metadata": "root.CNN_SAT.__init__", "header": "['class', 'CNN_SAT', '(', 'object', ')', ':', '___EOS___']", "index": 39 }, { "content": " def build_finetune_functions(self, train_shared_xy, valid_shared_xy, batch_size):\n\n (train_set_x, train_set_y) = train_shared_xy\n (valid_set_x, valid_set_y) = valid_shared_xy\n\n index = T.lscalar('index') # index to a [mini]batch\n learning_rate = T.fscalar('learning_rate')\n momentum = T.fscalar('momentum')\n\n # compute the gradients with respect to the model parameters\n gparams = T.grad(self.finetune_cost, self.params)\n\n # compute list of fine-tuning updates\n updates = collections.OrderedDict()\n for dparam, gparam in zip(self.delta_params, gparams):\n updates[dparam] = momentum * dparam - gparam*learning_rate\n for dparam, param in zip(self.delta_params, self.params):\n updates[param] = param + updates[dparam]\n\n train_fn = theano.function(inputs=[index, theano.Param(learning_rate, default = 0.0001),\n theano.Param(momentum, default = 0.5)],\n outputs=self.errors,\n updates=updates,\n givens={\n self.x: train_set_x[index * batch_size:\n (index + 1) * batch_size],\n\t\tself.y: train_set_y[index * batch_size:\n\t\t\t (index + 1) * batch_size]})\n\n valid_fn = theano.function(inputs=[index],\n outputs=self.errors,\n givens={\n self.x: valid_set_x[index * batch_size:\n (index + 1) * batch_size],\n\t\tself.y: valid_set_y[index * batch_size:\n\t\t\t (index + 1) * batch_size]})\n\n return train_fn, valid_fn", "metadata": "root.CNN_SAT.build_finetune_functions", "header": "['class', 'CNN_SAT', '(', 'object', ')', ':', '___EOS___']", "index": 82 } ]
[ { "span": "import cPickle", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 14 }, { "span": "import gzip", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 11 }, { "span": "import os", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 9 }, { "span": "import sys", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 10 }, { "span": "import time", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 11 }, { "span": "import numpy", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 12 }, { "span": "import json", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 11 }, { "span": "from theano.tensor.signal import downsample", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 43 }, { "span": "from theano.tensor.nnet import conv", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 35 }, { "span": "from layers.logistic_sgd import LogisticRegression", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 50 }, { "span": "from layers.conv import ConvLayer, ConvLayerForward", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2014", " ", " ", " ", " ", "Ya", "jie", " ", "Mi", "ao", " ", " ", " ", " ", "Car", "neg", "ie", " ", "Mel", "lon", " ", "Univers", "ity_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "CODE", " ", "IS", " ", "PROVI", "DED", " ", "*", "AS", " ", "IS", "*", " ", "BAS", "IS", ",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "KIND", ",", " ", "EI", "THER", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "WITH", "OUT", " ", "LIMIT", "ATION", " ", "ANY", " ", "IMPL", "IED", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "TIT", "LE", ",", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "LIT", "Y", " ", "OR", " ", "NON", "-", "INF", "RING", "EME", "NT", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "Ap", "ache", " ", "2", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "c", "Pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gzip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "theano_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "theano_", "._", "tensor_", "as_", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "tensor_", "._", "signal_", "import_", "downsample", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "tensor_", "._", "nnet", "_", "import_", "conv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "layers_", "._", "logistic", "\\u", "sgd", "_", "import_", "Logi", "stic", "Regression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "layers_", "._", "mlp", "_", "import_", "Hi", "dde", "n", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "layers_", "._", "conv_", "import_", "Conv", "Layer_", ",_", "Conv", "Layer", "Forward_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dnn", "_", "import_", "DNN", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cnn_", "import_", "CNN", "_", "\\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_", "CNN", "\\u", "SAT", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "CNN", "\\u", "SAT", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "nump", "y", "\\u", "rng_", ",_", "theano", "\\u", "rng_", "=_", "None_", ",_", "cfg", "\\u", "si_", "=_", "None_", ",_", "cfg", "\\u", "adapt", "_", "=_", "None_", ",_", "testing_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "allocate", " ", "symbolic", " ", "variab", "les", " ", "for", " ", "the", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "x_", "=_", "T_", "._", "matrix_", "(_", "'", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "y_", "=_", "T_", "._", "ive", "ctor_", "(_", "'", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "assume", " ", "tha", "t", " ", "i", "-", "vector", "s", " ", "are", " ", "append", "ed", " ", "to", " ", "spe", "ech", " ", "features", " ", "in", " ", "a", " ", "frame", "-", "wis", "e", " ", "manner", " _", "\\u\\u\\uNL\\u\\u\\u_", "cnn", "\\u", "input", "\\u", "shape_", "=_", "cfg", "\\u", "si_", "._", "conv", "\\u", "layer", "\\u", "configs_", "[_", "0_", "]_", "[_", "'", "input", "\\u", "shape", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "feat", "\\u", "dim_", "=_", "cnn", "\\u", "input", "\\u", "shape_", "[_", "-_", "1_", "]_", "*_", "cnn", "\\u", "input", "\\u", "shape_", "[_", "-_", "2_", "]_", "*_", "cnn", "\\u", "input", "\\u", "shape_", "[_", "-_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ive", "c\\u", "dim_", "=_", "cfg", "\\u", "adapt", "_", "._", "n", "\\u", "ins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "iv_", "=_", "self_", "._", "x_", "[_", ":_", ",_", "self_", "._", "feat", "\\u", "dim_", ":_", "self_", "._", "feat", "\\u", "dim_", "+_", "self_", "._", "ive", "c\\u", "dim_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "feat_", "=_", "self_", "._", "x_", "[_", ":_", ",_", "0_", ":_", "self_", "._", "feat", "\\u", "dim_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delta", "\\u", "params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "i", "-", "vector", " ", "network_", "\\u\\u\\uNL\\u\\u\\u_", "dnn", "\\u", "adapt", "_", "=_", "DNN", "_", "(_", "nump", "y", "\\u", "rng_", "=_", "nump", "y", "\\u", "rng_", ",_", "theano", "\\u", "rng_", "=_", "theano", "\\u", "rng_", ",_", "cfg_", "=_", "cfg", "\\u", "adapt", "_", ",_", "input_", "=_", "self_", "._", "iv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dnn", "\\u", "adapt", "_", "=_", "dnn", "\\u", "adapt", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "final", " ", "output", " ", "layer", " ", "whi", "ch", " ", "has", " ", "the", " ", "same", " ", "dimension", " ", "as", " ", "the", " ", "input", " ", "features_", "\\u\\u\\uNL\\u\\u\\u_", "linear", "\\u", "func_", "=_", "lambda_", "x_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapt", "\\u", "output", "\\u", "layer_", "=_", "Hi", "dde", "n", "Layer_", "(_", "rng_", "=_", "nump", "y", "\\u", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input_", "=_", "dnn", "\\u", "adapt", "_", "._", "layers_", "[_", "-_", "1_", "]_", "._", "output_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "in_", "=_", "cfg", "\\u", "adapt", "_", "._", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "[_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "out_", "=_", "self_", "._", "feat", "\\u", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "activation_", "=_", "linear", "\\u", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dnn", "\\u", "adapt", "_", "._", "layers_", "._", "append_", "(_", "adapt", "\\u", "output", "\\u", "layer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dnn", "\\u", "adapt", "_", "._", "params_", "._", "extend_", "(_", "adapt", "\\u", "output", "\\u", "layer_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dnn", "\\u", "adapt", "_", "._", "delta", "\\u", "params_", "._", "extend_", "(_", "adapt", "\\u", "output", "\\u", "layer_", "._", "delta", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "construct", " ", "the", " ", "cnn", " ", "architecture_", "\\u\\u\\uNL\\u\\u\\u_", "cnn", "\\u", "si_", "=_", "CNN", "_", "(_", "nump", "y", "\\u", "rng_", "=_", "nump", "y", "\\u", "rng_", ",_", "theano", "\\u", "rng_", "=_", "theano", "\\u", "rng_", ",_", "cfg_", "=_", "cfg", "\\u", "si_", ",_", "input_", "=_", "self_", "._", "feat_", "+_", "dnn", "\\u", "adapt", "_", "._", "layers_", "[_", "-_", "1_", "]_", "._", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cnn", "\\u", "si_", "=_", "cnn", "\\u", "si_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "construct", " ", "a", " ", "function", " ", "tha", "t", " ", "implement", "s", " ", "one", " ", "step", " ", "of", " ", "fine", "tun", "inin", "g_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "the", " ", "cost", " ", "for", " ", "second", " ", "phase", " ", "of", " ", "train", "ing", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "ed", " ", "as", " ", "the", " ", "negati", "ve", " ", "log", " ", "likelihood_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fine", "tune", "\\u", "cost_", "=_", "cnn", "\\u", "si_", "._", "fc", "\\u", "dnn", "_", "._", "log", "Layer_", "._", "negati", "ve", "\\u", "log", "\\u", "likelihood_", "(_", "self_", "._", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "=_", "cnn", "\\u", "si_", "._", "fc", "\\u", "dnn", "_", "._", "log", "Layer_", "._", "errors_", "(_", "self_", "._", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CNN", "\\u", "SAT", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "fine", "tune", "\\u", "functions_", "(_", "self_", ",_", "train", "\\u", "shared", "\\u", "xy_", ",_", "valid", "\\u", "shared", "\\u", "xy_", ",_", "batch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "train", "\\u", "set\\u", "x_", ",_", "train", "\\u", "set\\u", "y_", ")_", "=_", "train", "\\u", "shared", "\\u", "xy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "valid", "\\u", "set\\u", "x_", ",_", "valid", "\\u", "set\\u", "y_", ")_", "=_", "valid", "\\u", "shared", "\\u", "xy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "T_", "._", "lsc", "ala", "r_", "(_", "'", "index", "'_", ")_", "#", " ", "index", " ", "to", " ", "a", " ", "[", "mini", "]", "batch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rate_", "=_", "T_", "._", "fsc", "ala", "r_", "(_", "'", "learn", "ing", "\\u", "rate", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "momentum_", "=_", "T_", "._", "fsc", "ala", "r_", "(_", "'", "moment", "um", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "the", " ", "gradi", "ents", " ", "with", " ", "respec", "t", " ", "to", " ", "the", " ", "model", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "gpa", "rams_", "=_", "T_", "._", "grad_", "(_", "self_", "._", "fine", "tune", "\\u", "cost_", ",_", "self_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "list", " ", "of", " ", "fine", "-", "tuning", " ", "updates_", "\\u\\u\\uNL\\u\\u\\u_", "updates_", "=_", "collections_", "._", "Order", "ed", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "dpa", "ram_", ",_", "gpa", "ram_", "in_", "zip_", "(_", "self_", "._", "delta", "\\u", "params_", ",_", "gpa", "rams_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "updates_", "[_", "dpa", "ram_", "]_", "=_", "momentum_", "*_", "dpa", "ram_", "-_", "gpa", "ram_", "*_", "learn", "ing", "\\u", "rate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "dpa", "ram_", ",_", "param_", "in_", "zip_", "(_", "self_", "._", "delta", "\\u", "params_", ",_", "self_", "._", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "updates_", "[_", "param_", "]_", "=_", "param_", "+_", "updates_", "[_", "dpa", "ram_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "fn_", "=_", "theano_", "._", "function_", "(_", "inputs_", "=_", "[_", "index_", ",_", "theano_", "._", "Param_", "(_", "learn", "ing", "\\u", "rate_", ",_", "default_", "=_", "0.0001_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "theano_", "._", "Param_", "(_", "momentum_", ",_", "default_", "=_", "0.5_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "self_", "._", "errors_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "updates_", "=_", "updates_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "give", "ns_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "x_", ":_", "train", "\\u", "set\\u", "x_", "[_", "index_", "*_", "batch", "\\u", "size_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "index_", "+_", "1_", ")_", "*_", "batch", "\\u", "size_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "y_", ":_", "train", "\\u", "set\\u", "y_", "[_", "index_", "*_", "batch", "\\u", "size_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "index_", "+_", "1_", ")_", "*_", "batch", "\\u", "size_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "valid", "\\u", "fn_", "=_", "theano_", "._", "function_", "(_", "inputs_", "=_", "[_", "index_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "self_", "._", "errors_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "give", "ns_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "x_", ":_", "valid", "\\u", "set\\u", "x_", "[_", "index_", "*_", "batch", "\\u", "size_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "index_", "+_", "1_", ")_", "*_", "batch", "\\u", "size_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "y_", ":_", "valid", "\\u", "set\\u", "y_", "[_", "index_", "*_", "batch", "\\u", "size_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "index_", "+_", "1_", ")_", "*_", "batch", "\\u", "size_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "train", "\\u", "fn_", ",_", "valid", "\\u", "fn_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unreachable code
pingali/dgit/dgitcore/contrib/repomanagers/gitmanager.py
[ { "content": " def _run_generic_command(self, repo, cmd):\n \"\"\"\n Run a generic command within the repo. Assumes that you are\n in the repo's root directory\n \"\"\"\n \n result = None\n with cd(repo.rootdir):\n # Dont use sh. It is not collecting the stdout of all\n # child processes.\n output = self._run(cmd)\n try:\n result = {\n 'cmd': cmd,\n 'status': 'success',\n 'message': output,\n }\n except Exception as e:\n result = {\n 'cmd': cmd,\n 'status': 'error',\n 'message': str(e)\n }\n\n return result", "metadata": "root.GitRepoManager._run_generic_command", "header": "['class', 'GitRepoManager', '(', 'RepoManagerBase', ')', ':', '___EOS___']", "index": 72 } ]
[ { "span": "except Exception as e:", "start_line": 89, "start_column": 12, "end_line": 89, "end_column": 34 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Git", "Rep", "o", "Manager_", "(_", "Rep", "o", "Manager", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "run", "\\u", "gener", "ic", "\\u", "command_", "(_", "self_", ",_", "repo_", ",_", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "a", " ", "gener", "ic", " ", "command", " ", "within", " ", "the", " ", "repo", ".", " ", "Assume", "s", " ", "tha", "t", " ", "you", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "repo", "'", "s", " ", "root", " ", "director", "y", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "cd_", "(_", "repo_", "._", "rootdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "t", " ", "use", " ", "sh", ".", " ", "It", " ", "is", " ", "not", " ", "collecti", "ng", " ", "the", " ", "stdout", " ", "of", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "child", " ", "process", "es", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "self_", "._", "\\u", "run_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cmd", "'_", ":_", "cmd_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "success", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "'_", ":_", "output_", ",_", "\\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 ", " _", "result_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cmd", "'_", ":_", "cmd_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "error", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "'_", ":_", "str_", "(_", "e_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Imprecise assert
StackStorm/st2/st2common/tests/unit/services/test_access.py
[ { "content": " def test_create_token(self):\n token = access.create_token(USERNAME)\n self.assertTrue(token is not None)\n self.assertTrue(token.token is not None)\n self.assertEqual(token.user, USERNAME)", "metadata": "root.AccessServiceTest.test_create_token", "header": "['class', 'AccessServiceTest', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 38 }, { "content": " def test_create_token_ttl_ok(self):\n ttl = 10\n token = access.create_token(USERNAME, 10)\n self.assertTrue(token is not None)\n self.assertTrue(token.token is not None)\n self.assertEqual(token.user, USERNAME)\n expected_expiry = date_utils.get_datetime_utc_now() + datetime.timedelta(seconds=ttl)\n expected_expiry = date_utils.add_utc_tz(expected_expiry)\n self.assertLess(isotime.parse(token.expiry), expected_expiry)", "metadata": "root.AccessServiceTest.test_create_token_ttl_ok", "header": "['class', 'AccessServiceTest', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 65 }, { "content": " def test_create_token_ttl_capped(self):\n ttl = cfg.CONF.auth.token_ttl + 10\n expected_expiry = date_utils.get_datetime_utc_now() + datetime.timedelta(seconds=ttl)\n expected_expiry = date_utils.add_utc_tz(expected_expiry)\n token = access.create_token(USERNAME, 10)\n self.assertTrue(token is not None)\n self.assertTrue(token.token is not None)\n self.assertEqual(token.user, USERNAME)\n self.assertLess(isotime.parse(token.expiry), expected_expiry)", "metadata": "root.AccessServiceTest.test_create_token_ttl_capped", "header": "['class', 'AccessServiceTest', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 75 } ]
[ { "span": "self.assertTrue(token is not None)", "start_line": 40, "start_column": 8, "end_line": 40, "end_column": 42 }, { "span": "self.assertTrue(token.token is not None)", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 48 }, { "span": "self.assertTrue(token is not None)", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 42 }, { "span": "self.assertTrue(token.token is not None)", "start_line": 69, "start_column": 8, "end_line": 69, "end_column": 48 }, { "span": "self.assertTrue(token is not None)", "start_line": 80, "start_column": 8, "end_line": 80, "end_column": 42 }, { "span": "self.assertTrue(token.token is not None)", "start_line": 81, "start_column": 8, "end_line": 81, "end_column": 48 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Access", "Service", "Test_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "token_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token_", "=_", "access_", "._", "create", "\\u", "token_", "(_", "USERNAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "token_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "token_", "._", "token_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "token_", "._", "user_", ",_", "USERNAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Access", "Service", "Test_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "token", "\\u", "ttl", "\\u", "ok_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ttl_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token_", "=_", "access_", "._", "create", "\\u", "token_", "(_", "USERNAME_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "token_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "token_", "._", "token_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "token_", "._", "user_", ",_", "USERNAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "expiry_", "=_", "date", "\\u", "utils_", "._", "get", "\\u", "datetime", "\\u", "utc", "\\u", "now_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "expiry_", "=_", "date", "\\u", "utils_", "._", "add", "\\u", "utc", "\\u", "tz_", "(_", "expected", "\\u", "expiry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Less_", "(_", "isot", "ime_", "._", "parse_", "(_", "token_", "._", "expiry_", ")_", ",_", "expected", "\\u", "expiry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Access", "Service", "Test_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "token", "\\u", "ttl", "\\u", "cap", "ped_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ttl_", "=_", "cfg_", "._", "CONF_", "._", "auth_", "._", "token", "\\u", "ttl_", "+_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "expiry_", "=_", "date", "\\u", "utils_", "._", "get", "\\u", "datetime", "\\u", "utc", "\\u", "now_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "expiry_", "=_", "date", "\\u", "utils_", "._", "add", "\\u", "utc", "\\u", "tz_", "(_", "expected", "\\u", "expiry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token_", "=_", "access_", "._", "create", "\\u", "token_", "(_", "USERNAME_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "token_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "token_", "._", "token_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "token_", "._", "user_", ",_", "USERNAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Less_", "(_", "isot", "ime_", "._", "parse_", "(_", "token_", "._", "expiry_", ")_", ",_", "expected", "\\u", "expiry_", ")_" ]
[ 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, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
SpriteLink/NIPAP/tests/upgrade-after.py
[ { "content": "#!/usr/bin/env python\n# vim: et :\n#\n# This is run by Travis-CI after an upgrade to verify that the data loaded by\n# upgrade-before.py has been correctly updated in the upgrade process. For\n# example, new columns might have been added and the value of those columns\n# should be automatically updated. This test should be used to verify such\n# things.\n#\n\nimport logging\nimport unittest\nimport sys\nsys.path.append('../nipap/')\n\nfrom nipap.backend import Nipap\nfrom nipap.authlib import SqliteAuth\nfrom nipap.nipapconfig import NipapConfig\n\nlogger = logging.getLogger()\nlogger.setLevel(logging.DEBUG)\nlog_format = \"%(levelname)-8s %(message)s\"\n\nimport xmlrpclib\n\nserver_url = \"http://unittest:gottatest@127.0.0.1:1337/XMLRPC\"\ns = xmlrpclib.Server(server_url, allow_none=1);\n\nad = { 'authoritative_source': 'nipap' }\n\n\n\n\n\nif __name__ == '__main__':\n\n # set up logging\n log = logging.getLogger()\n logging.basicConfig()\n log.setLevel(logging.INFO)\n\n if sys.version_info >= (2,7):\n unittest.main(verbosity=2)\n else:\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestCheckdata(unittest.TestCase):\n \"\"\" Tests the NIPAP XML-RPC daemon\n \"\"\"\n maxDiff = None\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestCheckdata", "header": "['module', '___EOS___']", "index": 31 }, { "content": " def _mangle_pool_result(self, res):\n \"\"\" Mangle pool result for easier testing\n\n We can never predict the values of things like the ID (okay, that\n one is actually kind of doable) or the added and last_modified\n timestamp. This function will make sure the values are present but\n then strip them to make it easier to test against an expected\n result.\n \"\"\"\n\n if isinstance(res, list):\n # res from list_prefix\n for p in res:\n self.assertIn('id', p)\n del(p['id'])\n\n elif isinstance(res, dict) and 'result' in res:\n # res from smart search\n for p in res['result']:\n self.assertIn('id', p)\n del(p['id'])\n\n elif isinstance(res, dict):\n # just one single prefix\n self.assertIn('id', res)\n del(res['id'])\n\n return res", "metadata": "root.TestCheckdata._mangle_pool_result", "header": "['class', 'TestCheckdata', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 36 }, { "content": " def _mangle_prefix_result(self, res):\n \"\"\" Mangle prefix result for easier testing\n\n We can never predict the values of things like the ID (okay, that\n one is actually kind of doable) or the added and last_modified\n timestamp. This function will make sure the values are present but\n then strip them to make it easier to test against an expected\n result.\n \"\"\"\n\n if isinstance(res, list):\n # res from list_prefix\n for p in res:\n self.assertIn('added', p)\n self.assertIn('last_modified', p)\n self.assertIn('id', p)\n self.assertIn('pool_id', p)\n del(p['added'])\n del(p['last_modified'])\n del(p['id'])\n del(p['pool_id'])\n\n elif isinstance(res, dict) and 'result' in res:\n # res from smart search\n for p in res['result']:\n self.assertIn('added', p)\n self.assertIn('last_modified', p)\n self.assertIn('id', p)\n self.assertIn('pool_id', p)\n del(p['added'])\n del(p['last_modified'])\n del(p['id'])\n del(p['pool_id'])\n\n elif isinstance(res, dict):\n # just one single prefix\n self.assertIn('added', res)\n self.assertIn('last_modified', res)\n self.assertIn('id', res)\n self.assertIn('pool_id', res)\n del(res['added'])\n del(res['last_modified'])\n del(res['id'])\n del(res['pool_id'])\n\n return res", "metadata": "root.TestCheckdata._mangle_prefix_result", "header": "['class', 'TestCheckdata', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 67 }, { "content": " def _mangle_vrf_result(self, res):\n \"\"\" Mangle vrf result for easier testing\n\n We can never predict the values of things like the ID (okay, that\n one is actually kind of doable) or the added and last_modified\n timestamp. This function will make sure the values are present but\n then strip them to make it easier to test against an expected\n result.\n \"\"\"\n\n if isinstance(res, list):\n # res from list_prefix\n for p in res:\n self.assertIn('id', p)\n del(p['id'])\n\n elif isinstance(res, dict) and 'result' in res:\n # res from smart search\n for p in res['result']:\n self.assertIn('id', p)\n del(p['id'])\n\n elif isinstance(res, dict):\n # just one single prefix\n self.assertIn('id', res)\n del(res['id'])\n\n return res", "metadata": "root.TestCheckdata._mangle_vrf_result", "header": "['class', 'TestCheckdata', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 116 }, { "content": " def test_verify_prefix(self):\n \"\"\" Verify data after upgrade\n \"\"\"\n expected_base = {\n 'alarm_priority': None,\n 'authoritative_source': 'nipap',\n 'avps': {},\n 'comment': None,\n 'country': None,\n 'description': 'test',\n 'expires': None,\n 'external_key': None,\n 'family': 4,\n 'indent': 0,\n 'inherited_tags': [],\n 'monitor': None,\n 'node': None,\n 'order_id': None,\n 'customer_id': None,\n 'pool_name': None,\n 'tags': [],\n 'type': 'reservation',\n 'vrf_rt': None,\n 'vrf_id': 0,\n 'vrf_name': 'default',\n 'vlan': None,\n 'status': 'assigned'\n }\n expected_prefixes = [\n { 'prefix': '192.168.0.0/16', 'indent': 0, 'total_addresses':\n '65536', 'used_addresses': '8192', 'free_addresses': '57344' },\n { 'prefix': '192.168.0.0/20', 'indent': 1, 'total_addresses':\n '4096', 'used_addresses': '768', 'free_addresses': '3328',\n 'pool_name': 'upgrade-test' },\n { 'prefix': '192.168.0.0/24', 'indent': 2, 'total_addresses':\n '256', 'used_addresses': '0', 'free_addresses': '256' },\n { 'prefix': '192.168.1.0/24', 'indent': 2, 'total_addresses':\n '256', 'used_addresses': '0', 'free_addresses': '256' },\n { 'prefix': '192.168.2.0/24', 'indent': 2, 'total_addresses':\n '256', 'used_addresses': '0', 'free_addresses': '256' },\n { 'prefix': '192.168.32.0/20', 'indent': 1, 'total_addresses':\n '4096', 'used_addresses': '256', 'free_addresses': '3840' },\n { 'prefix': '192.168.32.0/24', 'indent': 2, 'total_addresses':\n '256', 'used_addresses': '1', 'free_addresses': '255' },\n { 'prefix': '192.168.32.1/32', 'display_prefix': '192.168.32.1',\n 'indent': 3, 'total_addresses': '1', 'used_addresses': '1',\n 'free_addresses': '0' },\n { 'prefix': '2001:db8:1::/48', 'indent': 0, 'family': 6,\n 'pool_name': 'upgrade-test',\n 'total_addresses': '1208925819614629174706176',\n 'used_addresses': '18446744073709551616',\n 'free_addresses': '1208907372870555465154560' },\n { 'prefix': '2001:db8:1::/64', 'indent': 1, 'family': 6,\n 'total_addresses': '18446744073709551616', 'used_addresses': '0',\n 'free_addresses': '18446744073709551616' },\n { 'prefix': '2001:db8:2::/48', 'indent': 0, 'family': 6,\n 'total_addresses': '1208925819614629174706176',\n 'used_addresses': '0',\n 'free_addresses': '1208925819614629174706176' },\n ]\n expected = []\n for p in expected_prefixes:\n pexp = expected_base.copy()\n for key in p:\n pexp[key] = p[key]\n if 'display_prefix' not in pexp:\n pexp['display_prefix'] = p['prefix']\n expected.append(pexp)\n\n self.assertEqual(expected, self._mangle_prefix_result(s.list_prefix({ 'auth': ad, })))", "metadata": "root.TestCheckdata.test_verify_prefix", "header": "['class', 'TestCheckdata', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 147 }, { "content": " def test_pool1(self):\n \"\"\" Verify data after upgrade\n \"\"\"\n expected = [{\n 'used_prefixes_v4': '3',\n 'used_prefixes_v6': '1',\n 'free_prefixes_v4': '1664',\n 'free_prefixes_v6': '18446462598732840960',\n 'total_prefixes_v4': '1667',\n 'total_prefixes_v6': '18446462598732840961',\n 'default_type': None,\n 'description': None,\n 'free_addresses_v4': '3328',\n 'free_addresses_v6': '1208907372870555465154560',\n 'ipv4_default_prefix_length': 31,\n 'ipv6_default_prefix_length': 112,\n 'member_prefixes_v4': '1',\n 'member_prefixes_v6': '1',\n 'name': 'upgrade-test',\n 'prefixes': [ '192.168.0.0/20', '2001:db8:1::/48' ],\n 'total_addresses_v4': '4096',\n 'total_addresses_v6': '1208925819614629174706176',\n 'used_addresses_v4': '768',\n 'used_addresses_v6': '18446744073709551616',\n 'vrf_id': 0,\n 'vrf_name': 'default',\n 'vrf_rt': None,\n 'tags': [],\n 'avps': {}\n }]\n self.assertEqual(expected, self._mangle_pool_result(s.list_pool({ 'auth': ad, 'pool': { 'name': 'upgrade-test' } })))", "metadata": "root.TestCheckdata.test_pool1", "header": "['class', 'TestCheckdata', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 220 }, { "content": " def test_pool2(self):\n \"\"\" Verify data after upgrade\n \"\"\"\n expected = [{\n 'used_prefixes_v4': '0',\n 'used_prefixes_v6': '0',\n 'free_prefixes_v4': None,\n 'free_prefixes_v6': None,\n 'total_prefixes_v4': None,\n 'total_prefixes_v6': None,\n 'default_type': None,\n 'description': None,\n 'free_addresses_v4': '0',\n 'free_addresses_v6': '0',\n 'ipv4_default_prefix_length': None,\n 'ipv6_default_prefix_length': None,\n 'member_prefixes_v4': '0',\n 'member_prefixes_v6': '0',\n 'name': 'upgrade-test2',\n 'prefixes': [ ],\n 'total_addresses_v4': '0',\n 'total_addresses_v6': '0',\n 'used_addresses_v4': '0',\n 'used_addresses_v6': '0',\n 'vrf_id': None,\n 'vrf_name': None,\n 'vrf_rt': None,\n 'tags': [],\n 'avps': {}\n }]\n self.assertEqual(expected, self._mangle_pool_result(s.list_pool({ 'auth': ad, 'pool': { 'name': 'upgrade-test2' } })))", "metadata": "root.TestCheckdata.test_pool2", "header": "['class', 'TestCheckdata', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 254 }, { "content": " def test_vrf1(self):\n \"\"\" Verify empty VRF looks good\n \"\"\"\n expected = [\n {'description': None,\n 'free_addresses_v4': '0',\n 'free_addresses_v6': '0',\n 'name': 'foo',\n 'num_prefixes_v4': '0',\n 'num_prefixes_v6': '0',\n 'rt': '123:123',\n 'total_addresses_v4': '0',\n 'total_addresses_v6': '0',\n 'used_addresses_v4': '0',\n 'used_addresses_v6': '0',\n 'tags': [],\n 'avps': {}\n }]\n\n self.assertEqual(expected, self._mangle_vrf_result(s.list_vrf({ 'auth':\n ad, 'vrf': { 'name': 'foo' } })))", "metadata": "root.TestCheckdata.test_vrf1", "header": "['class', 'TestCheckdata', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 288 }, { "content": " def test_vrf2(self):\n \"\"\" Verify default VRF looks good with prefixes\n \"\"\"\n expected = [\n {\n 'description': 'The default VRF, typically the Internet.',\n 'free_addresses_v4': '57344',\n 'free_addresses_v6': '2417833192485184639860736',\n 'name': 'default',\n 'num_prefixes_v4': '8',\n 'num_prefixes_v6': '3',\n 'rt': None,\n 'total_addresses_v4': '65536',\n 'total_addresses_v6': '2417851639229258349412352',\n 'used_addresses_v4': '8192',\n 'used_addresses_v6': '18446744073709551616',\n 'tags': [],\n 'avps': {}\n }]\n\n self.assertEqual(expected, self._mangle_vrf_result(s.list_vrf({ 'auth':\n ad, 'vrf': { 'name': 'default' } })))", "metadata": "root.TestCheckdata.test_vrf2", "header": "['class', 'TestCheckdata', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 312 } ]
[ { "span": "from nipap.backend import Nipap", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 31 }, { "span": "from nipap.authlib import SqliteAuth", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 36 }, { "span": "from nipap.nipapconfig import NipapConfig", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", " ", "et", " ", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "run", " ", "by", " ", "Tra", "vis", "-", "CI", " ", "after", " ", "an", " ", "upgrade", " ", "to", " ", "verify", " ", "tha", "t", " ", "the", " ", "data", " ", "load", "ed", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "upgrade", "-", "bef", "ore", ".", "py", " ", "has", " ", "bee", "n", " ", "correct", "ly", " ", "update", "d", " ", "in", " ", "the", " ", "upgrade", " ", "process", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "example", ",", " ", "new", " ", "column", "s", " ", "mig", "ht", " ", "have", " ", "bee", "n", " ", "adde", "d", " ", "and", " ", "the", " ", "value", " ", "of", " ", "tho", "se", " ", "columns_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "be", " ", "automati", "call", "y", " ", "update", "d", ".", " ", "Thi", "s", " ", "test", " ", "shou", "ld", " ", "be", " ", "used", " ", "to", " ", "verify", " ", "suc", "h_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "thing", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "'../", "nip", "ap", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nip", "ap_", "._", "backend_", "import_", "Ni", "pap", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nip", "ap_", "._", "auth", "lib_", "import_", "Sqlite", "Auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nip", "ap_", "._", "nip", "ap", "config_", "import_", "Ni", "pap", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "format_", "=_", "\"%", "(", "level", "name", ")-", "8s", " ", "%", "(", "message", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "xmlrpclib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "server", "\\u", "url_", "=_", "\"", "http", "://", "unittest", ":", "got", "tate", "st", "@", "127", ".0", ".0", ".1", ":", "1337", "/", "XMLRPC", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "xmlrpclib_", "._", "Server_", "(_", "server", "\\u", "url_", ",_", "allow", "\\u", "none_", "=_", "1_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ad_", "=_", "{_", "'", "authori", "tative", "\\u", "source", "'_", ":_", "'", "nip", "ap", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "logging_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "set", "Level_", "(_", "logging_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "2_", ",_", "7_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", "verbosity_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Test", "s", " ", "the", " ", "NI", "PAP", " ", "XML", "-", "RP", "C", " ", "daemon", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Diff_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "mangle", "\\u", "pool", "\\u", "result_", "(_", "self_", ",_", "res_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Mang", "le", " ", "pool", " ", "result", " ", "for", " ", "easi", "er", " ", "testi", "ng", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "We", " ", "can", " ", "neve", "r", " ", "predi", "ct", " ", "the", " ", "values", " ", "of", " ", "thing", "s", " ", "like", " ", "the", " ", "ID", " ", "(", "oka", "y", ",", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "one", " ", "is", " ", "actual", "ly", " ", "kind", " ", "of", " ", "do", "able", ")", " ", "or", " ", "the", " ", "adde", "d", " ", "and", " ", "last", "\\u", "modifi", "ed", "\\", "10", ";", " ", " ", " ", " ", "timestamp", ".", " ", "Thi", "s", " ", "function", " ", "will", " ", "make", " ", "sure", " ", "the", " ", "values", " ", "are", " ", "presen", "t", " ", "but", "\\", "10", ";", " ", " ", " ", " ", "then", " ", "strip", " ", "them", " ", "to", " ", "make", " ", "it", " ", "easi", "er", " ", "to", " ", "test", " ", "against", " ", "an", " ", "expected", "\\", "10", ";", " ", " ", " ", " ", "result", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "res_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "res", " ", "from", " ", "list", "\\u", "prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "res_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "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_", "elif_", "isinstance_", "(_", "res_", ",_", "dict_", ")_", "and_", "'", "result", "'_", "in_", "res_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "res", " ", "from", " ", "smart", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "res_", "[_", "'", "result", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "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_", "elif_", "isinstance_", "(_", "res_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "just", " ", "one", " ", "single", " ", "prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "res_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "mangle", "\\u", "prefix", "\\u", "result_", "(_", "self_", ",_", "res_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Mang", "le", " ", "prefix", " ", "result", " ", "for", " ", "easi", "er", " ", "testi", "ng", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "We", " ", "can", " ", "neve", "r", " ", "predi", "ct", " ", "the", " ", "values", " ", "of", " ", "thing", "s", " ", "like", " ", "the", " ", "ID", " ", "(", "oka", "y", ",", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "one", " ", "is", " ", "actual", "ly", " ", "kind", " ", "of", " ", "do", "able", ")", " ", "or", " ", "the", " ", "adde", "d", " ", "and", " ", "last", "\\u", "modifi", "ed", "\\", "10", ";", " ", " ", " ", " ", "timestamp", ".", " ", "Thi", "s", " ", "function", " ", "will", " ", "make", " ", "sure", " ", "the", " ", "values", " ", "are", " ", "presen", "t", " ", "but", "\\", "10", ";", " ", " ", " ", " ", "then", " ", "strip", " ", "them", " ", "to", " ", "make", " ", "it", " ", "easi", "er", " ", "to", " ", "test", " ", "against", " ", "an", " ", "expected", "\\", "10", ";", " ", " ", " ", " ", "result", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "res_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "res", " ", "from", " ", "list", "\\u", "prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "res_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "adde", "d", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "last", "\\u", "modifi", "ed", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "pool", "\\u", "id", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "adde", "d", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "last", "\\u", "modifi", "ed", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "pool", "\\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_", "elif_", "isinstance_", "(_", "res_", ",_", "dict_", ")_", "and_", "'", "result", "'_", "in_", "res_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "res", " ", "from", " ", "smart", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "res_", "[_", "'", "result", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "adde", "d", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "last", "\\u", "modifi", "ed", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "pool", "\\u", "id", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "adde", "d", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "last", "\\u", "modifi", "ed", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "pool", "\\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_", "elif_", "isinstance_", "(_", "res_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "just", " ", "one", " ", "single", " ", "prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "adde", "d", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "last", "\\u", "modifi", "ed", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "pool", "\\u", "id", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "res_", "[_", "'", "adde", "d", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "res_", "[_", "'", "last", "\\u", "modifi", "ed", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "res_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "res_", "[_", "'", "pool", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "mangle", "\\u", "vrf", "\\u", "result_", "(_", "self_", ",_", "res_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Mang", "le", " ", "vrf", " ", "result", " ", "for", " ", "easi", "er", " ", "testi", "ng", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "We", " ", "can", " ", "neve", "r", " ", "predi", "ct", " ", "the", " ", "values", " ", "of", " ", "thing", "s", " ", "like", " ", "the", " ", "ID", " ", "(", "oka", "y", ",", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "one", " ", "is", " ", "actual", "ly", " ", "kind", " ", "of", " ", "do", "able", ")", " ", "or", " ", "the", " ", "adde", "d", " ", "and", " ", "last", "\\u", "modifi", "ed", "\\", "10", ";", " ", " ", " ", " ", "timestamp", ".", " ", "Thi", "s", " ", "function", " ", "will", " ", "make", " ", "sure", " ", "the", " ", "values", " ", "are", " ", "presen", "t", " ", "but", "\\", "10", ";", " ", " ", " ", " ", "then", " ", "strip", " ", "them", " ", "to", " ", "make", " ", "it", " ", "easi", "er", " ", "to", " ", "test", " ", "against", " ", "an", " ", "expected", "\\", "10", ";", " ", " ", " ", " ", "result", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "res_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "res", " ", "from", " ", "list", "\\u", "prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "res_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "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_", "elif_", "isinstance_", "(_", "res_", ",_", "dict_", ")_", "and_", "'", "result", "'_", "in_", "res_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "res", " ", "from", " ", "smart", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "res_", "[_", "'", "result", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "p_", "[_", "'", "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_", "elif_", "isinstance_", "(_", "res_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "just", " ", "one", " ", "single", " ", "prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "'", "id", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "res_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "verify", "\\u", "prefix_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Verify", " ", "data", " ", "after", " ", "upgrade", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "base_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alarm", "\\u", "priorit", "y", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "tative", "\\u", "source", "'_", ":_", "'", "nip", "ap", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "av", "ps", "'_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comment", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "countr", "y", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "expir", "es", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "external", "\\u", "key", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "indent", "'_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "inherited", "\\u", "tags", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "monit", "or", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "node", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "order", "\\u", "id", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "customer", "\\u", "id", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pool", "\\u", "name", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "reserva", "tion", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "rt", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "id", "'_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "name", "'_", ":_", "'", "default", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vlan", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "assign", "ed", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "prefixes_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "192", ".1", "68.", "0.", "0", "/", "16", "'_", ",_", "'", "indent", "'_", ":_", "0_", ",_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "'", "6553", "6", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "819", "2", "'_", ",_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "573", "4", "4", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "192", ".1", "68.", "0.", "0", "/", "20", "'_", ",_", "'", "indent", "'_", ":_", "1_", ",_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "'", "409", "6", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "768", "'_", ",_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "332", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pool", "\\u", "name", "'_", ":_", "'", "upgrade", "-", "test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "192", ".1", "68.", "0.", "0", "/", "24", "'_", ",_", "'", "indent", "'_", ":_", "2_", ",_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "'", "256", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "0", "'_", ",_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "256", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "192", ".1", "68.", "1.0", "/", "24", "'_", ",_", "'", "indent", "'_", ":_", "2_", ",_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "'", "256", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "0", "'_", ",_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "256", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "192", ".1", "68.", "2.0", "/", "24", "'_", ",_", "'", "indent", "'_", ":_", "2_", ",_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "'", "256", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "0", "'_", ",_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "256", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "192", ".1", "68.", "32.", "0", "/", "20", "'_", ",_", "'", "indent", "'_", ":_", "1_", ",_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "'", "409", "6", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "256", "'_", ",_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "384", "0", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "192", ".1", "68.", "32.", "0", "/", "24", "'_", ",_", "'", "indent", "'_", ":_", "2_", ",_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "'", "256", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "1", "'_", ",_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "255", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "192", ".1", "68.", "32.", "1", "/", "32", "'_", ",_", "'", "display", "\\u", "prefix", "'_", ":_", "'", "192", ".1", "68.", "32.", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "indent", "'_", ":_", "3_", ",_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "'", "1", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "0", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "200", "1", ":", "db", "8", ":", "1", "::", "/", "4", "8", "'_", ",_", "'", "indent", "'_", ":_", "0_", ",_", "'", "famil", "y", "'_", ":_", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pool", "\\u", "name", "'_", ":_", "'", "upgrade", "-", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "'", "120", "892", "581", "961", "462", "917", "470", "617", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "184", "467", "440", "737", "095", "516", "16", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "120", "890", "737", "287", "055", "546", "515", "456", "0", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "200", "1", ":", "db", "8", ":", "1", "::", "/", "64", "'_", ",_", "'", "indent", "'_", ":_", "1_", ",_", "'", "famil", "y", "'_", ":_", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "'", "184", "467", "440", "737", "095", "516", "16", "'_", ",_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "184", "467", "440", "737", "095", "516", "16", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "prefix", "'_", ":_", "'", "200", "1", ":", "db", "8", ":", "2", "::", "/", "4", "8", "'_", ",_", "'", "indent", "'_", ":_", "0_", ",_", "'", "famil", "y", "'_", ":_", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "'_", ":_", "'", "120", "892", "581", "961", "462", "917", "470", "617", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "'_", ":_", "'", "120", "892", "581", "961", "462", "917", "470", "617", "6", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "expected", "\\u", "prefixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pex", "p_", "=_", "expected", "\\u", "base_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pex", "p_", "[_", "key_", "]_", "=_", "p_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "display", "\\u", "prefix", "'_", "not_", "in_", "pex", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pex", "p_", "[_", "'", "display", "\\u", "prefix", "'_", "]_", "=_", "p_", "[_", "'", "prefix", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "._", "append_", "(_", "pex", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "\\u", "mangle", "\\u", "prefix", "\\u", "result_", "(_", "s_", "._", "list", "\\u", "prefix_", "(_", "{_", "'", "auth", "'_", ":_", "ad_", ",_", "}_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "pool", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Verify", " ", "data", " ", "after", " ", "upgrade", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "'", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "'", "166", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "'", "184", "464", "625", "987", "328", "409", "60", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "'", "166", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "'", "184", "464", "625", "987", "328", "409", "6", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "\\u", "type", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "332", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "120", "890", "737", "287", "055", "546", "515", "456", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ipv", "4", "\\u", "default", "\\u", "prefix", "\\u", "length", "'_", ":_", "31_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ipv", "6", "\\u", "default", "\\u", "prefix", "\\u", "length", "'_", ":_", "112_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "upgrade", "-", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "prefix", "es", "'_", ":_", "[_", "'", "192", ".1", "68.", "0.", "0", "/", "20", "'_", ",_", "'", "200", "1", ":", "db", "8", ":", "1", "::", "/", "4", "8", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "409", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "120", "892", "581", "961", "462", "917", "470", "617", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "768", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "184", "467", "440", "737", "095", "516", "16", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "id", "'_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "name", "'_", ":_", "'", "default", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "rt", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "av", "ps", "'_", ":_", "{_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "\\u", "mangle", "\\u", "pool", "\\u", "result_", "(_", "s_", "._", "list", "\\u", "pool_", "(_", "{_", "'", "auth", "'_", ":_", "ad_", ",_", "'", "pool", "'_", ":_", "{_", "'", "name", "'_", ":_", "'", "upgrade", "-", "test", "'_", "}_", "}_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "pool", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Verify", " ", "data", " ", "after", " ", "upgrade", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "\\u", "type", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ipv", "4", "\\u", "default", "\\u", "prefix", "\\u", "length", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ipv", "6", "\\u", "default", "\\u", "prefix", "\\u", "length", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "upgrade", "-", "test", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "prefix", "es", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "id", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "name", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vrf", "\\u", "rt", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "av", "ps", "'_", ":_", "{_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "\\u", "mangle", "\\u", "pool", "\\u", "result_", "(_", "s_", "._", "list", "\\u", "pool_", "(_", "{_", "'", "auth", "'_", ":_", "ad_", ",_", "'", "pool", "'_", ":_", "{_", "'", "name", "'_", ":_", "'", "upgrade", "-", "test", "2", "'_", "}_", "}_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "vrf", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Verify", " ", "empty", " ", "VR", "F", " ", "look", "s", " ", "good", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "description", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "foo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rt", "'_", ":_", "'", "123", ":", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "av", "ps", "'_", ":_", "{_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "\\u", "mangle", "\\u", "vrf", "\\u", "result_", "(_", "s_", "._", "list", "\\u", "vrf", "_", "(_", "{_", "'", "auth", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "ad_", ",_", "'", "vrf", "'_", ":_", "{_", "'", "name", "'_", ":_", "'", "foo", "'_", "}_", "}_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "vrf", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Verify", " ", "default", " ", "VR", "F", " ", "look", "s", " ", "good", " ", "with", " ", "prefix", "es", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "'", "The", " ", "default", " ", "VR", "F", ",", " ", "typical", "ly", " ", "the", " ", "Intern", "et", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "573", "4", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "free", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "241", "783", "319", "248", "518", "463", "986", "073", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "default", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "prefix", "es", "\\u", "v", "4", "'_", ":_", "'", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "prefix", "es", "\\u", "v6", "'_", ":_", "'", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rt", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "6553", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "241", "785", "163", "922", "925", "834", "941", "235", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "\\u", "v", "4", "'_", ":_", "'", "819", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "\\u", "addresse", "s", "\\u", "v6", "'_", ":_", "'", "184", "467", "440", "737", "095", "516", "16", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "av", "ps", "'_", ":_", "{_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "self_", "._", "\\u", "mangle", "\\u", "vrf", "\\u", "result_", "(_", "s_", "._", "list", "\\u", "vrf", "_", "(_", "{_", "'", "auth", "'_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "ad_", ",_", "'", "vrf", "'_", ":_", "{_", "'", "name", "'_", ":_", "'", "default", "'_", "}_", "}_", ")_", ")_", ")_", "\\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, 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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 ]
Unused import
aht/suas/suas/test/test_session.py
[ { "content": "#!/usr/bin/nosetests --with-gae\n\nimport re\nfrom time import time, gmtime\nfrom calendar import timegm\nfrom webtest import TestApp\n\nfrom google.appengine.ext import webapp\nfrom google.appengine.ext.webapp import util\n\n# hack the path\nimport sys, os\nsys.path.append( os.path.abspath( os.path.join( os.path.dirname(__file__), '..') ) )\n\nfrom signedcookie import SignedCookie, SIG_LEN\nfrom session import RequestHandler, SECRET_KEY, SESSION_TTL, SID_TTL\n\n# mock\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class User:", "metadata": "root.User", "header": "['module', '___EOS___']", "index": 18 }, { "content": "\tdef __init__(self, nickname):\n\t\tself.nickname = nickname", "metadata": "root.User.__init__", "header": "['class', 'User', ':', '___EOS___']", "index": 19 }, { "content": "class Login(RequestHandler):", "metadata": "root.Login", "header": "['module', '___EOS___']", "index": 22 }, { "content": "\tdef post(self):\n\t\tnickname = self.request.get('nickname')\n\t\tself.session.start(User(nickname))", "metadata": "root.Login.post", "header": "['class', 'Login', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 23 }, { "content": "class Regen(RequestHandler):", "metadata": "root.Regen", "header": "['module', '___EOS___']", "index": 27 }, { "content": "\tdef post(self):\n\t\tself.session.regen()", "metadata": "root.Regen.post", "header": "['class', 'Regen', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 28 }, { "content": "class Touch(RequestHandler):", "metadata": "root.Touch", "header": "['module', '___EOS___']", "index": 31 }, { "content": " def get(self):\n pass", "metadata": "root.Touch.get", "header": "['class', 'Touch', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 32 }, { "content": "class Logout(RequestHandler):", "metadata": "root.Logout", "header": "['module', '___EOS___']", "index": 35 }, { "content": "\tdef get(self):\n\t\tself.session.end()", "metadata": "root.Logout.get", "header": "['class', 'Logout', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 36 }, { "content": "def application():\n\treturn webapp.WSGIApplication(\n\t\t\t[\t('/login', Login),\n\t\t\t\t('/regen', Regen),\n\t\t\t\t('/touch', Touch),\n\t\t\t\t('/logout', Logout)\t],\n\t\t\tdebug=True)", "metadata": "root.application", "header": "['module', '___EOS___']", "index": 39 }, { "content": "def test_login():\n\tapp = TestApp(application())\n\n\t## forge the session cookie ##\n\tapp = TestApp(application())\n\n\tresponse = app.post( '/login', {'nickname': 'foo'} )\n\n\tres = str(response)\n\tassert 'SID=' in res\n\tassert 'user=\"foo' in res\n\tassert 'atime=' in res", "metadata": "root.test_login", "header": "['module', '___EOS___']", "index": 47 }, { "content": "def test_logout():\n\tapp = TestApp(application())\n\n\t## forge the session cookie ##\n\tSID = 'safd32hfsdasdh'\n\tc = SignedCookie(SECRET_KEY + SID)\n\tc['SID'] = SID\n\tc['user'] = 'foo'\n\tc['atime'] = timegm( gmtime() )\n\ts = 'Cookie: '+ '; '.join( m.output()[12:] for m in c.values() )\n\t\n\tresponse = app.get('/logout', extra_environ={'HTTP_COOKIE': s})\n\t\n\tres = str(response)\n\tassert re.search('SID=.*Max-Age=0', res)\n\tassert re.search('user=\"foo.*Max-Age=0', res)\n\tassert re.search('atime=.*Max-Age=0', res)", "metadata": "root.test_logout", "header": "['module', '___EOS___']", "index": 60 }, { "content": "def test_regen():\n\tapp = TestApp(application())\n\n\t## forge the session cookie ##\n\tSID = 'sfh98324igfnad'\n\tc = SignedCookie(SECRET_KEY + SID)\n\tc['SID'] = SID\n\tc['user'] = 'foo'\n\tc['atime'] = timegm( gmtime() )\n\ts = 'Cookie: '+ '; '.join( m.output()[12:] for m in c.values() )\n\t\n\tresponse = app.post('/regen', extra_environ={'HTTP_COOKIE': s})\n\t\n\tres = str(response)\n\tnew_SID = re.search('SID=\"(.*)\"', res).group(1)\n\tnew_user = re.search('user=\"(.*)\"', res).group(1)\n\tassert new_SID[:-SIG_LEN] != c['SID'].value\n\tassert new_user[:-SIG_LEN] == c['user'].value\n\tassert new_user != c['user'].coded_value", "metadata": "root.test_regen", "header": "['module', '___EOS___']", "index": 78 }, { "content": "def test_autoregen():\n\tapp = TestApp(application())\n\n\t## forge the session cookie ##\n\tSID = 'klah23dsfohdshds82'\n\tc = SignedCookie(SECRET_KEY + SID)\n\tc['SID'] = SID\n\tc['user'] = 'foo'\n\tc['atime'] = timegm( gmtime() ) - SID_TTL - 1\n\ts = 'Cookie: '+ '; '.join( m.output()[12:] for m in c.values() )\n\t\n\tresponse = app.get('/touch', extra_environ={'HTTP_COOKIE': s})\n\t\n\tres = str(response)\n\tnew_SID = re.search('SID=\"(.*)\"', res).group(1)\n\tnew_user = re.search('user=\"(.*)\"', res).group(1)\n\tassert new_SID[:-SIG_LEN] != c['SID'].value\n\tassert new_user[:-SIG_LEN] == c['user'].value\n\tassert new_user != c['user'].coded_value", "metadata": "root.test_autoregen", "header": "['module', '___EOS___']", "index": 98 }, { "content": "def test_autoexpire():\n\tapp = TestApp(application())\n\n\t## forge the session cookie ##\n\tSID = 'afds87asg3hasdf'\n\tc = SignedCookie(SECRET_KEY + SID)\n\tc['SID'] = SID\n\tc['user'] = 'foo'\n\tc['atime'] = timegm( gmtime() ) - SESSION_TTL - 1\n\ts = 'Cookie: '+ '; '.join( m.output()[12:] for m in c.values() )\n\t\n\tresponse = app.get('/touch', extra_environ={'HTTP_COOKIE': s})\n\t\n\tres = str(response)\n\tassert re.search('SID=.*Max-Age=0', res)\n\tassert re.search('user=.*Max-Age=0', res)\n\tassert re.search('atime=.*Max-Age=0', res)", "metadata": "root.test_autoexpire", "header": "['module', '___EOS___']", "index": 118 } ]
[ { "span": "from time import time, gmtime", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 29 }, { "span": "from google.appengine.ext.webapp import util", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 44 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "nose", "tests", " ", "--", "with", "-", "gae", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "time_", ",_", "gmtime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "calendar_", "import_", "time", "gm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "web", "test_", "import_", "Test", "App_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "ext_", "import_", "webapp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "ext_", "._", "webapp_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hack", " ", "the", " ", "path_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'..'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sign", "edc", "ook", "ie_", "import_", "Signe", "d", "Cookie_", ",_", "SIG", "\\u", "LEN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "session_", "import_", "Request", "Handler_", ",_", "SEC", "RET", "\\u", "KEY_", ",_", "SES", "SION", "\\u", "TTL", "_", ",_", "SID", "\\u", "TTL", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mock_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "User_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "nickname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "nickname_", "=_", "nickname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Login_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Login_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "post_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "nickname_", "=_", "self_", "._", "request_", "._", "get_", "(_", "'", "nick", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "session_", "._", "start_", "(_", "User_", "(_", "nickname_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Rege", "n_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rege", "n_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "post_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "session_", "._", "regen", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Tou", "ch_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tou", "ch_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "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_", "Logo", "ut_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "session_", "._", "end_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "application_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "webapp_", "._", "WS", "GI", "Application_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'/", "login", "'_", ",_", "Login_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "regen", "'_", ",_", "Rege", "n_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "touch", "'_", ",_", "Tou", "ch_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "logo", "ut", "'_", ",_", "Logo", "ut_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "login_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "app_", "=_", "Test", "App_", "(_", "application_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "forge", " ", "the", " ", "session", " ", "cookie", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "Test", "App_", "(_", "application_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "app_", "._", "post_", "(_", "'/", "login", "'_", ",_", "{_", "'", "nick", "name", "'_", ":_", "'", "foo", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "str_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "SID", "='_", "in_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "user", "=\"", "foo", "'_", "in_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "atime", "='_", "in_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "logout_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "app_", "=_", "Test", "App_", "(_", "application_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "forge", " ", "the", " ", "session", " ", "cookie", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "SID", "_", "=_", "'", "saf", "d3", "2h", "fs", "das", "dh", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "Signe", "d", "Cookie_", "(_", "SEC", "RET", "\\u", "KEY_", "+_", "SID", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "SID", "'_", "]_", "=_", "SID", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "user", "'_", "]_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "atime", "'_", "]_", "=_", "time", "gm_", "(_", "gmtime_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "'", "Cooki", "e", ":", " ", "'_", "+_", "';", " ", "'_", "._", "join_", "(_", "m_", "._", "output_", "(_", ")_", "[_", "12_", ":_", "]_", "for_", "m_", "in_", "c_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "app_", "._", "get_", "(_", "'/", "logo", "ut", "'_", ",_", "extra", "\\u", "environ_", "=_", "{_", "'", "HTTP", "\\u", "COOKIE", "'_", ":_", "s_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "str_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "'", "SID", "=.", "*", "Max", "-", "Age", "=", "0", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "'", "user", "=\"", "foo", ".*", "Max", "-", "Age", "=", "0", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "'", "atime", "=.", "*", "Max", "-", "Age", "=", "0", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "regen", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "app_", "=_", "Test", "App_", "(_", "application_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "forge", " ", "the", " ", "session", " ", "cookie", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "SID", "_", "=_", "'", "sf", "h", "983", "24", "ig", "fna", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "Signe", "d", "Cookie_", "(_", "SEC", "RET", "\\u", "KEY_", "+_", "SID", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "SID", "'_", "]_", "=_", "SID", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "user", "'_", "]_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "atime", "'_", "]_", "=_", "time", "gm_", "(_", "gmtime_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "'", "Cooki", "e", ":", " ", "'_", "+_", "';", " ", "'_", "._", "join_", "(_", "m_", "._", "output_", "(_", ")_", "[_", "12_", ":_", "]_", "for_", "m_", "in_", "c_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "app_", "._", "post_", "(_", "'/", "regen", "'_", ",_", "extra", "\\u", "environ_", "=_", "{_", "'", "HTTP", "\\u", "COOKIE", "'_", ":_", "s_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "str_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "SID", "_", "=_", "re_", "._", "search_", "(_", "'", "SID", "=\"(", ".*)", "\"'_", ",_", "res_", ")_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "user_", "=_", "re_", "._", "search_", "(_", "'", "user", "=\"(", ".*)", "\"'_", ",_", "res_", ")_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "new", "\\u", "SID", "_", "[_", ":_", "-_", "SIG", "\\u", "LEN_", "]_", "!=_", "c_", "[_", "'", "SID", "'_", "]_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "new", "\\u", "user_", "[_", ":_", "-_", "SIG", "\\u", "LEN_", "]_", "==_", "c_", "[_", "'", "user", "'_", "]_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "new", "\\u", "user_", "!=_", "c_", "[_", "'", "user", "'_", "]_", "._", "code", "d\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "autore", "gen_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "app_", "=_", "Test", "App_", "(_", "application_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "forge", " ", "the", " ", "session", " ", "cookie", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "SID", "_", "=_", "'", "kla", "h2", "3d", "sfo", "hd", "sh", "ds", "8", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "Signe", "d", "Cookie_", "(_", "SEC", "RET", "\\u", "KEY_", "+_", "SID", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "SID", "'_", "]_", "=_", "SID", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "user", "'_", "]_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "atime", "'_", "]_", "=_", "time", "gm_", "(_", "gmtime_", "(_", ")_", ")_", "-_", "SID", "\\u", "TTL", "_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "'", "Cooki", "e", ":", " ", "'_", "+_", "';", " ", "'_", "._", "join_", "(_", "m_", "._", "output_", "(_", ")_", "[_", "12_", ":_", "]_", "for_", "m_", "in_", "c_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "app_", "._", "get_", "(_", "'/", "touch", "'_", ",_", "extra", "\\u", "environ_", "=_", "{_", "'", "HTTP", "\\u", "COOKIE", "'_", ":_", "s_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "str_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "SID", "_", "=_", "re_", "._", "search_", "(_", "'", "SID", "=\"(", ".*)", "\"'_", ",_", "res_", ")_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "user_", "=_", "re_", "._", "search_", "(_", "'", "user", "=\"(", ".*)", "\"'_", ",_", "res_", ")_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "new", "\\u", "SID", "_", "[_", ":_", "-_", "SIG", "\\u", "LEN_", "]_", "!=_", "c_", "[_", "'", "SID", "'_", "]_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "new", "\\u", "user_", "[_", ":_", "-_", "SIG", "\\u", "LEN_", "]_", "==_", "c_", "[_", "'", "user", "'_", "]_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "new", "\\u", "user_", "!=_", "c_", "[_", "'", "user", "'_", "]_", "._", "code", "d\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "autoe", "xp", "ire_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "app_", "=_", "Test", "App_", "(_", "application_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "forge", " ", "the", " ", "session", " ", "cookie", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "SID", "_", "=_", "'", "af", "ds", "87", "asg", "3", "has", "df", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "Signe", "d", "Cookie_", "(_", "SEC", "RET", "\\u", "KEY_", "+_", "SID", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "SID", "'_", "]_", "=_", "SID", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "user", "'_", "]_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "[_", "'", "atime", "'_", "]_", "=_", "time", "gm_", "(_", "gmtime_", "(_", ")_", ")_", "-_", "SES", "SION", "\\u", "TTL", "_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "'", "Cooki", "e", ":", " ", "'_", "+_", "';", " ", "'_", "._", "join_", "(_", "m_", "._", "output_", "(_", ")_", "[_", "12_", ":_", "]_", "for_", "m_", "in_", "c_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "app_", "._", "get_", "(_", "'/", "touch", "'_", ",_", "extra", "\\u", "environ_", "=_", "{_", "'", "HTTP", "\\u", "COOKIE", "'_", ":_", "s_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "str_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "'", "SID", "=.", "*", "Max", "-", "Age", "=", "0", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "'", "user", "=.", "*", "Max", "-", "Age", "=", "0", "'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "'", "atime", "=.", "*", "Max", "-", "Age", "=", "0", "'_", ",_", "res_", ")_" ]
[ 4, 4, 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, 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, 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, 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 ]
Except block handles 'BaseException'
rholder/retrying/retrying.py
[ { "content": " def call(self, fn, *args, **kwargs):\n start_time = int(round(time.time() * 1000))\n attempt_number = 1\n while True:\n try:\n attempt = Attempt(fn(*args, **kwargs), attempt_number, False)\n except:\n tb = sys.exc_info()\n attempt = Attempt(tb, attempt_number, True)\n\n if not self.should_reject(attempt):\n return attempt.get(self._wrap_exception)\n\n delay_since_first_attempt_ms = int(round(time.time() * 1000)) - start_time\n if self.stop(attempt_number, delay_since_first_attempt_ms):\n if not self._wrap_exception and attempt.has_exception:\n # get() on an attempt with an exception should cause it to be raised, but raise just in case\n raise attempt.get()\n else:\n raise RetryError(attempt)\n else:\n sleep = self.wait(attempt_number, delay_since_first_attempt_ms)\n if self._wait_jitter_max:\n jitter = random.random() * self._wait_jitter_max\n sleep = sleep + max(0, jitter)\n time.sleep(sleep / 1000.0)\n\n attempt_number += 1", "metadata": "root.Retrying.call", "header": "['class', 'Retrying', '(', 'object', ')', ':', '___EOS___']", "index": 194 } ]
[ { "span": "except:", "start_line": 200, "start_column": 12, "end_line": 200, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Retr", "ying", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "call_", "(_", "self_", ",_", "fn_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "time_", "=_", "int_", "(_", "round_", "(_", "time_", "._", "time_", "(_", ")_", "*_", "1000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "atte", "mpt", "\\u", "number_", "=_", "1_", "\\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 ", " _", "attempt_", "=_", "Atte", "mpt", "_", "(_", "fn_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ",_", "atte", "mpt", "\\u", "number_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tb_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attempt_", "=_", "Atte", "mpt", "_", "(_", "tb_", ",_", "atte", "mpt", "\\u", "number_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "shou", "ld", "\\u", "reject_", "(_", "attempt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "attempt_", "._", "get_", "(_", "self_", "._", "\\u", "wrap", "\\u", "exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dela", "y", "\\u", "sinc", "e\\u", "first", "\\u", "atte", "mpt", "\\u", "ms_", "=_", "int_", "(_", "round_", "(_", "time_", "._", "time_", "(_", ")_", "*_", "1000_", ")_", ")_", "-_", "start", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "stop_", "(_", "atte", "mpt", "\\u", "number_", ",_", "dela", "y", "\\u", "sinc", "e\\u", "first", "\\u", "atte", "mpt", "\\u", "ms_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "wrap", "\\u", "exception_", "and_", "attempt_", "._", "has", "\\u", "exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", "()", " ", "on", " ", "an", " ", "atte", "mpt", " ", "with", " ", "an", " ", "exception", " ", "shou", "ld", " ", "caus", "e", " ", "it", " ", "to", " ", "be", " ", "raise", "d", ",", " ", "but", " ", "raise", " ", "just", " ", "in", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "attempt_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Retr", "y", "Error_", "(_", "attempt_", ")_", "\\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 ", " _", "sleep_", "=_", "self_", "._", "wait_", "(_", "atte", "mpt", "\\u", "number_", ",_", "dela", "y", "\\u", "sinc", "e\\u", "first", "\\u", "atte", "mpt", "\\u", "ms_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "wait", "\\u", "jitter", "\\u", "max_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "jitter_", "=_", "random_", "._", "random_", "(_", ")_", "*_", "self_", "._", "\\u", "wait", "\\u", "jitter", "\\u", "max_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "=_", "sleep_", "+_", "max_", "(_", "0_", ",_", "jitter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "sleep_", "/_", "1000.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "atte", "mpt", "\\u", "number_", "+=_", "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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
ardekantur/pyglet/tests/image/MATRIX_RGB.py
[ { "content": "#!/usr/bin/env python\n\n'''Test rearrangement of color components using the OpenGL color matrix.\nThe test will be skipped if the GL_ARB_imaging extension is not present.\n\nYou should see the RGB test image correctly rendered. Press ESC to\nend the test.\n'''\n\n__docformat__ = 'restructuredtext'\n__version__ = '$Id$'\n\nimport unittest\nimport base_load\nimport sys\n\nfrom pyglet.gl import gl_info\n\n\nif __name__ == '__main__':\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TEST_MATRIX_RGB(base_load.TestLoad):\n texture_file = 'rgb.png'\n ", "metadata": "root.TEST_MATRIX_RGB", "header": "['module', '___EOS___']", "index": 18 }, { "content": " def load_image(self):\n if not gl_info.have_extension('GL_ARB_imaging'):\n print 'GL_ARB_imaging is not present, skipping test.'\n self.has_exit = True\n else:\n # Load image as usual then rearrange components\n super(TEST_MATRIX_RGB, self).load_image()\n self.image.format = 'GRB'\n pixels = self.image.data # forces conversion", "metadata": "root.TEST_MATRIX_RGB.load_image", "header": "['class', 'TEST_MATRIX_RGB', '(', 'base_load', '.', 'TestLoad', ')', ':', '___EOS___']", "index": 21 } ]
[ { "span": "import sys", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Test", " ", "rear", "range", "ment", " ", "of", " ", "color", " ", "component", "s", " ", "usi", "ng", " ", "the", " ", "Open", "GL", " ", "color", " ", "matrix", ".", "\\", "10", ";", "The", " ", "test", " ", "will", " ", "be", " ", "skip", "ped", " ", "if", " ", "the", " ", "GL", "\\u", "AR", "B", "\\u", "imagin", "g", " ", "extensi", "on", " ", "is", " ", "not", " ", "presen", "t", ".", "\\", "10", ";", "\\", "10", ";", "You", " ", "shou", "ld", " ", "see", " ", "the", " ", "RGB", " ", "test", " ", "image", " ", "correct", "ly", " ", "render", "ed", ".", " ", " ", "Press", " ", "ESC", " ", "to", "\\", "10", ";", "end", " ", "the", " ", "test", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "docformat", "\\u\\u_", "=_", "'", "restructur", "edt", "ext", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'$", "Id", "$'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base", "\\u", "load_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyglet_", "._", "gl_", "import_", "gl", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "TEST", "\\u", "MATRIX", "\\u", "RGB_", "(_", "base", "\\u", "load_", "._", "Test", "Load_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "textu", "re", "\\u", "file_", "=_", "'", "rgb", ".", "png", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "TEST", "\\u", "MATRIX", "\\u", "RGB_", "(_", "base", "\\u", "load_", "._", "Test", "Load_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "load", "\\u", "image_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "gl", "\\u", "info_", "._", "have", "\\u", "extension_", "(_", "'", "GL", "\\u", "AR", "B", "\\u", "imagin", "g", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "GL", "\\u", "AR", "B", "\\u", "imagin", "g", " ", "is", " ", "not", " ", "presen", "t", ",", " ", "skip", "ping", " ", "test", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "has", "\\u", "exit_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Load", " ", "image", " ", "as", " ", "usual", " ", "then", " ", "rear", "range", " ", "components_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "TEST", "\\u", "MATRIX", "\\u", "RGB_", ",_", "self_", ")_", "._", "load", "\\u", "image_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "image_", "._", "format_", "=_", "'", "GR", "B", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pixels_", "=_", "self_", "._", "image_", "._", "data_", "#", " ", "force", "s", " ", "conversion_", "\\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, 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, 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 ]
Comparison using is when operands support `__eq__`
skibblenybbles/django-commando/commando/management/base.py
[ { "content": "def get_option_default(option):\n \"\"\"\n Given an optparse.Option, returns a two-tuple of the option's variable name\n and default value.\n \n \"\"\"\n return (\n option.dest, \n None if option.default is optparse.NO_DEFAULT else option.default,\n )", "metadata": "root.get_option_default", "header": "['module', '___EOS___']", "index": 11 } ]
[ { "span": "option.default is optparse.NO_DEFAULT ", "start_line": 19, "start_column": 16, "end_line": 19, "end_column": 53 } ]
[]
1
false
[ "[CLS]_", "Compari", "son_", "using_", "is_", "when_", "operands_", "support_", " _", "`_", "\\u\\u", "eq\\u\\u_", "`_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "option", "\\u", "default_", "(_", "option_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "an", " ", "optparse", ".", "Optio", "n", ",", " ", "return", "s", " ", "a", " ", "two", "-", "tuple", " ", "of", " ", "the", " ", "option", "'", "s", " ", "variab", "le", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "default", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "option_", "._", "dest_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", "if_", "option_", "._", "default_", "is_", "optparse_", "._", "NO", "\\u", "DEFAULT_", "else_", "option_", "._", "default_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
QuantSoftware/QuantSoftwareToolkit/QSTK/qstkfeat/features.py
[ { "content": "def featDrawDown( dData, lLookback=30, b_human=False):\n '''\n @summary: Calculate Drawdown for the stock\n @param dData: Dictionary of data to use\n @param lLookback: Days to look back\n @return: DataFrame array containing values\n @param b_human: if true return dataframe to plot\n @warning: Drawdown and RunUp can depend heavily on sample period\n '''\n \n dfPrice = dData['close']\n \n #''' Feature DataFrame will be 1:1, we can use the price as a template '''\n dfRet = pand.DataFrame( index=dfPrice.index, columns=dfPrice.columns, data=np.zeros(dfPrice.shape) )\n \n dfMax = pand.rolling_max(dfPrice, lLookback)\n return (dfMax - dfPrice) / dfMax;\n \n if b_human:\n for sym in dData['close']:\n x=1000/dData['close'][sym][0]\n dData['close'][sym]=dData['close'][sym]*x\n return dData['close']\n return dfRet", "metadata": "root.featDrawDown", "header": "['module', '___EOS___']", "index": 272 }, { "content": "def featBollinger( dData, lLookback=20, b_human=False ):\n '''\n @summary: Calculate bollinger position as a function of std deviations.\n @param dData: Dictionary of data to use\n @param lLookback: Number of days to calculate moving average over\n @param b_human: if true return dataframe to plot\n @return: DataFrame array containing feature values\n '''\n if b_human:\n dfPrice = dData['close']\n nstdsRet = pand.DataFrame( index=dfPrice.index, columns=dfPrice.columns, data=np.zeros(dfPrice.shape) )\n #average minus standard deviation\n pstdsRet = pand.DataFrame( index=dfPrice.index, columns=dfPrice.columns, data=np.zeros(dfPrice.shape) ) \n data3 = pand.DataFrame({\"Raw\":dfPrice[dfPrice.columns[0]]})\n for sym in dfPrice.columns:\n if sym != '$SPX' and sym != '$VIX':\n tsPrice = dfPrice[sym]\n nstdRet = nstdsRet[sym]\n pstdRet = pstdsRet[sym]\n for i in range(len(tsPrice.index)):\n if i < lLookback - 1:\n nstdRet[i] = float('nan')\n pstdRet[i] = float('nan')\n continue \n fAvg = np.average( tsPrice[ i-(lLookback-1):i+1 ] )\n fStd = np.std( tsPrice[ i-(lLookback-1):i+1 ] )\n pstdRet[i] = fAvg+2.0*fStd\n nstdRet[i] = fAvg-2.0*fStd \n data3[sym] = dfPrice[sym]\n data3[sym + \" Lower\"] = nstdsRet[sym]\n data3[sym + \" Upper\"] = pstdsRet[sym]\n del data3['Raw']\n return data3\n else:\n dfPrice = dData['close']\n #''' Feature DataFrame will be 1:1, we can use the price as a template '''\n dfRet = pand.DataFrame( index=dfPrice.index, columns=dfPrice.columns, data=np.zeros(dfPrice.shape) )\n \n #''' Loop through stocks '''\n dfAvg = pand.rolling_mean(dfPrice, lLookback)\n dfStd = pand.rolling_std(dfPrice, lLookback)\n return (dfPrice - dfAvg) / (2.0*dfStd)", "metadata": "root.featBollinger", "header": "['module', '___EOS___']", "index": 446 } ]
[ { "span": "dfRet ", "start_line": 285, "start_column": 4, "end_line": 285, "end_column": 9 }, { "span": "dfRet ", "start_line": 482, "start_column": 8, "end_line": 482, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "feat", "Draw", "Down_", "(_", "d", "Data_", ",_", "l", "Look", "back_", "=_", "30_", ",_", "b", "\\u", "human_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "@", "summar", "y", ":", " ", "Calculat", "e", " ", "Draw", "down", " ", "for", " ", "the", " ", "stock", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "d", "Data", ":", " ", "Dict", "ionar", "y", " ", "of", " ", "data", " ", "to", " ", "use", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "l", "Look", "back", ":", " ", "Day", "s", " ", "to", " ", "look", " ", "back", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "Data", "Frame", " ", "array", " ", "contain", "ing", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "b", "\\u", "human", ":", " ", "if", " ", "true", " ", "return", " ", "dataframe", " ", "to", " ", "plot", "\\", "10", ";", " ", " ", " ", " ", "@", "warn", "ing", ":", " ", "Draw", "down", " ", "and", " ", "Run", "Up", " ", "can", " ", "depend", " ", "heav", "il", "y", " ", "on", " ", "sample", " ", "period", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df", "Price_", "=_", "d", "Data_", "[_", "'", "close", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#'", "''", " ", "Feature", " ", "Data", "Frame", " ", "will", " ", "be", " ", "1", ":", "1", ",", " ", "we", " ", "can", " ", "use", " ", "the", " ", "price", " ", "as", " ", "a", " ", "template", " ", "'''_", "\\u\\u\\uNL\\u\\u\\u_", "df", "Ret_", "=_", "pand", "_", "._", "Data", "Frame_", "(_", "index_", "=_", "df", "Price_", "._", "index_", ",_", "columns_", "=_", "df", "Price_", "._", "columns_", ",_", "data_", "=_", "np_", "._", "zeros_", "(_", "df", "Price_", "._", "shape_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df", "Max_", "=_", "pand", "_", "._", "rolling", "\\u", "max_", "(_", "df", "Price_", ",_", "l", "Look", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "df", "Max_", "-_", "df", "Price_", ")_", "/_", "df", "Max_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "b", "\\u", "human_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "sym_", "in_", "d", "Data_", "[_", "'", "close", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "1000_", "/_", "d", "Data_", "[_", "'", "close", "'_", "]_", "[_", "sym_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d", "Data_", "[_", "'", "close", "'_", "]_", "[_", "sym_", "]_", "=_", "d", "Data_", "[_", "'", "close", "'_", "]_", "[_", "sym_", "]_", "*_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d", "Data_", "[_", "'", "close", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "df", "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_", "def_", "feat", "Bol", "ling", "er_", "(_", "d", "Data_", ",_", "l", "Look", "back_", "=_", "20_", ",_", "b", "\\u", "human_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "@", "summar", "y", ":", " ", "Calculat", "e", " ", "bol", "ling", "er", " ", "position", " ", "as", " ", "a", " ", "function", " ", "of", " ", "std", " ", "deviation", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "d", "Data", ":", " ", "Dict", "ionar", "y", " ", "of", " ", "data", " ", "to", " ", "use", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "l", "Look", "back", ":", " ", "Number", " ", "of", " ", "day", "s", " ", "to", " ", "calcul", "ate", " ", "movin", "g", " ", "averag", "e", " ", "over", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "b", "\\u", "human", ":", " ", "if", " ", "true", " ", "return", " ", "dataframe", " ", "to", " ", "plot", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "Data", "Frame", " ", "array", " ", "contain", "ing", " ", "feature", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "b", "\\u", "human_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df", "Price_", "=_", "d", "Data_", "[_", "'", "close", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nst", "ds", "Ret_", "=_", "pand", "_", "._", "Data", "Frame_", "(_", "index_", "=_", "df", "Price_", "._", "index_", ",_", "columns_", "=_", "df", "Price_", "._", "columns_", ",_", "data_", "=_", "np_", "._", "zeros_", "(_", "df", "Price_", "._", "shape_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "averag", "e", " ", "minu", "s", " ", "standard", " ", "deviation", "_", "\\u\\u\\uNL\\u\\u\\u_", "pst", "ds", "Ret_", "=_", "pand", "_", "._", "Data", "Frame_", "(_", "index_", "=_", "df", "Price_", "._", "index_", ",_", "columns_", "=_", "df", "Price_", "._", "columns_", ",_", "data_", "=_", "np_", "._", "zeros_", "(_", "df", "Price_", "._", "shape_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data", "3_", "=_", "pand", "_", "._", "Data", "Frame_", "(_", "{_", "\"", "Ra", "w", "\"_", ":_", "df", "Price_", "[_", "df", "Price_", "._", "columns_", "[_", "0_", "]_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sym_", "in_", "df", "Price_", "._", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sym_", "!=_", "'$", "SP", "X", "'_", "and_", "sym_", "!=_", "'$", "VI", "X", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ts", "Price_", "=_", "df", "Price_", "[_", "sym_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nst", "d", "Ret_", "=_", "nst", "ds", "Ret_", "[_", "sym_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pst", "d", "Ret_", "=_", "pst", "ds", "Ret_", "[_", "sym_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "ts", "Price_", "._", "index_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "i_", "<_", "l", "Look", "back_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "nst", "d", "Ret_", "[_", "i_", "]_", "=_", "float_", "(_", "'", "nan", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pst", "d", "Ret_", "[_", "i_", "]_", "=_", "float_", "(_", "'", "nan", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f", "Avg_", "=_", "np_", "._", "average_", "(_", "ts", "Price_", "[_", "i_", "-_", "(_", "l", "Look", "back_", "-_", "1_", ")_", ":_", "i_", "+_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f", "Std", "_", "=_", "np_", "._", "std_", "(_", "ts", "Price_", "[_", "i_", "-_", "(_", "l", "Look", "back_", "-_", "1_", ")_", ":_", "i_", "+_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pst", "d", "Ret_", "[_", "i_", "]_", "=_", "f", "Avg_", "+_", "2.0_", "*_", "f", "Std", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nst", "d", "Ret_", "[_", "i_", "]_", "=_", "f", "Avg_", "-_", "2.0_", "*_", "f", "Std", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data", "3_", "[_", "sym_", "]_", "=_", "df", "Price_", "[_", "sym_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data", "3_", "[_", "sym_", "+_", "\"", " ", "Lower", "\"_", "]_", "=_", "nst", "ds", "Ret_", "[_", "sym_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data", "3_", "[_", "sym_", "+_", "\"", " ", "Upp", "er", "\"_", "]_", "=_", "pst", "ds", "Ret_", "[_", "sym_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "data", "3_", "[_", "'", "Ra", "w", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data", "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 ", " _", "df", "Price_", "=_", "d", "Data_", "[_", "'", "close", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#'", "''", " ", "Feature", " ", "Data", "Frame", " ", "will", " ", "be", " ", "1", ":", "1", ",", " ", "we", " ", "can", " ", "use", " ", "the", " ", "price", " ", "as", " ", "a", " ", "template", " ", "'''_", "\\u\\u\\uNL\\u\\u\\u_", "df", "Ret_", "=_", "pand", "_", "._", "Data", "Frame_", "(_", "index_", "=_", "df", "Price_", "._", "index_", ",_", "columns_", "=_", "df", "Price_", "._", "columns_", ",_", "data_", "=_", "np_", "._", "zeros_", "(_", "df", "Price_", "._", "shape_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#'", "''", " ", "Loop", " ", "through", " ", "stocks", " ", "'''_", "\\u\\u\\uNL\\u\\u\\u_", "df", "Avg_", "=_", "pand", "_", "._", "rolling", "\\u", "mean_", "(_", "df", "Price_", ",_", "l", "Look", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df", "Std", "_", "=_", "pand", "_", "._", "rolling", "\\u", "std_", "(_", "df", "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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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 ]
Unnecessary pass
PMEAL/OpenPNM/OpenPNM/Network/__MatFile__.py
[ { "content": " def _remove_disconnected_clusters(self):\n bad_pores = sp.array([], dtype=int)\n self._pore_map = self.pores()\n self._throat_map = self.throats()\n health = self.check_network_health()\n if health['disconnected_clusters'] == []:\n self._throat_map = self.throats()\n self._pore_map = self.pores()\n else:\n Np = self.num_pores()\n Nt = self.num_throats()\n cluster_sizes = [sp.shape(x)[0] for x in health['disconnected_clusters']]\n # 50 or less, if it's a really small network.\n acceptable_size = min([min([50, Np/2]), max(cluster_sizes)])\n # Step through each cluster of pores. If its a small cluster,\n # add it to the list\n for cluster in health['disconnected_clusters']:\n if sp.shape(cluster)[0] < acceptable_size:\n bad_pores = sp.append(bad_pores, sp.ravel(cluster))\n bad_throats = sp.unique(self.find_neighbor_throats(bad_pores))\n # Create map for pores\n if sp.shape(bad_pores)[0] > 0:\n i = 0\n self._pore_map = sp.zeros((Np-sp.shape(bad_pores)[0],), dtype=int)\n for pore in self.pores():\n if pore not in bad_pores:\n self._pore_map[i] = pore\n i += 1\n # Create map for throats\n if sp.shape(bad_throats)[0] > 0:\n i = 0\n self._throat_map = sp.zeros((Nt - sp.shape(bad_throats)[0],),\n dtype=int)\n for throat in self.throats():\n if throat not in bad_throats:\n self._throat_map[i] = throat\n i += 1\n # Fix the pore transformer\n try:\n if sp.shape(bad_pores)[0] > 0:\n i = 0\n old_transform = self._dictionary['pname_transform']\n self._dictionary['pname_transform'] = \\\n sp.zeros((Np-sp.shape(bad_pores)[0],), dtype=int)\n for pore in self.pores():\n if pore not in bad_pores:\n self._dictionary['pname_transform'][i] = \\\n old_transform[pore]\n i += 1\n except:\n logger.info('Could not update pname_transform. Imported network \\\n may not have had it.')\n pass\n self.trim(pores=bad_pores)", "metadata": "root.MatFile._remove_disconnected_clusters", "header": "['class', 'MatFile', '(', 'GenericNetwork', ')', ':', '___EOS___']", "index": 112 }, { "content": " def _add_xtra_pore_data(self):\n xpdata = self._xtra_pore_data\n if xpdata is not None:\n if isinstance(xpdata, type([])):\n for pdata in xpdata:\n try:\n self['pore.' + pdata] = \\\n self._dictionary['p' + pdata][self._pore_map]\n except:\n logger.warning('Could not add pore data: ' + pdata +\n ' to network')\n pass\n else:\n try:\n self['pore.' + xpdata] = \\\n self._dictionary['p'+xpdata][self._pore_map]\n except:\n logger.warning('Could not add pore data: '+xpdata+' to network')\n pass", "metadata": "root.MatFile._add_xtra_pore_data", "header": "['class', 'MatFile', '(', 'GenericNetwork', ')', ':', '___EOS___']", "index": 253 }, { "content": " def _add_xtra_throat_data(self):\n xtdata = self._xtra_throat_data\n if xtdata is not None:\n if isinstance(xtdata, type([])):\n for tdata in xtdata:\n try:\n self['throat.' + tdata] = \\\n self._dictionary['t' + tdata][self._throat_map]\n except:\n logger.warning('Could not add throat data: ' + tdata +\n ' to network')\n pass\n else:\n try:\n self['throat.' + xtdata] = \\\n self._dictionary['t' + xtdata][self._throat_map]\n except:\n logger.warning('Could not add throat data: ' + xtdata +\n ' to network')\n pass", "metadata": "root.MatFile._add_xtra_throat_data", "header": "['class', 'MatFile', '(', 'GenericNetwork', ')', ':', '___EOS___']", "index": 273 } ]
[ { "span": "pass", "start_line": 164, "start_column": 16, "end_line": 164, "end_column": 20 }, { "span": "pass", "start_line": 264, "start_column": 24, "end_line": 264, "end_column": 28 }, { "span": "pass", "start_line": 271, "start_column": 20, "end_line": 271, "end_column": 24 }, { "span": "pass", "start_line": 284, "start_column": 24, "end_line": 284, "end_column": 28 }, { "span": "pass", "start_line": 292, "start_column": 20, "end_line": 292, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Mat", "File_", "(_", "Gene", "ric", "Network_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "remove", "\\u", "disconnected", "\\u", "clusters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bad", "\\u", "pore", "s_", "=_", "sp_", "._", "array_", "(_", "[_", "]_", ",_", "dtype_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "pore", "\\u", "map_", "=_", "self_", "._", "pore", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "thro", "at", "\\u", "map_", "=_", "self_", "._", "thro", "ats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "health_", "=_", "self_", "._", "check", "\\u", "network", "\\u", "health_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "health_", "[_", "'", "disconnected", "\\u", "cluster", "s", "'_", "]_", "==_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "thro", "at", "\\u", "map_", "=_", "self_", "._", "thro", "ats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "pore", "\\u", "map_", "=_", "self_", "._", "pore", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Np", "_", "=_", "self_", "._", "num", "\\u", "pore", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Nt", "_", "=_", "self_", "._", "num", "\\u", "thro", "ats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cluster", "\\u", "sizes_", "=_", "[_", "sp_", "._", "shape_", "(_", "x_", ")_", "[_", "0_", "]_", "for_", "x_", "in_", "health_", "[_", "'", "disconnected", "\\u", "cluster", "s", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "50", " ", "or", " ", "less", ",", " ", "if", " ", "it", "'", "s", " ", "a", " ", "reall", "y", " ", "small", " ", "network", "._", "\\u\\u\\uNL\\u\\u\\u_", "acceptabl", "e\\u", "size_", "=_", "min_", "(_", "[_", "min_", "(_", "[_", "50_", ",_", "Np", "_", "/_", "2_", "]_", ")_", ",_", "max_", "(_", "cluster", "\\u", "sizes_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Step", " ", "through", " ", "each", " ", "cluster", " ", "of", " ", "pore", "s", ".", " ", "If", " ", "its", " ", "a", " ", "small", " ", "cluster", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "it", " ", "to", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "cluster_", "in_", "health_", "[_", "'", "disconnected", "\\u", "cluster", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sp_", "._", "shape_", "(_", "cluster_", ")_", "[_", "0_", "]_", "<_", "acceptabl", "e\\u", "size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bad", "\\u", "pore", "s_", "=_", "sp_", "._", "append_", "(_", "bad", "\\u", "pore", "s_", ",_", "sp_", "._", "ravel_", "(_", "cluster_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bad", "\\u", "thro", "ats_", "=_", "sp_", "._", "unique_", "(_", "self_", "._", "find", "\\u", "neighbor", "\\u", "thro", "ats_", "(_", "bad", "\\u", "pore", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "map", " ", "for", " ", "pore", "s_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sp_", "._", "shape_", "(_", "bad", "\\u", "pore", "s_", ")_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "pore", "\\u", "map_", "=_", "sp_", "._", "zeros_", "(_", "(_", "Np", "_", "-_", "sp_", "._", "shape_", "(_", "bad", "\\u", "pore", "s_", ")_", "[_", "0_", "]_", ",_", ")_", ",_", "dtype_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pore", "_", "in_", "self_", "._", "pore", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "pore", "_", "not_", "in_", "bad", "\\u", "pore", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "pore", "\\u", "map_", "[_", "i_", "]_", "=_", "pore", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "map", " ", "for", " ", "thro", "ats_", "\\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_", "sp_", "._", "shape_", "(_", "bad", "\\u", "thro", "ats_", ")_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "thro", "at", "\\u", "map_", "=_", "sp_", "._", "zeros_", "(_", "(_", "Nt", "_", "-_", "sp_", "._", "shape_", "(_", "bad", "\\u", "thro", "ats_", ")_", "[_", "0_", "]_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dtype_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "thro", "at_", "in_", "self_", "._", "thro", "ats_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "thro", "at_", "not_", "in_", "bad", "\\u", "thro", "ats_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "thro", "at", "\\u", "map_", "[_", "i_", "]_", "=_", "thro", "at_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fix", " ", "the", " ", "pore", " ", "transformer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sp_", "._", "shape_", "(_", "bad", "\\u", "pore", "s_", ")_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "transform_", "=_", "self_", "._", "\\u", "dictionary_", "[_", "'", "pn", "ame", "\\u", "transform", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "dictionary_", "[_", "'", "pn", "ame", "\\u", "transform", "'_", "]_", "=_", "sp_", "._", "zeros_", "(_", "(_", "Np", "_", "-_", "sp_", "._", "shape_", "(_", "bad", "\\u", "pore", "s_", ")_", "[_", "0_", "]_", ",_", ")_", ",_", "dtype_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pore", "_", "in_", "self_", "._", "pore", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "pore", "_", "not_", "in_", "bad", "\\u", "pore", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "dictionary_", "[_", "'", "pn", "ame", "\\u", "transform", "'_", "]_", "[_", "i_", "]_", "=_", "old", "\\u", "transform_", "[_", "pore", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "'", "Cou", "ld", " ", "not", " ", "update", " ", "pn", "ame", "\\u", "transform", ".", " ", "Imported", " ", "network", " ", "\\\\", "\\", "10", ";", " ", " ", " ", "may", " ", "not", " ", "have", " ", "had", " ", "it", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "trim_", "(_", "pore", "s_", "=_", "bad", "\\u", "pore", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mat", "File_", "(_", "Gene", "ric", "Network_", ")_", ":_", "\\u\\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", "add", "\\u", "xtra", "\\u", "pore", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xp", "data_", "=_", "self_", "._", "\\u", "xtra", "\\u", "pore", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "xp", "data_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "xp", "data_", ",_", "type_", "(_", "[_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "pdata_", "in_", "xp", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "[_", "'", "pore", ".'_", "+_", "pdata_", "]_", "=_", "self_", "._", "\\u", "dictionary_", "[_", "'", "p", "'_", "+_", "pdata_", "]_", "[_", "self_", "._", "\\u", "pore", "\\u", "map_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "logger_", "._", "warning_", "(_", "'", "Cou", "ld", " ", "not", " ", "add", " ", "pore", " ", "data", ":", " ", "'_", "+_", "pdata_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "to", " ", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "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 ", " ", "_", "self_", "[_", "'", "pore", ".'_", "+_", "xp", "data_", "]_", "=_", "self_", "._", "\\u", "dictionary_", "[_", "'", "p", "'_", "+_", "xp", "data_", "]_", "[_", "self_", "._", "\\u", "pore", "\\u", "map_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logger_", "._", "warning_", "(_", "'", "Cou", "ld", " ", "not", " ", "add", " ", "pore", " ", "data", ":", " ", "'_", "+_", "xp", "data_", "+_", "'", " ", "to", " ", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mat", "File_", "(_", "Gene", "ric", "Network_", ")_", ":_", "\\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", "add", "\\u", "xtra", "\\u", "thro", "at", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xt", "data_", "=_", "self_", "._", "\\u", "xtra", "\\u", "thro", "at", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "xt", "data_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "xt", "data_", ",_", "type_", "(_", "[_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tdata", "_", "in_", "xt", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "[_", "'", "thro", "at", ".'_", "+_", "tdata", "_", "]_", "=_", "self_", "._", "\\u", "dictionary_", "[_", "'", "t", "'_", "+_", "tdata", "_", "]_", "[_", "self_", "._", "\\u", "thro", "at", "\\u", "map_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "logger_", "._", "warning_", "(_", "'", "Cou", "ld", " ", "not", " ", "add", " ", "thro", "at", " ", "data", ":", " ", "'_", "+_", "tdata", "_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "to", " ", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "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 ", " ", "_", "self_", "[_", "'", "thro", "at", ".'_", "+_", "xt", "data_", "]_", "=_", "self_", "._", "\\u", "dictionary_", "[_", "'", "t", "'_", "+_", "xt", "data_", "]_", "[_", "self_", "._", "\\u", "thro", "at", "\\u", "map_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logger_", "._", "warning_", "(_", "'", "Cou", "ld", " ", "not", " ", "add", " ", "thro", "at", " ", "data", ":", " ", "'_", "+_", "xt", "data_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "to", " ", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 0 ]
Imprecise assert
adobe/brackets-shell/gyp/pylib/gyp/generator/ninja_test.py
[ { "content": " def test_BinaryNamesLinux(self):\n writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'ninja.build', 'linux')\n spec = { 'target_name': 'wee' }\n self.assertTrue('.' not in writer.ComputeOutputFileName(spec,\n 'executable'))\n self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').\n startswith('lib'))\n self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').\n startswith('lib'))\n self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').\n endswith('.so'))\n self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').\n endswith('.a'))", "metadata": "root.TestPrefixesAndSuffixes.test_BinaryNamesLinux", "header": "['class', 'TestPrefixesAndSuffixes', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 28 } ]
[ { "span": "self.assertTrue('.' not in writer.ComputeOutputFileName(spec,\n 'executable'))", "start_line": 31, "start_column": 6, "end_line": 32, "end_column": 76 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Prefixe", "s", "And", "Su", "ffi", "xes_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "Bin", "ary", "Names", "Lin", "ux_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "writer_", "=_", "ninja", "_", "._", "Nin", "ja", "Writer_", "(_", "'", "foo", "'_", ",_", "'", "wee", "'_", ",_", "'.'_", ",_", "'.'_", ",_", "'", "ninja", ".", "build", "'_", ",_", "'", "linux", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spec_", "=_", "{_", "'", "target", "\\u", "name", "'_", ":_", "'", "wee", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'.'_", "not_", "in_", "writer_", "._", "Compute", "Output", "File", "Name_", "(_", "spec_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "executable", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "writer_", "._", "Compute", "Output", "File", "Name_", "(_", "spec_", ",_", "'", "shared", "\\u", "librar", "y", "'_", ")_", "._", "\\u\\u\\uNL\\u\\u\\u_", "startswith_", "(_", "'", "lib", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "writer_", "._", "Compute", "Output", "File", "Name_", "(_", "spec_", ",_", "'", "static", "\\u", "librar", "y", "'_", ")_", "._", "\\u\\u\\uNL\\u\\u\\u_", "startswith_", "(_", "'", "lib", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "writer_", "._", "Compute", "Output", "File", "Name_", "(_", "spec_", ",_", "'", "shared", "\\u", "librar", "y", "'_", ")_", "._", "\\u\\u\\uNL\\u\\u\\u_", "endswith_", "(_", "'.", "so", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "writer_", "._", "Compute", "Output", "File", "Name_", "(_", "spec_", ",_", "'", "static", "\\u", "librar", "y", "'_", ")_", "._", "\\u\\u\\uNL\\u\\u\\u_", "endswith_", "(_", "'.", "a", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]